kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Allow the group FD to remain open when unplugging a device
@ 2022-10-06 12:40 Jason Gunthorpe
  2022-10-06 12:40 ` [PATCH 1/3] vfio: Add vfio_file_is_group() Jason Gunthorpe
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Jason Gunthorpe @ 2022-10-06 12:40 UTC (permalink / raw)
  To: Alex Williamson, Cornelia Huck, kvm, Paolo Bonzini
  Cc: Christian Borntraeger, Christian Borntraeger, Qian Cai,
	Eric Farman, Joerg Roedel, Marek Szyprowski, Matthew Rosato,
	Yi Liu

Testing has shown that virtnodedevd will leave the group FD open for long
periods, even after all the cdevs have been destroyed. This blocks
destruction of the VFIO device and is undesirable.

That approach was selected to accomodate SPAPR which has an broken
lifecyle model for the iommu_group. However, we can accomodate SPAPR by
realizing that it doesn't use the iommu core at all, so rules about
iommu_group lifetime do not apply to it.

Giving the KVM code its own kref on the iommu_group allows the VFIO core
code to release its iommu_group reference earlier and we can remove the
sleep that only existed for SPAPR.

Jason Gunthorpe (3):
  vfio: Add vfio_file_is_group()
  vfio: Hold a reference to the iommu_group in kvm for SPAPR
  vfio: Make the group FD disassociate from the iommu_group

 drivers/vfio/pci/vfio_pci_core.c |  2 +-
 drivers/vfio/vfio.h              |  1 -
 drivers/vfio/vfio_main.c         | 90 +++++++++++++++++++++-----------
 include/linux/vfio.h             |  1 +
 virt/kvm/vfio.c                  | 45 +++++++++++-----
 5 files changed, 94 insertions(+), 45 deletions(-)


base-commit: c82e81ab2569559ad873b3061217c2f37560682b
-- 
2.37.3


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2022-10-07 14:47 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2022-10-07 14:46             ` Matthew Rosato
2022-10-07 11:17     ` Christian Borntraeger

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).