qemu-e2k/include/hw/s390x
Matthew Rosato 03451953c7 s390x/pci: reset ISM passthrough devices on shutdown and system reset
ISM device firmware stores unique state information that can
can cause a wholesale unmap of the associated IOMMU (e.g. when
we get a termination signal for QEMU) to trigger firmware errors
because firmware believes we are attempting to invalidate entries
that are still in-use by the guest OS (when in fact that guest is
in the process of being terminated or rebooted).
To alleviate this, register both a shutdown notifier (for unexpected
termination cases e.g. virsh destroy) as well as a reset callback
(for cases like guest OS reboot).  For each of these scenarios, trigger
PCI device reset; this is enough to indicate to firmware that the IOMMU
is no longer in-use by the guest OS, making it safe to invalidate any
associated IOMMU entries.

Fixes: 15d0e7942d ("s390x/pci: don't fence interpreted devices without MSI-X")
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Message-Id: <20221209195700.263824-1-mjrosato@linux.ibm.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
[thuth: Adjusted the hunk in s390-pci-vfio.c due to different context]
Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-12-15 15:02:34 +01:00
..
3270-ccw.h
adapter.h
ap-bridge.h
ap-device.h
css-bridge.h
css.h css: fix actl handling for unit exceptions 2021-09-06 16:23:08 +02:00
ebcdic.h
event-facility.h
ioinst.h s390x/css: fix PMCW invalid mask 2022-01-17 08:34:19 +01:00
pv.h s390x: Add KVM PV dump interface 2022-10-26 12:54:59 +04:00
s390_flic.h
s390-ccw.h
s390-pci-bus.h s390x/pci: reset ISM passthrough devices on shutdown and system reset 2022-12-15 15:02:34 +01:00
s390-pci-clp.h Clean up ill-advised or unusual header guards 2022-05-11 16:50:01 +02:00
s390-pci-inst.h
s390-pci-kvm.h s390x/pci: enable adapter event notification for interpreted devices 2022-09-26 17:23:47 +02:00
s390-pci-vfio.h s390x/pci: add routine to get host function handle from CLP info 2022-09-26 17:23:47 +02:00
s390-virtio-ccw.h Revert "s390x/s390-virtio-ccw: add zpcii-disable machine property" 2022-11-08 10:10:57 +01:00
sclp.h
storage-attributes.h
storage-keys.h hw/s390x/s390-skeys: lazy storage key enablement under TCG 2021-09-06 16:24:05 +02:00
tod.h target/s390x: start moving TCG-only code to tcg/ 2021-07-07 14:01:56 +02:00
vfio-ccw.h