Skip to content

Nested Paging support for Nested SVM v2

Joerg Roedel kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest22 patches 34 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/22KVM: MMU: Check for root_level instead of long modearch/x86/kvm/paging_tmpl.h+2 -20 replies
2/22KVM: MMU: Make tdp_enabled a mmu-context parameterarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c+6 -31 reply
3/22KVM: 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/22KVM: 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/22KVM: 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/22KVM: MMU: Introduce inject_page_fault function pointerarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c+6 -10 replies
7/22KVM: SVM: Implement MMU helper functions for Nested Nested Pagingarch/x86/kvm/svm.c+33 -00 replies
8/22KVM: MMU: Change init_kvm_softmmu to take a context as parameterarch/x86/kvm/mmu.c arch/x86/kvm/mmu.h+36 -250 replies
9/22KVM: 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/22KVM: MMU: Introduce generic walk_addr functionarch/x86/kvm/paging_tmpl.h+20 -100 replies
11/22KVM: 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+14 -05 replies
12/22KVM: MMU: Implement nested gva_to_gpa functionsarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c arch/x86/kvm/paging_tmpl.h+43 -02 replies
13/22KVM: X86: Add kvm_read_guest_page_tdp functionarch/x86/include/asm/kvm_host.h arch/x86/kvm/x86.c+27 -03 replies
14/22KVM: MMU: Make walk_addr_generic capable for two-level walkingarch/x86/kvm/paging_tmpl.h+24 -100 replies
15/22KVM: MMU: Introduce kvm_read_guest_page_x86()arch/x86/include/asm/kvm_host.h arch/x86/kvm/x86.c+32 -47 replies
16/22KVM: MMU: Track page fault data in struct vcpuarch/x86/include/asm/kvm_host.h arch/x86/kvm/paging_tmpl.h+7 -014 replies
17/22KVM: MMU: Propagate the right fault back to the guest after gva_to_gpaarch/x86/include/asm/kvm_host.h arch/x86/kvm/emulate.c arch/x86/kvm/mmu.h +1 more+30 -120 replies
18/22KVM: X86: Propagate fetch faultsarch/x86/kvm/emulate.c arch/x86/kvm/x86.c+5 -10 replies
19/22KVM: MMU: Introduce init_kvm_nested_mmu()arch/x86/kvm/mmu.c+54 -10 replies
20/22KVM: SVM: Initialize Nested Nested MMU context on VMRUNarch/x86/kvm/mmu.c arch/x86/kvm/svm.c+47 -101 reply
21/22KVM: SVM: Report Nested Paging support to userspacearch/x86/kvm/svm.c+6 -10 replies
22/22KVM: SVM: Expect two more candiates for exit_int_infoarch/x86/kvm/svm.c+2 -10 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/22] Nested Paging support for Nested SVM v2

Hi,

this is the second and reworked version of my nested paging for nested svm patchset. Changes to the previous version include:

* Renamed mmu.tdp_enabled to mmu.direct_map
* Introduced two helper functions to read physical memory locations of the current running guest level
* Fixed a couple of bugs were KVM needs to read l2 physical memory and others

This patchset is tested with KVM and Windows 7 XPmode. I also tested in KVM with Linux and Windows 7 as l2 guests. I also tested different pagesize combinations and did a stress tests for a couple of hours. All these tests showed no introduced regressions.
Please review this second version of the patch-set. I appreciate your feedback.

Thanks,

Joerg

Diffstat:

 arch/x86/include/asm/kvm_host.h |   26 ++++++
 arch/x86/kvm/emulate.c          |   22 +++---
 arch/x86/kvm/mmu.c              |  160 ++++++++++++++++++++++++++++++--------
 arch/x86/kvm/mmu.h              |    2 +
 arch/x86/kvm/paging_tmpl.h      |   97 +++++++++++++++++++-----
 arch/x86/kvm/svm.c              |  120 ++++++++++++++++++++++++-----
 arch/x86/kvm/vmx.c              |    3 +
 arch/x86/kvm/x86.c              |   77 +++++++++++++++++--
 include/linux/kvm_host.h        |    5 +
 9 files changed, 423 insertions(+), 89 deletions(-)

Shortlog:

Joerg Roedel (22):
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: X86: Add kvm_read_guest_page_tdp function
KVM: MMU: Make walk_addr_generic capable for two-level walking
KVM: MMU: Introduce kvm_read_guest_page_x86()
KVM: MMU: Track page fault data in struct vcpu
KVM: MMU: Propagate the right fault back to the guest after gva_to_gpa
KVM: X86: Propagate fetch faults
KVM: MMU: Introduce init_kvm_nested_mmu()
KVM: SVM: Initialize Nested Nested MMU context on VMRUN
KVM: SVM: Report Nested Paging support to userspace
KVM: SVM: Expect two more candiates for exit_int_info