]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
vfio: selftests: Extend container/iommufd setup for passing vf_token
authorRaghavendra Rao Ananta <rananta@google.com>
Tue, 5 May 2026 21:28:34 +0000 (21:28 +0000)
committerAlex Williamson <alex@shazbot.org>
Wed, 20 May 2026 17:54:10 +0000 (11:54 -0600)
commite65f1bf8a2db8d68df88d304d1cd801b7c26031d
tree7468c2386c0dfaaee25bbffac2fc6bdab29d9c54
parentc5db77a035e1291e2c9b488073c28b441e5e44f3
vfio: selftests: Extend container/iommufd setup for passing vf_token

A UUID is normally set as a vf_token to correspond the VFs with the
PFs, if they are both bound by the vfio-pci driver. This is true for
iommufd-based approach and container-based approach. The token can be
set either during device creation (VFIO_GROUP_GET_DEVICE_FD) in
container-based approach or during iommu bind (VFIO_DEVICE_BIND_IOMMUFD)
in the iommu-fd case. Hence extend the functions,
vfio_pci_iommufd_setup() and vfio_pci_container_setup(), to accept
vf_token as an (optional) argument and handle the necessary setup.

No functional changes are expected.

Signed-off-by: Raghavendra Rao Ananta <rananta@google.com>
Reviewed-by: David Matlack <dmatlack@google.com>
Reviewed-by: Vipin Sharma <vipinsh@google.com>
Tested-by: David Matlack <dmatlack@google.com>
Link: https://lore.kernel.org/r/20260505212838.1698034-5-rananta@google.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
tools/testing/selftests/vfio/Makefile
tools/testing/selftests/vfio/lib/vfio_pci_device.c