]> Gentwo Git Trees - linux/.git/commit
vfio: selftests: replace iova=vaddr with allocated iovas
authorAlex Mastro <amastro@fb.com>
Tue, 11 Nov 2025 18:48:27 +0000 (10:48 -0800)
committerAlex Williamson <alex@shazbot.org>
Wed, 12 Nov 2025 15:04:42 +0000 (08:04 -0700)
commitd323ad739666761646048fca587734f4ae64f2c8
treee073bfa801d3caa5aaf0d2d27ad191087c9a5ebc
parentce0e3c403e00e9e03e80aca6570bf936a44279e2
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>
tools/testing/selftests/vfio/vfio_dma_mapping_test.c
tools/testing/selftests/vfio/vfio_pci_driver_test.c