Skip to content

KVM: nSVM: few random fixes

Maxim Levitsky kvm lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 8 repliesIn review
  2. v16 patches 4 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4KVM: nSVM: cancel KVM_REQ_GET_NESTED_STATE_PAGES on nested vmexitarch/x86/kvm/svm/nested.c+6 -05 replies
2/4KVM: nSVM: correctly restore nested_run_pending on migrationarch/x86/kvm/svm/nested.c+4 -03 replies
3/4KVM: nSVM: always leave the nested state first on KVM_SET_NESTED_STATEarch/x86/kvm/svm/nested.c+1 -00 replies
4/4KVM: nSVM: mark vmcb as dirty when forcingly leaving the guest modearch/x86/kvm/svm/nested.c+1 -00 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 0/4] KVM: nSVM: few random fixes

This is a series of fixes to nested SVM, that finally makes my kvm on kvm stress test pass, and fix various other issues/regressions.

Patch 1 is a fix for recent regression related to code that delayed the nested msr bitmap processing to the next vm entry, and started to crash the L1 after my on demand nested state allocation patches.

The problem was that the code assumed that we will still be in the nested guest mode on next vmentry after setting the nested state, but a pending event can cause a nested vmexit prior to that.

Patch 2 makes KVM restore nested_run_pending flag on migration which fixes various issues including potentially missed L1->L2 event injection if migration happens while nested run is pending.

Patches 3,4 are few things I found while reviewing the nested migration code. I don't have a reproducer for them.

Thanks a lot to Sean Christopherson for the review feedback on V1 of this series, which is fully incorporated in this series.

Best regards,
Maxim Levitsky

Maxim Levitsky (4):
KVM: nSVM: cancel KVM_REQ_GET_NESTED_STATE_PAGES on nested vmexit
KVM: nSVM: correctly restore nested_run_pending on migration
KVM: nSVM: always leave the nested state first on KVM_SET_NESTED_STATE
KVM: nSVM: mark vmcb as dirty when forcingly leaving the guest mode

 arch/x86/kvm/svm/nested.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
Signature · 1 line
2.26.2