diff options
author | Matthew Rosato <mjrosato@linux.ibm.com> | 2022-12-09 14:57:00 -0500 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2022-12-15 15:02:34 +0100 |
commit | 03451953c79e6b31f7860ee0c35b28e181d573c1 (patch) | |
tree | 5a27d67e9929989a44f00a2a13fc92bb85a72656 /qemu-io.c | |
parent | df202e3ff3fccb49868e08f20d0bda86cb953fbe (diff) |
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: 15d0e7942d3b ("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>
Diffstat (limited to 'qemu-io.c')
0 files changed, 0 insertions, 0 deletions