diff options
| author | David Matlack <dmatlack@google.com> | 2025-08-22 21:25:12 +0000 |
|---|---|---|
| committer | Alex Williamson <alex.williamson@redhat.com> | 2025-08-27 12:14:10 -0600 |
| commit | 892aff147a545fa7c94d98613093afa84faa25b1 (patch) | |
| tree | c190eab36ae17dd9da65bffa09960dfa24d517e6 /tools/testing/selftests/vfio/lib/include | |
| parent | vfio: selftests: Encapsulate IOMMU mode (diff) | |
| download | linux-892aff147a545fa7c94d98613093afa84faa25b1.tar.gz linux-892aff147a545fa7c94d98613093afa84faa25b1.zip | |
vfio: selftests: Replicate tests across all iommu_modes
Automatically replicate vfio_dma_mapping_test and vfio_pci_driver_test
across all supported IOMMU modes using fixture variants. Both of these
tests exercise DMA mapping to some degree so having automatic coverage
across all IOMMU modes will help catch bugs.
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: David Matlack <dmatlack@google.com>
Link: https://lore.kernel.org/r/20250822212518.4156428-26-dmatlack@google.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'tools/testing/selftests/vfio/lib/include')
| -rw-r--r-- | tools/testing/selftests/vfio/lib/include/vfio_util.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/testing/selftests/vfio/lib/include/vfio_util.h b/tools/testing/selftests/vfio/lib/include/vfio_util.h index d50debd84813..bf0b636a9c0c 100644 --- a/tools/testing/selftests/vfio/lib/include/vfio_util.h +++ b/tools/testing/selftests/vfio/lib/include/vfio_util.h @@ -53,6 +53,14 @@ struct vfio_iommu_mode { unsigned long iommu_type; }; +/* + * Generator for VFIO selftests fixture variants that replicate across all + * possible IOMMU modes. Tests must define FIXTURE_VARIANT_ADD_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__) + struct vfio_pci_bar { struct vfio_region_info info; void *vaddr; |
