Skip to content

KVM: PPC: BOok3S HV: Support for nested HPT guests

Suraj Jitindar Singh kvm kvm-ppc 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest23 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/23KVM: PPC: Book3S HV: Use __gfn_to_pfn_memslot in HPT page fault handlerarch/powerpc/kvm/book3s_64_mmu_hv.c+57 -610 replies
2/23KVM: PPC: Book3S HV: Increment mmu_notifier_seq when modifying radix pte rc bitsarch/powerpc/kvm/book3s_64_mmu_radix.c+2 -00 replies
3/23KVM: PPC: Book3S HV: Nested: Don't allow hash guests to run nested guestsarch/powerpc/kvm/book3s_hv.c+5 -11 reply
4/23KVM: PPC: Book3S HV: Handle making H_ENTER_NESTED hcall in a separate functionarch/powerpc/kvm/book3s_hv.c+49 -390 replies
5/23KVM: PPC: Book3S HV: Enable calling kvmppc_hpte_hv_fault in virtual modearch/powerpc/include/asm/kvm_ppc.h arch/powerpc/kvm/book3s_hv_rm_mmu.c arch/powerpc/kvm/book3s_hv_rmhandlers.S+11 -30 replies
6/23KVM: PPC: Book3S HV: Allow hpt manipulation hcalls to be called in virtual modearch/powerpc/include/asm/kvm_book3s.h arch/powerpc/kvm/book3s_64_mmu_hv.c arch/powerpc/kvm/book3s_hv.c +1 more+159 -340 replies
7/23KVM: PPC: Book3S HV: Make kvmppc_invalidate_hpte() take lpid not a kvm structarch/powerpc/include/asm/kvm_book3s.h arch/powerpc/kvm/book3s_64_mmu_hv.c arch/powerpc/kvm/book3s_hv_rm_mmu.c+16 -140 replies
8/23KVM: PPC: Book3S HV: Nested: Allow pseries hypervisor to run hpt nested guestarch/powerpc/include/asm/hvcall.h arch/powerpc/include/asm/kvm_book3s.h arch/powerpc/include/asm/kvm_host.h +4 more+173 -550 replies
9/23KVM: PPC: Book3S HV: Nested: Improve comments and naming of nest rmap functionsarch/powerpc/include/asm/kvm_book3s_64.h arch/powerpc/kvm/book3s_64_mmu_radix.c arch/powerpc/kvm/book3s_hv_nested.c+42 -190 replies
10/23KVM: PPC: Book3S HV: Nested: Increase gpa field in nest rmap to 46 bitsarch/powerpc/include/asm/kvm_book3s_64.h arch/powerpc/kvm/book3s_hv_nested.c+34 -120 replies
11/23KVM: PPC: Book3S HV: Nested: Remove single nest rmap entriesarch/powerpc/include/asm/kvm_book3s_64.h arch/powerpc/kvm/book3s_hv_nested.c+39 -770 replies
12/23KVM: PPC: Book3S HV: Nested: add kvmhv_remove_all_nested_rmap_lpid()arch/powerpc/kvm/book3s_hv_nested.c+47 -00 replies
13/23KVM: PPC: Book3S HV: Nested: Infrastructure for nested hpt guest setuparch/powerpc/include/asm/book3s/64/mmu-hash.h arch/powerpc/include/asm/book3s/64/mmu.h arch/powerpc/include/asm/kvm_book3s_64.h +1 more+235 -351 reply
14/23KVM: PPC: Book3S HV: Nested: Context switch slb for nested hpt guestarch/powerpc/kvm/book3s_hv_nested.c+79 -51 reply
15/23KVM: PPC: Book3S HV: Store lpcr and hdec_exp in the vcpu structarch/powerpc/include/asm/kvm_book3s.h arch/powerpc/include/asm/kvm_host.h arch/powerpc/kvm/book3s_hv.c +1 more+27 -280 replies
16/23KVM: PPC: Book3S HV: Nested: Make kvmppc_run_vcpu() entry path nested capablearch/powerpc/include/asm/kvm_asm.h arch/powerpc/include/asm/kvm_book3s.h arch/powerpc/include/asm/kvm_ppc.h +9 more+252 -990 replies
17/23KVM: PPC: Book3S HV: Nested: Rename kvmhv_xlate_addr_nested_radixarch/powerpc/kvm/book3s.c arch/powerpc/kvm/book3s_hv_nested.c+61 -210 replies
18/23KVM: PPC: Book3S HV: Separate out hashing from kvmppc_hv_find_lock_hpte()arch/powerpc/kvm/book3s_hv_rm_mmu.c+36 -240 replies
19/23KVM: PPC: Book3S HV: Nested: Implement nested hpt mmu translationarch/powerpc/include/asm/book3s/64/mmu-hash.h arch/powerpc/include/asm/kvm_book3s.h arch/powerpc/include/asm/kvm_book3s_64.h +2 more+404 -20 replies
20/23KVM: PPC: Book3S HV: Nested: Handle tlbie hcall for nested hpt guestarch/powerpc/include/asm/book3s/64/mmu-hash.h arch/powerpc/kvm/book3s_hv_nested.c+258 -460 replies
21/23KVM: PPC: Book3S HV: Nested: Implement nest rmap invalidations for hpt guestsarch/powerpc/kvm/book3s_hv_nested.c+85 -290 replies
22/23KVM: PPC: Book3S HV: Nested: Enable nested hpt guestsarch/powerpc/kvm/book3s_hv_nested.c+0 -10 replies
23/23KVM: PPC: Book3S HV: Add nested hpt pte information to debugfsarch/powerpc/kvm/book3s_64_mmu_radix.c+101 -560 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/23] KVM: PPC: BOok3S HV: Support for nested HPT guests

This patch series adds support for running a nested kvm guest which uses the hpt (hash page table) mmu type.

Patch series based on v5.3-rc6.

The first 8 patches in this series enable a radix guest (L1) running under a radix hypervisor (L0) to act as a guest hypervisor for it's own nested (L2) guest where the nested guest is using hash page table translation. This mainly involved ensuring that the guest hypervisor uses the new run_single_vcpu() entry path and ensuring that the appropriate functions which are normally called in the real mode entry path in book3s_hv_rmhandlers.S are called on the new virtual mode entry path when a hpt guest is being run.

The remainder of the patches enable a (L0) hypervisor to perform hash page table translation for a nested (L2) hpt guest which is running under one of it's radix (L1) it's which is acting as a guest hypervisor. This primarily required changes to the nested guest entry patch to ensure that a shadow hpt would be allocated for the nested hpt guest, that the slb was context switched and that the real mode entry path in book3s_hv_rmhandlers.S could be used to enter/exit a nested hpt guest.

It was also necessary to be able to create translations by inserting ptes into the shadow page table which provided the combination of the translation from L2 virtual address to L1 guest physical address and the translation from L1 guest physical address to L0 host real address. Additionally invalidations of these translations need to be handled at both levels, by L1 via the H_TLB_INVALIDATE hcall to invalidate a L2 virtual address to L1 guest physical address translation, and by L0 when paging out a L1 guest page which had been subsequently mapped through to L2 thus invalidating the L1 guest physical address to L0 host real address translation.

Still lacking support for:
Passthrough of emulated mmio devices to nested hpt guests since the current method of reading nested guest memory relies on using quadrants which are only available when using radix translation.

Paul Mackerras (1):
KVM: PPC: Book3S HV: Use __gfn_to_pfn_memslot in HPT page fault
handler

Suraj Jitindar Singh (22):
KVM: PPC: Book3S HV: Increment mmu_notifier_seq when modifying radix
pte rc bits
KVM: PPC: Book3S HV: Nested: Don't allow hash guests to run nested
guests
KVM: PPC: Book3S HV: Handle making H_ENTER_NESTED hcall in a separate
function
KVM: PPC: Book3S HV: Enable calling kvmppc_hpte_hv_fault in virtual
mode
KVM: PPC: Book3S HV: Allow hpt manipulation hcalls to be called in
virtual mode
KVM: PPC: Book3S HV: Make kvmppc_invalidate_hpte() take lpid not a kvm
struct
KVM: PPC: Book3S HV: Nested: Allow pseries hypervisor to run hpt
nested guest
KVM: PPC: Book3S HV: Nested: Improve comments and naming of nest rmap
functions
KVM: PPC: Book3S HV: Nested: Increase gpa field in nest rmap to 46
bits
KVM: PPC: Book3S HV: Nested: Remove single nest rmap entries
KVM: PPC: Book3S HV: Nested: add kvmhv_remove_all_nested_rmap_lpid()
KVM: PPC: Book3S HV: Nested: Infrastructure for nested hpt guest setup
KVM: PPC: Book3S HV: Nested: Context switch slb for nested hpt guest
KVM: PPC: Book3S HV: Store lpcr and hdec_exp in the vcpu struct
KVM: PPC: Book3S HV: Nested: Make kvmppc_run_vcpu() entry path nested
capable
KVM: PPC: Book3S HV: Nested: Rename kvmhv_xlate_addr_nested_radix
KVM: PPC: Book3S HV: Separate out hashing from
kvmppc_hv_find_lock_hpte()
KVM: PPC: Book3S HV: Nested: Implement nested hpt mmu translation
KVM: PPC: Book3S HV: Nested: Handle tlbie hcall for nested hpt guest
KVM: PPC: Book3S HV: Nested: Implement nest rmap invalidations for hpt
guests
KVM: PPC: Book3S HV: Nested: Enable nested hpt guests
KVM: PPC: Book3S HV: Add nested hpt pte information to debugfs

 arch/powerpc/include/asm/book3s/64/mmu-hash.h |   15 +
 arch/powerpc/include/asm/book3s/64/mmu.h      |    9 +
 arch/powerpc/include/asm/hvcall.h             |   36 -
 arch/powerpc/include/asm/kvm_asm.h            |    5 +
 arch/powerpc/include/asm/kvm_book3s.h         |   30 +-
 arch/powerpc/include/asm/kvm_book3s_64.h      |   87 +-
 arch/powerpc/include/asm/kvm_host.h           |   57 +
 arch/powerpc/include/asm/kvm_ppc.h            |    5 +-
 arch/powerpc/kernel/asm-offsets.c             |    5 +
 arch/powerpc/kvm/book3s.c                     |    1 +
 arch/powerpc/kvm/book3s_64_mmu_hv.c           |  136 ++-
 arch/powerpc/kvm/book3s_64_mmu_radix.c        |  167 +--
 arch/powerpc/kvm/book3s_hv.c                  |  327 ++++--
 arch/powerpc/kvm/book3s_hv_builtin.c          |   33 +-
 arch/powerpc/kvm/book3s_hv_interrupts.S       |   25 +-
 arch/powerpc/kvm/book3s_hv_nested.c           | 1381 ++++++++++++++++++++++---
 arch/powerpc/kvm/book3s_hv_rm_mmu.c           |  298 ++++--
 arch/powerpc/kvm/book3s_hv_rmhandlers.S       |  126 ++-
 arch/powerpc/kvm/book3s_xive.h                |   15 +
 arch/powerpc/kvm/powerpc.c                    |    3 +-
 20 files changed, 2136 insertions(+), 625 deletions(-)
Signature · 1 line
2.13.6