Hi Paolo, Please do a pull from my kvm-ppc-next branch to get a PPC update for 4.15. I have pulled in Michael Ellerman's topic/ppc-kvm branch from the powerpc tree to get two commits that touch both KVM PPC code and other PPC code. Apart from various bugfixes and code cleanups, the major new feature is the ability to run guests using the hashed page table (HPT) MMU mode on a host that is using the radix MMU mode. Because of limitations in the current POWER9 chip, this requires the host to be configured in a particular way. I have included the text from the cover letter of the patch series below in case you want to include it in the merge commit. Thanks, Paul. ------------------------------------------- [PATCH v2 0/6] KVM: PPC: Book3S HV: Run HPT guests on radix hosts Currently, on POWER9 machines using HV KVM, the host kernel will use one or other of the two MMU modes available, HPT (hashed page table) or radix, and all KVM guests must use the same MMU mode. This is inconvenient because it means that a guest on a radix host can't run a legacy OS that doesn't know about POWER9. On the other hand, if the host is booted in HPT mode so that legacy guest kernels can be run, then neither the host nor any other guest can take advantage of the radix MMU mode. To further complicate matters, current POWER9 chips have the restriction that all SMT threads in each core must use the same MMU mode (HPT or radix), though they can be in different partitions. This patch series adds the ability to run HPT guests on a host in radix mode. In order to comply with the restriction of not mixing HPT and radix threads on the same core, we take a similar approach to that already used on POWER8, namely, run the host in single-threaded mode (only thread 0 of each core online), and have KVM be able to wake up the other threads when a KVM guest is to be run, and use the other threads for running guest VCPUs. So that KVM knows whether it should be managing individual threads on POWER9 (as it does currently) or whole cores, we add a new module parameter called "indep_threads_mode". This is normally Y on POWER9 but must be set to N before any HPT guests can be run on a radix host. The value of indep_threads_mode is sampled at the time of creation of each guest, and the value at the time of creation is what applies to that guest for the whole of its lifetime. It is preferable to change indep_threads_mode only when no guests are running, in order to avoid confusion or unnecessarily reduced performance. In order to allow HPT guests to run on a radix host, the following commands (or their equivalents) are required first: # echo N >/sys/module/kvm_hv/parameters/indep_threads_mode # ppc64_cpu --smt=off KVM will run up to four vcpus on each core using the existing dynamic micro-threading code. This can be controlled using the target_smt_mode module parameter. ------------------------------------------- The following changes since commit 9b8ebbdb74b5ad76b9dfd8b101af17839174b126: KVM: x86: extend usage of RET_MMIO_PF_* constants (2017-10-12 14:01:56 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc kvm-ppc-next for you to fetch changes up to c01015091a77035de1939ef106bfbcaf9a21395f: KVM: PPC: Book3S HV: Run HPT guests on POWER9 radix hosts (2017-11-01 15:36:41 +1100) ---------------------------------------------------------------- Alexey Kardashevskiy (1): KVM: PPC: Book3S PR: Enable in-kernel TCE handlers for PR KVM Greg Kurz (1): KVM: PPC: Book3S PR: Only install valid SLBs during KVM_SET_SREGS Markus Elfring (1): KVM: PPC: Book3S HV: Delete an error message for a failed memory allocation in kvmppc_allocate_hpt() Michael Ellerman (1): KVM: PPC: Tie KVM_CAP_PPC_HTM to the user-visible TM feature Nicholas Piggin (1): KVM: PPC: Book3S: Fix gas warning due to using r0 as immediate 0 Paul Mackerras (11): KVM: PPC: Book3S HV: Handle unexpected interrupts better KVM: PPC: Book3S HV: Explicitly disable HPT operations on radix guests Revert "KVM: PPC: Book3S HV: POWER9 does not require secondary thread management" KVM: PPC: Book3S HV: Don't call real-mode XICS hypercall handlers if not enabled Merge remote-tracking branch 'remotes/powerpc/topic/ppc-kvm' into kvm-ppc-next KVM: PPC: Book3S HV: Don't rely on host's page size information KVM: PPC: Book3S HV: Rename hpte_setup_done to mmu_ready KVM: PPC: Book3S HV: Unify dirty page map between HPT and radix KVM: PPC: Book3S HV: Add infrastructure for running HPT guests on radix host KVM: PPC: Book3S HV: Allow for running POWER9 host in single-threaded mode KVM: PPC: Book3S HV: Run HPT guests on POWER9 radix hosts Thomas Meyer (2): KVM: PPC: Book3S HV: Use ARRAY_SIZE macro KVM: PPC: BookE: Use vma_pages function arch/powerpc/include/asm/kvm_book3s.h | 3 +- arch/powerpc/include/asm/kvm_book3s_64.h | 140 +++++++++++-- arch/powerpc/include/asm/kvm_book3s_asm.h | 17 +- arch/powerpc/include/asm/kvm_host.h | 6 +- arch/powerpc/include/asm/kvm_ppc.h | 3 + arch/powerpc/kernel/asm-offsets.c | 3 + arch/powerpc/kernel/idle_book3s.S | 35 +--- arch/powerpc/kvm/book3s_64_mmu_hv.c | 124 +++++------ arch/powerpc/kvm/book3s_64_mmu_radix.c | 51 +---- arch/powerpc/kvm/book3s_64_slb.S | 2 +- arch/powerpc/kvm/book3s_hv.c | 337 ++++++++++++++++++------------ arch/powerpc/kvm/book3s_hv_builtin.c | 117 ++++++++++- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 65 +++--- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 205 ++++++++++++++++-- arch/powerpc/kvm/book3s_pr.c | 16 +- arch/powerpc/kvm/book3s_pr_papr.c | 2 + arch/powerpc/kvm/e500_mmu_host.c | 2 +- arch/powerpc/kvm/powerpc.c | 7 +- 18 files changed, 797 insertions(+), 338 deletions(-)