From: Jason Gunthorpe <jgg@nvidia.com>
To: Yi Liu <yi.l.liu@intel.com>
Cc: Alex Williamson <alex.williamson@redhat.com>,
Cornelia Huck <cohuck@redhat.com>,
kvm@vger.kernel.org
Subject: Re: [PATCH] vfio: Remove vfio_group dev_counter
Date: Tue, 16 Aug 2022 09:29:57 -0300 [thread overview]
Message-ID: <YvuNxRhOynTDJV4D@nvidia.com> (raw)
In-Reply-To: <1e4626c7-4eba-d1d6-a85d-6042acd64991@intel.com>
On Tue, Aug 16, 2022 at 09:21:05AM +0800, Yi Liu wrote:
> Hi Jason,
>
> On 2022/8/16 00:50, Jason Gunthorpe wrote:
> > This counts the number of devices attached to a vfio_group, ie the number
> > of items in the group->device_list.
>
> yes. This dev_counter is added to ensure only singleton vfio group supports
> pin page. Although I don't think it is a good approach as it only counts the
> registered devices.
Ah, I missed explaining this, lets try again:
vfio: Remove vfio_group dev_counter
This counts the number of devices attached to a vfio_group, ie the number
of items in the group->device_list.
It has two purposes
- To ensure the vfio_device is opened
- To assert the group is singleton because the dirty tracking code in the
type1 iommu has limitations
However, vfio_pin_pages() already calls vfio_assert_device_open() so the
first is taken care of, and all callers of vfio_pin_pages() use now use
vfio_register_emulated_iommu_dev() which guarentees single groups by
constrution.
So delete dev_counter and leave a note that vfio_pin_pages() can only be
used with vfio_register_emulated_iommu_dev().
Jason
next prev parent reply other threads:[~2022-08-16 12:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-15 16:50 [PATCH] vfio: Remove vfio_group dev_counter Jason Gunthorpe
2022-08-16 1:21 ` Yi Liu
2022-08-16 12:29 ` Jason Gunthorpe [this message]
2022-08-16 15:12 ` Yi Liu
2022-08-18 7:46 ` Tian, Kevin
2022-08-18 8:12 ` Yi Liu
2022-08-18 8:19 ` Tian, Kevin
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=YvuNxRhOynTDJV4D@nvidia.com \
--to=jgg@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=cohuck@redhat.com \
--cc=kvm@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox