Skip to contentSkip to conversation

x86/mce/AMD: Make sure banks were initialized before accessing them

PATCH Borislav Petkov 1 participant 1 message Nov 29, 2018

Subsystems (2)
lore
Share & tools
lore

Borislav Petkov

author maintainer
#0 lore raw
Quoted 2 lines · Rafał Miłecki

Sure! E-mail me whenever you have something to test, I'll stick to the current BIOS version, thanks for the notice!

Thx!

Here's a first simple try to do the initialization of the needed structures much earlier so that the thresholding interrupt can function earlier and maybe catch your MCEs.

Please apply it ontop and send me full dmesg.

Thx.

arch/x86/kernel/cpu/mcheck/mce.c +2 -3
index 36d2696c9563..a5d8e7ad7046 100644
@@ -1747,10 +1747,9 @@ static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c)
 		mce_adjust_timer = cmci_intel_adjust_timer;
 		break;
 
-	case X86_VENDOR_AMD: {
+	case X86_VENDOR_AMD:
 		mce_amd_feature_init(c);
 		break;
-		}
 
 	case X86_VENDOR_HYGON:
 		mce_hygon_feature_init(c);
@@ -2411,7 +2410,7 @@ static __init int mcheck_init_device(void)
 
 	return err;
 }
-device_initcall_sync(mcheck_init_device);
+core_initcall(mcheck_init_device);
 
 /*
  * Old style boot options parsing. Only for compatibility.
arch/x86/kernel/cpu/mcheck/mce_amd.c +1 -1
index e12454e21b8a..227e50c73217 100644
@@ -1434,4 +1434,4 @@ static __init int threshold_init_device(void)
  * when running under xen, the initcall order is 1,2,3;
  * on baremetal, we skip 1 and we do only 2 and 3.
  */
-late_initcall(threshold_init_device);
+core_initcall_sync(threshold_init_device);