Alex Mastro
03b7c2d763
vfio: selftests: Centralize IOMMU mode name definitions
...
Replace scattered string literals with MODE_* macros in iommu.h. This
provides a single source of truth for IOMMU mode name strings.
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-1-44e036d95e64@fb.com
Signed-off-by: Alex Williamson <alex@shazbot.org >
2026-01-19 10:06:29 -07:00
David Matlack
193120dddd
vfio: selftests: Drop <uapi/linux/types.h> includes
...
Drop the <uapi/linux/types.h> includes now that <linux/types.h>
(tools/include/linux/types.h) has a definition for __aligned_le64, which
is needed by <linux/iommufd.h>.
Including <uapi/linux/types.h> is harmless but causes benign typedef
redefinitions. This is not a problem for VFIO selftests but becomes an
issue when the VFIO selftests library is built into KVM selftests, since
they are built with -std=gnu99 which does not allow typedef redifitions.
No functional change intended.
Signed-off-by: David Matlack <dmatlack@google.com >
Link: https://lore.kernel.org/r/20251219233818.1965306-3-dmatlack@google.com
Signed-off-by: Alex Williamson <alex@shazbot.org >
2025-12-23 14:17:13 -07:00
David Matlack
b8e96c8805
vfio: selftests: Eliminate INVALID_IOVA
...
Eliminate INVALID_IOVA as there are platforms where UINT64_MAX is a
valid iova.
Reviewed-by: Alex Mastro <amastro@fb.com >
Tested-by: Alex Mastro <amastro@fb.com >
Reviewed-by: Raghavendra Rao Ananta <rananta@google.com >
Signed-off-by: David Matlack <dmatlack@google.com >
Link: https://lore.kernel.org/r/20251126231733.3302983-18-dmatlack@google.com
Signed-off-by: Alex Williamson <alex@shazbot.org >
2025-11-28 10:58:07 -07:00
David Matlack
657d241e69
vfio: selftests: Rename vfio_util.h to libvfio.h
...
Rename vfio_util.h to libvfio.h to match the name of libvfio.mk.
No functional change intended.
Reviewed-by: Alex Mastro <amastro@fb.com >
Tested-by: Alex Mastro <amastro@fb.com >
Reviewed-by: Raghavendra Rao Ananta <rananta@google.com >
Signed-off-by: David Matlack <dmatlack@google.com >
Link: https://lore.kernel.org/r/20251126231733.3302983-15-dmatlack@google.com
Signed-off-by: Alex Williamson <alex@shazbot.org >
2025-11-28 10:58:07 -07:00
David Matlack
2aca571089
vfio: selftests: Move IOMMU library code into iommu.c
...
Move all the IOMMU related library code into their own file iommu.c.
This provides a better separation between the vfio_pci_device helper
code and the iommu code.
No function change intended.
Reviewed-by: Alex Mastro <amastro@fb.com >
Tested-by: Alex Mastro <amastro@fb.com >
Reviewed-by: Raghavendra Rao Ananta <rananta@google.com >
Signed-off-by: David Matlack <dmatlack@google.com >
Link: https://lore.kernel.org/r/20251126231733.3302983-12-dmatlack@google.com
Signed-off-by: Alex Williamson <alex@shazbot.org >
2025-11-28 10:58:06 -07:00