IP Library Granted Patent US 9,424,199
Granted Patent B2
US 9,424,199 · App. 13/597,575 · Granted Aug 23, 2016

Virtual input/output memory management unit within a guest virtual machine

Inventors: Andrew G. Kegel (Redmond, WA); Mark D. Hummel (Franklin, MA)
Assignee: Advanced Micro Devices, Inc.
G06F12/1009G06F12/109G06F12/1081
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,424,199
App. No.
13/597,575
Granted
Aug 23, 2016
Kind
B2
Abstract

A virtual input/output memory management unit (IOMMU) is configured to provide a firewall around memory requests associated with an input/output (I/O) device. The virtual IOMMU uses data structures including a guest page table, a host page table and a general control register (i.e., GCR3) table. The guest page table is implemented in hardware to support the speed requirements of the virtual IOMMU. The GCR3 table is indexed using a virtual DeviceID parameter stored in a device table.

Claims (35)

1. A method, comprising:

receiving, by a virtual I/O memory management unit (IOMMU) within a virtual machine (VM), a memory request by an input/output (I/O) device, wherein the memory request includes a guest virtual address and the I/O device is directly assigned to the VM;

translating, by the virtual IOMMU, the guest virtual address to a guest physical address using a guest page table, the guest page table being maintained by a guest OS (operating system) and accessed based on an indexed entry associated with a virtual I/O device identification in a device table in the virtual IOMMU, wherein the guest page table is implemented in hardware form and the device table is virtualized using software; and

translating, by the virtual IOMMU, the guest physical address to a system physical address using a host page table, the host page table being maintained by a hypervisor;

validating, by the virtual IOMMU, the guest virtual address using the guest page table to determine whether the guest virtual address is within a valid range of addresses authorized by the guest OS for the I/O device; and

if the guest virtual address is not within a valid range of addresses authorized by the guest OS for the I/O device, precluding the memory request from accessing the guest virtual address.

2. The method of claim 1 , further comprising:

identifying an entry in a general control register (GCR3) table indexed by a virtual DeviceID associated with the I/O device, wherein the virtual DeviceID is stored in a device table in the virtual IOMMU.

3. The method of claim 1 , further comprising:

virtualizing at least one of a control register, a configuration register, an error reporting register, a log, and an interrupt remapping table associated with the virtual IOMMU using software.

4. The method of claim 1 , further comprising:

using an identical format for the host page table and the guest page table; and

using a control bit in the device table to distinguish usage of the guest page table as a host table in virtualization mode.

5. The method of claim 1 , further comprising:

managing a virtual machine by the hypervisor, the virtual machine configured to support operation of the guest OS.

6. An apparatus, comprising:

a virtual I/O memory management unit (IOMMU) within a virtual machine (VM) configured to receive a memory request transmitted by an input/output (I/O) device, wherein the memory request includes a guest virtual address and the I/O device is directly assigned to the VM, and wherein the virtual IOMMU comprises data structures including:

a guest page table configured to translate the guest virtual address to a guest physical address, the guest page table being maintained by a guest OS (operating system) and accessed based on an indexed entry associated with a virtual I/O device identification in a device table in the virtual IOMMU, wherein the guest page table is implemented in hardware form and the device table is virtualized using software; and

a host page table configured to translate the guest physical address to system physical address, the host page table being maintained by a hypervisor;

wherein the virtual IOMMU is configured to validate the guest virtual address using the guest page table to determine whether the guest virtual address is within a valid range of addresses authorized by the guest OS for the I/O device;

wherein the guest OS precludes execution of the memory request when the guest virtual address is not within a valid range of addresses authorized by the guest OS for the I/O device.

7. The apparatus of claim 6 , further comprising:

a GCR3 table configured to be indexed by a virtual DeviceID associated with the I/O device, wherein the virtual DeviceID is stored in a device table in the virtual IOMMU.

8. The apparatus of claim 6 , wherein at least one of a control register, a configuration register, an error reporting register, a log, and an interrupt remapping table associated with the virtual IOMMU are virtualized using software.

9. The apparatus of claim 6 , wherein:

the host page table and the guest page table use an identical format; and

the device table uses a control bit to distinguish usage of the guest page table as a host table in virtualization mode.

10. The apparatus of claim 6 , further comprising:

a virtual machine configured to support operation of the guest OS, wherein the virtual machines is managed by the hypervisor.

11. A computer-readable storage device having instructions stored thereon, execution of which, by a computing device, causes the computing device to emulate an apparatus comprising:

a virtual I/O memory management unit (IOMMU) within a virtual machine (VM) configured to receive a memory request transmitted by an input/output (I/O) device, wherein the memory request includes a guest virtual address and the I/O device is directly assigned to the VM, and wherein the virtual IOMMU comprises data structures including:

a guest page table configured to translate the guest virtual address to a guest physical address, the guest page table being maintained by a guest OS (operating system) and accessed based on an indexed entry associated with a virtual I/O device identification in a device table in the virtual IOMMU, wherein the guest page table is implemented in hardware form and the device table is virtualized using software; and

a host page table configured to translate the guest physical address to system physical address, the host page table being maintained by a hypervisor;

wherein the virtual IOMMU is configured to validate the guest virtual address using the guest page table to determine whether the guest virtual address is within a valid range of addresses authorized by the guest OS for the I/O device;

wherein the guest OS precludes execution of the memory request when the guest virtual address is not within a valid range of addresses authorized by the guest OS for the I/O device.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 29, 2012
From: KEGEL, ANDREW G.; HUMMEL, MARK D.
To: ADVANCED MICRO DEVICES, INC.
Reel/Frame 028868/0868 →
Continuity (1)
Related Publication 20140068137A1 · Mar 6, 2014