]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
vfio: selftests: Add vfio_dma_mapping_mmio_test
authorAlex Mastro <amastro@fb.com>
Wed, 14 Jan 2026 18:57:18 +0000 (10:57 -0800)
committerAlex Williamson <alex@shazbot.org>
Mon, 19 Jan 2026 17:06:30 +0000 (10:06 -0700)
commit080723f4d4c3c6fb0720aae614deb1f30ee9ef2e
tree8bc2961acbd5d5f5def1e3a0f19d7c952cf98e36
parent557dbdf6c4e9c2dc3d4a4476c67ef14dca32378d
vfio: selftests: Add vfio_dma_mapping_mmio_test

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).

Signed-off-by: Alex Mastro <amastro@fb.com>
Reviewed-by: David Matlack <dmatlack@google.com>
Tested-by: David Matlack <dmatlack@google.com>
Link: https://lore.kernel.org/r/20260114-map-mmio-test-v3-3-44e036d95e64@fb.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
tools/testing/selftests/vfio/Makefile
tools/testing/selftests/vfio/vfio_dma_mapping_mmio_test.c [new file with mode: 0644]