On 11/26/25 7:45 AM, Tao Tang wrote:
Add a minimal PCI test device designed to exercise IOMMU translation
(such as ARM SMMUv3) without requiring guest firmware or OS. The device
provides MMIO registers to configure and trigger DMA operations with
controllable attributes (security state, address space), enabling
deterministic IOMMU testing.

Key features:
- Bare-metal IOMMU testing via simple MMIO interface
- Configurable DMA attributes for security states and address spaces
- Write-then-read verification pattern with automatic result checking

The device performs a deterministic DMA test pattern: write a known
value (0x88888888) to a configured IOVA, read it back, and verify data
integrity. Results are reported through a dedicated result register,
eliminating the need for complex interrupt handling or driver
infrastructure in tests.

This is purely a test device and not intended for production use or
machine realism. It complements existing test infrastructure like
pci-testdev but focuses specifically on IOMMU translation path
validation.

Signed-off-by: Tao Tang <[email protected]>
---
  docs/specs/index.rst            |   1 +
  docs/specs/iommu-testdev.rst    | 109 +++++++++++++
  hw/misc/Kconfig                 |   5 +
  hw/misc/iommu-testdev.c         | 278 ++++++++++++++++++++++++++++++++
  hw/misc/meson.build             |   1 +
  hw/misc/trace-events            |  10 ++
  include/hw/misc/iommu-testdev.h |  70 ++++++++
  7 files changed, 474 insertions(+)
  create mode 100644 docs/specs/iommu-testdev.rst
  create mode 100644 hw/misc/iommu-testdev.c
  create mode 100644 include/hw/misc/iommu-testdev.h
Overall, the test device looks sane and has a clear interface, that can be used for several iommu implementations, beyond Arm smmu.

Reviewed-by: Pierrick Bouvier <[email protected]>

Reply via email to