Skip to content

Commit

Permalink
KVM: vmx: fix MPX detection
Browse files Browse the repository at this point in the history
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: 93c4adc
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>
  • Loading branch information
Paolo Bonzini committed Mar 27, 2014
1 parent f7b9ddb commit 920c837
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 920c837

Please sign in to comment.