Virtualizing an IOMMU

Information

  • Patent Application
  • 20070168641
  • Publication Number
    20070168641
  • Date Filed
    January 16, 2007
    17 years ago
  • Date Published
    July 19, 2007
    16 years ago
Abstract
In one embodiment, a system comprises one or more input/output (I/O) devices; an I/O memory management unit (IOMMU) coupled to receive memory requests sourced by the I/O devices and configured to provide address translation for the memory requests; and a virtual machine monitor (VMM) configured to manage one or more virtual machines on the system, wherein the VMM is configured to virtualize the IOMMU, providing one or more virtual IOMMUs for use by one or more virtual machines.
Description

BRIEF DESCRIPTION OF THE DRAWINGS

The following detailed description makes reference to the accompanying drawings, which are now briefly described.



FIG. 1 is a block diagram of a high level view of one embodiment of a computer system.



FIG. 2 is a block diagram of one embodiment of a set of I/O translation tables.



FIG. 3 is a block diagram of one embodiment of a device table entry for a device table shown in FIG. 2.



FIG. 4 is a block diagram of one embodiment of a communication mechanism between the IOMMU and software.



FIG. 5 is a block diagram of one embodiment of virtual machines and a virtual machine monitor (VMM).



FIG. 6 is a block diagram of one embodiment of virtualizing the IOMMU.



FIG. 7 is a flowchart illustrating operation of one embodiment of a VMM intercepting a PCI configuration space access.



FIG. 8 is a flowchart illustrating operation of one embodiment of a VMM intercepting a write to a control register in the IOMMU.



FIG. 9 is a block diagram of one embodiment of a portion of an IOMMU capability block.



FIG. 10 is a block diagram of one embodiment of a computer accessible medium.


Claims
  • 1. A system comprising: one or more input/output (I/O) devices;an I/O memory management unit (IOMMU) coupled to receive memory requests sourced by the I/O devices and configured to provide address translation for the memory requests; anda virtual machine monitor (VMM) configured to manage one or more virtual machines on the system, wherein the VMM is configured to virtualize the IOMMU, providing one or more virgital IOMMUs for use by one or more virtual machines.
  • 2. The system as recited in claim 1 wherein the VMM is configured to detect one or more updates to I/O translation tables within the virtual machine, the I/O translation tables storing translation data created within the virtual machine for use by the virtual IOMMU, and wherein the VMM is configured to generate corresponding translations in shadow I/O translation tables used by the IOMMU.
  • 3. The system as recited in claim 2 wherein a capabilities block defined for the IOMMU includes an indication of whether or not the IOMMU is configured to cache not-present translation table entries, and wherein the VMM is configured to intercept a read of the capabilities block from the virtual machine and is configured to respond to the read, and wherein the VMM is configured to place the indication, in the response data, in a state indicating that the IOMMU does cache not-present translation table entries.
  • 4. The system as recited in claim 3 wherein the invalidate commands are written to a command queue in the virtual machine memory.
  • 5. The system as recited in claim 4 wherein the virtual machine is configured to generate one or more write commands to write one or more control registers in the virtual IOMMU that control the virtual IOMMU access to the command queue, and wherein the VMM is configured to intercept the write commands.
  • 6. The system as recited in claim 5 wherein the VMM is configured to read the command queue in response to intercepting a write command, to determine the updates to the I/O translation tables.
  • 7. The system as recited in claim 6 wherein the VMM is configured to read the updated entries in the I/O translation tablees to determine shadow I/O translation table updates.
  • 8. The system as recited in claim 4 wherein the VMM is configured to transfer non-invalidate commands from the command queue in the virtual machine to a shadow command queue used by the IOMMU.
  • 9. The system as recited in claim 8 wherein the VMM is further configured to transfer the invalidate commands to the shadow command queue.
  • 10. The system as recited in claim 8 wherein the VMM is further configured to update the one or more control registers in the IOMMU that control the IOMMU access to the command queue.
  • 11. An input/output (I/O) memory management unit (IOMMU) comprising: control logic configured to implement address translation for I/O device-initiated memory requests; andmemory coupled to the control logic and configured to store translation data for performing the translations, the translation data corresponding to one or more I/O translation tables stored in a main memory system of a computer system including the IOMMU;wherein the control logic, in response to a read request for a capabilities block, is configured to return data defined in the capabilities block for the IOMMU, and wherein the capabilities block includes an indication of whether or not the IOMMU is configured to cache not-present translation table entries, and wherein the indication is useable to virtualize the IOMMU by changing, in a virtual machine monitor, the indication as returned by the control logic to a state indicating that the IOMMU does cache not-present translation table entries.
  • 12. The IOMMU as recited in claim 11 further comprising a plurality of control registers, wherein the control registers locate a command queue in memory, and wherein the control logic is configured to read commands from the command queue, and wherein writes to the control registers to update pointers in the command queue are interceptable by the virtual machine monitor.
  • 13. A method comprising: managing one or more virtual machines on a system that includes one or more input/output (I/O) devices and an I/O memory management unit (IOMMU) configured to provide address translation for memory requests issued by the I/O devices; andvirtualizing the IOMMU, providing one or more virtual IOMMUs for use by one or more virtual machines.
  • 14. The method as recited in claim 13 wherein the virtualizing comprises: detect one or more updates to I/O translation tables within the virtual machine, the I/O translation tables storing translation data created within the virtual machine for use by the virtual IOMMU; andgenerating corresponding translations in shadow I/O translation tables used by the IOMMU.
  • 15. The method as recited in claim 14 wherein a capabilities block defined for the IOMMU includes an indication of whether or not the IOMMU is configured to cache not-present translation table entries, and the virtualizing further comprising: intercepting a read of the capabilities block from the virtual machine; andresponding to the read with response data, and wherein the indication is placed in a state indicating that IOMMU does cache not-present translation table entries in the response data.
  • 16. The method as recited in claim 15 wherein the invalidate commands are written to a command queue in the virtual machine memory, and wherein the virtual machine is configured to generate one or more write commands to write one or more control registers in the virtual IOMMU that control the virtual IOMMU access to the command queue, and the method further comprising: intercepting the write commands; andreading the command queue to determine the updates to the I/O translation tables in response to the intercepting.
  • 17. The method as recited in claim 16 wherein the virtualizing further comprises transferring non-invalidate commands from the command queue in the virtual machine to a shadow command queue used by the IOMMU.
  • 18. The method as recited in claim 17 wherein the virtualizing further comprises transferring the invalidate commands to the shadow command queue.
  • 19. The method as recited in claim 18 wherein the virtualizing further comprises updating the one or more control registers in the IOMMU that control the IOMMU access to the command queue.
Provisional Applications (1)
Number Date Country
60759826 Jan 2006 US