# US 2021/0342172 A1 · Asynchronous management of unencrypted memory page list of a virtual machine

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

- Number: US 2021/0342172 A1
- Document ID: US20210342172A1
- Status: Published application
- Kind: A1
- Application number: 16/862,456
- Filed: 2020-04-29
- Published: 2021-11-04
- Earliest claimed: 2020-04-29
- Assignees: Red Hat, Inc.
- Applicants: Red Hat, Inc.
- Inventors: Michael Tsirkin
- Web page: https://patentgrep.com/patent/US20210342172A1

## CPC

- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 12/1009: using page tables, e.g. page table structures
- G06F 12/1408: {by using cryptography (for digital transmission H04L9/00)}
- G06F 2009/4557: {Distribution of virtual machine instances; Migration and load balancing}
- G06F 2009/45575: {Starting, stopping, suspending or resuming virtual machine instances}
- G06F 2009/45583: {Memory management, e.g. access or allocation}
- G06F 2212/1052: Security improvement
- G06F 2212/151: Emulated environment, e.g. virtual machine
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems and methods for supporting asynchronous management of unencrypted memory pages of a virtual machine (VM) are disclosed. In one implementation, a processing device may receive, at a destination hypervisor of a host machine as part of a migration process of a VM, two copies of a memory page of the VM, the two copies comprising: a decrypted copy of the memory page, and an unencrypted copy of the memory page. The processing device may also cause the VM to execute a VM resume code, wherein executing the VM resume code comprises: determining whether the memory page is unencrypted based on a page table of the VM. Responsive to determining that the memory page is unencrypted, the processing device may copy the unencrypted copy of the memory page to a guest memory address.

## Claims

### Claim 1

A method, comprising:
receiving, at a destination hypervisor of a host machine as part of a migration process of a virtual machine (VM), two copies of a memory page of the VM, the two copies comprising:
a decrypted copy of the memory page; and
an unencrypted copy of the memory page;
causing the VM to execute a VM resume code, wherein executing the VM resume code comprises:
determining whether the memory page is unencrypted based on a page table of the VM; and
responsive to determining that the memory page is unencrypted, copying the unencrypted copy of the memory page to a guest memory address.

### Claim 2 (depends on 1)

The method of claim 1, wherein copying the unencrypted copy of the memory page further comprises:
discarding the decrypted copy of the memory page.

### Claim 3 (depends on 1)

The method of claim 1, wherein the unencrypted copy of the memory page is accessible by the hypervisor and is used for communication with the hypervisor.

### Claim 4 (depends on 1)

The method of claim 1, wherein the decrypted page is decrypted with an address-independent encryption key.

### Claim 5 (depends on 1)

The method of claim 1 further comprising:
responsive to determining that the memory page is not unencrypted, discarding the unencrypted copy of the memory page.

### Claim 6 (depends on 1)

The method of claim 1, wherein at least a subset of a plurality of memory pages of the VM are unencrypted. The method of claim 1 further comprising:
marking the unencrypted copy of the memory page as inaccessible in a host page table; and
responsive to detecting that the VM resume code has been executed, marking the unencrypted copy of the memory page as accessible in the host page table.

### Claim 8 (depends on 1)

The method of claim 1 further comprising:
providing a reference of the unencrypted copy of the memory page as a parameter to the VM resume code.

### Claim 9 (depends on 1)

The method of claim 1, wherein the unencrypted copy of the memory page is provided to the VM at an address that is located at a predetermined offset from the guest physical address space.

### Claim 10 (depends on 1)

The method of claim 1 further comprising:
responsive to detecting a completion of the migration process of the VM:
sending an interrupt to the VM to execute the VM resume code; and
resuming the VM on the host machine.

### Claim 11

A system comprising:
a memory;
a processing device operatively coupled to the memory, the processing device to:
receive, as part of a migration process of a virtual machine (VM), two copies of a memory page of the VM, the two copies comprising:
a decrypted copy of the memory page; and
an unencrypted copy of the memory page;
cause the VM to execute a VM resume code, wherein executing the VM resume code comprises:
determining whether the memory page is unencrypted based on a page table of the VM; and
responsive to determining that the memory page is unencrypted, copy the unencrypted copy of the memory page to a guest memory address.

### Claim 12 (depends on 11)

The system of claim 11, wherein to copy the unencrypted copy of the memory page, the processing device is further to:
discard the decrypted copy of the memory page.

### Claim 13 (depends on 11)

The system of claim 11, wherein the unencrypted copy of the memory page is accessible by a hypervisor and is used for communication with the hypervisor.

### Claim 14 (depends on 11)

The system of claim 11, wherein the decrypted page is decrypted with an address-independent encryption key.

### Claim 15 (depends on 11)

The system of claim 11, wherein the processing device is further to:
responsive to determining that the memory page is not unencrypted, discard the unencrypted copy of the memory page.

### Claim 16 (depends on 11)

The system of claim 11 wherein, responsive to detecting a completion of the migration process of the VM, the processing device is further to:
send an interrupt to the VM to execute the VM resume code; and
resume the VM on the host machine.

### Claim 17 (depends on 11)

The system of claim 11, wherein the processing device is further to:
mark the unencrypted copy of the memory page as inaccessible in a host page table; and
responsive to detecting that the VM resume code has been executed, mark the unencrypted copy of the memory page as accessible in the host page table.

### Claim 18

A non-transitory computer-readable media storing instructions that, when executed, cause a processing device to:
receive, as part of a migration process of a virtual machine (VM), two copies of a memory page of the VM, the two copies comprising:
a decrypted copy of the memory page; and
an unencrypted copy of the memory page;
cause the VM to execute a VM resume code, wherein executing the VM resume code comprises:
determining whether the memory page is unencrypted based on a page table of the VM; and
responsive to determining that the memory page is unencrypted, copy the unencrypted copy of the memory page to a guest memory address.

### Claim 19 (depends on 18)

The non-transitory computer-readable media of claim 18, wherein the unencrypted copy of the memory page is provided to the VM at an address that is located at a predetermined offset from the guest physical address space.

### Claim 20 (depends on 18)

The non-transitory computer-readable media of claim 18, wherein determining whether the memory page is unencrypted based on the page table of the VM further comprises:
inspecting, by the VM resume code, an unencrypted page flag in the VM page table, the unencrypted page flag is associated with the memory page.
