Skip to content

Add support for nested SVM (kernel) v5

Alexander Graf kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 43 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9Clean up VINTR setting v5arch/x86/kvm/svm.c+15 -50 replies
2/9Add helper functions for nested SVM v5arch/x86/kvm/svm.c+88 -04 replies
3/9Implement GIF, clgi and stgi v5arch/x86/kvm/svm.c include/asm-x86/kvm_host.h+42 -38 replies
4/9Implement hsave v5arch/x86/kvm/kvm_svm.h arch/x86/kvm/svm.c+13 -09 replies
5/9Add VMLOAD and VMSAVE handlers v5arch/x86/kvm/svm.c+58 -25 replies
6/9Add VMRUN handler v5arch/x86/kvm/kvm_svm.h arch/x86/kvm/svm.c include/asm-x86/kvm_host.h+164 -23 replies
7/9Add VMEXIT handler and intercepts v5arch/x86/kvm/svm.c+295 -00 replies
8/9allow read access to MSR_VM_VRarch/x86/kvm/svm.c+3 -02 replies
9/9Allow setting the SVME bit v5arch/x86/kvm/svm.c+6 -012 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/9] Add support for nested SVM (kernel) v5

The current generation of virtualization extensions only supports one VM layer. While we can't change that, it is pretty easy to emulate the CPU's behavior and implement the virtualization opcodes ourselves.

This patchset does exactly this for SVM. Using it, KVM can run within a VM. Since we're emulating the real CPU's behavior, this should also enable other VMMs to run within KVM.
So far I've only tested to run KVM inside the VM though.

As always, comments and suggestions are highly welcome.

v2 takes most comments from Avi into account.

v3 addresses Joergs comments, including

- V_INTR_MASKING support
- a generic permission checking helper

v4 addresses even more comments from Joerg, including

- don't use the guest's hsave to store the guest's vmcb in
- add nested=<int> flag for kvm-amd.ko, defaults to 0 (off)
- include Joerg's VM_CR MSR patch

v5 removes the IOPM merging code

To be usable, this patchset requires the two simple changes in the userspace part, that I sent to the list with the first version.

Known issues:

- TODO: #VMEXIT on save/restore
- SMP l2 guests break with in-kernel-apic

Thanks for reviewing!

Alex

Alexander Graf (8):
Clean up VINTR setting v5
Add helper functions for nested SVM v5
Implement GIF, clgi and stgi v5
Implement hsave v5
Add VMLOAD and VMSAVE handlers v5
Add VMRUN handler v5
Add VMEXIT handler and intercepts v5
Allow setting the SVME bit v5

Joerg Roedel (1):
allow read access to MSR_VM_VR

 arch/x86/kvm/kvm_svm.h     |    9 +
 arch/x86/kvm/svm.c         |  682 +++++++++++++++++++++++++++++++++++++++++++-
 include/asm-x86/kvm_host.h |    5 +
 3 files changed, 684 insertions(+), 12 deletions(-)