Skip to contentSkip to conversation

KVM: x86/tdx: Do not print error message on non-present feature

PATCH Superseded Jiri Slaby (SUSE) 4 participants 4 messages Jul 29

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

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

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.

Fixes 165e77353831 ("KVM: x86/tdx: Do VMXON and TDX-Module initialization during subsys init")
Cc Dan Williams <[email protected]>
Cc Chao Gao <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Sean Christopherson <[email protected]>

---

[v2] update the commit message.

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Rick Edgecombe <[email protected]>
---
 arch/x86/virt/vmx/tdx/tdx.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/virt/vmx/tdx/tdx.c +1 -3
index 1b9ff749dd8e..e5fb0d382c4c 100644
@@ -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");
Signature · 1 line
2.55.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 14 lines · Jiri Slaby (SUSE)

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.

Quoted 7 lines
Fixes 165e77353831 ("KVM: x86/tdx: Do VMXON and TDX-Module initialization during subsys init")
Cc Dan Williams <[email protected]>
Cc Chao Gao <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Sean Christopherson <[email protected]>
reviewer Reviewed-by on v2 1/1
#2 lore raw
In reply to Jiri Slaby (SUSE)

For the scope:

x86/virt/tdx

because this is no longer in KVM's purview.

Quoted 14 lines · Jiri Slaby (SUSE)

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.

Quoted 7 lines
Fixes 165e77353831 ("KVM: x86/tdx: Do VMXON and TDX-Module initialization during subsys init")
Cc Dan Williams <[email protected]>
Cc Chao Gao <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Sean Christopherson <[email protected]>
maintainer Reviewed-by on v2 1/1
#3 lore raw
In reply to Jiri Slaby (SUSE)
Quoted 16 lines · Jiri Slaby (SUSE)

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.

Fixes 165e77353831 ("KVM: x86/tdx: Do VMXON and TDX-Module initialization
Quoted 8 lines

during subsys init")

Cc Dan Williams <[email protected]>
Cc Chao Gao <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Sean Christopherson <[email protected]>

---

Thanks for the log changes.