From: Dexuan Cui <decui@microsoft.com>
To: tony.luck@intel.com, bp@alien8.de, tglx@kernel.org,
mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org,
hpa@zytor.com, linux-edac@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: kameroncarr@microsoft.com, namjain@linux.microsoft.com,
yazen.ghannam@amd.com, Dexuan Cui <decui@microsoft.com>
Subject: [PATCH v3] x86/mce: Don't report an error when MCE is unavailable
Date: Thu, 3 Dec 2026 18:12:24 -0800 [thread overview]
Message-ID: <20261204021224.574793-1-decui@microsoft.com> (raw)
A TDX guest with TD_CTLS.REDUCE_VE set and FEATURE_PARAVIRT_CTLS.MCA
clear does not enumerate the MCE or MCA CPUID bits. This is expected,
but mcheck_init_device() logs:
mce: Unable to init MCE device (rc: -5)
An internal monitor treats every pr_err() in dmesg as a failure, so it
flags a healthy guest. Booting with mce=off or nomce takes the same
error path.
Return -ENODEV without logging when mce_available() is false. Keep the
existing diagnostic for failures during device initialization.
Signed-off-by: Dexuan Cui <decui@microsoft.com>
---
Changes in v3:
- Explain the motivation in the commit message (Boris).
- Drop the v2 pr_info("MCE is unavailable\n") and return silently
(Boris).
- Not carrying the v2 Reviewed-by tags, since the logging behavior
they reviewed has changed.
v2: https://lore.kernel.org/all/20261119185811.565606-1-decui@microsoft.com/
v2 review: https://lore.kernel.org/all/20261204003753.GJaxILYWe-nBosYtkh@fat_crate.local/
arch/x86/kernel/cpu/mce/core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -2814,10 +2814,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;
- }
+ if (!mce_available(&boot_cpu_data))
+ return -ENODEV;
if (!zalloc_cpumask_var(&mce_device_initialized, GFP_KERNEL)) {
err = -ENOMEM;
reply other threads:[~2026-12-04 2:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261204021224.574793-1-decui@microsoft.com \
--to=decui@microsoft.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kameroncarr@microsoft.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namjain@linux.microsoft.com \
--cc=tglx@kernel.org \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
--cc=yazen.ghannam@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox