[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v7 3/8] s390x/pci: enable for load/store intepretation

From: Matthew Rosato
Subject: Re: [PATCH v7 3/8] s390x/pci: enable for load/store intepretation
Date: Wed, 22 Jun 2022 11:20:14 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1

On 6/22/22 4:35 AM, Pierre Morel wrote:

On 6/6/22 22:36, Matthew Rosato wrote:
If the ZPCI_OP ioctl reports that is is available and usable, then the
underlying KVM host will enable load/store intepretation for any guest
device without a SHM bit in the guest function handle.  For a device that
will be using interpretation support, ensure the guest function handle
matches the host function handle; this value is re-checked every time the
guest issues a SET PCI FN to enable the guest device as it is the only
opportunity to reflect function handle changes.

By default, unless interpret=off is specified, interpretation support will
always be assumed and exploited if the necessary ioctl and features are
available on the host kernel.  When these are unavailable, we will silently revert to the interception model; this allows existing guest configurations
to work unmodified on hosts with and without zPCI interpretation support,
allowing QEMU to choose the best support model available.

Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
  hw/s390x/meson.build            |  1 +
  hw/s390x/s390-pci-bus.c         | 66 ++++++++++++++++++++++++++++++++-
  hw/s390x/s390-pci-inst.c        | 16 ++++++++
  hw/s390x/s390-pci-kvm.c         | 22 +++++++++++
  include/hw/s390x/s390-pci-bus.h |  1 +
  include/hw/s390x/s390-pci-kvm.h | 24 ++++++++++++
  target/s390x/kvm/kvm.c          |  7 ++++
  target/s390x/kvm/kvm_s390x.h    |  1 +
  8 files changed, 137 insertions(+), 1 deletion(-)
  create mode 100644 hw/s390x/s390-pci-kvm.c
  create mode 100644 include/hw/s390x/s390-pci-kvm.h

diff --git a/hw/s390x/meson.build b/hw/s390x/meson.build
index feefe0717e..f291016fee 100644
--- a/hw/s390x/meson.build
+++ b/hw/s390x/meson.build
@@ -23,6 +23,7 @@ s390x_ss.add(when: 'CONFIG_KVM', if_true: files(
+  's390-pci-kvm.c',


diff --git a/hw/s390x/s390-pci-kvm.c b/hw/s390x/s390-pci-kvm.c
new file mode 100644
index 0000000000..0f16104a74
--- /dev/null
+++ b/hw/s390x/s390-pci-kvm.c

...and here:

Shouldn't this file go in target/s390x/kvm ?

I wasn't sure tbh, there seems to be precedent to use hw/s390x already today for kvm-specific pieces of hardware support (e.g. tod, skeys, pv, stattrib) whereas target/s390x/kvm has only kvm.c?

Anyone else have an opinion on this one?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]