KVM: vmx: fix MPX detection
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 26 Mar 2014 14:54:00 +0000 (15:54 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 27 Mar 2014 12:06:51 +0000 (13:06 +0100)
kvm_x86_ops is still NULL at this point.  Since kvm_init_msr_list
cannot fail, it is safe to initialize it before the call.

Fixes: 93c4adc7afedf9b0ec190066d45b6d67db5270da
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Tested-by: Jet Chen <jet.chen@intel.com>
Cc: kvm@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c

index aa986959f237644e80da91a2077bee1a6244591f..d1c55f8722c66cf6139222c3544c97700169c523 100644 (file)
@@ -5594,9 +5594,10 @@ int kvm_arch_init(void *opaque)
                goto out_free_percpu;
 
        kvm_set_mmio_spte_mask();
-       kvm_init_msr_list();
 
        kvm_x86_ops = ops;
+       kvm_init_msr_list();
+
        kvm_mmu_set_mask_ptes(PT_USER_MASK, PT_ACCESSED_MASK,
                        PT_DIRTY_MASK, PT64_NX_MASK, 0);