VM is not really an emulation. If the
guest's
code is just user level code, then
it just runs as usual directly in the
hardware processor. But if in the guest's code
there is a
privileged instruction, that is,
an instruction reserved for an operating system,
then the VM
gets an interrupt and, then, decides if
VM wants to execute the privileged instruction
on behalf of the guest. To make this
all efficient, there is some hardware called
virtual machine assist.
Comments
VM is not really an emulation. If the guest's code is just user level code, then it just runs as usual directly in the hardware processor. But if in the guest's code there is a privileged instruction, that is, an instruction reserved for an operating system, then the VM gets an interrupt and, then, decides if VM wants to execute the privileged instruction on behalf of the guest. To make this all efficient, there is some hardware called virtual machine assist.