# US 2015/0149997 A1 · Facilitating execution of mmio based instructions

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

- Number: US 2015/0149997 A1
- Document ID: US20150149997A1
- Status: Published application
- Kind: A1
- Application number: 14/089,105
- Filed: 2013-11-25
- Published: 2015-05-28
- Earliest claimed: 2013-11-25
- Assignees: Red Hat Israel, Ltd.
- Applicants: Red Hat Israel, Ltd.
- Inventors: Michael Tsirkin; Gleb Natapov
- Web page: https://patentgrep.com/patent/US20150149997A1

## CPC

- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 12/063: {for I/O modules, e.g. memory mapped I/O (I/O protocol G06F13/42)}
- G06F 9/455: Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F 9/45533: {Hypervisors; Virtual machine monitors}
- G06F 2009/45583: {Memory management, e.g. access or allocation}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A hypervisor of a host receives an indication of an exit from a guest to the hypervisor and a memory-mapped input output (MMIO) address that caused the exit to hypervisor. The hypervisor walks a page table of the guest to identify a guest address associated with the MMIO address that caused the exit to the hypervisor. The hypervisor decodes an instruction of the guest referenced by the guest address to determine a type of operation that the guest intended to execute and a location of MMIO information. The hypervisor records, in a page table entry for the MMIO address of a host page table, an association with the type of operation and the location of the MMIO information. The hypervisor executes the operation on behalf of the guest based on the type of the operation and the MMIO information.

## Claims

### Claim 1

A method, comprising:
receiving, by a hypervisor of a host, an indication of an exit from a guest to the hypervisor and a memory-mapped input output (MMIO) address that caused the exit to hypervisor;
walking, by the hypervisor, a page table of the guest to identify a guest address associated with the MMIO address that caused the exit to the hypervisor;
decoding, by the hypervisor, an instruction of the guest referenced by the guest address to determine a type of operation that the guest intended to execute and a location of MMIO information;
recording, by the hypervisor in a page table entry for the MMIO address of a host page table, an association with the type of operation and the location of the MMIO information; and
executing, by the hypervisor, the operation on behalf of the guest based on the type of the operation and the MMIO information.

### Claim 2 (depends on 1)

The method of claim 1, wherein said recording comprises:
associating an entry of an array with the type of operation and the location of the MMIO information and
storing the association in the page table entry for the MMIO address.

### Claim 3 (depends on 2)

The method of claim 2, wherein said recording further comprises adding the type of operation and the location of the MMIO information in the entry of the array.

### Claim 4 (depends on 3)

The method of claim 3, further comprising:
receiving, by the hypervisor, an indication of a subsequent exit from the guest to the hypervisor and the MMIO address that caused the exit to the hypervisor and
walking, by the hypervisor, the host page to locate the page table entry for the MMIO address.

### Claim 5 (depends on 4)

The method of claim 4, wherein when the hypervisor finds the association to the page table entry for the MMIO address:
locating, by the hypervisor, the association in an entry of the array;
obtaining, by the hypervisor, the type of operation and the location of the MMIO information from the entry of the array; and
executing, by the hypervisor, the operation on behalf of the guest based on the type of the operation and the MMIO information.

### Claim 6 (depends on 4)

The method of claim 4, wherein when the hypervisor does not find the association to the page table entry for the MMIO address:
walking, by the hypervisor, a page table of the guest to identify a guest address associated with the MMIO address that caused the exit to the hypervisor;
decoding, by the hypervisor, an instruction of the guest referenced by the guest address to determine a type of operation that the guest intended to execute and a location of MMIO information;
adding, by the hypervisor, an entry for the type of operation and the location of MMIO information to the MMIO array;
adding, by the hypervisor, the association to the entry added to the MMIO array to the page table entry for the MMIO address in the host page table; and
executing, by the hypervisor, the operation on behalf of the guest based on the type of the operation and the MMIO information.

### Claim 7 (depends on 2)

The method of claim 2, wherein said recording further comprises storing the type of operation and the location of the information in the page table entry for the MMIO address.

### Claim 8 (depends on 7)

The method of claim 7, further comprising:
receiving, by the hypervisor, an indication of a subsequent exit from the guest to the hypervisor and the MMIO address that caused the exit to the hypervisor and
walking, by the hypervisor, the host page table to locate the page table entry for the MMIO address.

### Claim 9 (depends on 8)

The method of claim 8, wherein when the hypervisor finds the type of operation and the location of the MMIO information in the page table entry for the MMIO address:
retrieving the type of operation and the location of the MMIO information from the page table entry; and
executing, by the hypervisor, the operation on behalf of the guest based on the type of operation and the location of the MMIO information.

### Claim 10 (depends on 8)

The method of claim 8, wherein when the hypervisor does not find the type of operation and the location of the MMIO information in the page table entry for the MMIO address:
decoding, by the hypervisor, an instruction of the guest referenced by the guest address to determine a type of operation that the guest intended to execute and a location of MMIO information;
recording, by the hypervisor in a page table entry for the MMIO address of a host page table, an association with the type of operation and the location of the MMIO information; and
executing, by the hypervisor, the operation on behalf of the guest based on the type of the operation and the MMIO information.

### Claim 11 (depends on 1)

The method of claim 1, further comprising:
receiving, by the hypervisor from the guest, a set of addresses that the guest intends to use for MMIO operations;
walking, by the hypervisor, the host page table to locate a set of page table entries corresponding to the set of addresses; and
marking, by the hypervisor, each entry of the set of page table entries as an invalid page table entry.

### Claim 12 (depends on 11)

The method of claim 11, further comprising:
receiving, by the hypervisor from the guest, an indication that the guest no longer intends to use at least one of the set of addresses for MMIO operations; and
marking, by the hypervisor, a corresponding page table entry as a valid page table entry.

### Claim 13 (depends on 12)

The method of claim 12, further comprising removing, by the hypervisor, the association with the type of operation and the location of the MMIO information of the page table entry.

### Claim 14 (depends on 2)

The method of claim 2, wherein the location of the MMIO information is located in a first general purpose register of one or more general purpose registers.

### Claim 15 (depends on 14)

The method of claim 14, wherein the one or more general purpose registers store additional MMIO information.

### Claim 16 (depends on 13)

The method of claim 13, wherein the additional information comprises an MMIO address associated with an MMIO-based device or one or more parameters associated with the MMIO operation.

### Claim 17

A computer system comprising:
a memory;
a host CPU, coupled to the memory; and
a hypervisor hosted by the computer system, having access to the memory and use of the host CPU, the hypervisor to:
receive an indication of an exit by a guest to the hypervisor and a memory-mapped input output (MMIO) address that caused the exit to hypervisor;
walk a page table of the guest to identify a guest address associated with the MMIO address that caused the exit to the hypervisor;
decode an instruction of the guest referenced by the guest address to determine a type of operation that the guest intended to execute and a location of MMIO information;
record, in a page table entry for the MMIO address of a host page table, an association with the type of operation and the location of the MMIO information; and
execute the operation on behalf of the guest based on the type of the operation and the MMIO information.

### Claim 18 (depends on 17)

The system of claim 17, wherein recording comprises:
associating an entry of an array with the type of operation and the location of the MMIO information and
storing the association in the page table entry for the MMIO address.

### Claim 19

A non-transitory computer-readable storage medium including instructions that, when accessed by a processing system, cause the processing system to perform operations comprising:
receiving, by a hypervisor of a host, an indication of an exit by a guest to the hypervisor and a memory-mapped input output (MMIO) address that caused the exit to hypervisor;
walking, by the hypervisor, a page table of the guest to identify a guest address associated with the MMIO address that caused the exit to the hypervisor;
decoding, by the hypervisor, an instruction of the guest referenced by the guest address to determine a type of operation that the guest intended to execute and a location of MMIO information;
recording, by the hypervisor in a page table entry for the MMIO address of a host page table, an association with the type of operation and the location of the MMIO information; and
executing, by the hypervisor, the operation on behalf of the guest based on the type of the operation and the MMIO information.

### Claim 20 (depends on 19)

The non-transitory computer-readable storage medium of claim 19, wherein said recording comprises:
associating an entry of an array with the type of operation and the location of the MMIO information and
storing the association in the page table entry for the MMIO address.
