From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Mattson Subject: [PATCH 2/2] KVM: nVMX: Check host support for MSR bitmaps Date: Thu, 25 May 2017 11:01:14 -0700 Message-ID: <20170525180114.131500-2-jmattson@google.com> References: <20170525180114.131500-1-jmattson@google.com> Cc: Jim Mattson To: kvm@vger.kernel.org, Wincy Van Return-path: Received: from mail-pf0-f171.google.com ([209.85.192.171]:35590 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967127AbdEYSBz (ORCPT ); Thu, 25 May 2017 14:01:55 -0400 Received: by mail-pf0-f171.google.com with SMTP id n23so174015561pfb.2 for ; Thu, 25 May 2017 11:01:54 -0700 (PDT) In-Reply-To: <20170525180114.131500-1-jmattson@google.com> Sender: kvm-owner@vger.kernel.org List-ID: 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 --- arch/x86/kvm/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.13.0.219.gdb65acc882-goog