Skip to contentSkip to conversation

x86/mce: make sure cmci banks are cleared during shutdown on intel

PATCH Applied JP Kobryn 2 participants 2 messages Jun 27, 2025 – Jun 28, 2025

Subsystems (3)
lore
Share & tools
lore

JP Kobryn

author
#0 lore raw

PATCH v2 1/1 x86/mce: make sure cmci banks are cleared during shutdown on intel

CMCI banks are not cleared during shutdown on intel CPU's. As a side effect when a kexec is performed, CPU's coming back online are unable to rediscover/claim these occupied banks which breaks MCE reporting.

Clear the CPU ownership during shutdown via cmci_clear() so the banks can be reclaimed and MCE reporting will become functional once more.

---
 arch/x86/kernel/cpu/mce/intel.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/kernel/cpu/mce/intel.c +1 -0
index efcf21e9552e..9b149b9c4109 100644
@@ -478,6 +478,7 @@ void mce_intel_feature_init(struct cpuinfo_x86 *c)
 void mce_intel_feature_clear(struct cpuinfo_x86 *c)
 {
 	intel_clear_lmce();
+	cmci_clear();
 }
 
 bool intel_filter_mce(struct mce *m)
Signature · 1 line
2.47.1
merge bot Applied
#1 lore raw

[tip: ras/urgent] x86/mce: Make sure CMCI banks are cleared during shutdown on Intel

The following commit has been merged into the ras/urgent branch of tip:

The following commit has been merged into the ras/urgent branch of tip:

Commit-ID:     30ad231a5029bfa16e46ce868497b1a5cdd3c24d
Gitweb:        https://git.kernel.org/tip/30ad231a5029bfa16e46ce868497b1a5cdd3c24d
Author:        JP Kobryn <[email protected]>
AuthorDate:    Fri, 27 Jun 2025 10:49:35 -07:00
Committer:     Borislav Petkov (AMD) <[email protected]>
CommitterDate: Sat, 28 Jun 2025 12:45:48 +02:00

x86/mce: Make sure CMCI banks are cleared during shutdown on Intel

CMCI banks are not cleared during shutdown on Intel CPUs. As a side effect, when a kexec is performed, CPUs coming back online are unable to rediscover/claim these occupied banks which breaks MCE reporting.

Clear the CPU ownership during shutdown via cmci_clear() so the banks can be reclaimed and MCE reporting will become functional once more.

[ bp: Massage commit message. ]

---
 arch/x86/kernel/cpu/mce/intel.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/kernel/cpu/mce/intel.c +1 -0
index efcf21e..9b149b9 100644
@@ -478,6 +478,7 @@ void mce_intel_feature_init(struct cpuinfo_x86 *c)
 void mce_intel_feature_clear(struct cpuinfo_x86 *c)
 {
 	intel_clear_lmce();
+	cmci_clear();
 }
 
 bool intel_filter_mce(struct mce *m)