KVM: x86: Do not use kvm_x86_ops->mpx_supported() directly
authorLiran Alon <liran.alon@oracle.com>
Fri, 14 Sep 2018 00:25:53 +0000 (03:25 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 1 Oct 2018 13:40:57 +0000 (15:40 +0200)
Commit a87036add092 ("KVM: x86: disable MPX if host did not enable
MPX XSAVE features") introduced kvm_mpx_supported() to return true
iff MPX is enabled in the host.

However, that commit seems to have missed replacing some calls to
kvm_x86_ops->mpx_supported() to kvm_mpx_supported().

Complete original commit by replacing remaining calls to
kvm_mpx_supported().

Fixes: a87036add092 ("KVM: x86: disable MPX if host did not enable
MPX XSAVE features")

Suggested-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Liran Alon <liran.alon@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.c

index d32e9c5..5bb2acd 100644 (file)
@@ -12036,7 +12036,7 @@ static void prepare_vmcs02_full(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12)
 
        set_cr4_guest_host_mask(vmx);
 
-       if (vmx_mpx_supported())
+       if (kvm_mpx_supported())
                vmcs_write64(GUEST_BNDCFGS, vmcs12->guest_bndcfgs);
 
        if (enable_vpid) {
index edbf00e..ca71773 100644 (file)
@@ -4698,7 +4698,7 @@ static void kvm_init_msr_list(void)
                 */
                switch (msrs_to_save[i]) {
                case MSR_IA32_BNDCFGS:
-                       if (!kvm_x86_ops->mpx_supported())
+                       if (!kvm_mpx_supported())
                                continue;
                        break;
                case MSR_TSC_AUX: