Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Introduce vfio_dma_mapping_perf_test
@ 2026-08-04 16:57 Aaron Lewis
  2026-08-04 16:57 ` [PATCH v2 1/4] vfio: selftests: Assert the region was unmapped in iommu_unmap() Aaron Lewis
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Aaron Lewis @ 2026-08-04 16:57 UTC (permalink / raw)
  To: kvm; +Cc: alex, dmatlack, jgg, Aaron Lewis

Add a new VFIO selftest, vfio_dma_mapping_perf_test, to provide a
configurable tool for measuring DMA mapping and unmapping latencies.

This selftest introduces command-line parameters to provide a convenient
way to tune the test for specific situations. For example, it can be used
to observe the lengthy unmap times of the Type 1 IOMMU on large memory
regions, or to compare DMA mapping performance between the Type 1 IOMMU
and IOMMUFD. These scenarios can now be easily configured and run via the
command line.

Changes in V2:
- Assert expected unmap size in iommu_unmap().
- Remove unused struct iommu_mapping
- Create a reusable TIME() macro and move timer-related helpers to libvfio to
  output nanoseconds
- Unified latency reporting by pulling over the TIME() macro instead of
  distinct test-specific prints.
- Drop confusing prints mixing size/addresses in favor of parsing-friendly
  outputs.
- Fix potentially undefined behavior on 32-bit caused by passing u64 directly
  to %lu.
- Refactored memfd tests to run only on MODE_IOMMUFD and drop redundant
  variants.
- Removed MAP_SHARED from memfd_create flags to avoid inadvertently aliasing
  MFD_CLOEXEC.
- Fixed memfd_create() return validation to correctly verify against < 0.
- Updated the map/unmap failure block to properly abort/SKIP on ENOMEM hugepage
  failures.
- Store the device_bdf parameter statically within test_params to unify
  configuration definitions.
- Eliminate memory leaks in populate_harness_args by correctly piping argv into
  wordexp with WRDE_APPEND on subsequent uses.  Subsequent uses now works whether
- Halt execution and exit gracefully if invalid configurations or the
  "-h" flag are supplied, preventing test execution dropout.

Aaron Lewis (4):
  vfio: selftests: Assert the region was unmapped in iommu_unmap()
  vfio: selftests: Introduce vfio_dma_mapping_perf_test
  vfio: selftests: Add memfd test to vfio_dma_mapping_perf_test
  vfio: selftests: Allow a size for vfio_dma_mapping_perf_test

 tools/testing/selftests/vfio/Makefile         |   1 +
 .../selftests/vfio/lib/include/libvfio.h      |  28 ++
 .../vfio/lib/include/libvfio/iommu.h          |  12 +-
 tools/testing/selftests/vfio/lib/iommu.c      |  24 ++
 .../vfio/vfio_dma_mapping_perf_test.c         | 331 ++++++++++++++++++
 .../selftests/vfio/vfio_dma_mapping_test.c    |  11 +-
 6 files changed, 397 insertions(+), 10 deletions(-)
 create mode 100644 tools/testing/selftests/vfio/vfio_dma_mapping_perf_test.c

-- 
2.55.0.654.g21b8a5bc05-goog


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-08-04 17:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-04 16:57 [PATCH v2 0/4] Introduce vfio_dma_mapping_perf_test Aaron Lewis
2026-08-04 16:57 ` [PATCH v2 1/4] vfio: selftests: Assert the region was unmapped in iommu_unmap() Aaron Lewis
2026-08-04 16:57 ` [PATCH v2 2/4] vfio: selftests: Introduce vfio_dma_mapping_perf_test Aaron Lewis
2026-08-04 17:15   ` sashiko-bot
2026-08-04 16:57 ` [PATCH v2 3/4] vfio: selftests: Add memfd test to vfio_dma_mapping_perf_test Aaron Lewis
2026-08-04 16:57 ` [PATCH v2 4/4] vfio: selftests: Allow a size for vfio_dma_mapping_perf_test Aaron Lewis
2026-08-04 17:11   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox