diff options
author | Nadav Amit <namit@cs.technion.ac.il> | 2015-04-12 14:47:15 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-04-14 12:09:50 -0400 |
commit | 9e9c3fe40bcd28e3f98f0ad8408435f4503f2781 (patch) | |
tree | 90aeef820e057dbf24566306b15b44ce6ec3833e /arch/x86/kvm | |
parent | b79013b2449c23f1f505bdf39c5a6c330338b244 (diff) |
KVM: x86: Fix MSR_IA32_BNDCFGS in msrs_to_save
kvm_init_msr_list is currently called before hardware_setup. As a result,
vmx_mpx_supported always returns false when kvm_init_msr_list checks whether to
save MSR_IA32_BNDCFGS.
Move kvm_init_msr_list after vmx_hardware_setup is called to fix this issue.
Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
Message-Id: <1428864435-4732-1-git-send-email-namit@cs.technion.ac.il>
Cc: stable@vger.kernel.org # 3.15+
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/x86.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index e1a81267f3f6..ed31c31b2485 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -5799,7 +5799,6 @@ int kvm_arch_init(void *opaque) | |||
5799 | kvm_set_mmio_spte_mask(); | 5799 | kvm_set_mmio_spte_mask(); |
5800 | 5800 | ||
5801 | kvm_x86_ops = ops; | 5801 | kvm_x86_ops = ops; |
5802 | kvm_init_msr_list(); | ||
5803 | 5802 | ||
5804 | kvm_mmu_set_mask_ptes(PT_USER_MASK, PT_ACCESSED_MASK, | 5803 | kvm_mmu_set_mask_ptes(PT_USER_MASK, PT_ACCESSED_MASK, |
5805 | PT_DIRTY_MASK, PT64_NX_MASK, 0); | 5804 | PT_DIRTY_MASK, PT64_NX_MASK, 0); |
@@ -7253,7 +7252,14 @@ void kvm_arch_hardware_disable(void) | |||
7253 | 7252 | ||
7254 | int kvm_arch_hardware_setup(void) | 7253 | int kvm_arch_hardware_setup(void) |
7255 | { | 7254 | { |
7256 | return kvm_x86_ops->hardware_setup(); | 7255 | int r; |
7256 | |||
7257 | r = kvm_x86_ops->hardware_setup(); | ||
7258 | if (r != 0) | ||
7259 | return r; | ||
7260 | |||
7261 | kvm_init_msr_list(); | ||
7262 | return 0; | ||
7257 | } | 7263 | } |
7258 | 7264 | ||
7259 | void kvm_arch_hardware_unsetup(void) | 7265 | void kvm_arch_hardware_unsetup(void) |