On 2026-01-14 10:57 AM, Alex Mastro wrote: > Test IOMMU mapping the BAR mmaps created during vfio_pci_device_setup(). > > All IOMMU modes are tested: vfio_type1 variants are expected to succeed, > while non-type1 modes are expected to fail. iommufd compat mode can be > updated to expect success once kernel support lands. Native iommufd will > not support mapping vaddrs backed by MMIO (it will support dma-buf based > MMIO mapping instead). > > Changes in v3: > - Rename mmap_aligned() to mmap_reserve() > - Reorder variable declarations for reverse-fir-tree style > - Update patch 2 commit message to mention MADV_HUGEPAGE and MAP_FILE > - Move BAR size check into map_partial_bar test only > - Link to v2: > https://lore.kernel.org/r/[email protected] > > Changes in v2: > - Split into patch series > - Factor out mmap_reserve() for vaddr alignment > - Align BAR mmaps to improve hugepage IOMMU mapping efficiency > - Centralize MODE_* string definitions > - Add is_power_of_2() assertion for BAR size > - Simplify align calculation to min(size, 1G) > - Add map_bar_misaligned test case > - Link to v1: > https://lore.kernel.org/all/20260107-scratch-amastro-vfio-dma-mapping-mmio-test-v1-1-0cec5e9ec...@fb.com > > Signed-off-by: Alex Mastro <[email protected]>
Reviewed-by: David Matlack <[email protected]> Tested-by: David Matlack <[email protected]>

