Skip to content

Nested Paging Virtualization for KVM v4

Joerg Roedel kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest29 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/29KVM: MMU: Check for root_level instead of long modearch/x86/kvm/paging_tmpl.h+2 -20 replies
2/29KVM: MMU: Make tdp_enabled a mmu-context parameterarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c+15 -80 replies
3/29KVM: MMU: Make set_cr3 a function pointer in kvm_mmuarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c+5 -20 replies
4/29KVM: 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/29KVM: 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/29KVM: MMU: Introduce inject_page_fault function pointerarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c+6 -10 replies
7/29KVM: MMU: Introduce kvm_init_shadow_mmu helper functionarch/x86/kvm/mmu.c arch/x86/kvm/mmu.h+36 -250 replies
8/29KVM: MMU: Let is_rsvd_bits_set take mmu context instead of vcpuarch/x86/kvm/mmu.c arch/x86/kvm/paging_tmpl.h+7 -60 replies
9/29KVM: MMU: Track page fault data in struct vcpuarch/x86/include/asm/kvm_emulate.h arch/x86/include/asm/kvm_host.h arch/x86/kvm/emulate.c +3 more+38 -310 replies
10/29KVM: MMU: Introduce generic walk_addr functionarch/x86/kvm/paging_tmpl.h+18 -80 replies
11/29KVM: MMU: Add infrastructure for two-level page walkerarch/x86/include/asm/kvm_host.h arch/x86/kvm/x86.c include/linux/kvm_host.h+12 -00 replies
12/29KVM: X86: Introduce pointer to mmu context used for gva_to_gpaarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c arch/x86/kvm/x86.c+28 -120 replies
13/29KVM: MMU: Implement nested gva_to_gpa functionsarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c arch/x86/kvm/paging_tmpl.h +1 more+54 -00 replies
14/29KVM: X86: Add kvm_read_guest_page_mmu functionarch/x86/include/asm/kvm_host.h arch/x86/kvm/x86.c+26 -00 replies
15/29KVM: MMU: Make walk_addr_generic capable for two-level walkingarch/x86/kvm/paging_tmpl.h+23 -70 replies
16/29KVM: MMU: Introduce kvm_read_nested_guest_page()arch/x86/kvm/x86.c+16 -30 replies
17/29KVM: MMU: Introduce init_kvm_nested_mmu()arch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c arch/x86/kvm/mmu.h +1 more+55 -10 replies
18/29KVM: MMU: Propagate the right fault back to the guest after gva_to_gpaarch/x86/include/asm/kvm_host.h arch/x86/kvm/x86.c+18 -11 reply
19/29KVM: X86: Propagate fetch faultsarch/x86/kvm/emulate.c arch/x86/kvm/x86.c+7 -00 replies
20/29KVM: MMU: Add kvm_mmu parameter to load_pdptrs functionarch/x86/include/asm/kvm_host.h arch/x86/kvm/kvm_cache_regs.h arch/x86/kvm/svm.c +2 more+27 -240 replies
21/29KVM: MMU: Introduce kvm_pdptr_read_mmuarch/x86/kvm/kvm_cache_regs.h arch/x86/kvm/mmu.c arch/x86/kvm/paging_tmpl.h+9 -20 replies
22/29KVM: MMU: Refactor mmu_alloc_roots functionarch/x86/kvm/mmu.c+60 -220 replies
23/29KVM: MMU: Allow long mode shadows for legacy page tablesarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c+53 -80 replies
24/29KVM: MMU: Track NX state in struct kvm_mmuarch/x86/include/asm/kvm_host.h arch/x86/kvm/mmu.c arch/x86/kvm/paging_tmpl.h+19 -31 reply
25/29KVM: SVM: Implement MMU helper functions for Nested Nested Pagingarch/x86/kvm/svm.c+30 -00 replies
26/29KVM: SVM: Initialize Nested Nested MMU context on VMRUNarch/x86/kvm/mmu.c arch/x86/kvm/svm.c+42 -90 replies
27/29KVM: SVM: Expect two more candiates for exit_int_infoarch/x86/kvm/svm.c+2 -10 replies
28/29KVM: SVM: Report Nested Paging support to userspacearch/x86/kvm/svm.c+4 -00 replies
29/29KVM: X86: Report SVM bit to userspace only when supportedarch/x86/kvm/svm.c arch/x86/kvm/x86.c+5 -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/29] Nested Paging Virtualization for KVM v4

Hi Avi, Marcelo,

as promised here is -v4 of my patch-set for virtualizing nested paging in KVM. I addresses all of your review comments in this version and fixed a misbehavior in the nested page-walker code where it would have reported the wrong error-code on an emulated nested page fault.

Here is the complete list of changes:

* Fixed the bug in the gpa_to_gfn function
* Made sure that the right fault values are kept in the two-dimensional page-table walker
* Fixed the return code of x86_decode_insn so that a page-fault within that function can be handled
* Set vcpu->arch.mmu.direct_map to true for nonpaging mode too
* Changed code so that the right access-mode is used on nested page-table walks
* Made the NX mode a capability of the MMU context to distinguish between l1-nx and l2-nx (1 additional patch)
* Fixed the bug that KVM always reports the SVM flag as supported to userspace, it should only be reported on AMD hardware when nesting is enabled

As the patch-set before this one was tested with the same set of combinations too. I found no regressions to current avi/master. This patch-set applies on current avi/master plus the three fixes I sent last week.

As with the last version of the patch-set I also pushed this one to a tree on korg. Find it in

	git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-kvm.git npt-virt-v4

Please review these patches and/or apply them :-) As usual I appreciate your feedback.

Thanks,

Joerg