Jonas Haglund

Timer virtualisation for hypervisors

Abstract





A hypervisor is installed directly on top of a computer's hardware. Above this hypervisor is then several operating systems installed, called guests. This technique offers a number of efficient solutions: better resource utilisation; less hardware and physical space is needed; and security in the form of isolation.

For a hypervisor to be able to offer these possibilities it must be able to do context switches in order to give all guests execution time. But this can also be said about the guests and their applications. To perform these context switches a timer is used.

This means that the same timer shall be used by several users simultaneously. Because of the possibilities and the timer's importance it is interesting to investigate how a timer component can be constructed for a hypervisor. This was done by means of a general design and by an implementation on the ARM architecture.

An important decision was how the timers should be counting the guests' time: either continuously or the execution time. The last option was chosen because it shows the guest operating systems for how long time their applications have been executing, and thereby unnecessary context switches are avoided.

Another important question is for how long does a hypervisor delay the timer interrupt for the guest operating system. The ambition was to not execute more than 100 instructions between the interrupt occurred and till the operating system was executing the interrupt routine. This ambition was achieved with circa 40 instructions.

One conclusion was that a timer component shall offer the guest operating systems several different types of timers. Therefore this timer component is only one part of a complete timer component.