VM Non-Deterministic Instruction Buffering

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

The execution of non-deterministic instructions in virtual machines requires frequent context switches between the virtual machine and the hypervisor, leading to substantial performance penalties, especially when many such instructions are executed in a short time, such as in loops during record and replay operations.

Innovation Solution

Storing the results of non-deterministic instructions in a storage buffer during record mode and retrieving them during replay mode without exiting to the hypervisor, allowing the CPU to manage execution semantics based on record/replay operating states, thereby reducing the need for hypervisor invocations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If non-deterministic instructions are executed in virtual machine record and replay operations, then the execution behavior can be recorded and replayed, but frequent context switches between virtual machine and hypervisor occur causing substantial performance penalties

Engineering Contradiction:
Improveexecution behavior recording accuracyVSAvoidprocessor cycle usage
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent applies preliminary action by pre-allocating storage buffers for non-deterministic instruction results before they are needed. During record mode, results are stored in pre-prepared buffers rather than immediately writing to persistent storage, and during replay mode, pre-filled buffers provide results without requiring hypervisor context switches. This advance preparation eliminates frequent context switches and improves processor cycle usage while maintaining execution accuracy.

Inventive Principle:
Principle #10Preliminary action

2Adaptability or versatility

If context switches are performed for each non-deterministic instruction during record and replay, then hypervisor can manage execution, but the frequency of context switches increases leading to resource-intensive operations

Engineering Contradiction:
Improvehypervisor execution managementVSAvoidcontext switch overhead
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent segments the execution management into two distinct modes: record mode and replay mode. In record mode, the system captures non-deterministic results in storage buffers without requiring hypervisor intervention for each instruction. In replay mode, pre-captured results are retrieved from buffers without context switches. This segmentation allows the hypervisor to manage execution adaptively only when necessary (mode switching) rather than for every non-deterministic instruction, significantly reducing context switch overhead and time loss.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS10394560B2Efficient recording and replaying of non-deterministic instructions in a virtual machine and CPU therefor
Publication Date: 2019.08.27 VMWARE INC
  • US10394560B2 patent drawing
  • US10394560B2 patent drawing
  • US10394560B2 patent drawing

AI summary

The output of a non-deterministic instruction is handled during record and replay in a virtual machine. An output of a non-deterministic instruction is stored to a buffer during record mode and retrieved from a buffer during replay mode without exiting to the hypervisor. At least part of the contents of the buffer can be stored to a log when the buffer is full during record mode, and the buffer can be replenished from a log when the buffer is empty during replay mode.