CPC G06F 9/45558 (2013.01) [G06F 2009/45583 (2013.01)] | 20 Claims |
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.
|