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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-32544f060326bffa60dade49ce4595652df4d3ab@git.kernel.org>
Date:	Thu, 12 May 2016 03:27:11 -0700
From:	tip-bot for Yazen Ghannam <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	brgerst@...il.com, tglx@...utronix.de, aravindksg.lkml@...il.com,
	luto@...capital.net, tony.luck@...el.com, bp@...en8.de,
	hpa@...or.com, torvalds@...ux-foundation.org, dvlasenk@...hat.com,
	Yazen.Ghannam@....com, mingo@...nel.org, peterz@...radead.org,
	linux-kernel@...r.kernel.org, bp@...e.de,
	linux-edac@...r.kernel.org
Subject: [tip:ras/core] x86/mce/AMD: Disable LogDeferredInMcaStat for SMCA
 systems

Commit-ID:  32544f060326bffa60dade49ce4595652df4d3ab
Gitweb:     http://git.kernel.org/tip/32544f060326bffa60dade49ce4595652df4d3ab
Author:     Yazen Ghannam <Yazen.Ghannam@....com>
AuthorDate: Wed, 11 May 2016 14:58:24 +0200
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Thu, 12 May 2016 09:08:20 +0200

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@....com>
[ Simplify, drop SMCA_MCAX_EN_OFF define too. ]
Signed-off-by: Borislav Petkov <bp@...e.de>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Aravind Gopalakrishnan <aravindksg.lkml@...il.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Brian Gerst <brgerst@...il.com>
Cc: Denys Vlasenko <dvlasenk@...hat.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Tony Luck <tony.luck@...el.com>
Cc: linux-edac <linux-edac@...r.kernel.org>
Link: http://lkml.kernel.org/r/1462971509-3856-3-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 arch/x86/kernel/cpu/mcheck/mce_amd.c | 38 +++++++++++++++++++++++++++---------
 1 file 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 d1b1e62..527ddae 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -54,14 +54,6 @@
 /* Threshold LVT offset is at MSR0xC0000410[15:12] */
 #define SMCA_THR_LVT_OFF	0xF000
 
-/*
- * OS is required to set the MCAX bit to acknowledge that it is now using the
- * new MSR ranges and new registers under each bank. It also means that the OS
- * will configure deferred errors in the new MCx_CONFIG register. If the bit is
- * not set, uncorrectable errors will cause a system panic.
- */
-#define SMCA_MCAX_EN_OFF	0x1
-
 static const char * const th_names[] = {
 	"load_store",
 	"insn_fetch",
@@ -374,7 +366,35 @@ prepare_threshold_block(unsigned int bank, unsigned int block, u32 addr,
 		u32 smca_addr = MSR_AMD64_SMCA_MCx_CONFIG(bank);
 
 		if (!rdmsr_safe(smca_addr, &smca_low, &smca_high)) {
-			smca_high |= SMCA_MCAX_EN_OFF;
+			/*
+			 * OS is required to set the MCAX bit to acknowledge
+			 * that it is now using the new MSR ranges and new
+			 * registers under each bank. It also means that the OS
+			 * will configure deferred errors in the new MCx_CONFIG
+			 * register. If the bit is not set, uncorrectable errors
+			 * will cause a system panic.
+			 *
+			 * MCA_CONFIG[MCAX] is bit 32 (0 in the high portion of
+			 * the MSR.)
+			 */
+			smca_high |= BIT(0);
+
+			/*
+			 * SMCA logs Deferred Error information in
+			 * MCA_DE{STAT,ADDR} registers with the option of
+			 * additionally logging to MCA_{STATUS,ADDR} if
+			 * MCA_CONFIG[LogDeferredInMcaStat] is set.
+			 *
+			 * This bit is usually set by BIOS to retain the old
+			 * behavior for OSes that don't use the new registers.
+			 * Linux supports the new registers so let's disable
+			 * that additional logging here.
+			 *
+			 * MCA_CONFIG[LogDeferredInMcaStat] is bit 34 (bit 2 in
+			 * the high portion of the MSR).
+			 */
+			smca_high &= ~BIT(2);
+
 			wrmsr(smca_addr, smca_low, smca_high);
 		}
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ