aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYazen Ghannam <Yazen.Ghannam@amd.com>2016-05-11 08:58:24 -0400
committerIngo Molnar <mingo@kernel.org>2016-05-12 03:08:20 -0400
commit32544f060326bffa60dade49ce4595652df4d3ab (patch)
tree2dd1fac7e27cbaf68685d9835cba52dd905a5bc3
parent34102009580a047c02b21f089f7fc7f65e605887 (diff)
x86/mce/AMD: Disable LogDeferredInMcaStat for SMCA systems
Disable Deferred Error logging in MCA_{STATUS,ADDR} additionally for SMCA systems as this information will retrieved from MCA_DE{STAT,ADDR} on those systems. Signed-off-by: Yazen Ghannam <Yazen.Ghannam@amd.com> [ Simplify, drop SMCA_MCAX_EN_OFF define too. ] Signed-off-by: Borislav Petkov <bp@suse.de> Cc: Andy Lutomirski <luto@amacapital.net> Cc: Aravind Gopalakrishnan <aravindksg.lkml@gmail.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Tony Luck <tony.luck@intel.com> Cc: linux-edac <linux-edac@vger.kernel.org> Link: http://lkml.kernel.org/r/1462971509-3856-3-git-send-email-bp@alien8.de Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_amd.c38
1 files changed, 29 insertions, 9 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index d1b1e62f7cb9..527ddae3017b 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -54,14 +54,6 @@
54/* Threshold LVT offset is at MSR0xC0000410[15:12] */ 54/* Threshold LVT offset is at MSR0xC0000410[15:12] */
55#define SMCA_THR_LVT_OFF 0xF000 55#define SMCA_THR_LVT_OFF 0xF000
56 56
57/*
58 * OS is required to set the MCAX bit to acknowledge that it is now using the
59 * new MSR ranges and new registers under each bank. It also means that the OS
60 * will configure deferred errors in the new MCx_CONFIG register. If the bit is
61 * not set, uncorrectable errors will cause a system panic.
62 */
63#define SMCA_MCAX_EN_OFF 0x1
64
65static const char * const th_names[] = { 57static const char * const th_names[] = {
66 "load_store", 58 "load_store",
67 "insn_fetch", 59 "insn_fetch",
@@ -374,7 +366,35 @@ prepare_threshold_block(unsigned int bank, unsigned int block, u32 addr,
374 u32 smca_addr = MSR_AMD64_SMCA_MCx_CONFIG(bank); 366 u32 smca_addr = MSR_AMD64_SMCA_MCx_CONFIG(bank);
375 367
376 if (!rdmsr_safe(smca_addr, &smca_low, &smca_high)) { 368 if (!rdmsr_safe(smca_addr, &smca_low, &smca_high)) {
377 smca_high |= SMCA_MCAX_EN_OFF; 369 /*
370 * OS is required to set the MCAX bit to acknowledge
371 * that it is now using the new MSR ranges and new
372 * registers under each bank. It also means that the OS
373 * will configure deferred errors in the new MCx_CONFIG
374 * register. If the bit is not set, uncorrectable errors
375 * will cause a system panic.
376 *
377 * MCA_CONFIG[MCAX] is bit 32 (0 in the high portion of
378 * the MSR.)
379 */
380 smca_high |= BIT(0);
381
382 /*
383 * SMCA logs Deferred Error information in
384 * MCA_DE{STAT,ADDR} registers with the option of
385 * additionally logging to MCA_{STATUS,ADDR} if
386 * MCA_CONFIG[LogDeferredInMcaStat] is set.
387 *
388 * This bit is usually set by BIOS to retain the old
389 * behavior for OSes that don't use the new registers.
390 * Linux supports the new registers so let's disable
391 * that additional logging here.
392 *
393 * MCA_CONFIG[LogDeferredInMcaStat] is bit 34 (bit 2 in
394 * the high portion of the MSR).
395 */
396 smca_high &= ~BIT(2);
397
378 wrmsr(smca_addr, smca_low, smca_high); 398 wrmsr(smca_addr, smca_low, smca_high);
379 } 399 }
380 400