]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
vfio: selftests: update DMA map/unmap helpers to support more test kinds
authorAlex Mastro <amastro@fb.com>
Tue, 28 Oct 2025 16:15:03 +0000 (09:15 -0700)
committerAlex Williamson <alex@shazbot.org>
Tue, 28 Oct 2025 21:54:41 +0000 (15:54 -0600)
commit16950b60c19b9137eb8bfeb298621e803e98dcc7
treed28448b8078fc316db591843e696830cfbd41bd4
parentef270ec44637d464126bd4ade483c4a1887e06bc
vfio: selftests: update DMA map/unmap helpers to support more test kinds

Add __vfio_pci_dma_*() helpers which return -errno from the underlying
ioctls.

Add __vfio_pci_dma_unmap_all() to test more unmapping code paths. Add an
out unmapped arg to report the unmapped byte size.

The existing vfio_pci_dma_*() functions, which are intended for
happy-path usage (assert on failure) are now thin wrappers on top of the
double-underscore helpers.

Reviewed-by: David Matlack <dmatlack@google.com>
Signed-off-by: Alex Mastro <amastro@fb.com>
Link: https://lore.kernel.org/r/20251028-fix-unmap-v6-4-2542b96bcc8e@fb.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
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