IOMMU
From Wikipedia, the free encyclopedia
The IOMMU or input/output memory management unit is a computer memory management unit (MMU) that connects a DMA-capable I/O bus to the primary storage memory. Like the CPU memory management unit, an IOMMU takes care of mapping virtual addresses (also called device addresses or I/O addresses) to physical addresses and some units guarantee memory protection from misbehaving devices.
An example IOMMU is the Graphics Address Remapping Table (GART) used by AGP and PCI Express graphics cards.
AMD has published a specification for IOMMU technology in the HyperTransport architecture[1]. Intel has published a specification for IOMMU technology as Virtualization Technology for Directed I/O, abbreviated VT-d.[2]
Contents |
[edit] Advantages
The advantages of having an IOMMU, compared to direct physical addressing of the memory, include:
- Large regions of memory can be allocated without the need to be contiguous in physical memory — the IOMMU will take care of mapping contiguous virtual addresses to fragmented physical addresses. Thus, the use of vectored I/O (scatter-gather lists) can sometimes be avoided.
- Memory protection from malicious or misbehaving devices – a device cannot read or write to memory that hasn't been explicitly allocated (mapped) for it.
- For devices that do not support memory addresses long enough to address the entire physical memory, the device can still address the entire memory through the IOMMU. This avoids overhead associated with buffer copies to and from the memory space the peripheral can address.
- Virtualized guest operating systems can safely be granted direct access to hardware.
All these advantages are also available when communicating with devices through I/O ports, although with a significant CPU overhead when moving large volumes of data (see direct memory access).
In general, the IOMMU provides isolation (memory protection) and address translation. Some architectures allow for interrupt remapping that is similar to address translation.
[edit] IOMMU in relation to virtualization
When an operating system is running in a virtual machine, including systems that use paravirtualization, such as the Xen, it does not usually know the physical addresses of memory that it accesses. This makes providing direct access to the computer hardware difficult, because if the OS tried to instruct the hardware to perform a direct memory access, it would likely corrupt the memory, as the hardware does not know about the mapping between the virtual real addresses used by the virtualized guest system. The corruption is avoided because the hypervisor or OS intervenes in the I/O operation to apply the translations; unfortunately, this injects delays and overhead in the I/O operation.
An IOMMU can solve this problem by re-mapping the addresses accessed by the hardware according to the same (or a compatible) translation table used by the virtual machine guest[3].
[edit] See also
[edit] References
- Bottomley, James (2004-05-01). "Using DMA". Linux Journal.
- ^ AMD I/O Virtualization Technology (IOMMU) Specification Revision 1.0. Retrieved on 2006-02-01.
- ^ Mainstreaming Server Virtualization: The Intel Approach. Retrieved on 2006-03-01.
- ^ Xen FAQ: In DomU, how can I use 3D graphics. Retrieved on 2006-12-12.