Skip to content

KVM: nVMX: Fix migration of nested guests when eVMCS is in use

Vitaly Kuznetsov kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 14 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4KVM: nVMX: Always make an attempt to map eVMCS after migrationarch/x86/kvm/vmx/nested.c+19 -104 replies
2/4KVM: nVMX: Properly pad 'struct kvm_vmx_nested_state_hdr'arch/x86/include/uapi/asm/kvm.h+2 -02 replies
3/4KVM: nVMX: Introduce __nested_vmx_handle_enlightened_vmptrld()arch/x86/kvm/vmx/nested.c+17 -91 reply
4/4KVM: nVMX: Map enlightened VMCS upon restore when possiblearch/x86/include/uapi/asm/kvm.h arch/x86/kvm/vmx/nested.c+23 -65 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchMaxim Levitsky
1/4
2/4R-b
3/4R-b
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] KVM: nVMX: Fix migration of nested guests when eVMCS is in use

Win10 guests with WSL2 enabled sometimes crash on migration when enlightened VMCS was used. The condition seems to be induced by the situation when L2->L1 exit is caused immediately after migration and before L2 gets a chance to run (e.g. when there's an interrupt pending). The issue was introduced by commit f2c7ef3ba955 ("KVM: nSVM: cancel KVM_REQ_GET_NESTED_STATE_PAGES on nested vmexit") and the first patch of the series addresses the immediate issue. The eVMCS mapping restoration path, however, seems to be fragile and the rest of the series tries to make it more future proof by including eVMCS GPA in the migration data.

Vitaly Kuznetsov (4):
KVM: nVMX: Always make an attempt to map eVMCS after migration
KVM: nVMX: Properly pad 'struct kvm_vmx_nested_state_hdr'
KVM: nVMX: Introduce __nested_vmx_handle_enlightened_vmptrld()
KVM: nVMX: Map enlightened VMCS upon restore when possible

 arch/x86/include/uapi/asm/kvm.h |  4 ++
 arch/x86/kvm/vmx/nested.c       | 82 +++++++++++++++++++++++----------
 2 files changed, 61 insertions(+), 25 deletions(-)
Signature · 1 line
2.30.2