CPC G06F 9/45558 (2013.01) [G06F 2009/45583 (2013.01)] | 17 Claims |
1. A method of managing guest time for a virtual machine (VM) supported by a hypervisor of a virtualized host computer, the method comprising:
configuring, by the hypervisor, a central processing unit (CPU) of the host computer to trap, to the hypervisor, access by guest code in the VM to a physical counter and timer of the CPU;
configuring, by the hypervisor, the guest code in the VM to use the physical counter and timer of the CPU rather than a virtual counter and timer of the CPU by masking, a device tree presented to the guest code by the hypervisor, presence of the virtual counter and timer in the CPU;
trapping, at the hypervisor, an access to the physical counter and timer by the guest code; and
executing, by the hypervisor, the access to the physical counter and timer on behalf of the guest code while compensating for an adjustment of a system count of the physical counter and timer to maintain the guest time as scaled with respect to frequency of the physical counter and timer.
|