Updated: October 28, 2024 |
A QNX hypervisor comprises the hypervisor microkernel, virtualization extensions, and one or more instances of the qvm process.
The diagram above presents a static view of a hypervisor system. Unfortunately, it is necessarily misleading, in that it can be interpreted as suggesting that guests actually run in VMs or on the host system; to make matters worse, when describing a hypervisor system, we often say that a guest is running in a VM.
In fact, a guest doesn't actually run in a VM. The hypervisor isn't an intermediary that translates the guest's instructions for the CPU. The VM defines virtual hardware (see Virtual devices) and presents it and pass-through hardware (see Pass-through devices) to the guest, which doesn't need to know it is running in a VM rather than in an environment defined directly by the hardware.
That is, when a guest is running, its instructions execute on a physical CPU, just as if the guest were running without a hypervisor. Only when the guest attempts to execute an instruction that it is not permitted to execute or when it accesses guest memory that the hypervisor is monitoring does the virtualization hardware trap the attempt and force the guest to exit.
On the trap, the hardware notifies the hypervisor, which saves the guest's context (guest exit) and completes the task the guest had begun but was unable to complete for itself. On completion of the task, the hypervisor restores the guest's context and hands execution back to the guest (guest entrance).
For information about what the hypervisor does to mitigate time drift in the guest (caused by the need to have the guest exit), see Time in this chapter.