lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1430913538-1415-3-git-send-email-Aravind.Gopalakrishnan@amd.com>
Date:	Wed, 6 May 2015 06:58:54 -0500
From:	Aravind Gopalakrishnan <Aravind.Gopalakrishnan@....com>
To:	<tglx@...utronix.de>, <mingo@...hat.com>, <hpa@...or.com>,
	<tony.luck@...el.com>, <bp@...en8.de>, <jiang.liu@...ux.intel.com>,
	<yinghai@...nel.org>
CC:	<x86@...nel.org>, <dvlasenk@...hat.com>, <JBeulich@...e.com>,
	<slaoub@...il.com>, <luto@...capital.net>,
	<dave.hansen@...ux.intel.com>, <oleg@...hat.com>,
	<rostedt@...dmis.org>, <rusty@...tcorp.com.au>,
	<prarit@...hat.com>, <linux@...musvillemoes.dk>, <jroedel@...e.de>,
	<andriy.shevchenko@...ux.intel.com>, <macro@...ux-mips.org>,
	<wangnan0@...wei.com>, <linux-kernel@...r.kernel.org>,
	<linux-edac@...r.kernel.org>, <rric@...nel.org>
Subject: [PATCH V2 2/6] x86/MCE/AMD: Read MCx_ADDR(bank) before we log the error

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 <Aravind.Gopalakrishnan@....com>
---
 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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ