US 12,367,057 B2
Scaling a host virtual counter and timer in a virtualized computer system
Regis Duchesne, Monts-de-Corsier (CH); Andrei Warkentin, South Elgin, IL (US); Cyprien Laplace, Boston, MA (US); Ye Li, Cambridge, MA (US); Shruthi Muralidhara Hiriyuru, Medford, MA (US); Alexander Fainkichen, Southborough, MA (US); and Sunil Kumar Kotian, San Jose, CA (US)
Assigned to VMware LLC, Palo Alto, CA (US)
Filed by VMware, Inc., Palo Alto, CA (US)
Filed on Dec. 22, 2021, as Appl. No. 17/559,313.
Prior Publication US 2023/0195487 A1, Jun. 22, 2023
Int. Cl. G06F 9/455 (2018.01)
CPC G06F 9/45558 (2013.01) [G06F 2009/45583 (2013.01)] 20 Claims
OG exemplary drawing
 
1. A method of virtualizing a host virtual counter and timer in a central processing unit (CPU) of a virtualized host computer, the method comprising:
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, the hypervisor executing at a first privilege level of the CPU;
mapping a shared memory page having the data structure into an address space of memory allocated to the VM, the shared memory page accessible at a second privilege level of the CPU, the second privilege level being less privileged than the first privilege level; 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 executing at the second privilege level, the guest OS being paravirtualized to access and scale the host virtual counter and timer of the CPU based on the scaling factors of the guest virtual counter in response to trapping access to the host virtual counter and timer by an application in the VM executing at a third privilege level of the CPU, the third privilege level being less privileged than the second privilege level.