smmu_* data structures

Updated: May 06, 2022

Data structures used by the SMMUMAN client API

The following data structures are defined in the smmu.h header file for the SMMUMAN client API.

smmu_devid

union smmu_devid {
    unsigned		type;
    struct smmu_devid_pci	pci;
    struct smmu_devid_mmio	mmio;
    _Uint64t		__spacer[4];
};

The smmu_devid data structure is used to identify devices. Its members include:

type
The type of device; can be one of the values defined by the smmu_devid_type enumerated values.
pci
If type is set to SDT_PCI, the smmu_devid_pci data structure specifying the PCI device information.
mmio
If type is set to SDT_MMIO, the smmu_devid_mmio data structure specifying the MMIO device information.
__spacer
For internal use.

smmu_devid_mmio

struct smmu_devid_mmio {
	unsigned	type;
	unsigned	length;
	_Uint64t	phys;
};

The smmu_devid_mmio data structure is used to identify MMIO devices. Its members include:

type
The type of device; should be SDT_MMIO
length
The length of the memory region the device requires for its registers.
phys
The physical address of the MMIO device's register memory region.

smmu_devid_pci

struct smmu_devid_pci {
	unsigned	type;
	unsigned	bus;
	unsigned	dev;
	unsigned	func;
};

The smmu_devid_pci is used to identify PCI devices. Its members include:

type
The type of device; should be SDT_PCI
bus
The PCI device's bus number.
dev
The PCI device's device number.
func
The PCI device's function number.

If you set bus, dev, or func to SMMU_PCI_FIELD_ANY, any value is allowed.

smmu_map_entry

struct smmu_map_entry {
	union {
		void		*virt;
		_Uint32t	virt32;
		_Uint64t	virt64;
		_Uint64t	phys;
	};
	_Uint64t	len;
};

The smmu_map_entry data structure is used by the smmu_device_report_reserved() and smmu_mapping_add() functions; it includes the following members:

virt
For future use.
virt32
For future use.
virt64
For future use.
phys
The address of the DMA device in physical memory.
len
The length (in bytes) of the DMA device memory region.

For more information about guest-physical and host-physical addresses and memory, see the “QNX Virtual Environments” chapter in the QNX Hypervisor User's Manual.

smmu_status

struct smmu_status {
	_Uint64t		hw_specific;
	_Uint64t		fault_addr;
	union smmu_devid	devid;
	unsigned		flags;
};

The smmu_status data structure is used by the smmu_xfer_status() function; it carries information about DMA device transgressions, and includes the following members:

hw_specific
Hardware-specific information.
fault_addr
The physical address in memory the DMA tried to access, triggering the fault.
devid
The ID of the misbehaving DMA device.
flags
A permissions flag indicating the reason for a failed request (see smmu_mapping_flags).
If the SSF_DROPPED_FAULTS bit is set, the smmuman service had to drop one or more transgression records before the client retrieved them.