kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anthony DeRossi <ajderossi@gmail.com>
To: kvm@vger.kernel.org
Cc: alex.williamson@redhat.com, cohuck@redhat.com, jgg@ziepe.ca,
	kevin.tian@intel.com, abhsahu@nvidia.com, yishaih@nvidia.com
Subject: [PATCH v4 0/3] vfio/pci: Check the device set open_count on reset
Date: Fri,  4 Nov 2022 12:57:24 -0700	[thread overview]
Message-ID: <20221104195727.4629-1-ajderossi@gmail.com> (raw)

I took Alex's suggestion on the v2 patch to add an open count to the device
set. This simplified the final patch and might generally be useful for other
drivers.

The first patch in the series fixes a life cycle issue that was discovered
while adding open_count to vfio_device_set. It is also fixed by a patch [1] in
Jason's "Connect VFIO to IOMMU" series.

The third patch is a rework of the original fix that uses the new device set
open_count instead of the private open_count in vfio_device.

[1] https://lore.kernel.org/kvm/1-v1-4991695894d8+211-vfio_iommufd_jgg@nvidia.com/

Anthony

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: Add an open counter to vfio_device_set
  vfio/pci: Check the device set open_count on reset

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

-- 
2.37.4


             reply	other threads:[~2022-11-04 20:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04 19:57 Anthony DeRossi [this message]
2022-11-04 19:57 ` [PATCH v4 1/3] vfio: Fix container device registration life cycle Anthony DeRossi
2022-11-04 20:59   ` Alex Williamson
2022-11-09  0:51     ` Jason Gunthorpe
2022-11-09  0:58       ` Alex Williamson
2022-11-09  1:00         ` Jason Gunthorpe
2022-11-04 19:57 ` [PATCH v4 2/3] vfio: Add an open counter to vfio_device_set Anthony DeRossi
2022-11-04 20:59   ` Alex Williamson
2022-11-05 22:56     ` Anthony DeRossi
2022-11-04 19:57 ` [PATCH v4 3/3] vfio/pci: Check the device set open_count on reset Anthony DeRossi

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=20221104195727.4629-1-ajderossi@gmail.com \
    --to=ajderossi@gmail.com \
    --cc=abhsahu@nvidia.com \
    --cc=alex.williamson@redhat.com \
    --cc=cohuck@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=yishaih@nvidia.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).