lkml.org 
[lkml]   [2015]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH V2 2/6] x86/MCE/AMD: Read MCx_ADDR(bank) before we log the error
Date
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@amd.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


\
 
 \ /
  Last update: 2015-05-06 19:41    [W:0.054 / U:0.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site