KVM: VMX: make MSR bitmaps per-VCPU
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 16 Jan 2018 15:51:18 +0000 (16:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Feb 2018 19:12:24 +0000 (11:12 -0800)
commit7f8da2c8a191f274600bafcf6e58f54e16d5c8de
treedb5a6db202d41d10821306608fd3be6ab60e2b59
parentad368e5b2d56ed059ebc8343cd7e713f3a7717d4
KVM: VMX: make MSR bitmaps per-VCPU

commit 904e14fb7cb96401a7dc803ca2863fd5ba32ffe6

Place the MSR bitmap in struct loaded_vmcs, and update it in place
every time the x2apic or APICv state can change.  This is rare and
the loop can handle 64 MSRs per iteration, in a similar fashion as
nested_vmx_prepare_msr_bitmap.

This prepares for choosing, on a per-VM basis, whether to intercept
the SPEC_CTRL and PRED_CMD MSRs.

Cc: stable@vger.kernel.org # prereq for Spectre mitigation
Suggested-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/vmx.c