Skip to content

RFC Nested Paging support for Nested SVM (aka NPT-Virtualization)

Joerg Roedel kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest18 patches 30 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18KVM: MMU: Check for root_level instead of long modearch/x86/kvm/paging_tmpl.h+2 -20 replies
2/18KVM: MMU: Make tdp_enabled a mmu-context parameterarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c+6 -36 replies
3/18KVM: MMU: Make set_cr3 a function pointer in kvm_mmuarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c+4 -10 replies
4/18KVM: X86: Introduce a tdp_set_cr3 functionarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c arch/x86/kvm/svm.c +1 more+19 -100 replies
5/18KVM: MMU: Introduce get_cr3 function pointerarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c arch/x86/kvm/paging_tmpl.h+11 -30 replies
6/18KVM: MMU: Introduce inject_page_fault function pointerarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c+5 -10 replies
7/18KVM: SVM: Implement MMU helper functions for Nested Nested Pagingarch/x86/kvm/svm.c+33 -00 replies
8/18KVM: MMU: Change init_kvm_softmmu to take a context as parameterarch/x86/kvm/mmu.c arch/x86/kvm/mmu.h+36 -250 replies
9/18KVM: MMU: Let is_rsvd_bits_set take mmu context instead of vcpuarch/x86/kvm/mmu.c arch/x86/kvm/paging_tmpl.h+4 -30 replies
10/18KVM: MMU: Introduce generic walk_addr functionarch/x86/kvm/paging_tmpl.h+20 -100 replies
11/18KVM: MMU: Add infrastructure for two-level page walkerarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c arch/x86/kvm/paging_tmpl.h +1 more+32 -02 replies
12/18KVM: MMU: Implement nested gva_to_gpa functionsarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c arch/x86/kvm/paging_tmpl.h+42 -00 replies
13/18KVM: MMU: Introduce Nested MMU contextarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c+55 -10 replies
14/18KVM: SVM: Initialize Nested Nested MMU context on VMRUNarch/x86/kvm/mmu.c arch/x86/kvm/svm.c+47 -100 replies
15/18KVM: MMU: Propagate the right fault back to the guest after gva_to_gpaarch/x86/kvm/mmu.h arch/x86/kvm/paging_tmpl.h arch/x86/kvm/x86.c+17 -16 replies
16/18KVM: X86: Add callback to let modules decide over some supported cpuid bitsarch/x86/include/asm/kvm_host.h arch/x86/kvm/svm.c arch/x86/kvm/vmx.c +1 more+17 -00 replies
17/18KVM: SVM: Report Nested Paging support to userspacearch/x86/kvm/svm.c+10 -02 replies
18/18KVM: X86: Add KVM_CAP_SVM_CPUID_FIXEDarch/x86/kvm/x86.c include/linux/kvm.h+2 -02 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/18][RFC] Nested Paging support for Nested SVM (aka NPT-Virtualization)

Hi,

here are the patches that implement nested paging support for nested svm. They are somewhat intrusive to the soft-mmu so I post them as RFC in the first round to get feedback about the general direction of the changes. Nevertheless I am proud to report that with these patches the famous kernel-compile benchmark runs only 4% slower in the l2 guest as in the l1 guest when l2 is single-processor. With SMP guests the situation is very different. The more vcpus the guest has the more is the performance drop from l1 to l2.
Anyway, this post is to get feedback about the overall concept of these patches. Please review and give feedback :-)

Thanks,

Joerg

Diffstat:

 arch/x86/include/asm/kvm_host.h |   21 ++++++
 arch/x86/kvm/mmu.c              |  152 ++++++++++++++++++++++++++++++---------
 arch/x86/kvm/mmu.h              |    2 +
 arch/x86/kvm/paging_tmpl.h      |   81 ++++++++++++++++++---
 arch/x86/kvm/svm.c              |  126 +++++++++++++++++++++++++++-----
 arch/x86/kvm/vmx.c              |    9 +++
 arch/x86/kvm/x86.c              |   19 +++++-
 include/linux/kvm.h             |    1 +
 include/linux/kvm_host.h        |    5 ++
 9 files changed, 354 insertions(+), 62 deletions(-)

Shortlog:

Joerg Roedel (18):
KVM: MMU: Check for root_level instead of long mode
KVM: MMU: Make tdp_enabled a mmu-context parameter
KVM: MMU: Make set_cr3 a function pointer in kvm_mmu
KVM: X86: Introduce a tdp_set_cr3 function
KVM: MMU: Introduce get_cr3 function pointer
KVM: MMU: Introduce inject_page_fault function pointer
KVM: SVM: Implement MMU helper functions for Nested Nested Paging
KVM: MMU: Change init_kvm_softmmu to take a context as parameter
KVM: MMU: Let is_rsvd_bits_set take mmu context instead of vcpu
KVM: MMU: Introduce generic walk_addr function
KVM: MMU: Add infrastructure for two-level page walker
KVM: MMU: Implement nested gva_to_gpa functions
KVM: MMU: Introduce Nested MMU context
KVM: SVM: Initialize Nested Nested MMU context on VMRUN
KVM: MMU: Propagate the right fault back to the guest after gva_to_gpa
KVM: X86: Add callback to let modules decide over some supported cpuid bits
KVM: SVM: Report Nested Paging support to userspace
KVM: X86: Add KVM_CAP_SVM_CPUID_FIXED