Skip to content

KVM: SVM: Create separate vmcbs for L1 and L2

Cathy Avery kvm lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 2 repliesIn review
  2. v22 patches 11 repliesApplied

Changes in v3 from the cover letter

- Added vmcb switching helper.
- svm_set_nested_state always forces to L1 before determining state
to set. This is more like vmx and covers any potential L2 to L2 nested state switch.
- Moved svm->asid tracking to pre_svm_run and added ASID set dirty bit checking.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KVM: SVM: Track asid from vcpu_svmarch/x86/kvm/svm/svm.c arch/x86/kvm/svm/svm.h+16 -20 replies
2/2KVM: SVM: Use a separate vmcb for the nested L2 guestarch/x86/kvm/svm/nested.c arch/x86/kvm/svm/svm.c arch/x86/kvm/svm/svm.h+94 -1220 replies

Reviews trailers per patch

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

Read the v3 thread

Cover letter [PATCH v3 0/2] KVM: SVM: Create separate vmcbs for L1 and L2

svm->vmcb will now point to either a separate vmcb L1 ( not nested ) or L2 vmcb ( nested ).

Changes:
v2 -> v3
- Added vmcb switching helper.
- svm_set_nested_state always forces to L1 before determining state
to set. This is more like vmx and covers any potential L2 to L2 nested state switch.
- Moved svm->asid tracking to pre_svm_run and added ASID set dirty bit checking.

v1 -> v2
- Removed unnecessary update check of L1 save.cr3 during nested_svm_vmexit.
- Moved vmcb01_pa to svm.
- Removed get_host_vmcb() function.
- Updated vmsave/vmload corresponding vmcb state during L2 enter and exit which fixed the L2 load issue.
- Moved asid workaround to a new patch which adds asid to svm.
- Init previously uninitialized L2 vmcb save.gpat and save.cr4

Tested:
kvm-unit-tests
kvm self tests
Loaded fedora nested guest on fedora

Cathy Avery (2):
KVM: SVM: Track asid from vcpu_svm
KVM: SVM: Use a separate vmcb for the nested L2 guest

 arch/x86/kvm/svm/nested.c | 125 ++++++++++++++++++--------------------
 arch/x86/kvm/svm/svm.c    |  58 +++++++++++-------
 arch/x86/kvm/svm/svm.h    |  51 +++++-----------
 3 files changed, 110 insertions(+), 124 deletions(-)
Signature · 1 line
2.20.1