]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: vVMX: signal failure for nested VMEntry if emulation_required
authorSean Christopherson <sean.j.christopherson@intel.com>
Mon, 12 Mar 2018 17:56:13 +0000 (10:56 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 16 Mar 2018 21:01:38 +0000 (22:01 +0100)
commit7324c15db720be1bf7af0da40debe8011451b4d7
tree38958959d708fa92778368a7e269fe9b474e465f
parent9b4c84c0d71b20b9e00e7567b26cc93463d14abe
KVM: vVMX: signal failure for nested VMEntry if emulation_required

Fail a nested VMEntry with EXIT_REASON_INVALID_STATE if L2 guest state
is invalid, i.e. vmcs12 contained invalid guest state, and unrestricted
guest is disabled in L0 (and by extension disabled in L1).

WARN_ON_ONCE in handle_invalid_guest_state() if we're attempting to
emulate L2, i.e. nested_run_pending is true, to aid debug in the
(hopefully unlikely) scenario that we somehow skip the nested VMEntry
consistency check, e.g. due to a L0 bug.

Note: KVM relies on hardware to detect the scenario where unrestricted
guest is enabled in L0 but disabled in L1 and vmcs12 contains invalid
guest state, i.e. checking emulation_required in prepare_vmcs02 is
required only to handle the case were unrestricted guest is disabled
in L0 since L0 never actually attempts VMLAUNCH/VMRESUME with vmcs02.

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