Skip to content

Commit f4cfcd2

Browse files
Maxim Levitskybonzini
authored andcommitted
KVM: x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally
This msr is only available when the host supports WAITPKG feature. This breaks a nested guest, if the L1 hypervisor is set to ignore unknown msrs, because the only other safety check that the kernel does is that it attempts to read the msr and rejects it if it gets an exception. Cc: [email protected] Fixes: 6e3ba4a ("KVM: vmx: Emulate MSR IA32_UMWAIT_CONTROL") Signed-off-by: Maxim Levitsky <[email protected]> Message-Id: <[email protected]> Reviewed-by: Sean Christopherson <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 0abcc8f commit f4cfcd2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/x86/kvm/x86.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5242,6 +5242,10 @@ static void kvm_init_msr_list(void)
52425242
if (!kvm_cpu_cap_has(X86_FEATURE_RDTSCP))
52435243
continue;
52445244
break;
5245+
case MSR_IA32_UMWAIT_CONTROL:
5246+
if (!kvm_cpu_cap_has(X86_FEATURE_WAITPKG))
5247+
continue;
5248+
break;
52455249
case MSR_IA32_RTIT_CTL:
52465250
case MSR_IA32_RTIT_STATUS:
52475251
if (!kvm_cpu_cap_has(X86_FEATURE_INTEL_PT))

0 commit comments

Comments
 (0)