]> git.hungrycats.org Git - linux/commitdiff
kvm: vmx: Do not disable intercepts for BNDCFGS
authorJim Mattson <jmattson@google.com>
Tue, 23 May 2017 18:52:52 +0000 (11:52 -0700)
committerSasha Levin <alexander.levin@verizon.com>
Mon, 31 Jul 2017 17:37:55 +0000 (13:37 -0400)
[ Upstream commit a8b6fda38f80e75afa3b125c9e7f2550b579454b ]

The MSR permission bitmaps are shared by all VMs. However, some VMs
may not be configured to support MPX, even when the host does. If the
host supports VMX and the guest does not, we should intercept accesses
to the BNDCFGS MSR, so that we can synthesize a #GP
fault. Furthermore, if the host does not support MPX and the
"ignore_msrs" kvm kernel parameter is set, then we should intercept
accesses to the BNDCFGS MSR, so that we can skip over the rdmsr/wrmsr
without raising a #GP fault.

Fixes: da8999d31818fdc8 ("KVM: x86: Intel MPX vmx and msr handle")
Signed-off-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
arch/x86/kvm/vmx.c

index ad6a662af58dbb48d934d299fb8788a159b3d64a..32e29f926e5afcb7054738394a902b460939fe12 100644 (file)
@@ -6153,7 +6153,6 @@ static __init int hardware_setup(void)
        vmx_disable_intercept_for_msr(MSR_IA32_SYSENTER_CS, false);
        vmx_disable_intercept_for_msr(MSR_IA32_SYSENTER_ESP, false);
        vmx_disable_intercept_for_msr(MSR_IA32_SYSENTER_EIP, false);
-       vmx_disable_intercept_for_msr(MSR_IA32_BNDCFGS, true);
 
        memcpy(vmx_msr_bitmap_legacy_x2apic,
                        vmx_msr_bitmap_legacy, PAGE_SIZE);