vfio: selftests: Drop IOMMU mapping size assertions for VFIO_TYPE1_IOMMU
Subsystems (4)
David Matlack
maintainerPATCH 1/1 vfio: selftests: Drop IOMMU mapping size assertions for VFIO_TYPE1_IOMMU
Drop the assertions about IOMMU mappings sizes for VFIO_TYPE1_IOMMU modes (both the VFIO mode and the iommufd compatibility mode). These assertions fail when CONFIG_IOMMUFD_VFIO_CONTAINER is enabled, since iommufd compatibility mode provides different huge page behavior than VFIO for VFIO_TYPE1_IOMMU. VFIO_TYPE1_IOMMU is an old enough interface that it's not worth changing the behavior of VFIO and iommufd to match nor care about the IOMMU mapping sizes.
--- tools/testing/selftests/vfio/vfio_dma_mapping_test.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
tools/testing/selftests/vfio/vfio_dma_mapping_test.c +2 -6
@@ -162,12 +162,8 @@ TEST_F(vfio_dma_mapping_test, dma_map_unmap)if (rc == -EOPNOTSUPP ) goto unmap; -/* -* IOMMUFD compatibility-mode does not support huge mappings when -* using VFIO_TYPE1_IOMMU. -*/ -if (!strcmp (variant->iommu_mode,"iommufd_compat_type1" )) - mapping_size =SZ_4K ; +if (self->iommu->mode->iommu_type ==VFIO_TYPE1_IOMMU ) + goto unmap;ASSERT_EQ (0 , rc);printf ("Found IOMMU mappings for IOVA 0x%lx:\n" , region.iova);
base-commit: d721f52e31553a848e0e9947ca15a49c5674aef3
Signature · 1 line
2.52.0.457.g6b5491de43-goog
Quoted 8 lines · On Wed, 14 Jan 2026 21:12:52 +0000 David Matlack <[email protected]> wrote:
Drop the assertions about IOMMU mappings sizes for
VFIO_TYPE1_IOMMUmodes (both the VFIO mode and the iommufd compatibility mode). These assertions fail whenCONFIG_IOMMUFD_VFIO_CONTAINERis enabled, since iommufd compatibility mode provides different huge page behavior than VFIO forVFIO_TYPE1_IOMMU.VFIO_TYPE1_IOMMUis an old enough interface that it's not worth changing the behavior of VFIO and iommufd to match nor care about the IOMMU mapping sizes.
Quoted 6 lines
Cc Jason Gunthorpe <[email protected]>Signed-off-by David Matlack <[email protected]>--- tools/testing/selftests/vfio/vfio_dma_mapping_test.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
Applied to vfio next branch for v6.20/7.0. Thanks,
Alex
Quoted 21 lines
tools/testing/selftests/vfio/vfio_dma_mapping_test.c +2
-6@@ -162,12 +162,8 @@ TEST_F(vfio_dma_mapping_test, dma_map_unmap)if (rc == -EOPNOTSUPP ) goto unmap; -/* -* IOMMUFD compatibility-mode does not support huge mappings when -* using VFIO_TYPE1_IOMMU. -*/ -if (!strcmp (variant->iommu_mode,"iommufd_compat_type1" )) - mapping_size =SZ_4K ; +if (self->iommu->mode->iommu_type ==VFIO_TYPE1_IOMMU ) + goto unmap;ASSERT_EQ (0 , rc);printf ("Found IOMMU mappings for IOVA 0x%lx:\n" , region.iova);base-commit:
d721f52e31553a848e0e9947ca15a49c5674aef3