Skip to content

Commit bb02e2c

Browse files
Sean Christophersonsuryasaimadhu
authored andcommitted
x86/cpu: Print "VMX disabled" error message iff KVM is enabled
Don't print an error message about VMX being disabled by BIOS if KVM, the sole user of VMX, is disabled. E.g. if KVM is disabled and the MSR is unlocked, the kernel will intentionally disable VMX when locking feature control and then complain that "BIOS" disabled VMX. Fixes: ef4d3bf ("x86/cpu: Clear VMX feature flag if VMX is not fully enabled") Signed-off-by: Sean Christopherson <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 8f63aaf commit bb02e2c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/x86/kernel/cpu/feat_ctl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,9 @@ void init_ia32_feat_ctl(struct cpuinfo_x86 *c)
133133

134134
if ( (tboot && !(msr & FEAT_CTL_VMX_ENABLED_INSIDE_SMX)) ||
135135
(!tboot && !(msr & FEAT_CTL_VMX_ENABLED_OUTSIDE_SMX))) {
136-
pr_err_once("VMX (%s TXT) disabled by BIOS\n",
137-
tboot ? "inside" : "outside");
136+
if (IS_ENABLED(CONFIG_KVM_INTEL))
137+
pr_err_once("VMX (%s TXT) disabled by BIOS\n",
138+
tboot ? "inside" : "outside");
138139
clear_cpu_cap(c, X86_FEATURE_VMX);
139140
} else {
140141
#ifdef CONFIG_X86_VMX_FEATURE_NAMES

0 commit comments

Comments
 (0)