]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: VMX: Intercept guest reserved CR4 bits to inject #GP fault
authorSean Christopherson <sean.j.christopherson@intel.com>
Wed, 30 Sep 2020 04:16:58 +0000 (21:16 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 21 Oct 2020 21:48:50 +0000 (17:48 -0400)
commit59c32fc03f5cfe04b9f65f3f3801987dde4f8710
tree4c1f50a474f1ebd4ea8fad02bbfa10eb097b090e
parent4326b56cf3bd05e92b589a514e74ce684c7b9fa0
KVM: VMX: Intercept guest reserved CR4 bits to inject #GP fault

Intercept CR4 bits that are guest reserved so that KVM correctly injects
a #GP fault if the guest attempts to set a reserved bit.  If a feature
is supported by the CPU but is not exposed to the guest, and its
associated CR4 bit is not intercepted by KVM by default, then KVM will
fail to inject a #GP if the guest sets the CR4 bit without triggering
an exit, e.g. by toggling only the bit in question.

Note, KVM doesn't give the guest direct access to any CR4 bits that are
also dependent on guest CPUID.  Yet.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200930041659.28181-5-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c