Skip to contentSkip to conversation

x86/mce: Don't disable MCA banks when offlining a CPU on AMD systems

PATCH Applied Yazen Ghannam 2 participants 2 messages Jun 5, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/mce: Don't disable MCA banks when offlining a CPU on AMD systems

From: Yazen Ghannam <[email protected]>

AMD systems have non-core, shared MCA banks within a Die. These banks are controlled by a master CPU per Die. If this CPU is offlined then all the shared banks are disabled in addition to the CPU's core banks.

Also, Fam17h systems may have SMT enabled. The MCA_CTL register is shared between SMT thread siblings. If a CPU is offlined then all its sibling's MCA banks are also disabled.

Do a vendor check for AMD and return early when offling a CPU.

---
 arch/x86/kernel/cpu/mcheck/mce.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/mcheck/mce.c +2 -1
index 5cfbaeb..e317a95 100644
@@ -1917,7 +1917,8 @@ static void vendor_disable_error_reporting(void)
 	 * inhibit reporting for all shared resources on the socket like the
 	 * last level cache (LLC), the integrated memory controller (iMC), etc.
 	 */
-	if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
+	if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL ||
+	    boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
 		return;
 
 	mce_disable_error_reporting();
maintainer Applied
#1 lore raw
Quoted 23 lines · Yazen Ghannam

From: Yazen Ghannam <[email protected]>

AMD systems have non-core, shared MCA banks within a Die. These banks are controlled by a master CPU per Die. If this CPU is offlined then all the shared banks are disabled in addition to the CPU's core banks.

Also, Fam17h systems may have SMT enabled. The MCA_CTL register is shared between SMT thread siblings. If a CPU is offlined then all its sibling's MCA banks are also disabled.

Do a vendor check for AMD and return early when offling a CPU.

---
 arch/x86/kernel/cpu/mcheck/mce.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/mcheck/mce.c +0 -0
index 5cfbaeb..e317a95 100644

arch/x86/kernel/cpu/mcheck/mce.c static void vendor_disable_error_reporting(void) · line 1924

Quoted 9 lines
arch/x86/kernel/cpu/mcheck/mce.c +2 -1
@@ -1917,7 +1917,8 @@ static void vendor_disable_error_reporting(void)
 	 * inhibit reporting for all shared resources on the socket like the
 	 * last level cache (LLC), the integrated memory controller (iMC), etc.
 	 */
-	if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
+	if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL ||
+	    boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
 		return;
 
 	mce_disable_error_reporting();

Applied, thanks.