# US 2021/0064525 A1 · Hardware-based virtualization of input/output (i/o) memory management unit

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0064525 A1
- Document ID: US20210064525A1
- Status: Published application
- Kind: A1
- Application number: 16/958,479
- Filed: 2018-01-02
- Published: 2021-03-04
- Earliest claimed: 2018-01-02
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Kun Tian; Rajesh Sankaran; Sanjay Kumar; Ashok Raj
- Web page: https://patentgrep.com/patent/US20210064525A1

## CPC

- G06F 12/063: {for I/O modules, e.g. memory mapped I/O (I/O protocol G06F13/42)}
- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 12/0891: using clearing, invalidating or resetting means
- G06F 12/1036: for multiple virtual address spaces, e.g. segmentation (G06F12/1045 takes precedence)
- G06F 12/1081: for peripheral access to main memory, e.g. direct memory access [DMA]
- G06F 12/109: for multiple virtual address spaces, e.g. segmentation (G06F12/1036 takes precedence)
- G06F 2009/45583: {Memory management, e.g. access or allocation}
- G06F 2212/1024: Latency reduction
- G06F 2212/151: Emulated environment, e.g. virtual machine
- G06F 2212/651: Multi-level translation tables
- G06F 2212/657: Virtual address space management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A processor includes a hardware input/output (I/O) memory management unit (IOMMU) and a core, which executes an instruction to intercept a payload from a virtual machine (VM). The payload contains a guest bus device function (BDF) identifier, a guest address space identifier (ASID), and a guest address range. The core accesses, within a virtual machine control structure stored in memory, pointers to a first set of translation tables and a second set of translation tables. The core traverses the first set of translation tables to translate the guest BDF identifier to a host BDF identifier and traverses the second set of translation tables to translate the guest ASID to a host ASID. The core stores the host BDF identifier and the host ASID in the payload and submits, to the hardware IOMMU, an administrative command containing the payload to perform invalidation of the guest address range.

## Claims

### Claim 1

A processor comprising:
a hardware input/output (I/O) memory management unit (IOMMU); and
a core coupled to the hardware IOMMU, wherein the core is to execute a first instruction to:
intercept a descriptor payload from a virtual machine (VM), the descriptor payload containing a guest bus device function (BDF) identifier, a guest address space identifier (ASID), and a guest address range to be invalidated;
access, within a virtual machine control structure (VMCS) stored in memory, a first pointer to a first set of translation tables and a second pointer to a second set of translation tables;
traverse the first set of translation tables to translate the guest BDF identifier to a host BDF identifier;
traverse the second set of translation tables to translate the guest ASID to a host ASID;
insert the host BDF identifier and the host ASID in the descriptor payload; and
submit, to the hardware IOMMU, an administrative command containing the descriptor payload to perform invalidation of the guest address range.

### Claim 2 (depends on 1)

The processor of claim 1, wherein the hardware IOMMU is to use the host BDF identifier and the host ASID within the descriptor payload of the administrative command to perform an invalidation operation with relation to the guest address range, wherein the invalidation operation is at least one of an I/O translation lookaside buffer (IOTLB) invalidation, a device TLB invalidation, or an ASID cache invalidation.

### Claim 3 (depends on 2)

The processor of claim 2, wherein the core is to execute the first instruction to further communicate, to the VM, successful invalidation in response to completion of the invalidation operation by the hardware IOMMU.

### Claim 4 (depends on 1)

The processor of claim 1, wherein the first set of tables comprises a bus table and a device-function table, wherein the bus table is indexed by a guest bus identifier, and wherein the device-function table is indexed by a guest device-function identifier.

### Claim 5 (depends on 1)

The processor of claim 1, wherein the core is further to execute a guest IOMMU driver within the VM to:
call the first instruction;
populate the descriptor payload with the guest BDF identifier, the guest ASID, and the guest address range; and
transmit the descriptor payload as a work submission to a shared work queue (SWQ) of the hardware IOMMU.

### Claim 6 (depends on 5)

The processor of claim 5, further comprising a memory-mapped I/O (MMIO) register, wherein the guest IOMMU driver is further to access, within the MMIO register, a MMIO register address to which to submit the descriptor payload to the SWQ.

### Claim 7 (depends on 1)

The processor of claim 1, wherein the first set of translation tables is stored in one of the VMCS or an on-chip memory.

### Claim 8

A method comprising:
intercepting, by a processor from a virtual machine (VM) running on the processor, a descriptor payload with a guest bus device function (BDF) identifier, a guest address space identifier (ASID), and a guest address range to be invalidated;
accessing, within a virtual machine control structure (VMCS) stored in memory for the VM, a first pointer to a first set of translation tables and a second pointer to a second set of translation tables;
traversing, by the processor, the first set of translation tables to translate the guest BDF identifier to a host BDF identifier;
traversing, by the processor, the second set of translation tables to translate the guest ASID to a host ASID;
inserting, within the descriptor payload, the host BDF identifier and the host ASID; and
submitting, by the processor, to a hardware IOMMU of the processor, an administrative command containing the descriptor payload, to perform invalidation of the guest address range.

### Claim 9 (depends on 8)

The method of claim 8, further comprising performing, by the hardware IOMMU, an invalidation operation in relation to the guest address range using the host BDF identifier and the host ASID within the descriptor payload of the administrative command, wherein the invalidation operation is at least one of an I/O translation lookaside buffer (IOTLB) invalidation, a device TLB invalidation, or an ASID cache invalidation.

### Claim 10 (depends on 9)

The method of claim 9, further comprising communicating, by the processor to the VM, successful invalidation in response to completion of the invalidation operation by the hardware IOMMU, wherein the communicating comprises setting a status bit within a completion record accessible to the VM.

### Claim 11 (depends on 8)

The method of claim 8, wherein the first set of tables comprises a bus table and a device-function table, the method further comprising indexing the bus table by the guest bus identifier, and indexing the device-function table by a guest device-function identifier.

### Claim 12 (depends on 8)

The method of claim 8, further comprising:
calling, by a guest IOMMU driver of the VM, an instruction for execution by the processor;
populating, by the guest IOMMU driver, the descriptor payload with the guest BDF identifier, the guest ASID, and the guest address range; and
transmitting, by the guest IOMMU driver, the descriptor payload to a shared work queue (SWQ) of the hardware IOMMU.

### Claim 13 (depends on 12)

The method of claim 12, further comprising:
retrieving, from a memory-mapped I/O (MMIO) register, a MMIO register address to which to submit the descriptor payload to the SWQ; and
submitting the descriptor payload to the MMIO register address.

### Claim 14

A system comprising:
a hardware input/output (I/O) memory management unit (IOMMU);
multiple cores, coupled to the hardware IOMMU, the multiple cores to execute a plurality of virtual machines; and
wherein a core, of the multiple cores, is to execute a first instruction to:
intercept a descriptor payload from a virtual machine (VM) of the plurality of virtual machines, the descriptor payload containing a guest bus device function (BDF) identifier, a guest address space identifier (ASID), and a guest address range to be invalidated;
access, within a virtual machine control structure (VMCS) stored in memory, a first pointer to a first set of translation tables and a second pointer to a second set of translation tables;
traverse the first set of translation tables to translate the guest BDF identifier to a host BDF identifier;
traverse the second set of translation tables to translate the guest ASID to a host ASID;
insert the host BDF identifier and the host ASID in the descriptor payload; and
submit, to the hardware IOMMU, an administrative command containing the descriptor payload to perform invalidation of the guest address range.

### Claim 15 (depends on 14)

The system of claim 14, wherein the hardware IOMMU is to use the host BDF identifier and the host ASID within the descriptor payload of the administrative command to perform an invalidation operation with relation to the guest address range, wherein the invalidation operation is at least one of an I/O translation lookaside buffer (IOTLB) invalidation, a device TLB invalidation, or an ASID cache invalidation.

### Claim 16 (depends on 15)

The system of claim 15, wherein the core is to execute the first instruction to further communicate, to the VM, successful invalidation in response to completion of the invalidation operation by the hardware IOMMU, wherein to communicate comprises to set a status bit within a completion record accessible to the guest IOMMU driver.

### Claim 17 (depends on 14)

The system of claim 14, wherein the first set of tables comprises a bus table and a device-function table, wherein the bus table is indexed by a guest bus identifier, and wherein the device-function table is indexed by a guest device-function identifier.

### Claim 18 (depends on 14)

The system of claim 14, wherein the core is further to execute a guest IOMMU driver within the VM to:
call the first instruction;
populate the descriptor payload with the guest BDF identifier, the guest ASID, and the guest address range; and
transmit the descriptor payload to a shared work queue (SWQ) of the hardware IOMMU.

### Claim 19 (depends on 18)

The system of claim 18, further comprising a memory-mapped I/O (MMIO) register, wherein the guest IOMMU driver is further to access, within the MMIO register, a MMIO register address to which to submit the descriptor payload to the SWQ.

### Claim 20 (depends on 14)

The system of claim 14, wherein the first set of translation tables is stored in one of the VMCS, the memory, or an on-chip memory.
