KVM: x86/tdx: Do not print error message on non-present feature
Subsystems (3)
PATCH 1/1 KVM: x86/tdx: Do not print error message on non-present feature
Before commit 165e77353831 below, the kernel did not print anything when X86_FEATURE_TDX_HOST_PLATFORM was not present in a cpu.
After the commit, this is emitted to the log, with the error level:virt/tdx: TDX not supported by the host platform
This is disturbing as it is not an error running CPUs without the feature.
Drop the error message completely to revert to the state before 165e77353831.
--
--- arch/x86/virt/vmx/tdx/tdx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/x86/virt/vmx/tdx/tdx.c +1 -3
@@ -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.54.0
Quoted 12 lines · Jiri Slaby (SUSE)
Before commit
165e77353831below, the kernel did not print anything whenX86_FEATURE_TDX_HOST_PLATFORMwas not present in a cpu.After the commit, this is emitted to the log, with the error level:
virt/tdx: TDX not supported by the host platformThis is disturbing as it is not an error running CPUs without the feature.
Drop the error message completely to revert to the state before
165e77353831.
Quoted 6 lines
Signed-off-by Jiri Slaby (SUSE) <[email protected]>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]>
Signature · 1 line
Kiryl Shutsemau / Kirill A. Shutemov
Edgecombe, Rick P
maintainerQuoted 2 lines · Jiri Slaby (SUSE)
Before commit
165e77353831below, the kernel did not print anything whenX86_FEATURE_TDX_HOST_PLATFORMwas not present in a cpu.
This isn't quite correct. It would print something if KVM tried to enable it, which is controlled by a module param.
Quoted 6 lines
After the commit, this is emitted to the log, with the error level:
virt/tdx: TDX not supported by the host platformThis is disturbing as it is not an error running CPUs without the feature.
Agree. If the kernel is now trying to enabling TDX automatically, it is not error print worthy if it fails because TDX is not supported.
But after the below change, something is still printed if the kernel param is used. Can we be a little more specific?
Quoted 3 lines
Drop the error message completely to revert to the state before
165e77353831.
'state' is a little ambiguous here. Sounds like a full revert.
Quoted 30 lines
Signed-off-by Jiri Slaby (SUSE) <[email protected]>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]>--
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 Kiryl Shutsemau <[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 +0
-0
arch/x86/virt/vmx/tdx/tdx.c static __init int tdx_enable(void) · line 1234
Quoted 8 lines
arch/x86/virt/vmx/tdx/tdx.c +1
-3@@ -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 ; - }
Seems like a reasonable change to me, but the log is a bit misleading.
Quoted 3 lines
arch/x86/virt/vmx/tdx/tdx.c +0
-0if (!cpu_feature_enabled (X86_FEATURE_XSAVE )) {pr_err ("XSAVE is required for TDX\n" );