linux/drivers/vfio/pci/pds
Jason Gunthorpe 86624ba3b5 vfio/pci: Do vf_token checks for VFIO_DEVICE_BIND_IOMMUFD
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: 5fcc26969a ("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>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/0-v3-bdd8716e85fe+3978a-vfio_token_jgg@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2025-08-05 15:41:14 -06:00
..
cmds.c vfio/pds: Send type for SUSPEND_STATUS command 2023-08-22 13:11:57 -06:00
cmds.h vfio/pds: Add support for dirty page tracking 2023-08-16 10:54:46 -06:00
dirty.c fix missing vmalloc.h includes 2024-04-25 20:55:49 -07:00
dirty.h vfio/pds: Add multi-region support 2023-12-04 14:33:21 -07:00
Kconfig iommufd for 6.7 2023-11-01 16:44:56 -10:00
lm.c [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
lm.h vfio/pds: Make sure migration file isn't accessed after reset 2024-03-11 12:10:37 -06:00
Makefile vfio/pds: Add support for dirty page tracking 2023-08-16 10:54:46 -06:00
pci_drv.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
pci_drv.h
vfio_dev.c vfio/pci: Do vf_token checks for VFIO_DEVICE_BIND_IOMMUFD 2025-08-05 15:41:14 -06:00
vfio_dev.h vfio/pds: Refactor/simplify reset logic 2024-03-11 12:10:37 -06:00