# US 12,117,940 B2 · Host address space identifier for non-uniform memory access locality in virtual machines

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

- Number: US 12,117,940 B2
- Document ID: US12117940B2
- Status: Granted
- Kind: B2
- Application number: 17/963,001
- Filed: 2022-10-10
- Published: 2023-02-02
- Granted: 2024-10-15
- Earliest claimed: 2017-12-05
- Assignees: Red Hat, Inc.
- Applicants: Red Hat, Inc.
- Inventors: Andrea Arcangeli; Michael Tsirkin
- Web page: https://patentgrep.com/patent/US12117940B2

## CPC

- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 12/1009: using page tables, e.g. page table structures
- G06F 9/45545: {Guest-host, i.e. hypervisor is an application program itself, e.g. VirtualBox}
- G06F 12/0292: {using tables or multilevel address translation means (G06F12/023 takes precedence; address translation in virtual memory systems G06F12/10)}
- 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/151: Emulated environment, e.g. virtual machine
- G06F 2212/651: Multi-level translation tables
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Aspects of the disclosure provide for implementing host address space identifiers for non-uniform memory access (NUMA) locality in virtual machines. A method of the disclosure includes determining, by a virtual machine (VM), that a guest memory page is to be moved from a first virtual NUMA node of the VM to a second virtual NUMA node of the VM. The method also includes updating, one or more designated bits of a guest physical address (GPA) of the memory page to include a host address space identifier (HASID) of the second virtual NUMA node, where the guest page table maps the GPA of the memory page to a corresponding guest virtual address (GVA) of the VM and where the HASID associates the GPA of the memory page with a corresponding virtual NUMA node locality, and accessing by the VM, the updated GPA.

## Claims

### Claim 1

A method comprising:
determining, by a virtual machine (VM) comprising a set of virtual non-uniform memory access (NUMA) nodes, wherein each virtual NUMA node comprises a set of virtual CPUs (vCPUs) and a set of guest memories, and wherein each virtual NUMA node individually maps to a corresponding physical host NUMA node, that a guest memory page is to be moved from a first virtual NUMA node of the VM to a second virtual NUMA node of the VM;
updating, by the VM in a guest page table of the VM, one or more designated bits of a guest physical address (GPA) of the memory page to include a host address space identifier (HASID) of the second virtual NUMA node, wherein the guest page table maps the GPA of the memory page to a corresponding guest virtual address (GVA) of the VM and wherein the HASID associates the GPA of the memory page with a corresponding virtual NUMA node locality; and
accessing by the VM, the updated GPA.

### Claim 2 (depends on 1)

The method of claim 1, wherein the HASID is included in a determined number of the designated bits of the GPA, and wherein an address portion of the GPA is maintained in other bits of the GPA separate from the HASID.

### Claim 3 (depends on 1)

The method of claim 1, wherein the HASID comprises a virtual NUMA node indicated by the VM to associate with the GPA, and wherein the virtual NUMA node is different than a current virtual NUMA node associated with the GPA.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
mapping a plurality of HASIDs to groups of virtual central processing units (vCPUs) of the VM.

### Claim 5 (depends on 4)

The method of claim 4, further comprising:
notifying a hypervisor managing the VM of the mapping of plurality of HASIDs to the groups of vCPUs of the VM.

### Claim 6 (depends on 4)

The method of claim 4, further comprising:
modifying the mapping of plurality of HASIDs to the groups of vCPUs of the VM; and
notifying a hypervisor managing the VM of the modified mapping of plurality of HASIDs to the groups of vCPUs of the VM.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
receiving, from the hypervisor managing the VM, a mapping of a plurality of HASIDs to groups of virtual central processing units (vCPUs) of the VM; and
synchronizing, with the hypervisor managing the VM, changes to the mapping of plurality of HASIDs to the groups of vCPUs of the VM.

### Claim 8

A system comprising:
a memory; and
a processing device, coupled to the memory, to:
detect a virtual machine (VM) access of a guest physical address (GPA), wherein the virtual machine comprises a set of virtual non-uniform memory access (NUMA) nodes, wherein each virtual NUMA node comprises a set of set of virtual CPUs (vCPUs) and a set of guest memories, and maps to a corresponding physical host NUMA node;
reference a NUMA node locality table using the GPA to determine a memory page and a virtual NUMA node associated with the GPA using a host address space identifier (HASID) that associates the GPA of the memory page with a corresponding virtual NUMA node locality;
determine whether to migrate the memory page associated with the GPA to a host NUMA node corresponding to the virtual NUMA node; and
create a new page table entry for the GPA in a host page table of the hypervisor, wherein the host page table maps the GPA of the memory page to a corresponding host physical address.

### Claim 9 (depends on 8)

The system of claim 8, wherein the HASID is maintained in a determined number of upper bits of the GPA, wherein an address portion of the GPA is maintained in lower bits of the GPA separate from the HASID.

### Claim 10 (depends on 8)

The system of claim 8, wherein to identify the HASID, the processing device is to:
identify a host physical address and the HASID in the NUMA node locality table.

### Claim 11 (depends on 10)

The system of claim 10, wherein the HASID corresponds to an offset used to adjust the GPA.

### Claim 12 (depends on 11)

The system of claim 11, wherein adjusting the GPA with the offset causes the GPA to reside within a range of memory addresses accessible by the virtual machine.

### Claim 13

A non-transitory computer-readable storage medium including instructions that, when executed by a processing device of a host machine, cause the processing device to:
determine, by a virtual machine (VM) executed by the processing device and managed by a hypervisor, wherein the virtual machine comprises a set of virtual non-uniform memory access (NUMA) nodes, wherein each virtual NUMA node comprises a set of set of virtual CPUs (vCPUs) and a set of guest memories, and wherein each virtual NUMA node individually maps to a corresponding physical host NUMA node, that a memory page of the guest is to be moved from a first virtual NUMA node of the VM to a second virtual NUMA node of the VM;
reference a NUMA node locality table to identify an offset corresponding to the second virtual NUMA node using a host address space identifier (HASID) that associates a guest physical address (GPA) of the memory page with a corresponding virtual NUMA node locality;
adjust the GPA of the memory page by the offset;
store the adjusted address as the GPA for the memory page in a guest page table of the VM, wherein the guest page table maps the GPA of the memory page to a corresponding guest virtual address (GVA) of the VM; and
access, by the VM, the adjusted address stored as the GPA for the memory page.

### Claim 14 (depends on 13)

The non-transitory computer-readable storage medium of claim 13, wherein the offset is associated with the HASID corresponding to the second virtual NUMA node.

### Claim 15 (depends on 14)

The non-transitory computer-readable storage medium of claim 14, wherein the HASID is included in a determined number of designated bits of the GPA, and wherein an address portion of the GPA is maintained in other bits of the GPA separate from the HASID.

### Claim 16 (depends on 14)

The non-transitory computer-readable storage medium of claim 14, wherein the HASID is included in a determined number of upper bits of the GPA, and wherein an address portion of the GPA is maintained in lower bits of the GPA separate from the HASID.

### Claim 17 (depends on 14)

The non-transitory computer-readable storage medium of claim 14, wherein the HASID comprises a virtual NUMA node indicated by the VM to associate with the GPA, and wherein the virtual NUMA node is different than a current virtual NUMA node associated with the GPA.

### Claim 18 (depends on 14)

The non-transitory computer-readable storage medium of claim 14, wherein an identical version of the NUMA node locality table is maintained by the hypervisor to reference with the GPA and to determine the memory page and the second virtual NUMA node associated with the GPA.

### Claim 19 (depends on 18)

The non-transitory computer-readable storage medium of claim 18, wherein mapping of HASIDs to groups of virtual central processing units (vCPUs) of the VM is agreed upon by the hypervisor and the VM.

### Claim 20 (depends on 19)

The non-transitory computer-readable storage medium of claim 19, wherein a change to the mapping of the HASIDs to the groups of vCPUs is synchronized between the hypervisor and the VM.
