- Certain events are intercepted by the hypervisor
- On that event, the processor:
- saves the current register values into the context structure
- loads the previously saved register values from a host-state area
- changes the processor mode to the host-mode
- starts execution
- This guest-to-host-mode transition is called:
- Intel: VM-exit 📖CHAPTER 28 VM EXITS
- AMD: #VMEXIT 📖15.6 #VMEXIT
- We call it as "VM exit"
- Note that guest uses actual registers and actually runs instructions on a processor.
- There is no "virtual register" or "virtual processor".
- HW VT is a mechanism to perform world switches, ie, changing actual register values.
- Akin to task/process context switching:
- VMCS/VMCB = "task/process" struct
VMLAUNCH
/VMRESUME
/VMRUN
= context switch to a task
- VM-exit/#VMEXIT = preempting the task