Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752706AbbEFRDO (ORCPT ); Wed, 6 May 2015 13:03:14 -0400 Received: from mail-by2on0114.outbound.protection.outlook.com ([207.46.100.114]:4512 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752675AbbEFRBt (ORCPT ); Wed, 6 May 2015 13:01:49 -0400 Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=amd.com; alien8.de; dkim=none (message not signed) header.d=none; X-WSS-ID: 0NNXTYP-07-8B6-02 X-M-MSG: From: Aravind Gopalakrishnan To: , , , , , , CC: , , , , , , , , , , , , , , , , , Subject: [PATCH V2 2/6] x86/MCE/AMD: Read MCx_ADDR(bank) before we log the error Date: Wed, 6 May 2015 06:58:54 -0500 Message-ID: <1430913538-1415-3-git-send-email-Aravind.Gopalakrishnan@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430913538-1415-1-git-send-email-Aravind.Gopalakrishnan@amd.com> References: <1430913538-1415-1-git-send-email-Aravind.Gopalakrishnan@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.221;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(428002)(199003)(189002)(53416004)(19580405001)(19580395003)(50466002)(86362001)(47776003)(105586002)(87936001)(575784001)(50986999)(76176999)(2201001)(50226001)(229853001)(46102003)(106466001)(101416001)(5001770100001)(5001920100001)(36756003)(2950100001)(48376002)(92566002)(77156002)(189998001)(62966003)(77096005);DIR:OUT;SFP:1102;SCL:1;SRVR:BN1PR02MB071;H:atltwp01.amd.com;FPR:;SPF:None;MLV:sfv;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1PR02MB071; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BN1PR02MB071;BCL:0;PCL:0;RULEID:;SRVR:BN1PR02MB071; X-Forefront-PRVS: 0568F32D91 X-OriginatorOrg: amd4.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2015 17:01:37.7575 (UTC) X-MS-Exchange-CrossTenant-Id: fde4dada-be84-483f-92cc-e026cbee8e96 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fde4dada-be84-483f-92cc-e026cbee8e96;Ip=[165.204.84.221];Helo=[atltwp01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1PR02MB071 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1789 Lines: 49 amd_decode_mce() needs value in m->addr so it can report the error address correctly on kernel logs. This should be setup in __log_error() before we call mce_log(). Else, m.addr = 0x0 and amd_decode_mce() just ends up printing 0x0. Like this: [76916.275587] [Hardware Error]: Corrected error, no action required. [76916.279576] [Hardware Error]: CPU:0 (15:60:0) MC0_STATUS [-|CE|-|-|AddrV|-|-|CECC]: 0x840041000028017b [76916.279576] [Hardware Error]: MC0 Error Address: 0x0000000000000000 We correct it in this patch by reading MSR_IA32_MCx_ADDR(bank) if it is valid before calling mce_log(). Corrected error output: [ 102.623490] [Hardware Error]: Corrected error, no action required. [ 102.623668] [Hardware Error]: CPU:0 (15:60:0) MC0_STATUS [-|CE|-|-|AddrV|-|-|CECC]: 0x840041000028017b [ 102.623930] [Hardware Error]: MC0 Error Address: 0x00001f808f0ff040 Signed-off-by: Aravind Gopalakrishnan --- arch/x86/kernel/cpu/mcheck/mce_amd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c index 60ae315..769f5cd 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c @@ -277,8 +277,10 @@ static void __log_error(unsigned int bank, bool is_thr, u64 misc) m.misc = misc; m.bank = bank; - mce_log(&m); + if (m.status & MCI_STATUS_ADDRV) + rdmsrl(MSR_IA32_MCx_ADDR(bank), m.addr); + mce_log(&m); wrmsrl(MSR_IA32_MCx_STATUS(bank), 0); } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/