Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751688AbbFGRht (ORCPT ); Sun, 7 Jun 2015 13:37:49 -0400 Received: from [198.137.202.10] ([198.137.202.10]:57166 "EHLO terminus.zytor.com" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1751048AbbFGRhm (ORCPT ); Sun, 7 Jun 2015 13:37:42 -0400 Date: Sun, 7 Jun 2015 10:37:00 -0700 From: tip-bot for Aravind Gopalakrishnan Message-ID: Cc: hpa@zytor.com, Aravind.Gopalakrishnan@amd.com, linux-kernel@vger.kernel.org, bp@suse.de, x86@kernel.org, tglx@linutronix.de, mingo@kernel.org, linux-edac@vger.kernel.org, tony.luck@intel.com Reply-To: tglx@linutronix.de, x86@kernel.org, bp@suse.de, tony.luck@intel.com, linux-edac@vger.kernel.org, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, Aravind.Gopalakrishnan@amd.com In-Reply-To: <1430913538-1415-3-git-send-email-Aravind.Gopalakrishnan@amd.com> References: <1430913538-1415-3-git-send-email-Aravind.Gopalakrishnan@amd.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/core] x86/mce/amd: Collect valid address before logging an error Git-Commit-ID: 6e6e746e33e9555a7fce159d25314c9df3bcda93 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2122 Lines: 55 Commit-ID: 6e6e746e33e9555a7fce159d25314c9df3bcda93 Gitweb: http://git.kernel.org/tip/6e6e746e33e9555a7fce159d25314c9df3bcda93 Author: Aravind Gopalakrishnan AuthorDate: Wed, 6 May 2015 06:58:54 -0500 Committer: Borislav Petkov CommitDate: Wed, 6 May 2015 19:49:31 +0200 x86/mce/amd: Collect valid address before logging an error amd_decode_mce() needs value in m->addr so it can report the error address correctly. This should be setup in __log_error() before we call mce_log(). We do this because the error address is an important bit of information which should be conveyed to userspace. The correct output then reports proper address, like this: [Hardware Error]: Corrected error, no action required. [Hardware Error]: CPU:0 (15:60:0) MC0_STATUS [-|CE|-|-|AddrV|-|-|CECC]: 0x840041000028017b [Hardware Error]: MC0 Error Address: 0x00001f808f0ff040 Signed-off-by: Aravind Gopalakrishnan Cc: Tony Luck Cc: x86-ml Cc: linux-edac Link: http://lkml.kernel.org/r/1430913538-1415-3-git-send-email-Aravind.Gopalakrishnan@amd.com Signed-off-by: Borislav Petkov --- arch/x86/kernel/cpu/mcheck/mce_amd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c index 5f25de2..6070757 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c @@ -277,11 +277,14 @@ static void __log_error(unsigned int bank, bool threshold_err, u64 misc) m.status = status; m.bank = bank; + if (threshold_err) m.misc = misc; - 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); } -- 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/