RFC selftests/vfio: Add sPAPR TCE v2 coverage
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest6 patches 11 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | selftests/vfio: allow selecting IOMMU backend from environmenttools/ tools/ tools/ | +50 | 1 reply | |
| 2/6 | selftests/vfio: add sPAPR TCE v2 IOMMU modetools/ tools/ | +15 | 0 replies | |
| 3/6 | selftests/vfio: add sPAPR TCE v2 DMA window helperstools/ tools/ tools/ | +288 | 2 replies | |
| 4/6 | selftests/vfio: Exercise sPAPR DDW path for hugepage DMA mappingstools/ | +22 | 2 replies | |
| 5/6 | selftests/vfio: Accept sPAPR errno for DMA range overflowtools/ | +8 | 1 reply | |
| 6/6 | selftests/vfio: Enable VFIO selftests on ppc64 and ppc64letools/ | +1 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH 0/6] selftests/vfio: Add sPAPR TCE v2 coverage
This RFC adds PowerPC sPAPR TCE v2 support to VFIO selftests.
The series adds a selftest IOMMU mode for the legacy VFIO container backend, adds helpers for default and dynamic DMA windows, and exercises the sPAPR DDW path through the DMA mapping tests.
sPAPR TCE v2 remains a legacy VFIO container backend. This series does not add iommufd or VFIO cdev support for sPAPR.
The main points are
1. add VFIO_SELFTESTS_IOMMU_MODE for selecting a backend
2. add vfio_spapr_tce_v2_iommu as the PowerPC VFIO backend
3. preserve the platform default DMA window
4. create and tear down only selftest-created DDWs
5. prepare the DMA window before IOVA allocation
6. exercise DDW creation for hugepage DMA mappings
7. accept sPAPR-specific errno for invalid DMA ranges
Example:
VFIO_SELFTESTS_IOMMU_MODE=vfio_spapr_tce_v2_iommu
./vfio_dma_mapping_test <BDF>
Observed coverage includes anonymous mappings through the default window and 2MB hugetlb mappings through a DDW. 1GB hugetlb mappings may skip when the platform rejects the requested DDW characteristics.
Feedback is requested from the VFIO and PowerPC communities on:
1. whether the sPAPR TCE v2 helpers should remain in the common VFIO selftest library or move into a sPAPR-specific test helper?
2. whether DDW setup through hugepage mappings is the right initial coverage?
3. whether the sPAPR-specific overflow errno expectation should be accepted, skipped, or hidden behind a backend helper?
4. whether PowerPC should generate only the sPAPR TCE v2 fixture variants, or keep the generic IOMMU-mode matrix and skip unsupported modes.
TODO: vfio_spapr_tce_v1_iommu yet to be covered.
Narayana Murty N (6):
selftests/vfio: allow selecting IOMMU backend from environment selftests/vfio: add sPAPR TCE v2 IOMMU mode selftests/vfio: add sPAPR TCE v2 DMA window helpers selftests/vfio: Exercise sPAPR DDW path for hugepage DMA mappings selftests/vfio: Accept sPAPR errno for DMA range overflow selftests/vfio: Enable VFIO selftests on ppc64 and ppc64le
.../selftests/vfio/lib/include/libvfio.h | 9 + .../vfio/lib/include/libvfio/iommu.h | 26 ++ tools/testing/selftests/vfio/lib/iommu.c | 280 +++++++++++++++++- tools/testing/selftests/vfio/lib/libvfio.c | 37 +++ .../selftests/vfio/vfio_dma_mapping_test.c | 30 ++ .../selftests/vfio/vfio_pci_device_test.c | 4 +- tools/testing/selftests/vfio/Makefile | 2 +- 7 files changed, 382 insertions(+), 6 deletions(-)
Signature · 1 line
2.51.1