# US 9,355,042 B2 · Managing a translation lookaside buffer

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

- Number: US 9,355,042 B2
- Document ID: US9355042B2
- Status: Granted
- Kind: B2
- Application number: 14/306,790
- Filed: 2014-06-17
- Published: 2014-12-25
- Granted: 2016-05-31
- Earliest claimed: 2013-06-21
- Assignees: Globalfoundries Inc.
- Applicants: Globalfoundries Inc.
- Inventors: Xiao Tao Chang; Hubertus Franke; Yi Ge; Kun Wang
- Web page: https://patentgrep.com/patent/US9355042B2

## CPC

- G06F 12/1027: using associative or pseudo-associative address translation means, e.g. translation look-aside buffer [TLB]
- G06F 9/3004: {to perform operations on memory}
- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 2009/45583: {Memory management, e.g. access or allocation}
- G06F 2212/151: Emulated environment, e.g. virtual machine
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Method and apparatus for managing a translation lookaside buffer (TLB) at hardware in a virtualization enabled system. According to embodiments of the present invention, a series of operations caused by TLB miss would not need intervening from the hypervisor. On the contrary, when a TLB miss occurs, the hardware directly issues an interrupt to a virtual machine. In this way, the TLB can be efficiently managed by means of a hardware-level auxiliary translation table. Therefore, system overheads can be greatly reduced and system performance can be improved. Methods and apparatuses associated with hardware, hypervisor, and virtual machine in a virtualization enabled system are disclosed, respectively.

## Claims

### Claim 1

A method for managing a translation lookaside buffer (TLB) at hardware in a virtualization enabled system, the method comprising:
querying the TLB with a guest virtual address indicated by a memory access instruction, the memory access instruction being received from a virtual machine running in the virtualization enabled system;
in response to a miss of the guest virtual address in the TLB, issuing an interrupt to the virtual machine to cause the virtual machine to process the miss; and
managing the TLB using an auxiliary translation table based on a result of a processing of the miss by the virtual machine, wherein an entry of the auxiliary translation table maps a guest physical address to a host physical address in the virtualization enabled system.

### Claim 2 (depends on 1)

The method according to claim 1, wherein managing the TLB using an auxiliary translation table comprises:
receiving a TLB write instruction from the virtual machine, the TLB write instruction being for writing into the TLB an entry that maps the guest virtual address to a guest physical address;
querying the auxiliary translation table with the guest physical address;
in response to a hit of the guest physical address in the auxiliary translation table, determining the host physical address corresponding to the guest physical address; and
writing into the TLB the entry that maps the guest virtual address to the host physical address.

### Claim 3 (depends on 2)

The method according to claim 2, wherein managing the TLB using an auxiliary translation table further comprises:
in response to the miss of the guest physical address in the auxiliary translation table, issuing an interrupt to a hypervisor of the system to cause the hypervisor to update the auxiliary translation table.

### Claim 4 (depends on 1)

The method according to claim 1, further comprising:
in response to a hit of the guest virtual address in the TLB and an entry containing the guest virtual address being prohibited to be accessed, issuing an interrupt indicating a data storage exception to a hypervisor of the virtualization enabled system.

### Claim 5 (depends on 1)

The method according to claim 1, further comprising:
in response to the miss of the guest virtual address in the TLB, storing a context of the memory access instruction into a register specific to the virtual machine.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the result of the processing of the miss by the virtual machine comprises a TLB write instruction from the virtual machine, the TLB write instruction being for writing into the TLB an entry that maps the guest virtual address to a guest physical address, and the guest physical address being determined by the virtual machine by querying a page table.

### Claim 7

A method for managing a TLB at a hypervisor in a virtualization enabled system, the method comprising:
receiving an interrupt from a hardware of the system, the interrupt being caused by a miss of a guest physical address in an auxiliary translation table, and the guest physical address being determined according to a memory access instruction issued by a virtual machine running in the virtualization enabled system;
determining a host physical address in the virtualization enabled system that corresponds to the guest physical address; and
in response to the memory access instruction being directed to an access to a memory space, writing into the auxiliary translation table an entry that maps the guest physical address to the host physical address.

### Claim 8 (depends on 7)

The method according to claim 7, further comprising:
in response to the memory access instruction being directed to an access to an input/output device,
writing into the auxiliary translation table the entry that maps the guest physical address to the host physical address, thereby producing a written entry; and
prohibiting access to the written entry.

### Claim 9 (depends on 7)

The method according to claim 7, further comprising:
in response to the memory access instruction being directed to an access to an input/output device,
accessing a register specific to the virtual machine to obtain a context of the memory access instruction; and
performing an access to an input/output device based on the obtained context.

### Claim 10

An apparatus for managing a TLB at hardware in a virtualization enabled system, the apparatus comprising:
a TLB querying unit configured to query the TLB with a guest virtual address indicated by a memory access instruction, the memory access instruction being received from a virtual machine running in the virtualization enabled system;
a first interrupt issuing unit configured to issue an interrupt to the virtual machine in response to a miss of the guest virtual address in the TLB, thereby causing the virtual machine to process the miss; and
a TLB managing unit configured to manage the TLB using an auxiliary translation table based on a result of a processing of the miss by the virtual machine, wherein an entry of the auxiliary translation table maps a guest physical address to a host physical address in the system.

### Claim 11 (depends on 10)

The apparatus according to claim 10, further comprising:
a TLB write instruction receiving unit configured to receive a TLB write instruction from the virtual machine, the TLB write instruction being for writing into the TLB an entry that maps the guest virtual address to a guest physical address;
a translation table querying unit configured to query the auxiliary translation table with the guest physical address;
an address translating unit configured to determine a host physical address corresponding to the guest physical address in response to a hit of the guest physical address in the auxiliary translation table; and
a TLB writing unit configured to write into the TLB the entry that maps the guest virtual address to the host physical address.

### Claim 12 (depends on 11)

The apparatus according to claim 11, further comprising:
a second interrupt issuing unit configured to issue an interrupt to a hypervisor of the virtualization enabled system in response to a miss of the guest physical address in the auxiliary translation table, thereby causing the hypervisor to update the auxiliary translation table.

### Claim 13 (depends on 10)

The apparatus according to claim 10, further comprising:
a third interrupt issuing unit configured to issue an interrupt indicating a data storage exception to a hypervisor of the virtualization enabled system in response to a hit of the guest virtual address in the TLB and an entry containing the guest virtual address being prohibited to be accessed.

### Claim 14 (depends on 10)

The apparatus according to claim 10, further comprising:
a context storing unit configured to store a context of the memory access instruction into a register specific to the virtual machine in response to the miss of the guest virtual address in the TLB.

### Claim 15 (depends on 10)

The apparatus according to claim 10, wherein the result of the processing of the miss by the virtual machine comprises a TLB write instruction from the virtual machine, the TLB write instruction being for writing into the TLB an entry that maps the guest virtual address to a guest physical address, and the guest physical address being determined by the virtual machine by querying a page table.

### Claim 16

An apparatus for managing a TLB at a hypervisor in a virtualization enabled system, the apparatus comprising:
an interrupt receiving unit configured to receive an interrupt from a hardware of the virtualization enabled system, the interrupt being caused by a miss of a guest physical address in an auxiliary translation table, and the guest physical address being determined according to a memory access instruction issued by a virtual machine running in the virtualization enabled system;
an address translating unit configured to determine a host physical address in the virtualization enabled system that corresponds to the guest physical address; and
a translation table writing unit configured to write an entry into the auxiliary translation table in response to the memory access instruction being directed to an access to a memory space, wherein the entry maps the guest physical address to the host physical address.

### Claim 17 (depends on 16)

The apparatus according to claim 16, further comprising:
a first unit configured to write the entry into the auxiliary translation table in response to the memory access instruction being directed to an access to an input/output device, thereby producing a written entry; and
a second unit configured to prohibit access to the written entry.

### Claim 18 (depends on 16)

The apparatus according to claim 16, further comprising:
a third unit configured to access a register in response to the memory access instruction being directed to an access to an input/output device, wherein the register is specific to the virtual machine to obtain a context of the memory access instruction; and
a fourth unit configured to execute the access to the input/output device based on the obtained context.
