diff options
author | Borislav Petkov <bp@suse.de> | 2014-10-21 16:19:59 -0400 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2014-10-21 16:28:48 -0400 |
commit | a3a529d104ec5149fb9a667dce988635941be1ed (patch) | |
tree | 7be73a235ce379c859e47710b5192316a51de89e | |
parent | 69b957583580bf40624553c64d802fefb54199cb (diff) |
x86, MCE, AMD: Drop software-defined bank in error thresholding
Aravind had the good question about why we're assigning a
software-defined bank when reporting error thresholding errors instead
of simply using the bank which reports the last error causing the
overflow.
Digging through git history, it pointed to
95268664390b ("[PATCH] x86_64: mce_amd support for family 0x10 processors")
which added that functionality. The problem with this, however, is that
tools don't know about software-defined banks and get puzzled. So drop
that K8_MCE_THRESHOLD_BASE and simply use the hw bank reporting the
thresholding interrupt.
Save us a couple of MSR reads while at it.
Reported-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
Link: https://lkml.kernel.org/r/5435B206.60402@amd.com
Signed-off-by: Borislav Petkov <bp@suse.de>
-rw-r--r-- | arch/x86/include/asm/mce.h | 1 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce_amd.c | 5 |
2 files changed, 2 insertions, 4 deletions
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index 958b90f761e5..276392f121fb 100644 --- a/arch/x86/include/asm/mce.h +++ b/arch/x86/include/asm/mce.h | |||
@@ -78,7 +78,6 @@ | |||
78 | /* Software defined banks */ | 78 | /* Software defined banks */ |
79 | #define MCE_EXTENDED_BANK 128 | 79 | #define MCE_EXTENDED_BANK 128 |
80 | #define MCE_THERMAL_BANK (MCE_EXTENDED_BANK + 0) | 80 | #define MCE_THERMAL_BANK (MCE_EXTENDED_BANK + 0) |
81 | #define K8_MCE_THRESHOLD_BASE (MCE_EXTENDED_BANK + 1) | ||
82 | 81 | ||
83 | #define MCE_LOG_LEN 32 | 82 | #define MCE_LOG_LEN 32 |
84 | #define MCE_LOG_SIGNATURE "MACHINECHECK" | 83 | #define MCE_LOG_SIGNATURE "MACHINECHECK" |
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c index 9af7bd74828b..6606523ff1c1 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c | |||
@@ -318,10 +318,9 @@ static void amd_threshold_interrupt(void) | |||
318 | 318 | ||
319 | log: | 319 | log: |
320 | mce_setup(&m); | 320 | mce_setup(&m); |
321 | rdmsrl(MSR_IA32_MCG_STATUS, m.mcgstatus); | ||
322 | rdmsrl(address, m.misc); | ||
323 | rdmsrl(MSR_IA32_MCx_STATUS(bank), m.status); | 321 | rdmsrl(MSR_IA32_MCx_STATUS(bank), m.status); |
324 | m.bank = K8_MCE_THRESHOLD_BASE + bank * NR_BLOCKS + block; | 322 | m.misc = ((u64)high << 32) | low; |
323 | m.bank = bank; | ||
325 | mce_log(&m); | 324 | mce_log(&m); |
326 | 325 | ||
327 | wrmsrl(MSR_IA32_MCx_STATUS(bank), 0); | 326 | wrmsrl(MSR_IA32_MCx_STATUS(bank), 0); |