Skip to content

Add support for nested SVM (kernel) v2

Alexander Graf kvm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9Add CPUID feature flag for SVM v2include/asm-x86/cpufeature.h+1 -00 replies
2/9Clean up VINTR setting v2arch/x86/kvm/svm.c+15 -50 replies
3/9Implement GIF, clgi and stgi v2arch/x86/kvm/svm.c include/asm-x86/kvm_host.h+50 -31 reply
4/9Add helper functions for nested SVM v2arch/x86/kvm/svm.c+76 -00 replies
5/9Implement hsave v2arch/x86/kvm/kvm_svm.h arch/x86/kvm/svm.c+9 -00 replies
6/9Add VMLOAD and VMSAVE handlers v2arch/x86/kvm/svm.c+67 -20 replies
7/9Add VMRUN handler v2arch/x86/kvm/kvm_svm.h arch/x86/kvm/svm.c include/asm-x86/kvm_host.h+206 -20 replies
8/9Add VMEXIT handler and intercepts v2arch/x86/kvm/svm.c+319 -02 replies
9/9Allow setting the SVME bit v2arch/x86/kvm/svm.c+2 -00 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) v2

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 this, a 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.

This was created with help from Joerg Roedel. Since he's not fond of the GIF handling as it is now, there is no signed-off-by from him for now.

As always, comments and suggestions are highly welcome.

This is v2, taking most comments from Avi into account. Two things are missing:

- save/restore of hflags
- #VMEXIT on save/restore

I'd rather have them submitted as later patches though, so we don't clutter this already big patchset (I'm slowly getting crazy using git to manage it)

Thanks for reviewing!

Alex

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

 arch/x86/kvm/kvm_svm.h       |   11 +
 arch/x86/kvm/svm.c           |  741 +++++++++++++++++++++++++++++++++++++++++-
 include/asm-x86/cpufeature.h |    1 +
 include/asm-x86/kvm_host.h   |    4 +
 4 files changed, 745 insertions(+), 12 deletions(-)