OSDN Git Service

KVM: x86: don't expose MSR_IA32_UMWAIT_CONTROL unconditionally
authorMaxim Levitsky <mlevitsk@redhat.com>
Sat, 23 May 2020 16:14:55 +0000 (19:14 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 27 May 2020 17:08:19 +0000 (13:08 -0400)
commitf4cfcd2d5aea4e96c5d483c476f3057b6b7baf6a
tree00a54177bb0e4c8721a4db2ffe0fdeb679108f7e
parent0abcc8f65cc23b65bc8d1614cc64b02b1641ed7c
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: stable@vger.kernel.org
Fixes: 6e3ba4abce ("KVM: vmx: Emulate MSR IA32_UMWAIT_CONTROL")
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Message-Id: <20200523161455.3940-3-mlevitsk@redhat.com>
Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c