# US 11,119,918 B2 · Execution using multiple page tables

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

- Number: US 11,119,918 B2
- Document ID: US11119918B2
- Status: Granted
- Kind: B2
- Application number: 16/209,025
- Filed: 2018-12-04
- Published: 2019-05-16
- Granted: 2021-09-14
- Earliest claimed: 2017-04-25
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Mike B. Macpherson
- Web page: https://patentgrep.com/patent/US11119918B2

## CPC

- G06F 12/0802: Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F 9/06: using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F 9/30: Arrangements for executing machine instructions, e.g. instruction decode (for executing microinstructions G06F9/22)
- 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 9/45554: {Instruction set architectures of guest OS and hypervisor or native processor differ, e.g. Bochs or VirtualPC on PowerPC MacOS}
- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 12/1009: using page tables, e.g. page table structures
- G06F 12/1036: for multiple virtual address spaces, e.g. segmentation (G06F12/1045 takes precedence)
- G06F 2009/45583: {Memory management, e.g. access or allocation}
- G06F 2212/151: Emulated environment, e.g. virtual machine
- G06F 2212/656: Address space sharing
- G06F 2212/657: Virtual address space management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments of techniques and systems for execution of code with multiple page tables are described. In embodiments, a heterogenous system utilizing multiple processors may use multiple page tables to selectively execute appropriate ones of different versions of executable code. The system may be configured to support use of function pointers to virtual memory addresses. In embodiments, a virtual memory address may be mapped, such as during a code fetch. In embodiments, when a processor seeks to perform a code fetch using the function pointer, a page table associated with the processor may be used to translate the virtual memory address to a physical memory address where code executable by the processor may be found. Usage of multiple page tables may allow the system to support function pointers while utilizing only one virtual memory address for each function that is pointed to. Other embodiments may be described and claimed.

## Claims

### Claim 1

One or more non-transitory computer-readable storage media comprising instructions embodied therein that, in response to execution by a computer device having a first computer processor with a first instruction set architecture and a second computer processor with a second instruction set architecture that differs from the first instruction set architecture, cause the computer device to:
implement a virtual machine manager to operate on one or more of the first computer processor and the second computer processor,
facilitate, with the virtual machine manager, selective invocation of a first version of a function for execution by the first computer processor or a second version of the same function for execution by the second computer processor,
wherein to facilitate includes to translate a virtual memory address in a function pointer of the function associated with a code fetch by the first or the second processor into a corresponding first or second physical memory address of a first or a second physical memory location of a first or a second physical memory region of the computer device, having the first or the second version of the same function respectively implemented with a first and a second plurality of instructions of the first or second instruction set architecture,
wherein to translate the virtual memory address includes usage of a selected one of a first page table or a second page table correspondingly associated with the first and second processors, the first page table separately located from the second page table,
wherein which of the first and second page tables is used depends on whether the code fetch is associated with the first or the second processor.

### Claim 2 (depends on 1)

The one or more non-transitory computer-readable storage media of claim 1, wherein:
the first page table maps the virtual memory address in the function pointer of the function associated with the code fetch to the first physical memory address, when the code fetch is associated with the first processor, and
the second page table maps the virtual memory address in the function pointer of the function associated with the code fetch to the second physical memory address, when the code fetch is associated with the second processor.

### Claim 3 (depends on 2)

The one or more non-transitory computer-readable storage media of claim 2, wherein the first physical memory address is associated with the first physical memory location of the first physical memory region having the first version of the function implemented with instructions of the first instruction set architecture of the first processor, and the second physical memory address is associated with the second physical memory location of the second physical memory region having the second version of the function implemented with instructions of the second instruction set architecture of the second processor, wherein the first and second physical memory regions are different physical memory regions.

### Claim 4 (depends on 3)

The one or more non-transitory computer-readable storage media of claim 3, wherein the first and second page tables are to map virtual memory addresses associated with a common virtual memory data region to physical memory addresses of a common physical memory region.

### Claim 5 (depends on 3)

The one or more non-transitory computer-readable storage media of claim 3, wherein the first version of the function implemented with instructions of the first instruction set architecture, and the second version of the function implemented with instructions of the second instruction set architecture are each generated from common source code.

### Claim 6 (depends on 5)

The one or more non-transitory computer-readable storage media of claim 5, wherein the instructions are to further cause the computer device to load the first version of the function and the second version of the function into the corresponding first and second physical memory regions.

### Claim 7 (depends on 6)

The one or more non-transitory computer-readable storage media of claim 6, wherein the instructions are to further cause the computer device to facilitate configuration of the first and second page tables to map the virtual memory address of the function pointer of the function associated with the code fetch to the corresponding first and second physical memory addresses.

### Claim 8 (depends on 7)

The one or more non-transitory computer-readable storage media of claim 7, wherein the instructions are to further cause the computer device to facilitate configuration of the first and second page tables to map virtual memory addresses associated with a common virtual memory region including the virtual memory address associated with the code fetch to physical memory addresses of the first and second physical memory regions.

### Claim 9 (depends on 8)

The one or more non-transitory computer-readable storage media of claim 8, wherein the instructions are to further cause the computer device to select a size for the common virtual memory region based at least in part on respective sizes of the first version of the function and the second version of the function.

### Claim 10 (depends on 9)

The one or more non-transitory computer-readable storage media of claim 9, wherein the instructions are to further cause the computer device to select the size for the common virtual memory region based at least in part on a larger of a size of the first version of the function and a size of the second version of the function.

### Claim 11

A computer-implemented method for facilitating selective execution of a first version of a function or a second version of the same function on a heterogeneous computer device comprising first and second computer processors with first and second different instruction set architectures, the method comprising:
receiving a virtual memory address in a function pointer of the function associated with a code fetch by the first or the second processor;
translating, by a virtual machine manager that operates on the computer device, the virtual memory address in the function pointer of the function associated with the code fetch by the first or the second processor into a corresponding first or second physical memory address of a first or a second physical memory location of a first or a second physical memory region respectively having a first version of the function implemented with a first plurality of instructions of the first instruction set architecture or a second version of the same function implemented with a second plurality of instructions of the second instruction set architecture, wherein translating the virtual memory address includes using a selected one of a first page table or a second page table correspondingly associated with the first and second processors, the first page table separately located from the second page table, wherein which of the first or second page table is used depends on whether the virtual memory address in the function pointer is associated with the code fetch by the first or the second processor; and
invoking, with the virtual machine manager, the first or the second version of the function for execution by the first or the second processor, using the first or the second physical memory address resulted from the translating.

### Claim 12 (depends on 11)

The method of claim 11, further comprising:
configuring the first page table to map the virtual memory address in the function pointer to the first physical memory address, for the first processor, and
configuring the second page table to map the virtual memory address to the second physical memory address for the second processor.

### Claim 13 (depends on 12)

The method of claim 12, wherein configuring the first and second page tables comprises configuring the first and second page tables to map virtual memory addresses associated with a common virtual memory region including the virtual memory address associated with the code fetch to physical memory addresses of the first and second physical memory regions.

### Claim 14 (depends on 13)

The method of claim 13, further comprising selecting a size for the common virtual memory region based at least in part on respective sizes of the first version of the function and the second version of the function.

### Claim 15 (depends on 14)

The method of claim 14, wherein selecting the size for the common virtual memory region based at least in part on a larger of a size of the first version of the function and a size of the second version of the function.

### Claim 16 (depends on 11)

The method of claim 11, further comprising generating the first version of the function implemented with instructions of the first instruction set architecture, and the second version of the function implemented with instructions of the second instruction set architecture from common source code.

### Claim 17

A heterogeneous computer apparatus for executing a function on the heterogeneous computer apparatus comprising:
a physical memory;
a first computer processor coupled to the physical memory and to support a first instruction set architecture;
a second computer processor coupled to the physical memory and to support a second instruction set architecture;
a first version of the function implemented with instructions of the first instruction set architecture, stored at a first memory area of the physical memory having a first physical memory address;
a second version of the function implemented with instructions of the second instruction set architecture, stored at a second memory area of the physical memory having a second physical memory address;
a first page table associated with the first computer processor located at a first location to map a virtual memory address in a function pointer of the function to the first physical memory address, for the first computer processor;
a second page table associated with the second computer processor and located at a second location, different from the first location, to map the virtual memory address in the function pointer of the function to the second physical memory address, for the second computer processor; and
a virtual machine manager to operate on one or more computer processors of the apparatus to facilitate selective invocation of a first version of a function or a second version of the same function for respective execution by either the first computer processor or the second computer processor;
wherein the virtual machine manager is to operate to translate the virtual memory address in the function pointer of the function associated with a code fetch by the first or the second computer processor into the corresponding first or second physical memory address of the first or second memory area, using a selected one of a first page table or a second page table;
wherein which of the first or the second page table is used depends on whether the virtual memory address in the function pointer is associated with a code fetch by the first or the second computer processor.

### Claim 18 (depends on 17)

The apparatus of claim 17, further comprising a loader to operate on one or more computer processors of the apparatus to load the function into the physical memory, wherein to load the function into the physical memory, the loader is to:
load executable code of the first version of the function into a first physical memory region; and
load executable code of the second version of the same function into a second physical memory region.

### Claim 19 (depends on 18)

The apparatus of claim 18, wherein the loader is further to operate to facilitate configuration of the first and second page tables to respectively map the virtual memory address in the function pointer associated with a code fetch to the corresponding first and second physical memory addresses of the first and second physical memory regions.
