[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-5.2] s390x/pci: Unregister listeners before destroying IO
Re: [PATCH for-5.2] s390x/pci: Unregister listeners before destroying IOMMU address space
Tue, 17 Nov 2020 10:45:50 +0100
On Mon, 16 Nov 2020 16:42:35 -0500
Matthew Rosato <email@example.com> wrote:
> Hot-unplugging a vfio-pci device on s390x causes a QEMU crash:
> qemu-system-s390x: ../softmmu/memory.c:2772:
> do_address_space_destroy: Assertion `QTAILQ_EMPTY(&as->listeners)' failed.
> In s390, the IOMMU address space is freed during device unplug but the
> associated vfio-pci device may not yet be finalized and therefore may
> still have a listener registered to the IOMMU address space.
> Commit a2166410ad74 ("spapr_pci: Unregister listeners before destroying
> the IOMMU address space") previously resolved this issue for spapr_pci.
> We are now seeing this in s390x; it would seem the possibility for this
> issue was already present but based on a bisect commit 2d24a6466154
> ("device-core: use RCU for list of children of a bus") has now changed
> the timing such that it is now readily reproducible.
> Add logic to ensure listeners are removed before destroying the address
> Reported-by: Niklas Schnelle <firstname.lastname@example.org>
> Signed-off-by: Matthew Rosato <email@example.com>
> Reviewed-by: Pierre Morel <firstname.lastname@example.org>
> Tested-by: Niklas Schnelle <email@example.com>
> hw/s390x/s390-pci-bus.c | 7 +++++++
> 1 file changed, 7 insertions(+)
Thanks, queued to s390-fixes.