Skip to content

powerpc/kvm: Enable HV KVM guests to use prefixed instructions to access emulated MMIO

Paul Mackerras kvm kvm-ppc linuxppc-dev 1 version Applied

Status from this message: Applied to powerpc/topic/ppc-kvm.

Get series with b4
b4 am ZAgsR04beDcARCiw@cleo

Versions newest first

  1. v1 Latest3 patches 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3powerpc/kvm: Make kvmppc_get_last_inst() produce a ppc_inst_tarch/powerpc/include/asm/kvm_ppc.h arch/powerpc/kvm/book3s_64_mmu_hv.c arch/powerpc/kvm/book3s_hv.c +6 more+47 -310 replies
2/3powerpc/kvm: Fetch prefixed instructions from the guestarch/powerpc/include/asm/kvm_host.h arch/powerpc/include/asm/kvm_ppc.h arch/powerpc/kvm/book3s.c +8 more+78 -260 replies
3/3powerpc/kvm: Enable prefixed instructions for HV KVM and disable for PR KVMarch/powerpc/include/asm/reg.h arch/powerpc/kvm/book3s_hv.c arch/powerpc/kvm/book3s_pr.c +1 more+11 -21 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchNicholas PigginSachin Sant
1/3R-b T-b
2/3R-b T-b
3/3R-b T-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/3] powerpc/kvm: Enable HV KVM guests to use prefixed instructions to access emulated MMIO

This series changes the powerpc KVM code so that HV KVM can fetch prefixed instructions from the guest in those situations where there is a need to emulate an instruction, which for HV KVM means emulating loads and stores to emulated MMIO devices. (Prefixed instructions were introduced with POWER10 and Power ISA v3.1, and consist of two 32-bit words, called the prefix and the suffix.)

The instruction analysis code in arch/powerpc/lib/sstep.c has already been extended to handle prefixed loads and stores, so all we have to do in HV KVM is to fetch the suffix when necessary and pass it to analyse_instr().

Since PR KVM doesn't yet handle prefixed instructions, we disable PR KVM guests from using prefixed instructions (this is done using the FSCR).

Paul.

 arch/powerpc/include/asm/kvm_host.h      |  4 ++--
 arch/powerpc/include/asm/kvm_ppc.h       | 37 +++++++++++++++++++++++---------
 arch/powerpc/include/asm/reg.h           |  1 +
 arch/powerpc/kvm/book3s.c                | 32 ++++++++++++++++++++++-----
 arch/powerpc/kvm/book3s_64_mmu_hv.c      | 26 ++++++++++++++++------
 arch/powerpc/kvm/book3s_hv.c             | 24 ++++++++++++++-------
 arch/powerpc/kvm/book3s_hv_rmhandlers.S  |  6 +++---
 arch/powerpc/kvm/book3s_paired_singles.c |  4 +++-
 arch/powerpc/kvm/book3s_pr.c             | 22 ++++++++++---------
 arch/powerpc/kvm/book3s_rmhandlers.S     |  1 +
 arch/powerpc/kvm/booke.c                 | 12 +++++++----
 arch/powerpc/kvm/bookehv_interrupts.S    |  2 +-
 arch/powerpc/kvm/e500_mmu_host.c         |  4 ++--
 arch/powerpc/kvm/emulate.c               |  8 ++++++-
 arch/powerpc/kvm/emulate_loadstore.c     |  8 +++----
 arch/powerpc/kvm/powerpc.c               |  4 ++--
 16 files changed, 136 insertions(+), 59 deletions(-)