From: Cornelia Huck <cohuck@redhat.com>
To: Matthew Rosato <mjrosato@linux.ibm.com>
Cc: thuth@redhat.com, pmorel@linux.ibm.com, david@redhat.com,
qemu-devel@nongnu.org, schnelle@linux.ibm.com,
richard.henderson@linaro.org, groug@kaod.org,
mlevitsk@redhat.com, pasic@linux.ibm.com, borntraeger@de.ibm.com,
qemu-s390x@nongnu.org
Subject: Re: [PATCH for-5.2] s390x/pci: Unregister listeners before destroying IOMMU address space
Date: Tue, 17 Nov 2020 10:45:50 +0100 [thread overview]
Message-ID: <20201117104550.74465dab.cohuck@redhat.com> (raw)
In-Reply-To: <1605562955-21152-1-git-send-email-mjrosato@linux.ibm.com>
On Mon, 16 Nov 2020 16:42:35 -0500
Matthew Rosato <mjrosato@linux.ibm.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
> space.
>
> Reported-by: Niklas Schnelle <schnelle@linux.ibm.com>
> Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
> Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
> Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
> ---
> hw/s390x/s390-pci-bus.c | 7 +++++++
> 1 file changed, 7 insertions(+)
Thanks, queued to s390-fixes.
prev parent reply other threads:[~2020-11-17 9:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-16 21:42 [PATCH for-5.2] s390x/pci: Unregister listeners before destroying IOMMU address space Matthew Rosato
2020-11-17 8:23 ` Thomas Huth
2020-11-17 9:45 ` Cornelia Huck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201117104550.74465dab.cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=david@redhat.com \
--cc=groug@kaod.org \
--cc=mjrosato@linux.ibm.com \
--cc=mlevitsk@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=pmorel@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=schnelle@linux.ibm.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).