[PATCH v2] KVM: x86/tdx: Do not print error message on non-present feature

From: Jiri Slaby (SUSE)

Date: Wed Jul 29 2026 - 05:02:04 EST


Before commit 165e77353831 below, the kernel did not print anything
during boot if X86_FEATURE_TDX_HOST_PLATFORM was not present, unless TDX
enablement was explicitly requested via a module parameter.

After the commit, when attempting to load TDX automatically, this is
emitted to the log:
virt/tdx: TDX not supported by the host platform

It is emitted with the "error" level, hence it is disturbing. It is not
an error to run CPUs without the feature.

Drop this silent-boot-breaking error message for the automatic
initialization path.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@xxxxxxxxxx>
Fixes: 165e77353831 ("KVM: x86/tdx: Do VMXON and TDX-Module initialization during subsys init")
Reviewed-by: Kiryl Shutsemau (Meta) <kas@xxxxxxxxxx>
Cc: Dan Williams <dan.j.williams@xxxxxxxxx>
Cc: Chao Gao <chao.gao@xxxxxxxxx>
Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
Cc: Sean Christopherson <seanjc@xxxxxxxxxx>

---

[v2] update the commit message.

Cc: Thomas Gleixner <tglx@xxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxxxx>
Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
Cc: x86@xxxxxxxxxx
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
Cc: Rick Edgecombe <rick.p.edgecombe@xxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: linux-coco@xxxxxxxxxxxxxxx
Cc: kvm@xxxxxxxxxxxxxxx
---
arch/x86/virt/vmx/tdx/tdx.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/x86/virt/vmx/tdx/tdx.c b/arch/x86/virt/vmx/tdx/tdx.c
index 1b9ff749dd8e..e5fb0d382c4c 100644
--- a/arch/x86/virt/vmx/tdx/tdx.c
+++ b/arch/x86/virt/vmx/tdx/tdx.c
@@ -1228,10 +1228,8 @@ static __init int tdx_enable(void)
enum cpuhp_state state;
int ret;

- if (!cpu_feature_enabled(X86_FEATURE_TDX_HOST_PLATFORM)) {
- pr_err("TDX not supported by the host platform\n");
+ if (!cpu_feature_enabled(X86_FEATURE_TDX_HOST_PLATFORM))
return -ENODEV;
- }

if (!cpu_feature_enabled(X86_FEATURE_XSAVE)) {
pr_err("XSAVE is required for TDX\n");
--
2.55.0