Skip to main content

Module iommufd

Module iommufd 

Source
Expand description

Bindings for the Linux iommufd subsystem (/dev/iommu).

Provides safe wrappers around iommufd ioctls for:

  • IOAS allocation and DMA mapping (IOMMU_IOAS_ALLOC, IOMMU_IOAS_MAP, IOMMU_IOAS_MAP_FILE, IOMMU_IOAS_UNMAP)
  • Hardware page table management (IOMMU_HWPT_ALLOC, IOMMU_HWPT_INVALIDATE)
  • Hardware info query (IOMMU_GET_HW_INFO)
  • Virtual IOMMU objects (IOMMU_VIOMMU_ALLOC, IOMMU_VDEVICE_ALLOC, IOMMU_VEVENTQ_ALLOC)

The IOAS path supports identity DMA mapping (Phase 4). The HWPT/vIOMMU path supports nested stage 1 translation for VFIO passthrough (Phase 5).

Structs§

HwptInvalidateError
Error from IommufdCtx::hwpt_invalidate, pairing the underlying ioctl errno with the kernel’s reported handled-entry count.
IommuHwInfoArmSmmuv3
ARM SMMUv3 hardware information returned by IOMMU_GET_HW_INFO.
IommuHwptArmSmmuv3
ARM SMMUv3 nested HWPT data: the first two double words of the STE.
IommuVeventArmSmmuv3
ARM SMMUv3 virtual event record (256-bit, little-endian).
IommufdCtx
An open iommufd file descriptor (/dev/iommu).
IommufdVeventHeader
Header for each event in a vEVENTQ fd read.

Enums§

ViommuAlloc
Outcome of IommufdCtx::viommu_alloc.

Constants§

IOMMU_HWPT_ALLOC_NEST_PARENT
Flags for IOMMU_HWPT_ALLOC.
IOMMU_HWPT_DATA_ARM_SMMUV3
HWPT data type: ARM SMMUv3 (nested STE DW0-1).
IOMMU_HWPT_DATA_NONE
HWPT data type: no type-specific data.
IOMMU_HW_INFO_TYPE_ARM_SMMUV3
HW info type: ARM SMMUv3.
IOMMU_IOAS_MAP_FIXED_IOVA
Flags for IOMMU_IOAS_MAP.
IOMMU_IOAS_MAP_READABLE
IOMMU_IOAS_MAP_WRITEABLE
IOMMU_VEVENTQ_FLAG_LOST_EVENTS
IommufdVeventHeader::flags: the queue lost one or more events before this one. No event data follows a header carrying this flag.
IOMMU_VEVENTQ_TYPE_ARM_SMMUV3
vEVENTQ type: ARM SMMUv3.
IOMMU_VIOMMU_INVALIDATE_DATA_ARM_SMMUV3
Invalidation data type for ARM SMMUv3 (via vIOMMU).
IOMMU_VIOMMU_TYPE_ARM_SMMUV3
vIOMMU type: ARM SMMUv3.