All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/3] vfio/pci: Check the device set open count on reset
@ 2022-11-05 22:44 Anthony DeRossi
  2022-11-05 22:44 ` [PATCH v5 1/3] vfio: Fix container device registration life cycle Anthony DeRossi
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Anthony DeRossi @ 2022-11-05 22:44 UTC (permalink / raw)
  To: kvm; +Cc: alex.williamson, cohuck, jgg, kevin.tian, abhsahu, yishaih

This series fixes an issue where devices bound to vfio-pci are not reset when
they are released. Skipping the reset has unpredictable results depending on
the device, and can cause errors when accessing the device later or binding to
a different driver.

This revision replaces the patch that introduced an open_count field in
vfio_device_set with one that exports a new function that can be used for the
same purpose, i.e., determining whether any device in the set is in use.

The first patch in this series fixes a life cycle issue that was discovered in
an earlier revision of the series.

Anthony

v4 -> v5:
- Replaced patch 2 with a patch that introduces a new function to get the
  open count of a device set
- Updated patch 3 to use the new function
v4: https://lore.kernel.org/kvm/20221104195727.4629-1-ajderossi@gmail.com/

v3 -> v4:
- Added a patch to fix device registration life cycle
- Added a patch to add a public open_count on vfio_device_set
- Changed the implementation to avoid private open_count usage
v3: https://lore.kernel.org/kvm/20221102055732.2110-1-ajderossi@gmail.com/

v2 -> v3:
- Added WARN_ON()
- Revised commit message
v2: https://lore.kernel.org/kvm/20221026194245.1769-1-ajderossi@gmail.com/

v1 -> v2:
- Changed reset behavior instead of open_count ordering
- Retitled from "vfio: Decrement open_count before close_device()"
v1: https://lore.kernel.org/kvm/20221025193820.4412-1-ajderossi@gmail.com/

Anthony DeRossi (3):
  vfio: Fix container device registration life cycle
  vfio: Export the device set open count
  vfio/pci: Check the device set open count on reset

 drivers/vfio/pci/vfio_pci_core.c | 10 +++++-----
 drivers/vfio/vfio_main.c         | 24 +++++++++++++++++++-----
 include/linux/vfio.h             |  1 +
 3 files changed, 25 insertions(+), 10 deletions(-)

-- 
2.37.4


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

end of thread, other threads:[~2022-11-09 16:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-05 22:44 [PATCH v5 0/3] vfio/pci: Check the device set open count on reset Anthony DeRossi
2022-11-05 22:44 ` [PATCH v5 1/3] vfio: Fix container device registration life cycle Anthony DeRossi
2022-11-09  0:43   ` Jason Gunthorpe
2022-11-09  3:36   ` Tian, Kevin
2022-11-05 22:44 ` [PATCH v5 2/3] vfio: Export the device set open count Anthony DeRossi
2022-11-08 23:52   ` Alex Williamson
2022-11-09  0:48   ` Jason Gunthorpe
2022-11-09 16:04     ` Alex Williamson
2022-11-09  3:37   ` Tian, Kevin
2022-11-05 22:44 ` [PATCH v5 3/3] vfio/pci: Check the device set open count on reset Anthony DeRossi
2022-11-09  0:53   ` Jason Gunthorpe
2022-11-09  3:38   ` Tian, Kevin

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.