linux/tools/testing/selftests/vfio
Alex Mastro d323ad7396 vfio: selftests: replace iova=vaddr with allocated iovas
vfio_dma_mapping_test and vfio_pci_driver_test currently use iova=vaddr
as part of DMA mapping operations. However, not all IOMMUs support the
same virtual address width as the processor. For instance, older Intel
consumer platforms only support 39-bits of IOMMU address space. On such
platforms, using the virtual address as the IOVA fails.

Make the tests more robust by using iova_allocator to vend IOVAs, which
queries legally accessible IOVAs from the underlying IOMMUFD or VFIO
container.

Reviewed-by: David Matlack <dmatlack@google.com>
Tested-by: David Matlack <dmatlack@google.com>
Signed-off-by: Alex Mastro <amastro@fb.com>
Link: https://lore.kernel.org/r/20251111-iova-ranges-v3-4-7960244642c5@fb.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
2025-11-12 08:04:42 -07:00
..
lib vfio: selftests: add iova allocator 2025-11-12 08:04:42 -07:00
.gitignore vfio: selftests: Fix .gitignore for already tracked files 2025-08-28 13:40:51 -06:00
Makefile vfio: selftests: Add a script to help with running VFIO selftests 2025-08-27 12:14:11 -06:00
run.sh vfio: selftests: Add a script to help with running VFIO selftests 2025-08-27 12:14:11 -06:00
vfio_dma_mapping_test.c vfio: selftests: replace iova=vaddr with allocated iovas 2025-11-12 08:04:42 -07:00
vfio_iommufd_setup_test.c vfio: selftests: Move helper to get cdev path to libvfio 2025-08-27 12:14:09 -06:00
vfio_pci_device_test.c vfio: selftests: Encapsulate IOMMU mode 2025-08-27 12:14:09 -06:00
vfio_pci_driver_test.c vfio: selftests: replace iova=vaddr with allocated iovas 2025-11-12 08:04:42 -07:00