What is trap and emulation in virtualization? Is my understanding correct?
Trap is generated by VM when privilege instruction execution is failed in VM. Trap is generated by VM and sent it to Hypervisor.Now Hypervisor will emulate the trap and creates other privilege instruction and sent it to Hardware for execution (since hypervisor is in kernel mode or higher privilege mode). Once emulated trap response is sent back to Hypervisor by hardware then hypervisor will emulate the response back to the VM and it will make Guest OS feel that it is working on real hardware.