Re: [PATCH] vfio: selftests: Skip vfio_dma_map_limit_test if mapping returns -EINVAL

Alex Mastro
2025-11-08T00:17:39Z

On Fri, Nov 07, 2025 at 10:20:58PM +0000, David Matlack wrote:
> Skip vfio_dma_map_limit_test.{unmap_range,unmap_all} (instead of
> failing) on systems that do not support mapping in the page-sized region
> at the top of the u64 address space. Use -EINVAL as the signal for
> detecting systems with this limitation, as that is what both VFIO Type1
> and iommufd return.
>
> A more robust solution that could be considered in the future would be
> to explicitly check the range of supported IOVA regions and key off
> that, instead of inferring from -EINVAL.
>
> Fixes: de8d1f2fd5a5 ("vfio: selftests: add end of address space DMA map/unmap tests")
> Signed-off-by: David Matlack <dmatlack@google.com>

Makes sense -- thanks David. Agree about keying this off
VFIO_IOMMU_TYPE1_INFO_CAP_IOVA_RANGE longer term.

Reviewed-by: Alex Mastro <amastro@fb.com>