]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
vfio: selftests: Add iommufd_compat_type1{,v2} modes
authorDavid Matlack <dmatlack@google.com>
Fri, 22 Aug 2025 21:25:14 +0000 (21:25 +0000)
committerAlex Williamson <alex.williamson@redhat.com>
Wed, 27 Aug 2025 18:14:10 +0000 (12:14 -0600)
commitd1a17495bb878542898d7ca4aa8fde29423a8ee0
treebb755cc1149c8c2fe4de5099f3c70a011ac751a5
parent0969c685ba5b248648533a3313f55a3fd9382a9e
vfio: selftests: Add iommufd_compat_type1{,v2} modes

Add new IOMMU modes for using iommufd in compatibility mode with
VFIO_TYPE1_IOMMU and VFIO_TYPE1v2_IOMMU.

In these modes, VFIO selftests will open /dev/iommu and treats it as a
container FD (as if it had opened /dev/vfio/vfio) and the kernel
translates the container ioctls to iommufd calls transparently.

Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: David Matlack <dmatlack@google.com>
Link: https://lore.kernel.org/r/20250822212518.4156428-28-dmatlack@google.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
tools/testing/selftests/vfio/lib/include/vfio_util.h
tools/testing/selftests/vfio/lib/vfio_pci_device.c
tools/testing/selftests/vfio/vfio_dma_mapping_test.c