diff mbox

[2/2] KVM: nVMX: Check host support for MSR bitmaps

Message ID 20170525180114.131500-2-jmattson@google.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jim Mattson May 25, 2017, 6:01 p.m. UTC
If the host doesn't support MSR bitmaps, but the L2 guest is
configured to use MSR bitmaps, fail the emulated VM-entry.

Fixes: 3af18d9c5fe95 ("KVM: nVMX: Prepare for using hardware MSR bitmap")
Signed-off-by: Jim Mattson <jmattson@google.com>
---
 arch/x86/kvm/vmx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index ae641c8d4284..639188037744 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -9590,7 +9590,7 @@  static int nested_vmx_check_msr_bitmap_controls(struct kvm_vcpu *vcpu,
 	if (!nested_cpu_has(vmcs12, CPU_BASED_USE_MSR_BITMAPS))
 		return 0;
 
-	if (vmcs12_read_any(vcpu, MSR_BITMAP, &addr)) {
+	if (!cpu_has_vmx_msr_bitmap()) {
 		WARN_ON(1);
 		return -EINVAL;
 	}