Guest Timer Facility for Virtualized Processing Systems
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In virtualized processing systems, frequent access to the Advanced Configuration and Power Interface (ACPI) Power Management Timer by guest operating systems leads to inefficient performance due to the need for multiple world switches, as the timer is indirectly accessible and emulated by the virtual machine monitor, resulting in substantial cycles wasted and performance degradation.
Innovation Solution
A PM Timer facility is implemented that generates a local value of the ACPI Power Management Timer based on the guest Time Stamp Counter, reducing the need for world switches by calculating the timer value locally without causing a switch to the virtual machine monitor, using a formula such as PM—TMR=(current_guest—TSC/current_guest—TSC_rate/PM—TMR_freq)+offset, where current_guest_TSC is the current Time Stamp Counter value and current_guest_TSC_rate is determined based on the host TSC rate and guest TSC ratio.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If the PM Timer is emulated by the virtual machine monitor, then the timer is accessible to guest operating systems, but the access requires multiple world switches causing performance degradation
Solution Approach 1:
The patent creates a local copy of the PM Timer value in the guest mode processing system. Instead of requiring the guest to access the original PM Timer through the virtual machine monitor (which requires world switches), the system generates and maintains a local copy of the timer value that the guest can access directly. This copying approach preserves timer accessibility while eliminating the performance penalty of frequent world switches.
Solution Approach 2:
The patent introduces an intermediary mechanism that generates the local PM Timer value based on the Time Stamp Counter without requiring direct access to the original PM Timer. This intermediary calculation layer allows the guest operating system to access timer functionality through a local value rather than through the virtual machine monitor, resolving the contradiction between accessibility and performance.
2Productivity
If the PM Timer is directly accessible in guest mode, then access performance improves, but the timer becomes inaccessible in host mode
Solution Approach 1:
The patent implements different access characteristics for different modes. In guest mode, the system provides direct access to a local copy of the PM Timer value for high performance. In host mode, the system maintains access to the original PM Timer through the virtual machine monitor. This local quality approach allows each mode to have optimized access characteristics appropriate to its needs.
Solution Approach 2:
The patent segments the timer access functionality into two separate access paths: one for guest mode that uses a local copied value for fast access, and another for host mode that accesses the original timer through the virtual machine monitor. This segmentation allows both modes to access timer functionality with appropriate performance characteristics without conflicting requirements.
3Measurement precision
If world switches are performed for each PM Timer access, then timer accuracy is maintained, but substantial processing cycles are wasted
Solution Approach 1:
The patent performs preliminary action by generating the local PM Timer value in advance through calculation from the Time Stamp Counter. This local value is maintained and updated without requiring world switches, allowing the guest operating system to access timer information without the overhead of repeated world switches. The preliminary calculation preserves timer accuracy while eliminating the time loss from frequent mode switching.
Data Source
AI summary
A method includes, in a virtualized processing system, generating a local value of a first counter. The local value is accessible while executing in a first mode of the virtualized processing system. The local value is generated based on a value of a second counter and a ratio of a rate of the first counter to a rate of the second counter. The first counter is inaccessible while executing in the first mode of the virtualized processing system and accessible while executing in a second mode of the virtualized processing system. The first mode may be a guest mode and the second mode may be a host mode. The first counter may be an ACPI Power Management Timer. The second counter may be a Time Stamp Counter.


