]> Gentwo Git Trees - linux/.git/commit
vfio: selftests: Stop passing device for IOMMU operations
authorDavid Matlack <dmatlack@google.com>
Wed, 26 Nov 2025 23:17:28 +0000 (23:17 +0000)
committerAlex Williamson <alex@shazbot.org>
Fri, 28 Nov 2025 17:58:06 +0000 (10:58 -0700)
commit831c37a5bf046bbdf65c042b53fd2e8cac0b1a5a
tree2a3d7f25ceee10cf2598ca4e56ead68c6408beb0
parent2607a4361312bf407931597423fe23db406ca8d3
vfio: selftests: Stop passing device for IOMMU operations

Drop the struct vfio_pci_device wrappers for IOMMU map/unmap functions
and require tests to directly call iommu_map(), iommu_unmap(), etc. This
results in more concise code, and also makes it clear the map operations
are happening on a struct iommu, not necessarily on a specific device,
especially when multi-device tests are introduced.

Do the same for iova_allocator_init() as that function only needs the
struct iommu, not struct vfio_pci_device.

Reviewed-by: Alex Mastro <amastro@fb.com>
Tested-by: Alex Mastro <amastro@fb.com>
Reviewed-by: Raghavendra Rao Ananta <rananta@google.com>
Signed-off-by: David Matlack <dmatlack@google.com>
Link: https://lore.kernel.org/r/20251126231733.3302983-14-dmatlack@google.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
tools/testing/selftests/vfio/lib/include/vfio_util.h
tools/testing/selftests/vfio/lib/iova_allocator.c
tools/testing/selftests/vfio/vfio_dma_mapping_test.c
tools/testing/selftests/vfio/vfio_pci_driver_test.c