]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: Explicitly check for valid guest state for !unrestricted guest
authorSean Christopherson <sean.j.christopherson@intel.com>
Wed, 23 Sep 2020 18:44:48 +0000 (11:44 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 28 Sep 2020 11:57:45 +0000 (07:57 -0400)
commitf4e3e7727a94c9a4be78324b31d890b1a997afb3
treeb020e969bb15a32b30e3282a3d8ab9074c54836c
parent6cfdec41a4d68fb50ad937acfb91cd7b0cbae81d
KVM: nVMX: Explicitly check for valid guest state for !unrestricted guest

Call guest_state_valid() directly instead of querying emulation_required
when checking if L1 is attempting VM-Enter with invalid guest state.
If emulate_invalid_guest_state is false, KVM will fixup segment regs to
avoid emulation and will never set emulation_required, i.e. KVM will
incorrectly miss the associated consistency checks because the nested
path stuffs segments directly into vmcs02.

Opportunsitically add Consistency Check tracing to make future debug
suck a little less.

Fixes: 6804a27cf3a5c ("KVM: vVMX: signal failure for nested VMEntry if emulation_required")
Fixes: f9f6df11d4ccc ("KVM: nVMX: fix vmentry failure code when L2 state would require emulation")
Cc: stable@vger.kernel.org
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200923184452.980-4-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/vmx/vmx.h