All of lore.kernel.org
 help / color / mirror / Atom feed
From: Naman Jain <namjain@linux.microsoft.com>
To: Dexuan Cui <decui@microsoft.com>,
	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, yazen.ghannam@amd.com
Subject: Re: [PATCH v3] x86/mce: Don't report an error when MCE is unavailable
Date: Fri, 4 Dec 2026 11:00:50 +0530	[thread overview]
Message-ID: <a9aec6e3-00b4-4bc4-87bb-391d6eef770f@linux.microsoft.com> (raw)
In-Reply-To: <20261204021224.574793-1-decui@microsoft.com>



On 12/4/2026 7:42 AM, Dexuan Cui wrote:
> 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;


Reviewed-by: Naman Jain <namjain@linux.microsoft.com>

Regards,
Naman

      reply	other threads:[~2026-12-04  5:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  2:12 [PATCH v3] x86/mce: Don't report an error when MCE is unavailable Dexuan Cui
2026-12-04  5:30 ` 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=a9aec6e3-00b4-4bc4-87bb-391d6eef770f@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 \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.