Friday, July 3, 2015

IOMMU - I/O Memory Management Unit

IOMMU stands for I/O memory management Unit.  It connects a DMA capable I/O  bus to the system memory. It provides memory protection and address translations for I/O devices. This address translation is implemented in paging based. Some architectures allow interrupt remapping in a manner generally similar to address translation.



IOMMU is controlled by system rather than device. As control is with OS , faulty device can not corrupt memory and also provide memory protection.

IOMMU is transparent to devices and their drivers.

IOMMU is used to enhance virtualized I/O performance.

Large regions of memory can be allocated without the need to be contiguous in physical memory. IOMMU will take care of mapping contiguous virtual addresses to fragmented physical addresses.

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 ( bounce buffer) to and from the memory space the peripheral can address.

Virtualized guest operating systems can safely be granted direct access to hardware. (Device pass-through).

Guest Virtual Address -> Guest Physical Address -> System Physical Address.
Guest Physical address is same as System Virtual address.

Device pass-through : This is the ability to directly assign a physical device to a particular guest OS. The required address space translation is handled transparently. Ideally a device’ address space is the same as a guest’s physical address space; however, in the virtualized case this is hard to achieve without an IOMMU. IOMMU is designed in such a way to  remap Guest Virtual address to Device I/O address in guest operating system. It allows the Guest OS to direct access to Hardware to improve performance. If we do not use IOMMU , guest physical address needs to remap to host physical address using Host OS intervence but it will delay the process. So directly providing access to VM will improve the performance.

Remapping of interrupts: Usually sharing device interrupts among several guests is complicated to handle. IOMMU provides a basis to separate device interrupts that are already shared by different devices. It remaps a shared interrupt to an exclusive vector to ease up its delivery to a particular guest OS.

Disadvantages:
I/O page tables need some amount of physical memory.
I/O translation can not be avoided.






Note : i just try to put my understanding on Guest OS to Host OS interaction with IOMMU in my words. Thanks to google for all the information.

















No comments:

Post a Comment