Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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.

Cc: Jason Gunthorpe <jgg@ziepe.ca>
Link: https://lore.kernel.org/kvm/20260109143830.176dc279@shazbot.org/
Signed-off-by: David Matlack <dmatlack@google.com>
Link: https://lore.kernel.org/r/20260114211252.2581145-1-dmatlack@google.com
Signed-off-by: Alex Williamson <alex@shazbot.org>

authored by

David Matlack and committed by
Alex Williamson
1c588bca 080723f4

+2 -6
+2 -6
tools/testing/selftests/vfio/vfio_dma_mapping_test.c
··· 161 161 if (rc == -EOPNOTSUPP) 162 162 goto unmap; 163 163 164 - /* 165 - * IOMMUFD compatibility-mode does not support huge mappings when 166 - * using VFIO_TYPE1_IOMMU. 167 - */ 168 - if (!strcmp(variant->iommu_mode, MODE_IOMMUFD_COMPAT_TYPE1)) 169 - mapping_size = SZ_4K; 164 + if (self->iommu->mode->iommu_type == VFIO_TYPE1_IOMMU) 165 + goto unmap; 170 166 171 167 ASSERT_EQ(0, rc); 172 168 printf("Found IOMMU mappings for IOVA 0x%lx:\n", region.iova);