From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=13.77.154.182 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796362255; b=Lm/u0O6+j1N5nBpo1llP0TO4aFM+saOtKjrLMYT7s+oVFBzyOlV4itmlZ4S2gURS02b3 YSKuxQwJT2hepMUiXT2uj4sLTJ+aSbwWq0gxauo2kahw/w4R+DbomZkpaozTVFQABe9se d4MW+P4uDjiYZfB1gjAfbSECyRQUm0aJOaQasbTq0qBLzLWbJPhhYvekkUTLxuZg79SHx v9mhgkMErYiF8hdJ4TBstypvcGvUoB2Iwc5jMIAPDKjKv7qJ4I69OQeni1c7p/gxfKLco LPLj+ih1K8PkGvHlarj3UNqOB/cSwNr1lQKfFrzhDrRpzs9VznPVTvHgwRbtnDZn0XA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796362255; h=DMARC-Filter:Received:DKIM-Filter:DKIM-Signature:Message-ID:Date: MIME-Version:User-Agent:Subject:To:Cc:References:Content-Language: From:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Spam-Status: X-Spam-Checker-Version; bh=duK+6JxP6pzK+dsmUAx1LtLg4pAlOiBH258jeZfdIN8=; b=lihpalls4M/jyW8rWC+AbI66dOIeHqKjpkuD+YMQ00w4+lZcvNfwEUPEgpCw8wPcmTGZ B3CFRKO3wcafnfbVQtaa87jleLbb1shq9shMYc7mruvpdLQnzwFXVNQMDkuFWBIlKlfhn INaAwOP5//RjnVKShx7qTVK45HRIFMj6R6ZUZsL+BGDa7o3/7sYXsaGPm3lSWYBA3qX/p 5Rbpov5tw+dkc0L3enco8VyKvNMn2VQJGYcHtr/iH8XaWnPnFNzVtboDTwqx1VR/hzk9H 05MZkwqBxLqCqTM3uqfItEVhDZxmAzHGvAHKmutYEJKC5q12gbrmWlClmvUCKlW8lxg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=jHHApgxn; arc=none smtp.remote-ip=13.77.154.182 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23DC3606A32C; Fri, 4 Dec 2026 05:30:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 23DC3606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=jHHApgxn Received: from [192.168.1.70] (unknown [52.172.102.219]) by linux.microsoft.com (Postfix) with ESMTPSA id 3B26420B7166; Thu, 3 Dec 2026 21:30:50 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3B26420B7166 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1796362254; bh=duK+6JxP6pzK+dsmUAx1LtLg4pAlOiBH258jeZfdIN8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=jHHApgxnrqPq6nq2WfmzVHwU5OvGqc++c4oKX6jnstoyC2+Rw+Px0uiijx/BYNjCX JGAdQM/BfEatWrloveJ+FgvxjikTO2novDw+IbRoQ9+MSO8AdNHoFrH15kksGpxxe9 l6ceaTmy6EYhaK/VHp/jGMnJF2orptasHVhSyH5w= Message-ID: Date: Fri, 4 Dec 2026 11:00:50 +0530 X-Mailing-List: linux-edac@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] x86/mce: Don't report an error when MCE is unavailable To: Dexuan Cui , 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 References: <20261204021224.574793-1-decui@microsoft.com> Content-Language: en-US From: Naman Jain In-Reply-To: <20261204021224.574793-1-decui@microsoft.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 > --- > 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 Regards, Naman