]> www.infradead.org Git - users/hch/misc.git/commitdiff
vfio: selftests: Add vfio_type1v2_mode
authorDavid Matlack <dmatlack@google.com>
Fri, 22 Aug 2025 21:25:13 +0000 (21:25 +0000)
committerAlex Williamson <alex.williamson@redhat.com>
Wed, 27 Aug 2025 18:14:10 +0000 (12:14 -0600)
Add a new IOMMU mode for using VFIO_TYPE1v2_IOMMU.

Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: David Matlack <dmatlack@google.com>
Link: https://lore.kernel.org/r/20250822212518.4156428-27-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

index bf0b636a9c0c139da73e5b2953c4fc6fc3f5f221..981ddc9a52a978b64210a249ed747819d76b0df6 100644 (file)
@@ -59,7 +59,8 @@ struct vfio_iommu_mode {
  * which should then use FIXTURE_VARIANT_ADD() to create the variant.
  */
 #define FIXTURE_VARIANT_ADD_ALL_IOMMU_MODES(...) \
-FIXTURE_VARIANT_ADD_IOMMU_MODE(vfio_type1_iommu, ##__VA_ARGS__)
+FIXTURE_VARIANT_ADD_IOMMU_MODE(vfio_type1_iommu, ##__VA_ARGS__); \
+FIXTURE_VARIANT_ADD_IOMMU_MODE(vfio_type1v2_iommu, ##__VA_ARGS__)
 
 struct vfio_pci_bar {
        struct vfio_region_info info;
index 5c4d008f2a25ef462d696dd41c35567cee40a633..cc1b732dd8ba74a7f611712ac95c9aa469c3f1fb 100644 (file)
@@ -371,6 +371,11 @@ static const struct vfio_iommu_mode iommu_modes[] = {
                .container_path = "/dev/vfio/vfio",
                .iommu_type = VFIO_TYPE1_IOMMU,
        },
+       {
+               .name = "vfio_type1v2_iommu",
+               .container_path = "/dev/vfio/vfio",
+               .iommu_type = VFIO_TYPE1v2_IOMMU,
+       },
 };
 
 const char *default_iommu_mode = "vfio_type1_iommu";