From: Matthew Rosato <mjrosato@linux.ibm.com>
To: qemu-s390x@nongnu.org
Cc: farman@linux.ibm.com, kvm@vger.kernel.org, pmorel@linux.ibm.com,
schnelle@linux.ibm.com, cohuck@redhat.com,
richard.henderson@linaro.org, thuth@redhat.com,
qemu-devel@nongnu.org, pasic@linux.ibm.com,
alex.williamson@redhat.com, mst@redhat.com, pbonzini@redhat.com,
david@redhat.com, borntraeger@linux.ibm.com
Subject: [PATCH v4 00/11] s390x/pci: zPCI interpretation support
Date: Mon, 14 Mar 2022 15:49:09 -0400 [thread overview]
Message-ID: <20220314194920.58888-1-mjrosato@linux.ibm.com> (raw)
For QEMU, the majority of the work in enabling instruction interpretation
is handled via a new KVM ioctls to enable interpretation, interrupt
forwarding and registration of the guest IOAT tables. In order to make
use of the KVM-managed IOMMU domain operations on the host, we also add
some code to vfio to indicate that a given device wishes to register the
alternate domain type for its group.
This series also adds a new, optional 'interpret' parameter to zpci which
can be used to disable interpretation support (interpret=off) as well as
an 'forwarding_assist' parameter to determine whether or not the firmware
assist will be used for interrupt delivery (default when interpretation
is in use) or whether the host will be responsible for delivering all
interrupts (forwarding_assist=off).
The ZPCI_INTERP CPU feature is added beginning with the z14 model to
enable this support.
As a consequence of implementing zPCI interpretation, ISM devices now
become eligible for passthrough (but only when zPCI interpretation is
available).
From the perspective of guest configuration, you passthrough zPCI devices
in the same manner as before, with intepretation support being used by
default if available in kernel+qemu.
Associated kernel series:
https://lore.kernel.org/kvm/20220314194451.58266-1-mjrosato@linux.ibm.com/
Changelog v3->v4
- Unfortunately I had to remove some Review tags because the userspace API
moved from vfio device feature ioctls to KVM ioctls in response to
feedback from the kernel series. The vast majority of the QEMU logic
remains intact however, with most changes being to the way we issue
ioctls.
- Additional logic was added to test for availability of the KVM ioctl,
this replaces the probe logic done for the vfio ioctls
- Add code to issue indicate on VFIO_SET_IOMMU that a KVM-managed IOMMU
domain is to be allocated.
Matthew Rosato (11):
Update linux headers
vfio: handle KVM-owned IOMMU requests
target/s390x: add zpci-interp to cpu models
s390x/pci: add routine to get host function handle from CLP info
s390x/pci: enable for load/store intepretation
s390x/pci: don't fence interpreted devices without MSI-X
s390x/pci: enable adapter event notification for interpreted devices
s390x/pci: use KVM-managed IOMMU for interpretation
s390x/pci: use I/O Address Translation assist when interpreting
s390x/pci: use dtsm provided from vfio capabilities for interpreted
devices
s390x/pci: let intercept devices have separate PCI groups
hw/s390x/meson.build | 1 +
hw/s390x/s390-pci-bus.c | 125 ++++++++++++++++++++--
hw/s390x/s390-pci-inst.c | 136 +++++++++++++++++++++--
hw/s390x/s390-pci-kvm.c | 160 ++++++++++++++++++++++++++++
hw/s390x/s390-pci-vfio.c | 151 ++++++++++++++++++++++----
hw/s390x/s390-virtio-ccw.c | 1 +
hw/vfio/ap.c | 2 +-
hw/vfio/ccw.c | 2 +-
hw/vfio/common.c | 26 ++++-
hw/vfio/pci.c | 3 +-
hw/vfio/pci.h | 1 +
hw/vfio/platform.c | 2 +-
include/hw/s390x/s390-pci-bus.h | 8 +-
include/hw/s390x/s390-pci-inst.h | 2 +-
include/hw/s390x/s390-pci-kvm.h | 68 ++++++++++++
include/hw/s390x/s390-pci-vfio.h | 11 ++
include/hw/vfio/vfio-common.h | 4 +-
linux-headers/asm-s390/kvm.h | 1 +
linux-headers/asm-x86/kvm.h | 3 +
linux-headers/linux/kvm.h | 51 ++++++++-
linux-headers/linux/vfio.h | 6 ++
linux-headers/linux/vfio_zdev.h | 6 ++
target/s390x/cpu_features_def.h.inc | 1 +
target/s390x/gen-features.c | 2 +
target/s390x/kvm/kvm.c | 8 ++
target/s390x/kvm/kvm_s390x.h | 1 +
26 files changed, 731 insertions(+), 51 deletions(-)
create mode 100644 hw/s390x/s390-pci-kvm.c
create mode 100644 include/hw/s390x/s390-pci-kvm.h
--
2.27.0
next reply other threads:[~2022-03-14 19:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-14 19:49 Matthew Rosato [this message]
2022-03-14 19:49 ` [PATCH v4 01/11] Update linux headers Matthew Rosato
2022-03-14 19:49 ` [PATCH v4 02/11] vfio: handle KVM-owned IOMMU requests Matthew Rosato
2022-03-14 19:49 ` [PATCH v4 03/11] target/s390x: add zpci-interp to cpu models Matthew Rosato
2022-03-14 19:49 ` [PATCH v4 04/11] s390x/pci: add routine to get host function handle from CLP info Matthew Rosato
2022-03-14 19:49 ` [PATCH v4 05/11] s390x/pci: enable for load/store intepretation Matthew Rosato
2022-03-14 19:49 ` [PATCH v4 06/11] s390x/pci: don't fence interpreted devices without MSI-X Matthew Rosato
2022-03-14 19:49 ` [PATCH v4 07/11] s390x/pci: enable adapter event notification for interpreted devices Matthew Rosato
2022-03-14 19:49 ` [PATCH v4 08/11] s390x/pci: use KVM-managed IOMMU for interpretation Matthew Rosato
2022-03-14 19:49 ` [PATCH v4 09/11] s390x/pci: use I/O Address Translation assist when interpreting Matthew Rosato
2022-03-14 19:49 ` [PATCH v4 10/11] s390x/pci: use dtsm provided from vfio capabilities for interpreted devices Matthew Rosato
2022-03-14 19:49 ` [PATCH v4 11/11] s390x/pci: let intercept devices have separate PCI groups Matthew Rosato
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=20220314194920.58888-1-mjrosato@linux.ibm.com \
--to=mjrosato@linux.ibm.com \
--cc=alex.williamson@redhat.com \
--cc=borntraeger@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@redhat.com \
--cc=farman@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=pmorel@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=schnelle@linux.ibm.com \
--cc=thuth@redhat.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).