]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: disable MPX if host did not enable MPX XSAVE features
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 8 Mar 2016 08:52:13 +0000 (09:52 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 9 Mar 2016 13:04:36 +0000 (14:04 +0100)
commit9896d2e75fe0482b865b694ab3b5435e759c3971
tree42ca5c20c06ae8a8f988192e44f3d3263fbabdf3
parentb9022de480bcf45e64181fb40c09ccf1235bd323
KVM: x86: disable MPX if host did not enable MPX XSAVE features

When eager FPU is disabled, KVM will still see the MPX bit in CPUID and
presumably the MPX vmentry and vmexit controls.  However, it will not
be able to expose the MPX XSAVE features to the guest, because the guest's
accessible XSAVE features are always a subset of host_xcr0.

In this case, we should disable the MPX CPUID bit, the BNDCFGS MSR,
and the MPX vmentry and vmexit controls for nested virtualization.
It is then unnecessary to enable guest eager FPU if the guest has the
MPX CPUID bit set.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/cpuid.c
arch/x86/kvm/cpuid.h
arch/x86/kvm/vmx.c