# US 2022/0035648 A1 · Memory encryption for virtual machines by hypervisor-controlled firmware

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

- Number: US 2022/0035648 A1
- Document ID: US20220035648A1
- Status: Published application
- Kind: A1
- Application number: 16/943,556
- Filed: 2020-07-30
- Published: 2022-02-03
- Earliest claimed: 2020-07-30
- Assignees: Red Hat, Inc.
- Applicants: Red Hat, Inc.
- Inventors: Michael Tsirkin
- Web page: https://patentgrep.com/patent/US20220035648A1

## CPC

- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 9/45545: {Guest-host, i.e. hypervisor is an application program itself, e.g. VirtualBox}
- G06F 12/1018: involving hashing techniques, e.g. inverted page tables
- G06F 12/1408: {by using cryptography (for digital transmission H04L9/00)}
- G06F 12/145: {the protection being virtual, e.g. for virtual blocks or segments before a translation mechanism}
- G06F 12/1491: {in a hierarchical protection system, e.g. privilege levels, memory rings}
- 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 2009/45587: {Isolation or security of virtual machine instances}
- G06F 2212/1016: Performance improvement
- G06F 2212/1032: Reliability improvement, data loss prevention, degraded operation etc
- G06F 2212/151: Emulated environment, e.g. virtual machine
- G06F 2212/651: Multi-level translation tables
- G06F 2212/657: Virtual address space management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems and methods for encryption support for virtual machines. An example method may comprise initializing, by a firmware module associated with a virtual machine running on a host computer system, an exclusion range register associated with the virtual machine with a value specifying a first portion of guest memory, wherein the first portion of the guest memory comprises an exclusion range marked as reserved; encrypting, by the firmware using an ephemeral encryption key, a second portion of the guest memory; booting, by a hypervisor of the host computer system, the virtual machine; and responsive to intercepting, by the hypervisor, a privileged instruction executed by the virtual machine, performing at least one of: copying data for performing the privileged instruction to the first portion of the guest memory or copying data for performing the privileged instruction from the first portion of the guest memory.

## Claims

### Claim 1

A method comprising:
initializing, by a firmware module associated with a virtual machine running on a host computer system, an exclusion range register associated with the virtual machine with a value specifying a first portion of guest memory, wherein the first portion of the guest memory comprises an exclusion range marked as reserved;
encrypting, by the firmware using an ephemeral encryption key, a second portion of the guest memory;
booting, by a hypervisor of the host computer system, the virtual machine; and
responsive to intercepting, by the hypervisor, a privileged instruction executed by the virtual machine, performing at least one of: copying data for performing the privileged instruction to the first portion of the guest memory or copying data for performing the privileged instruction from the first portion of the guest memory.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
sending a measurement reflecting a handler address, a control environment, and the exclusion range register to a guest owner.

### Claim 3 (depends on 2)

The method of claim 2, wherein the control environment comprises a page table.

### Claim 4 (depends on 2)

The method of claim 2, wherein the measurement comprises a cryptographic hash of the handler address, contents of the control environment, an address of the exclusion range register, and contents of the exclusion range register.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
generating, by the hypervisor, the firmware module associated with the virtual machine.

### Claim 6 (depends on 1)

The method of claim 1, wherein the second portion comprises all guest memory except for the first portion.

### Claim 7 (depends on 1)

The method of claim 1, further comprising:
receiving the ephemeral encryption key from a guest owner;
supplying, by the firmware, the ephemeral encryption key to the virtual machine through the second portion of guest memory; and
booting a guest operating system.

### Claim 8

A system, comprising:
a memory;
a processing device operatively coupled to the memory, the processing device configured to:
initialize, by a firmware module associated with a virtual machine running on a host computer system, an exclusion range register associated with the virtual machine with a value specifying a first portion of guest memory, wherein the first portion of the guest memory comprises an exclusion range marked as reserved;
encrypt, by the firmware using an ephemeral encryption key, a second portion of the guest memory;
boot, by a hypervisor of the host computer system, the virtual machine; and
responsive to intercepting, by the hypervisor, a privileged instruction executed by the virtual machine, perform at least one of: copying data for performing the privileged instruction to the first portion of the guest memory or copying data for performing the privileged instruction from the first portion of the guest memory.

### Claim 9 (depends on 8)

The system of claim 8, further comprising the processing device configured to:
send a measurement reflecting a handler address, a control environment, and the exclusion range register to a guest owner.

### Claim 10 (depends on 9)

The system of claim 9, wherein the control environment comprises a page table.

### Claim 11 (depends on 9)

The system of claim 9, wherein the measurement comprises a cryptographic hash of the handler address, contents of the control environment, an address of the exclusion range register, and contents of the exclusion range register.

### Claim 12 (depends on 8)

The system of claim 8, further comprising the processing device configured to:
generate, by the hypervisor, the firmware module associated with the virtual machine.

### Claim 13 (depends on 8)

The system of claim 8, wherein the second portion comprises all guest memory except for the first portion.

### Claim 14 (depends on 8)

The system of claim 8, further comprising the processing device configured to:
receive the ephemeral encryption key from a guest owner;
supply, by the firmware, the ephemeral encryption key to the virtual machine through the second portion of guest memory; and
boot a guest operating system.

### Claim 15

A non-transitory machine-readable storage medium storing instructions that cause a processing device to:
initialize, by a firmware module associated with a virtual machine running on a host computer system, an exclusion range register associated with the virtual machine with a value specifying a first portion of guest memory, wherein the first portion of the guest memory comprises an exclusion range marked as reserved;
encrypt, by the firmware using an ephemeral encryption key, a second portion of the guest memory;
boot the virtual machine; and
responsive to intercepting a privileged instruction executed by the virtual machine, perform at least one of: copy data for performing the privileged instruction to the first portion of the guest memory or copy data for performing the privileged instruction from the first portion of the guest memory.

### Claim 16 (depends on 15)

The non-transitory machine-readable storage medium of claim 15, further comprising the processing device configured to:
send a measurement reflecting a handler address, a control environment, and the exclusion range register to a guest owner.

### Claim 17 (depends on 16)

The non-transitory machine-readable storage medium of claim 16, wherein the measurement comprises a cryptographic hash of the handler address, contents of the control environment, an address of the exclusion range register, and contents of the exclusion range register

### Claim 18 (depends on 15)

The non-transitory machine-readable storage medium of claim 15, further comprising the processing device configured to:
generate the firmware module associated with the virtual machine.

### Claim 19 (depends on 15)

The non-transitory machine-readable storage medium of claim 15, wherein the second portion comprises all guest memory except for the first portion.

### Claim 20 (depends on 15)

The non-transitory machine-readable storage medium of claim 15, further comprising the processing device configured to:
receive the ephemeral encryption key from a guest owner;
supply, by the firmware, the ephemeral encryption key to the virtual machine through the second portion of guest memory; and boot a guest operating system.
