How the IOMMU Isolates Device DMA From Kernel Memory
How an IOMMU translates and restricts device DMA on Linux 6.12, how IOMMU groups and domains work, and how to check the setup from sysfs and boot flags.

Without an IOMMU, a device that can do DMA can read and write any physical address its bus mastering allows, which on a typical machine is all of RAM. A buggy driver, a faulty device or a malicious one such as a hot-plugged Thunderbolt peripheral can then overwrite kernel memory or read secrets with no CPU involvement. The IOMMU is the hardware that closes that door: it sits between devices and memory and translates and checks every DMA address, the way the MMU does for the CPU. This post explains how that works on Linux 6.12, what IOMMU groups and domains are, how to inspect them, and what the performance and security trade-offs are. It underlies the DMA API and is the foundation for VFIO.
The kernel documentation is in the IOMMU section of the admin guide for the parameters and the IOMMU API for the in-kernel interface.
What the hardware does
An IOMMU is a unit in the memory path of the platform: Intel calls it VT-d, AMD calls it AMD-Vi, and Arm calls it the SMMU. Each DMA request from a device carries a requester ID, which is the device's bus, device and function numbers. The IOMMU looks up the requester ID in a table to find the translation structure for that device, then walks that structure to turn the address the device used, an IO virtual address (IOVA), into a physical address. If no mapping exists for the IOVA, or the mapping forbids the access (a write to a read-only mapping), the IOMMU blocks the request and records a fault.
The CPU's MMU does the same job for software, with page tables, and the IOMMU mirrors the idea with its own tables and its own TLB, called the IOTLB. The practical result is that a device sees a private address space containing only what the kernel mapped for it. Memory the kernel did not map is unreachable.
Domains and groups
The kernel models this with two terms.
An IOMMU domain is one address space: one set of translation tables. A device attached to a domain can reach exactly the IOVAs mapped in it. Several devices can share a domain, and a virtual machine's assigned devices usually share one.
An IOMMU group is the smallest set of devices that the hardware can isolate from each other. Devices end up in the same group when they cannot be told apart for isolation purposes, for example two functions behind a PCI bridge that does not support access control services (ACS), where one device's DMA can reach another through the bridge without passing the IOMMU. The group is the unit of ownership: you assign a whole group to a domain or a VM, never part of one.
Inspect them in sysfs:
ls /sys/kernel/iommu_groups/
ls /sys/kernel/iommu_groups/12/devices0 1 2 3 4 5 6 7 8 9 10 11 12 13
0000:02:00.0 0000:02:00.1Group 12 holds two functions of one card, such as a GPU and its audio function. Because they share a group, they cannot be given to different owners. The group of a given device is a link in its own directory:
readlink /sys/bus/pci/devices/0000:02:00.0/iommu_group../../../kernel/iommu_groups/12What the kernel maps
When a driver calls the DMA mapping functions, the IOMMU is in the path without the driver knowing. dma_map_single() allocates an IOVA range from the device's domain, installs page-table entries that point at the buffer's physical pages with the right permissions, and returns the IOVA as the dma_addr_t. The device is given that IOVA, and its DMA goes through the translation. dma_unmap_single() removes the entries and invalidates the IOTLB. This is why the DMA API insists on the unmap call: it is what revokes the device's access.
A coherent allocation is mapped the same way, for its whole lifetime. The mappings are exact: a device cannot reach the page after the buffer you gave it, even if its descriptor says to.
On a machine with the IOMMU in passthrough mode, the default domain is identity-mapped, so IOVAs equal physical addresses and translation is trivial. That is faster, and it does not isolate anything.
Choosing the mode
Three kernel command-line parameters decide the behavior at boot. On x86 the central one is iommu.passthrough, and the others select the translation behavior:
| Parameter | Effect |
|---|---|
intel_iommu=on or amd_iommu=on | Enable the IOMMU (default on recent kernels with the hardware present) |
iommu=pt | Passthrough for devices owned by the host, translation only for assigned devices |
iommu.strict=1 | Invalidate the IOTLB on every unmap |
iommu.strict=0 | Batch invalidations (lazy mode), which is faster |
Lazy mode defers the IOTLB flush after an unmap and batches several. There is then a short window in which the device still holds a stale translation to a page the kernel has freed and may have reused. For a trusted device that is an acceptable speed gain, and for an untrusted one, such as an external Thunderbolt device, the kernel forces strict mode regardless of the setting.
You can see what the kernel chose from the log:
sudo dmesg | grep -i -e DMAR -e iommu | head -n 4DMAR: IOMMU enabled
DMAR: Intel(R) Virtualization Technology for Directed I/O
iommu: Default domain type: Translated
iommu: DMA domain TLB invalidation policy: lazy modeDefault domain type: Translated means devices get a translating domain, Passthrough means identity mapping. The invalidation policy line tells you whether lazy mode is active.
What it does not protect
An IOMMU limits what a device can reach. It does not make a driver correct, and four limits matter.
It cannot protect memory the kernel has mapped for the device. A driver that maps a buffer containing a kernel pointer next to the data gives the device access to both. Mapping granularity is the page, so a device given a 100-byte buffer can read the rest of its 4 KiB page, and on a streaming mapping that page may belong to something else.
It does not stop peer-to-peer traffic between devices behind the same bridge without ACS. This is the reason for groups and for the practical advice to check ACS support before trusting isolation.
It does nothing for devices that bypass it. Interrupt remapping is a related feature, and without it a device can raise arbitrary interrupts. The kernel reports interrupt remapping separately in the log (DMAR-IR: Enabled IRQ remapping).
It costs time. Each map and unmap updates tables and flushes the IOTLB, so mapping-heavy workloads such as high-rate networking see overhead. The strict and lazy modes and the batching in the DMA API exist to trade that cost against exposure.
What a fault looks like
A device that touches an unmapped address causes a fault, which the IOMMU driver logs. On an Intel system:
DMAR: DRHD: handling fault status reg 3
DMAR: [DMA Read NO_PASID] Request device [02:00.0] fault addr 0x7f4a3000 [fault reason 0x06] PTE Read access is not setThe device identity, the faulting IOVA and the reason are all there. The common causes are a driver that unmapped a buffer before the device finished with it, a device programmed with a stale address after a reset, or a device writing past a descriptor length. The address is an IOVA, not a physical one, so you match it against the driver's own mapping records.


