Skip to content

KVM: nVMX: Fix some failed VM-entry issues

Jim Mattson kvm 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4KVM: nVMX: Sequester all vmcs12 guest-state updatesarch/x86/kvm/vmx.c+16 -200 replies
2/4KVM: nVMX: Introduce update_vmcs12_vm_entry_controlsarch/x86/kvm/vmx.c+23 -80 replies
3/4KVM: nVMX: Introduce record_extra_vmcs12_exit_informationarch/x86/kvm/vmx.c+35 -190 replies
4/4KVM: nVMX: Don't set vmcs12 to "launched" when VMLAUNCH failsarch/x86/kvm/vmx.c+1 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] KVM: nVMX: Fix some failed VM-entry issues

According to the Intel SDM, volume 3, section 26.7: VM-Entry Failures During or After Loading Guest State,

Although this process resembles that of a VM exit, many steps taken during a VM exit do not occur for these VM-entry failures:

o Most VM-exit information fields are not updated (see step 1

    above).

o The valid bit in the VM-entry interruption-information field is not cleared.
o The guest-state area is not modified.
o No MSRs are saved into the VM-exit MSR-store area.

"Step 1 above" indicates that information about the VM-entry failure is only recorded in the exit reason and exit qualification fields. *All other VM-exit information fields are unmodified.*

Moreover, the pseudo-code for VMLAUNCH/VMRESUME in section 30.3 indicates that the launch state of the VMCS is only set to "launched" when the VM-entry succeeds.

The current nested_vmx_vmexit code does not sufficiently distinguish VM-entry failure from a normal VM-exit, and therefore gets most of these things wrong.

Jim Mattson (4):
KVM: nVMX: Sequester all vmcs12 guest-state updates
KVM: nVMX: Introduce update_vmcs12_vm_entry_controls
KVM: nVMX: Introduce record_extra_vmcs12_exit_information
KVM: nVMX: Don't set vmcs12 to "launched" when VMLAUNCH fails

 arch/x86/kvm/vmx.c | 112 +++++++++++++++++++++++++++++++++--------------------
 1 file changed, 69 insertions(+), 43 deletions(-)
Signature · 1 line
2.13.0.219.gdb65acc882-goog