Host Virtual Counter Scaling for Cross-Host VM Migration
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing CPUs, such as those compatible with the ARMv8 architecture, lack a mechanism to scale virtual counters and timers, which is necessary for scenarios like time warping or VM migration between hosts with different clock frequencies.
Innovation Solution
A hypervisor creates a guest virtual counter with scaling factors and maps it into the VM's memory, notifying the guest OS to paravirtualize the host virtual counter and timer, allowing the hypervisor to modify access based on these factors.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If direct access to hardware registers is allowed, then ease of operation is improved, but adaptability deteriorates because scaling cannot be implemented
Solution Approach 1:
The patent introduces a virtual counter register and virtual timer registers as intermediary layers between applications and hardware registers. These virtual registers are accessed through paravirtualized functions that apply scaling factors, enabling time scaling while maintaining ease of access for applications. The virtual counter value is derived from the system count through scaling operations without requiring direct hardware register access.
2Adaptability or versatility
If VM migration between hosts with different clock frequencies is supported, then adaptability is improved, but device complexity increases due to additional scaling mechanisms
Solution Approach 1:
The patent implements scaling factors (multiplicand, addend, shift) that can be dynamically adjusted based on the host environment. When a VM migrates between hosts with different clock frequencies, the paravirtualized functions update these scaling parameters to maintain consistent timing behavior. This allows adaptation to different hardware configurations without fundamentally changing the counter and timer architecture.
3Adaptability or versatility
If virtualization layer is introduced, then adaptability is improved for time warping and migration, but device complexity increases
Solution Approach 1:
The patent segments the timing functionality into distinct layers: hardware counters, virtual counter registers, and paravirtualized access functions. This segmentation allows the virtualization layer to manipulate time through scaling factors without requiring complex changes to the underlying hardware. Each layer has a specific responsibility, simplifying the overall virtualization structure while maintaining adaptability.
Data Source
AI summary
An example method of virtualizing a host virtual counter and timer in a central processing unit (CPU) of a virtualized host computer includes: creating, by a hypervisor of the host computer in response to power on of a virtual machine (VM), a guest virtual counter, the guest virtual counter comprising a data structure including scaling factors; mapping a shared memory page having the data structure into an address space of memory allocated to the VM; and notifying a guest operating system (OS) of the VM of a location in the address space for the shared memory page having the data structure, the guest OS being paravirtualized to scale the host virtual counter and timer based on the scaling factors of the guest virtual counter.


