Skip to content

Allow PR and HV KVM to coexist in one kernel

Paul Mackerras kvm kvm-ppc 1 version Applied

Status from this message: Thanks, applied to kvm-ppc-queue.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest23 patches 44 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/23KVM: PPC: Book3S: Fix compile error in XICS emulationarch/powerpc/kvm/book3s_xics.c+1 -01 reply
2/23KVM: PPC: Book3S PR: Don't corrupt guest state when kernel uses VMXarch/powerpc/kvm/book3s_pr.c+25 -42 replies
3/23KVM: PPC: Book3S PR: Make instruction fetch fallback work for system callsarch/powerpc/include/asm/kvm_book3s.h arch/powerpc/kvm/book3s_pr.c+39 -11 reply
4/23KVM: PPC: Book3S PR: Keep volatile reg values in vcpu rather than shadow_vcpuarch/powerpc/include/asm/kvm_book3s.h arch/powerpc/include/asm/kvm_book3s_asm.h arch/powerpc/include/asm/kvm_host.h +6 more+156 -2434 replies
5/23KVM: PPC: Book3S PR: Rework kvmppc_mmu_book3s_64_xlate()arch/powerpc/kvm/book3s_64_mmu.c+72 -781 reply
6/23KVM: PPC: Book3S PR: Allow guest to use 64k pagesarch/powerpc/include/asm/kvm_asm.h arch/powerpc/include/asm/kvm_book3s.h arch/powerpc/include/asm/kvm_host.h +3 more+173 -103 replies
7/23KVM: PPC: Book3S PR: Use 64k host pages where possiblearch/powerpc/include/asm/kvm_book3s.h arch/powerpc/kvm/book3s_32_mmu.c arch/powerpc/kvm/book3s_64_mmu.c +2 more+57 -133 replies
8/23KVM: PPC: Book3S PR: Handle PP0 page-protection bit in guest HPTEsarch/powerpc/kvm/book3s_64_mmu.c+3 -00 replies
9/23KVM: PPC: Book3S PR: Correct errors in H_ENTER implementationarch/powerpc/kvm/book3s_pr_papr.c+14 -50 replies
10/23KVM: PPC: Book3S PR: Make HPT accesses and updates SMP-safearch/powerpc/include/asm/kvm_host.h arch/powerpc/kvm/book3s_32_mmu.c arch/powerpc/kvm/book3s_64_mmu.c +2 more+72 -340 replies
11/23KVM: PPC: Book3S PR: Allocate kvm_vcpu structs from kvm_vcpu_cachearch/powerpc/include/asm/kvm_book3s.h arch/powerpc/include/asm/kvm_book3s_32.h arch/powerpc/include/asm/kvm_host.h +3 more+34 -251 reply
12/23KVM: PPC: Book3S HV: Better handling of exceptions that happen in real modearch/powerpc/include/asm/kvm_asm.h arch/powerpc/include/asm/kvm_book3s_asm.h arch/powerpc/kernel/asm-offsets.c +1 more+33 -90 replies
13/23KVM: PPC: Book3S: Move skip-interrupt handlers to common codearch/powerpc/kernel/exceptions-64s.S arch/powerpc/kvm/book3s_hv_rmhandlers.S arch/powerpc/kvm/book3s_rmhandlers.S+26 -500 replies
14/23KVM: PPC: Book3S PR: Delay disabling relocation-on interruptsarch/powerpc/include/asm/kvm_host.h arch/powerpc/kvm/book3s_pr.c+52 -204 replies
15/23KVM: PPC: Book3S: Rename symbols that exist in both PR and HV KVMarch/powerpc/include/asm/kvm_book3s.h arch/powerpc/kvm/book3s.c arch/powerpc/kvm/book3s_32_mmu_host.c +6 more+374 -1830 replies
16/23KVM: PPC: Book3S: Merge implementations of KVM_PPC_GET_SMMU_INFO ioctlarch/powerpc/include/asm/kvm_ppc.h arch/powerpc/kvm/book3s.c arch/powerpc/kvm/book3s_hv.c +1 more+57 -680 replies
17/23KVM: PPC: Book3S HV: Factorize kvmppc_core_vcpu_create_hv()arch/powerpc/kvm/book3s_hv.c+59 -360 replies
18/23KVM: PPC: Book3S: Allow both PR and HV KVM to be selectedarch/powerpc/include/asm/kvm_book3s.h arch/powerpc/include/asm/kvm_host.h arch/powerpc/include/asm/kvm_ppc.h +11 more+184 -620 replies
19/23KVM: PPC: Book3S: Select PR vs HV separately for each guestarch/powerpc/include/asm/kvm_book3s.h arch/powerpc/include/asm/kvm_booke.h arch/powerpc/include/asm/kvm_host.h +4 more+167 -1711 replies
20/23KVM: PPC: Book3S PR: Better handling of host-side read-only pagesarch/powerpc/include/asm/kvm_book3s.h arch/powerpc/include/asm/kvm_host.h arch/powerpc/kvm/book3s.c +6 more+91 -406 replies
21/23KVM: PPC: Book3S PR: Use mmu_notifier_retry() in kvmppc_mmu_map_page()arch/powerpc/include/asm/kvm_book3s.h arch/powerpc/kvm/book3s_64_mmu_host.c arch/powerpc/kvm/book3s_mmu_hpte.c+39 -137 replies
22/23KVM: PPC: Book3S PR: Mark pages accessed, and dirty if being writtenarch/powerpc/kvm/book3s_64_mmu_host.c+15 -110 replies
23/23KVM: PPC: Book3S PR: Reduce number of shadow PTEs invalidated by MMU notifiersarch/powerpc/kvm/book3s_pr.c+32 -80 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] Allow PR and HV KVM to coexist in one kernel

This series aims at making it possible to have one kernel image with both PR and HV KVM code included, so that guests can be run under HV KVM using hypervisor mode if available, or under PR KVM if hypervisor mode is not available or the guest is not a PAPR guest.

One of the difficulties in doing this is that the userspace may, and if the userspace is QEMU, does call the KVM_PPC_GET_SMMU_INFO ioctl before we have enough information to decide whether the guest should use PR or HV KVM. To overcome this, the series first enhances PR KVM to have the same set of MMU features as current real hardware, i.e. support for 64kB pages and 1TB segments. Thus it's possible to construct a result for KVM_PPC_GET_SMMU_INFO that it suitable for either PR or HV KVM.

With this series, guests start out as PR guests. At the time when the KVM_CAP_PPC_PAPR capability is enabled, the guest gets converted into a HV guest if possible. This way, a non-PAPR guest will naturally run using PR KVM.

The series also makes quite a lot of other improvements to PR KVM, notably to run SMP guests and to work better with KSM. For best results my patch "powerpc: Implement __get_user_pages_fast()" is also needed to allow the generic KVM code to detect correctly when pages for which we have only requested read access are actually writable.

Paul.