# US 2024/0201876 A1 · Method and apparatus for managing memory

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

- Number: US 2024/0201876 A1
- Document ID: US20240201876A1
- Status: Published application
- Kind: A1
- Application number: 18/083,306
- Filed: 2022-12-16
- Published: 2024-06-20
- Earliest claimed: 2022-12-16
- Assignees: Advanced Micro Devices, Inc.; ATI Technologies ULC
- Applicants: Advanced Micro Devices, Inc.; ATI Technologies ULC
- Inventors: Lu Lu; Anthony Asaro; Yinan Jiang
- Web page: https://patentgrep.com/patent/US20240201876A1

## CPC

- G06F 3/0625: {Power saving in storage systems}
- G06F 3/0644: {Management of space entities, e.g. partitions, extents, pools}
- G06F 3/0673: {Single storage device}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method and apparatus of managing memory includes storing a first memory page at a shared memory location in response to the first memory page including data shared between a first virtual machine and a second virtual machine. A second memory page is stored at a memory location unique to the first virtual machine in response to the second memory page including data unique to the first virtual machine. The first memory page is accessed by the first virtual machine and the second virtual machine, and the second memory page is accessed by the first virtual machine and not the second virtual machine.

## Claims

### Claim 1

A method for managing memory, the method comprising:
in response to a first memory page including data shared between a first virtual machine and a second virtual machine, storing the first memory page at a shared memory location;
in response to a second memory page including data unique to the first virtual machine, storing the second memory page at a memory location unique to the first virtual machine;
accessing the first memory page by the first virtual machine and the second virtual machine; and
accessing the second memory page by the first virtual machine and not the second virtual machine.

### Claim 2 (depends on 1)

The method of claim 1, wherein:
storing the first memory page at the shared memory location comprises storing the first memory page at a first system physical memory address designated as common memory that is shared by the first virtual machine and the second virtual machine, wherein the first system physical memory address is associated with the shared memory location.

### Claim 3 (depends on 2)

The method of claim 2, further comprising:
in response to the first memory page including shared data, storing a first mapping between a first guest physical address and the first system physical memory address for the first virtual machine.

### Claim 4 (depends on 2)

The method of claim 2, further comprising:
in response to the first memory page including shared data, storing a first mapping between a second guest physical address and the first physical memory address for the second virtual machine.

### Claim 5 (depends on 1)

The method of claim 1, wherein storing the second memory page at a memory location unique to the first virtual machine comprises:
storing the second memory page at a second system physical memory address designated as unique memory, wherein the second system physical memory address designated as unique memory is associated with the memory location unique to the first virtual machine.

### Claim 6 (depends on 5)

The method of claim 5, further comprising:
in response to the second memory page including data unique to the first virtual machine, storing a first mapping between a third guest physical address and the second system physical memory address for the first virtual machine.

### Claim 7 (depends on 1)

The method of claim 1, wherein the first memory page is read-only to the first virtual machine and to the second virtual machine.

### Claim 8 (depends on 1)

The method of claim 1, wherein the first virtual machine manages mappings for the first memory page between guest virtual addresses and guest physical addresses.

### Claim 9 (depends on 1)

The method of claim 1, wherein a host manages mappings for the first memory page between guest physical addresses and system physical addresses.

### Claim 10 (depends on 1)

The method of claim 1, wherein the first virtual machine and the second virtual machine execute a same application.

### Claim 11

An apparatus for managing memory, comprising:
a memory; and
a processor operatively coupled to and in communication with the memory, the processor configured to, in response to a first memory page including data shared between a first virtual machine and a second virtual machine, store the first memory page at a shared memory location, in response to a second memory page including data unique to the first virtual machine, store the second memory page at a memory location unique to the first virtual machine, access the first memory page by the first virtual machine and the second virtual machine, and access the second memory page by the first virtual machine and not the second virtual machine.

### Claim 12 (depends on 11)

The apparatus of claim 11, wherein the processor storing the first memory page at the shared memory location comprises storing the first memory page at a first system physical memory address designated as common memory that is shared by the first virtual machine and the second virtual machine, wherein the first system physical memory address is associated with the shared memory location.

### Claim 13 (depends on 12)

The apparatus of claim 12, wherein the processor is configured to, in response to the first memory page including shared data, store a first mapping between a first guest physical address and the first system physical memory address for the first virtual machine.

### Claim 14 (depends on 12)

The apparatus of claim 12, wherein the processor is configured to, in response to the first memory page including shared data, store a first mapping between a second guest physical address and the first physical memory address for the second virtual machine.

### Claim 15 (depends on 11)

The apparatus of claim 11, wherein the processor storing the second memory page at a memory location unique to the first virtual machine comprises:
storing the second memory page at a second system physical memory address designated as unique memory, wherein the second system physical memory address designated as unique memory is associated with the memory location unique to the first virtual machine.

### Claim 16 (depends on 15)

The apparatus of claim 15, wherein the processor is configured to, in response to the second memory page including data unique to the first virtual machine, store a first mapping between a third guest physical address and the second system physical memory address for the first virtual machine.

### Claim 17 (depends on 11)

The apparatus of claim 11, wherein the first memory page is read-only to the first virtual machine and to the second virtual machine.

### Claim 18 (depends on 11)

The apparatus of claim 11, wherein the first virtual machine manages mappings for the first memory page between guest virtual addresses and guest physical addresses.

### Claim 19 (depends on 11)

The apparatus of claim 11, wherein a host manages mappings for the first memory page between guest physical addresses and system physical addresses.

### Claim 20

A non-transitory computer-readable medium for managing memory, the non-transitory computer-readable medium having instructions recorded thereon that, when executed by the processor, cause the processor to perform operations including:
in response to a first memory page including data shared between a first virtual machine and a second virtual machine, storing the first memory page at a shared memory location;
in response to a second memory page including data unique to the first virtual machine, storing the second memory page at a memory location unique to the first virtual machine;
accessing the first memory page by the first virtual machine and not the second virtual machine; and
accessing the second memory page by the first virtual machine and not the second virtual machine.
