From patchwork Tue Dec 10 00:07:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Jan_H=2E_Sch=C3=B6nherr?= X-Patchwork-Id: 11281083 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 848FC138C for ; Tue, 10 Dec 2019 00:08:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 634B1207FF for ; Tue, 10 Dec 2019 00:08:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.de header.i=@amazon.de header.b="vcwxagY6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727333AbfLJAIm (ORCPT ); Mon, 9 Dec 2019 19:08:42 -0500 Received: from smtp-fw-6002.amazon.com ([52.95.49.90]:26780 "EHLO smtp-fw-6002.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727104AbfLJAIm (ORCPT ); Mon, 9 Dec 2019 19:08:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1575936521; x=1607472521; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HicyFk+3d8ZmzP7+t6CcJT69ujvdkdzFVSdbujksngc=; b=vcwxagY6j3Tuo2L5Lv9VL1YM4TBsHLEwtABqGZG9KvUWdL91hw/e6tyw umEBAyrgh8MeJePedJ9LVnvLO2Zh789fRLO9Yx62Uy6BtGNmaZpChLQ1Y ay6LeafwSrJfVm62aurQI2CbVUBrHagrYedsgU5+OAkMkLEH1ZwtFAKT8 Y=; IronPort-SDR: ez3FEeS2blQmwMhwslx8x+/APd4ERBvv+LDhRT6+W/JeOvkbo1LG1bpQ7PN1I5hiRe/dydg7zM vCbHFNWlkQSQ== X-IronPort-AV: E=Sophos;i="5.69,297,1571702400"; d="scan'208";a="6901773" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2b-8cc5d68b.us-west-2.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 10 Dec 2019 00:08:38 +0000 Received: from u7588a65da6b65f.ant.amazon.com (pdx2-ws-svc-lb17-vlan2.amazon.com [10.247.140.66]) by email-inbound-relay-2b-8cc5d68b.us-west-2.amazon.com (Postfix) with ESMTPS id 53F50A1DD0; Tue, 10 Dec 2019 00:08:37 +0000 (UTC) Received: from u7588a65da6b65f.ant.amazon.com (localhost [127.0.0.1]) by u7588a65da6b65f.ant.amazon.com (8.15.2/8.15.2/Debian-3) with ESMTPS id xBA08Xpk018257 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 Dec 2019 01:08:33 +0100 Received: (from jschoenh@localhost) by u7588a65da6b65f.ant.amazon.com (8.15.2/8.15.2/Submit) id xBA08UvI018248; Tue, 10 Dec 2019 01:08:30 +0100 From: =?utf-8?q?Jan_H=2E_Sch=C3=B6nherr?= To: Tony Luck , Borislav Petkov Cc: =?utf-8?q?Jan_H=2E_Sch=C3=B6nherr?= , linux-edac@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org Subject: [PATCH 3/6] x86/mce: Fix possibly incorrect severity calculation on AMD Date: Tue, 10 Dec 2019 01:07:30 +0100 Message-Id: <20191210000733.17979-4-jschoenh@amazon.de> X-Mailer: git-send-email 2.22.0.3.gb49bb57c8208.dirty In-Reply-To: <20191210000733.17979-1-jschoenh@amazon.de> References: <20191210000733.17979-1-jschoenh@amazon.de> MIME-Version: 1.0 Sender: linux-edac-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-edac@vger.kernel.org The function mce_severity_amd_smca() requires m->bank to be initialized for correct operation. Fix the one case, where mce_severity() is called without doing so. Fixes: 6bda529ec42e ("x86/mce: Grade uncorrected errors for SMCA-enabled systems") Fixes: d28af26faa0b ("x86/MCE: Initialize mce.bank in the case of a fatal error in mce_no_way_out()") Signed-off-by: Jan H. Schönherr --- arch/x86/kernel/cpu/mce/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index 81ab25d5357a..6afb9de251f2 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -809,8 +809,8 @@ static int mce_no_way_out(struct mce *m, char **msg, unsigned long *validp, if (quirk_no_way_out) quirk_no_way_out(i, m, regs); + m->bank = i; if (mce_severity(m, mca_cfg.tolerant, &tmp, true) >= MCE_PANIC_SEVERITY) { - m->bank = i; mce_read_aux(m, i); *msg = tmp; return 1;