From: Joerg Roedel on

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.




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(-)


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

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)
More majordomo info at
Please read the FAQ at