Separate the three address spaces
Software uses CPU virtual addresses, physical addresses describe memory locations, and devices use DMA addresses or IOVAs. Their numeric values can match on one platform and differ completely on another.
01
Who uses each address space
Applications and drivers normally access memory through CPU virtual addresses, which processor page tables translate to system physical addresses. A device uses the address returned by the platform DMA subsystem.
Without another translation stage, a DMA address may happen to resemble a physical address. An IOMMU, bus window, or device addressing limit breaks that assumption, so portable driver logic must never rely on accidental equality.
02
How an IOVA connects a device to memory
A driver supplies a buffer and transfer direction to the operating system's DMA interface. The DMA subsystem creates an accessible mapping and returns the address that the device may use. An IOMMU can translate that IOVA to one or more memory pages while checking permissions.
A mapping should cover only the range and lifetime needed by the operation. Releasing it after completion prevents a stale device address from remaining usable beyond its intended lifetime.
03
Why scatter/gather exists
A logically continuous packet or file buffer can occupy multiple non-contiguous physical pages. A scatter/gather list describes those transferable segments without requiring an extra copy into one physically contiguous area.
Windows map registers and the Linux DMA API both place this translation behind a platform DMA layer. Drivers consume the returned entries and lengths instead of treating an ordinary CPU pointer as a device address.
04
Direction, ownership, and cache coherency
A DMA mapping also carries transfer direction and buffer-ownership rules. If the CPU and device modify a buffer at the wrong time, or platform cache-coherency requirements are ignored, the result can be stale data, partial updates, or corruption.
A correct design performs the required synchronization before handing work to hardware, returns ownership only after completion, and preserves auditable cancellation and timeout paths.
05
What to inspect in a driver review
Confirm that every device address comes from a supported DMA API, map and unmap operations are paired, scatter/gather lengths respect hardware limits, and reset or recovery paths never reuse stale descriptors.
Record the operating system, IOMMU state, driver, device firmware, and hardware revision. One successful transfer validates one path, not every boundary condition.
- Never submit an ordinary pointer or an unmapped physical address as a device address
- Never release or reuse memory while the device still owns it
- Reclaim resources after mapping failure, cancellation, timeout, and reset
FAQ
Frequently asked questions
01Must an IOVA differ from a physical address?
No. The values can match on some platforms, but a driver must still treat the DMA address as a separate platform-provided value.
02Can an application pointer be placed directly in a DMA descriptor?
No such assumption is valid. A process pointer requires operating-system and driver pinning, authorization, and DMA mapping before device use.
03Does scatter/gather bypass the IOMMU?
No. It describes multiple transferable segments; each device-visible address remains subject to platform mapping and permissions.
04Can a DMA address be reused forever after one mapping?
Only a deliberately created long-lived coherent mapping has that lifetime. A streaming address must not be used after it is unmapped.
SOURCES
