qemu/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.c s390x/css: Refactor IRB construction 2021-06-21 08:48:21 +02:00
ap-bridge.c qbus: Rename qbus_create() to qbus_new() 2021-09-30 13:44:08 +01:00
ap-device.c
ccw-device.c
ccw-device.h
css-bridge.c qbus: Rename qbus_create() to qbus_new() 2021-09-30 13:44:08 +01:00
css.c s390x/css: revert SCSW ctrl/flag bits on error 2022-11-06 12:27:35 +01:00
event-facility.c Replace config-time define HOST_WORDS_BIGENDIAN 2022-04-06 10:50:37 +02:00
ipl.c machine: use QAPI struct for boot configuration 2022-05-12 12:29:43 +02:00
ipl.h s390x: Fix spelling errors 2022-11-16 10:15:26 +01:00
Kconfig
meson.build s390x/pci: enable for load/store interpretation 2022-09-26 17:23:47 +02:00
pv.c s390x/pv: remove semicolon from macro definition 2022-10-27 09:09:50 +02:00
s390-ccw.c misc: fix commonly doubled up words 2022-08-01 11:58:02 +02:00
s390-pci-bus.c s390x/pci: reset ISM passthrough devices on shutdown and system reset 2022-12-15 15:02:34 +01:00
s390-pci-inst.c s390x/pci: coalesce unmap operations 2022-12-15 15:02:34 +01:00
s390-pci-kvm.c Revert "s390x/s390-virtio-ccw: add zpcii-disable machine property" 2022-11-08 10:10:57 +01:00
s390-pci-vfio.c s390x/pci: reset ISM passthrough devices on shutdown and system reset 2022-12-15 15:02:34 +01:00
s390-skeys-kvm.c hw/s390x/s390-skeys: rename skeys_enabled to skeys_are_enabled 2021-09-06 16:24:05 +02:00
s390-skeys.c hw/s390x/s390-skeys: lazy storage key enablement under TCG 2021-09-06 16:24:05 +02:00
s390-stattrib-kvm.c target/s390x: move kvm files into kvm/ 2021-07-07 14:01:59 +02:00
s390-stattrib.c
s390-virtio-ccw.c s390x: Fix spelling errors 2022-11-16 10:15:26 +01:00
s390-virtio-hcall.c
s390-virtio-hcall.h
sclp.c Mark remaining global TypeInfo instances as const 2022-02-21 13:30:20 +00:00
sclpcpu.c
sclpquiesce.c
tod-kvm.c s390x/tod-kvm: don't save/restore the TOD in PV guests 2022-10-27 09:09:50 +02:00
tod-tcg.c Mark remaining global TypeInfo instances as const 2022-02-21 13:30:20 +00:00
tod.c Mark remaining global TypeInfo instances as const 2022-02-21 13:30:20 +00:00
trace-events
trace.h
vhost-scsi-ccw.c virtio-ccw: move device type declarations to .c files 2022-04-06 14:31:56 +02:00
vhost-user-fs-ccw.c
vhost-vsock-ccw.c virtio-ccw: move device type declarations to .c files 2022-04-06 14:31:56 +02:00
virtio-ccw-9p.c virtio-ccw: move device type declarations to .c files 2022-04-06 14:31:56 +02:00
virtio-ccw-balloon.c virtio-ccw: move device type declarations to .c files 2022-04-06 14:31:56 +02:00
virtio-ccw-blk.c virtio-ccw: move device type declarations to .c files 2022-04-06 14:31:56 +02:00
virtio-ccw-crypto.c virtio-ccw: move device type declarations to .c files 2022-04-06 14:31:56 +02:00
virtio-ccw-gpu.c modules: introduces module_kconfig directive 2022-06-06 09:26:53 +02:00
virtio-ccw-input.c virtio-ccw: move device type declarations to .c files 2022-04-06 14:31:56 +02:00
virtio-ccw-net.c virtio-ccw: move device type declarations to .c files 2022-04-06 14:31:56 +02:00
virtio-ccw-rng.c virtio-ccw: move device type declarations to .c files 2022-04-06 14:31:56 +02:00
virtio-ccw-scsi.c virtio-ccw: move device type declarations to .c files 2022-04-06 14:31:56 +02:00
virtio-ccw-serial.c virtio-ccw: move device type declarations to .c files 2022-04-06 14:31:56 +02:00
virtio-ccw.c virtio: stop ioeventfd on reset 2022-06-14 16:50:30 +02:00
virtio-ccw.h virtio-ccw: do not include headers for all virtio devices 2022-04-06 14:31:56 +02:00