From: Naman Jain <namjain@linux.microsoft.com>
To: decui@microsoft.com
Cc: bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com,
kameroncarr@microsoft.com, linux-edac@vger.kernel.org,
linux-kernel@vger.kernel.org, mingo@redhat.com,
namjain@linux.microsoft.com, tglx@kernel.org,
tony.luck@intel.com, x86@kernel.org
Subject: Re: [PATCH] x86/mce: Report unavailable MCE support at informational level
Date: Mon, 5 Oct 2026 15:56:41 +0000 [thread overview]
Message-ID: <20261005155641.272139-1-namjain@linux.microsoft.com> (raw)
In-Reply-To: <20260923173033.4104944-1-decui@microsoft.com>
On Wed, Sep 23, 2026 at 10:30:33AM -0700, Dexuan Cui wrote:
> 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)) {
LGTM.
Reviewed-by: Naman Jain <namjain@linux.microsoft.com>
Regards,
Naman Jain
prev parent reply other threads:[~2026-10-05 15:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 17:30 Dexuan Cui
2026-10-05 15:56 ` Naman Jain [this message]
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=20261005155641.272139-1-namjain@linux.microsoft.com \
--to=namjain@linux.microsoft.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=decui@microsoft.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=tglx@kernel.org \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®