Commit 702a71cf authored by Nadav Amit's avatar Nadav Amit Committed by Greg Kroah-Hartman

KVM: x86: Fix MSR_IA32_BNDCFGS in msrs_to_save

commit 9e9c3fe4 upstream.

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: default avatarNadav Amit <namit@cs.technion.ac.il>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Message-Id: <1428864435-4732-1-git-send-email-namit@cs.technion.ac.il>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 0d2b51f3
...@@ -5781,7 +5781,6 @@ int kvm_arch_init(void *opaque) ...@@ -5781,7 +5781,6 @@ int kvm_arch_init(void *opaque)
kvm_set_mmio_spte_mask(); kvm_set_mmio_spte_mask();
kvm_x86_ops = ops; kvm_x86_ops = ops;
kvm_init_msr_list();
kvm_mmu_set_mask_ptes(PT_USER_MASK, PT_ACCESSED_MASK, kvm_mmu_set_mask_ptes(PT_USER_MASK, PT_ACCESSED_MASK,
PT_DIRTY_MASK, PT64_NX_MASK, 0); PT_DIRTY_MASK, PT64_NX_MASK, 0);
...@@ -7218,7 +7217,14 @@ void kvm_arch_hardware_disable(void) ...@@ -7218,7 +7217,14 @@ void kvm_arch_hardware_disable(void)
int kvm_arch_hardware_setup(void) int kvm_arch_hardware_setup(void)
{ {
return kvm_x86_ops->hardware_setup(); int r;
r = kvm_x86_ops->hardware_setup();
if (r != 0)
return r;
kvm_init_msr_list();
return 0;
} }
void kvm_arch_hardware_unsetup(void) void kvm_arch_hardware_unsetup(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment