As processing resources have increased, demands to run multiple software programs and operating systems on a single microprocessor have also increased. To meet these demands virtual environments have been developed to allocate a single computer system's resources to various software application and operating systems. Typically, in a virtual environment, a virtual machine monitor (VMM) program interfaces with one or more software programs, such as a virtual machine (VM) program, and hardware resources available in a computer system. A VM may include guest software, such as an operating system (OS) or other software applications. Usually, to allow multiple VMs to run on a single processor the state information and control information for the VMM and each VM program is stored in memory.
One technique of virtualization ensures security between multiple VMs running on a single platform by assigning each VM an isolated portion of memory, which is also referred to as a domain or container. An illustration of this type of virtualization is shown in FIG. 1a. Virtual machine monitor (VMM) 100 interfaces with VM 110 and VM 115, also referred to as guest software, as well as underlying physical hardware 105. As explained above, VM 110 is assigned to domain 125 in and VM 115 is assigned to domain 130 in system memory 120. VMM 100 may also be assigned a domain within system memory 120. In one implementation, accesses from I/O devices 145, 150, 155, and 160 are trapped by VMM 100 to ensure unauthorized accesses by the I/O devices are not made. However, this requires all accesses by I/O devices to be trapped by the VMM, emulated, and the submitted to the underlying physical device hardware 105, which introduces potential delays.
In another implementation, I/O devices 145-160 are assigned or associated with domains or portions of memory by direct memory access (DMA) remapping engine 140, as illustrated in FIG. 1a. DMA remapping engine may be present in chipset 135, which is often distributed among multiple integrated circuits and controller hubs. DMA remapping engine 140 is capable of translating between guest physical addresses, the logical view of an address space from the guest software or device's perspective, and host physical addresses, the actual address space of underlying hardware 105. The term guest physical address is commonly used in an environment utilizing virtualization. However, it is apparent that the term guest physical address is a form of a device virtual address (DVA), where the DVA space is the device's or guest software's view of a physical address space.
I/O device 145 and 150 are mapped/assigned to domain 125, I/O device 155 is assigned to domain 130, and I/O device 160 is assigned to a shared portion of system memory 120. Device drivers 165, 170, 175, and 180 corresponding to I/O devices 145, 150, 155, and 160, respectively, are present in domains assigned to each of the I/O devices. Therefore, each I/O device may potentially access system memory 120 directly without emulation by the VMM 100. DMA remapping is discussed in more detail in co-pending application with Ser. No. 10/956,198 entitled, “Address Translation for Input/Output Devices using Hierarchical Translation Tables.”
A typical hierarchal structure of I/O devices 145-160 are shown in FIG. 1b. I/O device 155 and bridge, also referred to as a switch, 185 is locally coupled to chipset 135. I/O device 160 and bridge 190 is locally coupled to bridge 185. Locally coupled to bridge 190 is I/O devices 145 and 150. As noted above, device 145 and device 150 are also assigned to the same domain, domain 125. However, when a memory request or access meant for I/O device 150 is initiated by I/O device 145, the access is typically blindly forwarded upstream towards DMA engine 140. DMA engine 140 translates the address. If the translated address is a peer-to-peer request, as in this example, the access is sent back downstream to the appropriate destination, which is I/O device 150.
Therefore, accesses among peer I/O devices, which may be coupled locally to the same bridge or coupled in the hierarchal structure, are sent all the way upstream and either remapped or trapped by the VMM limiting the potential performance of peer-to-peer accesses.