Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1509945pxu; Fri, 27 Nov 2020 08:46:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyOOo+vXokSVbvuoDcHlVRLNeImvRz8n7igAlg8SsRjvC6kGj2WexSR8wsAIWTRilqhCKyP X-Received: by 2002:a17:906:c20f:: with SMTP id d15mr8684532ejz.341.1606495615087; Fri, 27 Nov 2020 08:46:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606495615; cv=none; d=google.com; s=arc-20160816; b=UQaG2bFd6TZvF4DEgdpncJNng/ez2vkmROZlHf5BP59m442kxL/VDiMYtkikHjS/du /5snelxUJlysG+IOZeU72EHO9Q53+cUuWJIr1TlVdsPEoLjs02geV9bFXfAwdOtPoogl 3C5TzUBixHUem7QOmXdnY21skv/NqJ/v0+UfJ/P34+YGw6cxKNcb4mWRAapiMs4zS51k Oz0YSE3yxisP+MzfJQgru5zdidkuOV6Z9SwEOGJF3B8GZmrl9WOXlp0wTJcyXkSJjAzP Kh3YDEReJj8K4wWmjrWwlScc8l1Gsz6b1WkAfcg7fKc8lmrHI9DG2aLC/tmP1Xqwu/we 0ycg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=nv5gpi5HupILoHk+ot9Wn43htm6UC76V9jpG2KLKJEE=; b=Fkg4kVxJJg7JbA6KmUTE3kkieawXHcKUWJcZvgYr02GfAW7OG3w2359FqktGOYpHCf hVS6emprmSv0kIM1euHofVR5FlHeW3b8RxBFiZZBBt+/x69El4rnSNMydaDGALCSWIcJ z8BV92MXWH7n84zJA0RVyAdOan8Km/pImoeDDbJnmz5MkKisgLKUW8RurU6EF0ssV14J ew6nDsgoMcpVqkoQZKdZA28c6/6nH/vW5uEsenD+wELeZlb3GGwUfJbeCj6C9TgkyIqm QnLdn6tAD5aUsmOobZivSsh51lls7JqpAA9d6HjvlD379ioipagx8lL4XQ5XquJleuC/ 49jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=180Bn1+L; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r3si5604565ejc.166.2020.11.27.08.46.31; Fri, 27 Nov 2020 08:46:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=180Bn1+L; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732164AbgK0Qn5 (ORCPT + 99 others); Fri, 27 Nov 2020 11:43:57 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:35400 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731594AbgK0Qn4 (ORCPT ); Fri, 27 Nov 2020 11:43:56 -0500 Date: Fri, 27 Nov 2020 16:43:52 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1606495433; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nv5gpi5HupILoHk+ot9Wn43htm6UC76V9jpG2KLKJEE=; b=180Bn1+L/FnoJaxMgIXFqxT9+x38cbsnfP5fDnYq7Cj5SBTWsJ7nUcJs1OkcYd0s0GKbR7 l/1bVNXT51Fbwp/6ZZ2knfLyu7mZ2iHWgQL2uuiO3rh+plvVWPdCsOkyoMx5hbtz2Kxe/u 3O/WLOS+EtHh2gRePoHWKEoM98Wxl999NUqF1jYrVxUqDINNeO0q83AcrXTptpxfvuILWy prP6yIusuZxWCdb9ROYJ+Kt/Pj8MTZDZcRIegNxPtZzDCAbKvdyXi+dtCNSDhNB9gq+DPr Wp9jCyaQePy6FmhCUaAHWOM7cVWmRlz47n3epLqkxqp8U1eAbs6cD9kAbkGPew== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1606495433; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nv5gpi5HupILoHk+ot9Wn43htm6UC76V9jpG2KLKJEE=; b=Sv6ayQ4aGumcqDVd7CqDEmYLQiJSSYkKdw41Z2Tg9wZkMwzHTUc4Ilo8RZhwuCmPFsJc2c 3P17tdsnXnm/ffBA== From: "tip-bot2 for Gabriele Paoloni" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/urgent] x86/mce: Do not overwrite no_way_out if mce_end() fails Cc: Gabriele Paoloni , Borislav Petkov , Tony Luck , , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20201127161819.3106432-2-gabriele.paoloni@intel.com> References: <20201127161819.3106432-2-gabriele.paoloni@intel.com> MIME-Version: 1.0 Message-ID: <160649543297.3364.4572741027949627240.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/urgent branch of tip: Commit-ID: 25bc65d8ddfc17cc1d7a45bd48e9bdc0e729ced3 Gitweb: https://git.kernel.org/tip/25bc65d8ddfc17cc1d7a45bd48e9bdc0e729ced3 Author: Gabriele Paoloni AuthorDate: Fri, 27 Nov 2020 16:18:15 Committer: Borislav Petkov CommitterDate: Fri, 27 Nov 2020 17:38:36 +01:00 x86/mce: Do not overwrite no_way_out if mce_end() fails Currently, if mce_end() fails, no_way_out - the variable denoting whether the machine can recover from this MCE - is determined by whether the worst severity that was found across the MCA banks associated with the current CPU, is of panic severity. However, at this point no_way_out could have been already set by mca_start() after looking at all severities of all CPUs that entered the MCE handler. If mce_end() fails, check first if no_way_out is already set and, if so, stick to it, otherwise use the local worst value. [ bp: Massage. ] Signed-off-by: Gabriele Paoloni Signed-off-by: Borislav Petkov Reviewed-by: Tony Luck Cc: Link: https://lkml.kernel.org/r/20201127161819.3106432-2-gabriele.paoloni@intel.com --- arch/x86/kernel/cpu/mce/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index 4102b86..32b7099 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -1384,8 +1384,10 @@ noinstr void do_machine_check(struct pt_regs *regs) * When there's any problem use only local no_way_out state. */ if (!lmce) { - if (mce_end(order) < 0) - no_way_out = worst >= MCE_PANIC_SEVERITY; + if (mce_end(order) < 0) { + if (!no_way_out) + no_way_out = worst >= MCE_PANIC_SEVERITY; + } } else { /* * If there was a fatal machine check we should have