Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5453067pxu; Tue, 22 Dec 2020 18:27:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGDLyc+XXWp+Wxnp/edVbl/Qvnr2GhCfHgGBYuSce82oWFcm1/BhCMViqluUe+LKHvkyFB X-Received: by 2002:a17:906:b082:: with SMTP id x2mr19924278ejy.100.1608690470464; Tue, 22 Dec 2020 18:27:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608690470; cv=none; d=google.com; s=arc-20160816; b=d0+G52cnwJwM500ifcX254tURUDq++hmzTRkhHVwLEShDA5F4XYqFLGafBvMi5C9nb jLghW055F6D1rECTC8YVeiZ+EKDUcisaTpZfovrSWNGnpV+uioFePcLfJckr3eOvVawH TGa29bgH976DqbVz634b/8WQlVN/v3ZNit88qPzPvWgQHTgEHEmmc0nQXnAwD/BZZgXt mRU2yB7aCaVZ1TG7GZY4gZsmEBldsC4+0IaK/gW/RXOTQV9LsHjpfbEFPGj23DiDBmYm mBY1YI+q4jgeV2mAC127GZ5Gy613SOsMBvQB0IZa9hLCX6iCcA0sTWhd1LPj7PFYr9jJ lxQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LrXt5p3dJ0ZwSs6XhfIsu8/l/dHbEO/r3i78+xQXZ+s=; b=xq+bBcRGTVeUcc0olbB+cx/FMBXJutQCn2u6Y/LVU2oZqbzlevA7O80z//QcH4ZZ1S btVdq74fMcwe+rJejAhLS8usM8PmVGrUzoKSOvvGNFbgLoGfUibLzvqj5RvEilIA16+M 1EbPnQxXx4KV8FHQ9Ls544VUJtGOqvKakxdZXYtJ5+hIrvjjMq3QxY9oGQF58qL6dld/ NmDCHnwWUGplI2SR4mRwV3m3B3HZXH8UiDQ5OpeWBGYEMcpWnMqhykAX3Qi7Y/IAlYko S6Jq1TE3DLFpnljawBlmOcKM8k7CJUAEMqNj6IHGFDF9E36yisu5sQJu38bAJo3yrD8M HVrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rmtfGRHy; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs15si5857390ejb.717.2020.12.22.18.27.28; Tue, 22 Dec 2020 18:27:50 -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=@kernel.org header.s=k20201202 header.b=rmtfGRHy; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730314AbgLWCYr (ORCPT + 99 others); Tue, 22 Dec 2020 21:24:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:54444 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729306AbgLWCYc (ORCPT ); Tue, 22 Dec 2020 21:24:32 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6C16F221E5; Wed, 23 Dec 2020 02:23:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608690232; bh=0r6bWH3isYsQt1YnNm7PhViwFMgHBQ79ofpoSy8Ur9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rmtfGRHyo0VxJY+xHsUcnmX72QY/GzTw/vHV4yp3lJ4E63i9DaPMo4SAPKZAZ+U9K f6nC2Pzo23LZZgZwHL5JMtfuyX5bhkDghm0Kpd1a8YS4EnXKe0nXUimGMyuzHbo7j1 a3Hyk706rM8yXSz3OQFGlZl3jJa2x8seSqEmc8R9/kLiUZ9oniqhQRRDaEcLSCeKjx Q0n4tcPvk222H8UJQeuTEU+S2vJXT4EhpnEMSU9H/Xt7E2kZAAsDfz0qMnDKoMU1UO JtwRogkJD388ESKx/JC8fW/QF/QDI0XVff6xtcwJcEMr8EezWSgqx7vw9As+HCgFmP mvlCLJDDW9GwQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Gabriele Paoloni , Borislav Petkov , Tony Luck , Sasha Levin Subject: [PATCH AUTOSEL 4.14 47/66] x86/mce: Panic for LMCE only if mca_cfg.tolerant < 3 Date: Tue, 22 Dec 2020 21:22:33 -0500 Message-Id: <20201223022253.2793452-47-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201223022253.2793452-1-sashal@kernel.org> References: <20201223022253.2793452-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gabriele Paoloni [ Upstream commit 3a866b16fd2360a9c4ebf71cfbf7ebfe968c1409 ] Right now for LMCE, if no_way_out is set, mce_panic() is called regardless of mca_cfg.tolerant. This is not correct as, if mca_cfg.tolerant = 3, the code should never panic. Add that check. [ bp: use local ptr 'cfg'. ] Signed-off-by: Gabriele Paoloni Signed-off-by: Borislav Petkov Reviewed-by: Tony Luck Link: https://lkml.kernel.org/r/20201127161819.3106432-4-gabriele.paoloni@intel.com Signed-off-by: Sasha Levin --- arch/x86/kernel/cpu/mcheck/mce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 95c09db1bba21..b89258cfa15e0 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -1245,7 +1245,7 @@ void do_machine_check(struct pt_regs *regs, long error_code) * to see it will clear it. */ if (lmce) { - if (no_way_out) + if (no_way_out && cfg->tolerant < 3) mce_panic("Fatal local machine check", &m, msg); } else { order = mce_start(&no_way_out); -- 2.27.0