s390x/pci: enable for load/store interpretation
commitdd1d5fd9684beeb0c14c39f497ef2aa9ac683aa7
authorMatthew Rosato <mjrosato@linux.ibm.com>
Fri, 2 Sep 2022 17:27:32 +0000 (2 13:27 -0400)
committerThomas Huth <thuth@redhat.com>
Mon, 26 Sep 2022 15:23:47 +0000 (26 17:23 +0200)
tree6596d49d0405642fe06a7421d7fe9af52d612461
parent21fa15298d88db2050a713cdf79c10cb0e09146f
s390x/pci: enable for load/store interpretation

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>
Acked-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220902172737.170349-4-mjrosato@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
hw/s390x/meson.build
hw/s390x/s390-pci-bus.c
hw/s390x/s390-pci-inst.c
hw/s390x/s390-pci-kvm.c [new file with mode: 0644]
include/hw/s390x/s390-pci-bus.h
include/hw/s390x/s390-pci-kvm.h [new file with mode: 0644]
target/s390x/kvm/kvm.c
target/s390x/kvm/kvm_s390x.h