Skip to content

vfio/pci: Check the device set open count on reset

Anthony DeRossi kvm 3 versions – Applied

Status from this message: Applied to vfio for-linus branch for v6.1. Thanks,

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest3 patches 6 repliesApplied
  2. v53 patches 8 repliesSuperseded
  3. v43 patches 6 repliesSuperseded

Changes in v6 from the cover letter

- Added a call to lockdep_assert_held() in patch 3
- Corrected "vfio_container_device_register()" in the patch 1 commit message
v5: https://lore.kernel.org/kvm/[email protected]/

Patches in v6 Applied

#Subject and filesSizeRepliesApplied
1/3vfio: Fix container device registration life cycledrivers/vfio/vfio_main.c+8 -51 reply
2/3vfio: Export the device set open countdrivers/vfio/vfio_main.c include/linux/vfio.h+14 -01 reply
3/3vfio/pci: Check the device set open count on resetdrivers/vfio/pci/vfio_pci_core.c+5 -53 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchJason GunthorpeKevin TianYi Liu
1/3R-b R-b R-b
2/3R-b R-b R-b
3/3R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v6 thread

Cover letter [PATCH v6 0/3] vfio/pci: Check the device set open count on reset

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.

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

Thank you Alex, Jason, and Kevin for your reviews and feedback. This revision includes the changes suggested on v5, but without any changes to vfio_device_set_open_count().

Anthony

v5 -> v6:
- Added a call to lockdep_assert_held() in patch 3
- Corrected "vfio_container_device_register()" in the patch 1 commit message
v5: https://lore.kernel.org/kvm/[email protected]/

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/[email protected]/

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/[email protected]/

v2 -> v3:
- Added WARN_ON()
- Revised commit message
v2: https://lore.kernel.org/kvm/[email protected]/

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/[email protected]/

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         | 26 +++++++++++++++++++++-----
 include/linux/vfio.h             |  1 +
 3 files changed, 27 insertions(+), 10 deletions(-)
Signature · 1 line
2.37.4