| 1 |
What: /sys/bus/pci/drivers/uio_pci_sva/<pci_dev>/pasid |
| 2 |
Date: September 2025 |
| 3 |
Contact: Yaxing Guo <[email protected]> |
| 4 |
Description: |
| 5 |
Process Address Space ID (PASID) assigned by IOMMU driver to |
| 6 |
the device for use with Shared Virtual Addressing (SVA). |
| 7 |
|
| 8 |
This read-only attribute exposes the PASID (A 20-bit identifier |
| 9 |
used in PCIe Address Translation Services and iommu table walks) |
| 10 |
allocated by the IOMMU driver during sva device binding. |
| 11 |
|
| 12 |
User-space UIO applications must read this attribute to obtain |
| 13 |
the PASID and program it into the device's configuration registers. |
| 14 |
This enables the device to perform DMA using user-space virtual |
| 15 |
address, with address translation handled by IOMMU. |
| 16 |
|
| 17 |
UIO User-space applications must: |
| 18 |
- Opening device and Mapping the device's register space via /dev/uioX |
| 19 |
(This triggers the IOMMU driver to allocate the PASID) |
| 20 |
- Reading the PASID from sysfs |
| 21 |
- Writing the PASID to a device-specific register (with example offset) |
| 22 |
The code may be like: |
| 23 |
|
| 24 |
map = mmap(..., "/dev/uio0", ...); |
| 25 |
|
| 26 |
f = fopen("/sys/.../pasid", "r"); |
| 27 |
fscanf(f, "%d", &pasid); |
| 28 |
|
| 29 |
map[REG_PASID_OFFSET] = pasid; |