linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@ozlabs.org>
To: linuxppc-dev@ozlabs.org, kvm@vger.kernel.org
Cc: Michael Neuling <mikey@neuling.org>,
	kvm-ppc@vger.kernel.org, Nick Piggin <npiggin@gmail.com>
Subject: [PATCH 0/3] powerpc/kvm: Enable HV KVM guests to use prefixed instructions to access emulated MMIO
Date: Wed, 8 Mar 2023 17:33:43 +1100	[thread overview]
Message-ID: <ZAgsR04beDcARCiw@cleo> (raw)

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(-)

             reply	other threads:[~2023-03-08  6:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08  6:33 Paul Mackerras [this message]
2023-03-08  6:34 ` [PATCH 1/3] powerpc/kvm: Make kvmppc_get_last_inst() produce a ppc_inst_t Paul Mackerras
2023-03-08  6:35 ` [PATCH 2/3] powerpc/kvm: Fetch prefixed instructions from the guest Paul Mackerras
2023-03-08  6:36 ` [PATCH 3/3] powerpc/kvm: Enable prefixed instructions for HV KVM and disable for PR KVM Paul Mackerras
2023-03-09 13:00   ` Sachin Sant
2023-04-06  0:34 ` [PATCH 0/3] powerpc/kvm: Enable HV KVM guests to use prefixed instructions to access emulated MMIO Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZAgsR04beDcARCiw@cleo \
    --to=paulus@ozlabs.org \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mikey@neuling.org \
    --cc=npiggin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).