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=1796350369; b=e9oe6ghSZWZDnaIDM20wJ2H2USYvNENLHcTaWHm9d8LjtVjA/jyBkApQwMJbV/RQ51re HyYJFcRAXYfvc7BGUTRMdjEqvuw1HYVNX7Z7vybUsdWEtwPfsE6LHSWXlW9qwJDhr4vHy Zt4cAFyEp27180EExANsElfCcvdrSOLMHnGTlKyH85ZS3Am1j18Yz0ZmzHPVtGTjk+dP2 SVuaar9cKDrzMQmvh4Hai7cwGkpjvl7EhHsOYJTx9n5R9OSZu/qqIohtK/qPzdTG43Dqw BP9XR5zvk87Hy83BiNep0edAxZ7dICvKWQFWoBng3YHSAuTCZeTeX7nDZRdAe352T6Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796350369; h=DMARC-Filter:Received:DKIM-Filter:From:To:Cc:Subject:Date:Message-ID: X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=aL+UhWpun6GEhEm9Dtla7qmFjids5RFwL1vA/304YCM=; b=KqFze94wr/XAiu7n6UxD4amJGJXpMVkgCFZf0/cx9V6YUIpEc6cXODAdCDevzWQGeULJ Hy25fHleXyHQ2EsAgiRemeqme1TXPVPmivqOuXYNV1d4dL/im5StEFRSJjolfHmM0Mkjm yABzIsLb+n+9YkRvpbaxw/nyy07NZPy1BTmW7ValmEcbKfs8V65c1C3exiXcSfttq4sBa nZPPaldydvEIuOt4HgZx8Xyk9PoCNa9R+ZKli5VvryiaR9yOKNR19oX4S1XPPQI53jjUC 0Tpm7/oYxHL0zYSrTvbz7P8BVvVeDG4aMAxBxdcmWwOChlr4rlo1FL4mDLi6LOxAcjw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; 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 3886C606A32C; Fri, 4 Dec 2026 02:12:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3886C606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Received: by linux.microsoft.com (Postfix, from userid 1009) id 3977220B7166; Thu, 3 Dec 2026 18:12:47 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 3977220B7166 From: Dexuan Cui 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 Subject: [PATCH v3] x86/mce: Don't report an error when MCE is unavailable Date: Thu, 3 Dec 2026 18:12:24 -0800 Message-ID: <20261204021224.574793-1-decui@microsoft.com> X-Mailer: git-send-email 2.43.7 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 Content-Transfer-Encoding: 8bit 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;