From: Alex Williamson <alex.williamson@redhat.com>
To: Jason Gunthorpe <jgg@nvidia.com>
Cc: Ankit Agrawal <ankita@nvidia.com>,
Brett Creeley <brett.creeley@amd.com>,
Giovanni Cabiddu <giovanni.cabiddu@intel.com>,
Kevin Tian <kevin.tian@intel.com>,
kvm@vger.kernel.org, Longfang Liu <liulongfang@huawei.com>,
qat-linux@intel.com,
Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>,
virtualization@lists.linux.dev, Xin Zeng <xin.zeng@intel.com>,
Yishai Hadas <yishaih@nvidia.com>,
patches@lists.linux.dev
Subject: Re: [PATCH v3] vfio/pci: Do vf_token checks for VFIO_DEVICE_BIND_IOMMUFD
Date: Wed, 16 Jul 2025 14:22:03 -0600 [thread overview]
Message-ID: <20250716142203.677d4a5d.alex.williamson@redhat.com> (raw)
In-Reply-To: <0-v3-bdd8716e85fe+3978a-vfio_token_jgg@nvidia.com>
On Mon, 14 Jul 2025 13:08:25 -0300
Jason Gunthorpe <jgg@nvidia.com> wrote:
> This was missed during the initial implementation. The VFIO PCI encodes
> the vf_token inside the device name when opening the device from the group
> FD, something like:
>
> "0000:04:10.0 vf_token=bd8d9d2b-5a5f-4f5a-a211-f591514ba1f3"
>
> This is used to control access to a VF unless there is co-ordination with
> the owner of the PF.
>
> Since we no longer have a device name in the cdev path, pass the token
> directly through VFIO_DEVICE_BIND_IOMMUFD using an optional field
> indicated by VFIO_DEVICE_BIND_FLAG_TOKEN.
>
> Fixes: 5fcc26969a16 ("vfio: Add VFIO_DEVICE_BIND_IOMMUFD")
> Tested-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
> Reviewed-by: Yi Liu <yi.l.liu@intel.com>
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
> drivers/vfio/device_cdev.c | 38 +++++++++++++++++--
> .../vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 1 +
> drivers/vfio/pci/mlx5/main.c | 1 +
> drivers/vfio/pci/nvgrace-gpu/main.c | 2 +
> drivers/vfio/pci/pds/vfio_dev.c | 1 +
> drivers/vfio/pci/qat/main.c | 1 +
> drivers/vfio/pci/vfio_pci.c | 1 +
> drivers/vfio/pci/vfio_pci_core.c | 22 +++++++----
> drivers/vfio/pci/virtio/main.c | 3 ++
> include/linux/vfio.h | 4 ++
> include/linux/vfio_pci_core.h | 2 +
> include/uapi/linux/vfio.h | 12 +++++-
> 12 files changed, 76 insertions(+), 12 deletions(-)
Applied to vfio next branch for v6.17 with discussed fix. Thanks,
Alex
prev parent reply other threads:[~2025-07-16 20:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-14 16:08 [PATCH v3] vfio/pci: Do vf_token checks for VFIO_DEVICE_BIND_IOMMUFD Jason Gunthorpe
2025-07-15 0:00 ` Tian, Kevin
2025-07-15 22:55 ` Dan Carpenter
2025-07-15 23:06 ` Jason Gunthorpe
2025-07-16 17:00 ` Alex Williamson
2025-07-16 20:22 ` Alex Williamson [this message]
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=20250716142203.677d4a5d.alex.williamson@redhat.com \
--to=alex.williamson@redhat.com \
--cc=ankita@nvidia.com \
--cc=brett.creeley@amd.com \
--cc=giovanni.cabiddu@intel.com \
--cc=jgg@nvidia.com \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=liulongfang@huawei.com \
--cc=patches@lists.linux.dev \
--cc=qat-linux@intel.com \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=virtualization@lists.linux.dev \
--cc=xin.zeng@intel.com \
--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).