If multiple virtual machines share a physical core, the hypervisor uses real-time scheduling policies to switch between virtual machines. The virtual machines’ view of CPU time on a physical core is provided by a virtual CPU (vCPU). The vCPU is used by the real-time operating system running in the virtual machine to schedule tasks. Thus, a 2-level scheduling mechanism is implemented. The hypervisor ensures that each virtual machine gets the configured amount of CPU time, while the RTOS scheduler assigns the provided CPU time to tasks based on their priorities.
Another important aspect for temporal separation is the management of interrupts. In most cases, the hypervisor assigns interrupts to specific virtual machines that use the corresponding devices. The hypervisor may also have to handle some interrupts at first and then notify the virtual machines, for example if multiple virtual machines share a physical core. The hypervisor may also have to take special care when virtual machines use hardware semaphores, in order to avoid conflicts between virtual machines.
The ARMv8-R architecture supports an additional privilege level for the hypervisor as well as virtualization of core timers. This makes implementation of 2-level schedulers easier. Moreover, the ARM Generic Interrupt Controller (GIC) has support for virtualization as well, allowing the hypervisor to directly route interrupts to virtual machines as well as virtualize interrupts. ARM virtualization extensions also make context switching between virtual machines easier.
In addition, the hypervisor must provide means for efficient and safe communication between virtual machines. The hypervisor may encapsulate the complete communication mechanisms, which is conceptually similar to the Inter-OS-Application Communicator (IOC) from AUTOSAR. Alternatively, the hypervisor may provide only the basic mechanisms needed to set up a communication channel to virtual machines: shared memory and, optionally, a notification mechanism between the virtual machines. In this case, the virtual machines execute the appropriate communication mechanisms.