Virtual Machine Frequency Sensing via CPU Register Pass-Through

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In virtualization environments based on QEMU and KVM, the operating frequency of virtual machines is fixed and does not reflect dynamic changes in the host CPU frequency, limiting real-time monitoring and optimization.

Innovation Solution

A method to determine the operating frequency of virtual machines by accessing target registers like APERF and MPERF through a pass-through mechanism, allowing direct access to actual CPU frequency data.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If the virtual machine uses a fixed operating frequency value, then the system simplicity is maintained, but the measurement precision of the actual operating frequency is poor

Engineering Contradiction:
Improveoperating frequency measurement precisionVSAvoidfrequency monitoring system complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent introduces a pass-through mechanism as an intermediary between the host CPU and virtual machine. This mechanism includes a pass-through list that maps host CPU registers (APERP, MPERP) to virtual machine accessible registers, enabling the virtual machine to directly read actual frequency data without complex monitoring software layers.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Speed

If the virtual machine accesses host CPU registers directly, then the real-time performance is improved, but the device complexity increases

Engineering Contradiction:
Improvefrequency update speedVSAvoidregister access mechanism complexity
Core Design Contradiction:
SpeedVSDevice complexity

Solution Approach 1:

The patent pre-configures a pass-through list before virtual machine execution, which maps host CPU register addresses to virtual machine accessible registers. This preliminary setup enables direct register access during runtime without complex real-time translation or mediation, achieving fast frequency updates with minimal overhead.

Inventive Principle:
Principle #10Preliminary action

3Loss of information

If the virtual machine cannot access actual frequency data, then the system stability is maintained, but the loss of information occurs

Engineering Contradiction:
Improvefrequency information lossVSAvoidinformation transmission mechanism complexity
Core Design Contradiction:
Loss of informationVSDevice complexity

Solution Approach 1:

The patent extracts the frequency information retrieval process from the virtual machine and implements it through the pass-through mechanism. By exposing host CPU registers (APERP for actual frequency, MPERP for maximum frequency) through the pass-through list, the virtual machine can directly read frequency data without relying on the host to provide processed information, eliminating information loss.

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS20260017077A1Method and apparatus for determining operating frequency of virtual machine, electronic device and storage medium
Publication Date: 2026.01.15 BEIJING BAIDU NETCOM SCI & TECH CO LTD
  • US20260017077A1 patent drawing
  • US20260017077A1 patent drawing
  • US20260017077A1 patent drawing

AI summary

A method and an apparatus for determining an operating frequency of a virtual machine, an electronic device, and a storage medium are provided. The method includes: obtaining a target register from a pass-through list, and acquiring register data corresponding to the target register, where registers in the pass-through list is accessible by the virtual machine; during the operation of the virtual machine, in response to receiving an instruction to read the target register data, passing through the register data corresponding to the target register to the virtual machine, so that the virtual machine obtains the operating frequency of the virtual machine according to the register data.