Received: by 10.192.165.148 with SMTP id m20csp4165614imm; Mon, 30 Apr 2018 13:01:57 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpn1MoRb6ZF9MX0FmJ8uONkLNVLW3qkEYwFcmiVqtBbMxyP6CbNVQLroqgPLwJI1c4yOF2q X-Received: by 2002:a17:902:6a89:: with SMTP id n9-v6mr3956030plk.41.1525118517462; Mon, 30 Apr 2018 13:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525118517; cv=none; d=google.com; s=arc-20160816; b=dH3JQ8ZNK+S8Dezxahs5Uc4Qedh7LRlytopTlL2MOUdRTWudPk803EP5ED0iY2mA9V tLqArY0up6Dgk1ZbnHX4V4TPs2tLwAMRl/nxYokQx1HQ0elL5v6Q48S+2eb6uOkcsMtR Wuns/RO4UtFL9VgdtByHJyIv2PhrQBrX/lidxCRpV6FT6YG1F/HMdbKz1uGn+u0N3x+6 WPbwXI8vJme3ZZTKoNGfDKvkC/USz90tKsBxOkLklgfIh/te8hYc6yxF7oy87a9qair9 aEb2rANW6dmUqXfWE3jH1EIT+XUver2HAR0rzz5SIyE7ybMYxedEnLlfrsAuwZZUX/fh lhtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=28MZFdm1qA+j6Wpqwy7nzJCtLrXPN7Ec1gD+eoQGmoY=; b=ttI2YAczNjqOHagFc0Yw1woSRzkb1KLTnRC//dKgxjSBwap910ApMhbmXw3idR0i3d kWPBaZvAjqUyUhSlj0Cpj64BhLtWE6o/bB8/4agpKmFkTMZNzfWrtQatc6zw2pBGXnJY LRE0dN9NWmNDvUvnq4pzAzwWyNC8ZS/Ji1yuLDl199dCIjTpXVt01cazh2r8GXvBMrFA N2lgs9ytUOA85FO0zirL5XkcG49XhskhZeG7mEeXmKHfvTUdiWvZea/PApsp2OywzQFb hZZUp0ayUad22oghkG/VYVM+2zdPy/WRudWrWsEh3Avyis9CopSuZNIgsrxMrVwGv9cT AsoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7-v6si4518271pgc.320.2018.04.30.13.01.43; Mon, 30 Apr 2018 13:01:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756074AbeD3UAT (ORCPT + 99 others); Mon, 30 Apr 2018 16:00:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:34648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755327AbeD3T1o (ORCPT ); Mon, 30 Apr 2018 15:27:44 -0400 Received: from localhost (unknown [104.132.1.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 256C322E01; Mon, 30 Apr 2018 19:27:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 256C322E01 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vitezslav Samel , Borislav Petkov , Thomas Gleixner , Ashok Raj Subject: [PATCH 4.14 87/91] x86/microcode: Do not exit early from __reload_late() Date: Mon, 30 Apr 2018 12:25:09 -0700 Message-Id: <20180430184008.830295165@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184004.216234025@linuxfoundation.org> References: <20180430184004.216234025@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Borislav Petkov commit 09e182d17e8891dd73baba961a0f5a82e9274c97 upstream. Vitezslav reported a case where the "Timeout during microcode update!" panic would hit. After a deeper look, it turned out that his .config had CONFIG_HOTPLUG_CPU disabled which practically made save_mc_for_early() a no-op. When that happened, the discovered microcode patch wasn't saved into the cache and the late loading path wouldn't find any. This, then, lead to early exit from __reload_late() and thus CPUs waiting until the timeout is reached, leading to the panic. In hindsight, that function should have been written so it does not return before the post-synchronization. Oh well, I know better now... Fixes: bb8c13d61a62 ("x86/microcode: Fix CPU synchronization routine") Reported-by: Vitezslav Samel Signed-off-by: Borislav Petkov Signed-off-by: Thomas Gleixner Tested-by: Vitezslav Samel Tested-by: Ashok Raj Cc: stable@vger.kernel.org Link: http://lkml.kernel.org/r/20180418081140.GA2439@pc11.op.pod.cz Link: https://lkml.kernel.org/r/20180421081930.15741-2-bp@alien8.de Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/microcode/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c @@ -564,14 +564,12 @@ static int __reload_late(void *info) apply_microcode_local(&err); spin_unlock(&update_lock); + /* siblings return UCODE_OK because their engine got updated already */ if (err > UCODE_NFOUND) { pr_warn("Error reloading microcode on CPU %d\n", cpu); - return -1; - /* siblings return UCODE_OK because their engine got updated already */ + ret = -1; } else if (err == UCODE_UPDATED || err == UCODE_OK) { ret = 1; - } else { - return ret; } /*