From: Jason Gunthorpe <jgg@nvidia.com>
To: Matthew Rosato <mjrosato@linux.ibm.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
Cornelia Huck <cohuck@redhat.com>,
kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
Christian Borntraeger <borntraeger@de.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Qian Cai <cai@lca.pw>, Eric Farman <farman@linux.ibm.com>,
Joerg Roedel <jroedel@suse.de>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Yi Liu <yi.l.liu@intel.com>
Subject: Re: [PATCH 0/3] Allow the group FD to remain open when unplugging a device
Date: Fri, 7 Oct 2022 11:39:44 -0300 [thread overview]
Message-ID: <Y0A6MH0Espv2JFWu@nvidia.com> (raw)
In-Reply-To: <b04ce2fd-2c68-7b0f-ec43-3f0c27d35c0e@linux.ibm.com>
On Fri, Oct 07, 2022 at 10:37:11AM -0400, Matthew Rosato wrote:
> On 10/7/22 9:37 AM, Jason Gunthorpe wrote:
> > On Thu, Oct 06, 2022 at 07:28:53PM -0400, Matthew Rosato wrote:
> >
> >>> Oh, I'm surprised the s390 testing didn't hit this!!
> >>
> >> Huh, me too, at least eventually - I think it's because we aren't
> >> pinning everything upfront but rather on-demand so the missing the
> >> type1 release / vfio_iommu_unmap_unpin_all wouldn't be so obvious.
> >> I definitely did multiple VM (re)starts and hot (un)plugs. But
> >> while my test workloads did some I/O, the long-running one was
> >> focused on the plug/unplug scenarios to recreate the initial issue
> >> so the I/O (and thus pinning) done would have been minimal.
> >
> > That explains ccw/ap a bit but for PCI the iommu ownership wasn't
> > released so it becomes impossible to re-attach a container to the
> > group. eg a 2nd VM can never be started
> >
> > Ah well, thanks!
> >
> > Jason
>
> Well, this bugged me enough that I traced the v1 series without fixup and vfio-pci on s390 was OK because it was still calling detach_container on vm shutdown via this chain:
>
> vfio_pci_remove
> vfio_pci_core_unregister_device
> vfio_unregister_group_dev
> vfio_device_remove_group
> vfio_group_detach_container
>
> I'd guess non-s390 vfio-pci would do the same. Alex also had the mtty mdev, maybe that's relevant.
As long as you are unplugging a driver the v1 series would work. The
failure mode is when you don't unplug the driver and just run a VM
twice in a row.
Jason
next prev parent reply other threads:[~2022-10-07 14:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-06 12:40 [PATCH 0/3] Allow the group FD to remain open when unplugging a device Jason Gunthorpe
2022-10-06 12:40 ` [PATCH 1/3] vfio: Add vfio_file_is_group() Jason Gunthorpe
2022-10-06 18:11 ` Alex Williamson
2022-10-06 12:40 ` [PATCH 2/3] vfio: Hold a reference to the iommu_group in kvm for SPAPR Jason Gunthorpe
2022-10-06 12:40 ` [PATCH 3/3] vfio: Make the group FD disassociate from the iommu_group Jason Gunthorpe
2022-10-06 19:53 ` [PATCH 0/3] Allow the group FD to remain open when unplugging a device Alex Williamson
2022-10-06 22:42 ` Jason Gunthorpe
2022-10-06 23:28 ` Matthew Rosato
2022-10-07 1:46 ` Matthew Rosato
2022-10-07 13:37 ` Jason Gunthorpe
2022-10-07 14:37 ` Matthew Rosato
2022-10-07 14:39 ` Jason Gunthorpe [this message]
2022-10-07 14:46 ` Matthew Rosato
2022-10-07 11:17 ` Christian Borntraeger
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=Y0A6MH0Espv2JFWu@nvidia.com \
--to=jgg@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=cai@lca.pw \
--cc=cohuck@redhat.com \
--cc=farman@linux.ibm.com \
--cc=jroedel@suse.de \
--cc=kvm@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mjrosato@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=yi.l.liu@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.