* [PATCH] x86/mce: Report unavailable MCE support at informational level
@ 2026-09-23 17:30 Dexuan Cui
0 siblings, 0 replies; only message in thread
From: Dexuan Cui @ 2026-09-23 17:30 UTC (permalink / raw)
To: tony.luck, bp, tglx, mingo, dave.hansen, x86, hpa, linux-edac,
linux-kernel
Cc: kameroncarr, Dexuan Cui
mcheck_init_device() reports an error and returns -EIO when
mce_available() is false. However, MCE support being unavailable does
not necessarily indicate an initialization failure.
For example, a TDX guest with TD_CTLS.REDUCE_VE set and
FEATURE_PARAVIRT_CTLS.MCA clear does not enumerate the MCE and MCA
CPUID capabilities. This is an expected configuration, but it causes
the kernel to print:
mce: Unable to init MCE device (rc: -5)
MCE can also be unavailable because it was explicitly disabled with
mce=off or nomce. When it was disabled due to an earlier initialization
problem, the relevant path already reports the reason.
Report MCE unavailability at informational level and return -ENODEV
directly instead of routing it through the common error path.
Signed-off-by: Dexuan Cui <decui@microsoft.com>
---
arch/x86/kernel/cpu/mce/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index f3a793e3a6c8..24ac10075263 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -2825,8 +2825,8 @@ static __init int mcheck_init_device(void)
MAYBE_BUILD_BUG_ON(__VIRTUAL_MASK_SHIFT >= 63);
if (!mce_available(&boot_cpu_data)) {
- err = -EIO;
- goto err_out;
+ pr_info("MCE is unavailable\n");
+ return -ENODEV;
}
if (!zalloc_cpumask_var(&mce_device_initialized, GFP_KERNEL)) {
--
2.52.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-23 17:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-23 17:30 [PATCH] x86/mce: Report unavailable MCE support at informational level Dexuan Cui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®