# US 10,120,738 B2 · Hypervisor techniques for performing non-faulting reads 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 10,120,738 B2
- Document ID: US10120738B2
- Status: Granted
- Kind: B2
- Application number: 15/192,642
- Filed: 2016-06-24
- Published: 2017-12-28
- Granted: 2018-11-06
- Earliest claimed: 2016-06-24
- Assignees: VMware, Inc.
- Applicants: VMware, Inc.
- Inventors: Radu Rugina; Jeffrey W. Sheldon; James S. Mattson, Jr.; David Dunn
- Web page: https://patentgrep.com/patent/US10120738B2

## CPC

- G06F 3/0659: {Command handling arrangements, e.g. command buffers, queues, command scheduling}
- G06F 3/0622: {in relation to access}
- G06F 3/0664: {at device level, e.g. emulation of a storage device or system}
- G06F 3/0673: {Single storage device}
- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 11/073: {in a memory management context, e.g. virtual memory or cache management (memory management G06F12/00; testing of static memory units G11C29/00)}
- G06F 11/0793: {Remedial or corrective actions (recovery from an exception in an instruction pipeline G06F9/3861; by retry G06F11/1402; for recovering from a failure of a protocol instance or entity H04L69/40)}
- G06F 21/52: during program execution, e.g. stack integrity {; Preventing unwanted data erasure; Buffer overflow}
- G06F 2009/45583: {Memory management, e.g. access or allocation}
- G06F 2009/45587: {Isolation or security of virtual machine instances}
- G06F 2009/45591: {Monitoring or debugging support}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Guest memory data structures are read by one or more read operations which are set up to handle page faults and general protection faults generated during the read in various ways. If such a fault occurs while performing the one or more read operations, the fault is handled and the one or more read operation is terminated. The fault is handled by either dropping the fault and reporting an error instead of the fault, by dropping the fault and invoking an error handler that is set up prior to performing the read operations, or by forwarding the fault to a fault handler that is setup prior to performing the read operations. If no fault occurs, the read operations complete successfully. Thus, under normal circumstances, no fault is incurred in a read operation on guest memory data structures.

## Claims

### Claim 1

In a computer system having virtualization software that supports execution of guest virtual machines, a method of supporting first and second read operations performed on a portion of guest memory, comprising:
upon detecting a fault caused by the first read operation while the virtualization software and a guest driver are in a first mode, the first read operation being carried out by the guest driver accessing said portion of guest memory, invoking a first fault handler to process the fault in the virtualization software, and terminating the first read operation; and
upon detecting a fault caused by the second read operation while the virtualization software and the guest driver are in a second mode, the second mode being established as a result of the guest driver calling into the virtualization software and the second read operation being carried out by the guest driver accessing said portion of guest memory, processing the fault by the guest driver in the guest software without invoking the first fault handler, and terminating the second read operation.

### Claim 2 (depends on 1)

The method of claim 1, wherein the guest driver processes an error code to indicate the fault caused by the second read operation.

### Claim 3 (depends on 1)

The method of claim 1, wherein the guest driver includes a guest error handler to process the fault.

### Claim 4 (depends on 1)

The method of claim 1, wherein the second read operation is performed by a repeat move string instruction.

### Claim 5 (depends on 4)

The method of claim 4, wherein terminating the second read operation includes causing a count to be reported, the guest driver processing the count to determine a number of iterations of the second read operation that did not complete.

### Claim 6 (depends on 1)

The method of claim 1, wherein the guest driver includes a second fault handler that is triggered by the fault caused by the second read operation.

### Claim 7 (depends on 6)

The method of claim 6, wherein
for the first read operation, a first interrupt descriptor table is used to determine an address of the first fault handler; and
for the second read operation, a second interrupt descriptor table replaces the first interrupt descriptor table and is used to determine an address of the second fault handler.

### Claim 8 (depends on 6)

The method of claim 6, wherein
for the first read operation, an entry of a first interrupt descriptor table stores an address of the first fault handler; and
for the second read operation, a pointer for an entry of the first interrupt descriptor table is associated with an address of the second fault handler.

### Claim 9 (depends on 1)

The method of claim 1, wherein the guest driver includes a second fault handler that is invoked by a virtualization exception triggered by the fault caused by the second read operation.

### Claim 10

A non-transitory computer-readable medium storing instructions which, when executed by a processor, cause the processor to perform, in a computer system having virtualization software that supports execution of guest virtual machines, a method of supporting one or more first read operations and second read operation performed on a portion of guest memory, the method comprising:
upon detecting a fault caused by the one or more first read operations while the virtualization software and a guest driver are in a first mode, the one or more first read operations being carried out by the guest driver accessing said portion of guest memory, invoking a first fault handler to process the fault in the virtualization software and terminating the one or more first read operations; and
upon detecting a fault caused by the second read operation while the virtualization software and the guest drive are in a second mode, the second mode being established as a result of the guest driver calling into the virtualization software and the second read operation being carried out by the guest driver accessing said portion of guest memory, processing the fault by the guest driver in the guest software without invoking the first fault handler, and terminating the second read operation.

### Claim 11 (depends on 10)

The non-transitory computer-readable medium of claim 10, wherein the guest driver includes a guest error handler to process the fault.

### Claim 12 (depends on 10)

The non-transitory computer-readable medium of claim 10, wherein the second read operation is performed by a repeat move string instruction.

### Claim 13 (depends on 12)

The non-transitory computer-readable medium of claim 12, wherein terminating the second read operation includes causing a count to be reported, the guest driver processing the count to determine a number of iterations of the second read operation that did not complete.

### Claim 14 (depends on 10)

The non-transitory computer-readable medium of claim 10, wherein the guest driver includes a second fault handler that is triggered by the fault caused by the second read operation.

### Claim 15 (depends on 10)

The non-transitory computer-readable medium of claim 10, wherein the guest driver includes a second fault handler is invoked by a virtualization exception triggered by the fault caused by the second read operation.

### Claim 16

A system comprising:
a processor of a host computer system; and
a memory of the host computer system,
wherein the processor is coupled to the memory to execute virtualization software loaded into the memory, the virtualization software supporting execution of guest virtual machines,
wherein at least one guest virtual machine supports a guest operating system that contains a guest driver, and
wherein the guest driver and the virtualization software are configured to support a first read operation and a second read operation performed on a portion of guest memory by:
invoking a first fault handler and terminating the first read operation, upon detecting a fault caused by the first read operation while the virtualization software and the guest driver are in a first mode, the first read operation being carried out by the guest driver accessing said portion of guest memory; and
processing the fault by the guest driver in the guest software without invoking the first fault handler, and terminating the second read operation, upon detecting a fault caused by the second read operation while the virtualization software and the guest driver are in a second mode, the second mode being established as a result of the guest driver calling into the virtualization software and the second read operation being carried out by the guest driver accessing said portion of guest memory.

### Claim 17 (depends on 16)

The system of claim 16, wherein the second read operation is performed by a repeat move string instruction.

### Claim 18 (depends on 17)

The system of claim 17, wherein terminating the second read operation includes causing a count to be reported, the guest driver processing the count to determine a number of iterations of the second read operations that did not complete.

### Claim 19 (depends on 16)

The system of claim 16, wherein the guest driver includes a second fault handler that is triggered by the fault caused by the second read operation.

### Claim 20 (depends on 16)

The system of claim 16, wherein the guest driver includes a second fault handler that is invoked by a virtualization exception triggered by the fault caused by the second read operation.
