I’ve been trying to figure out how VMware works (specifically when Linux is installed) and I have a couple of questions:
-
What happens when VMware encounters a command like
push cs? Specifically cs since its privilege level is 0 and VMware runs on 1 privilege level, so I’m assuming it somehow has to translate it into someother command. -
Virtual memory : How does it work on a virtual machine? are there 2 levels of translation – process virtual memory -> virtual machine physical memory -> real machine physical memory ? how would VMware be notified when a page is being swapped off by the real machine?
Most instructions run directly on the CPU. But privileged instructions cause an exception, the handler emulates them.push csexample. You mean instructions that silently behave differently on different privilege levels. The wikipedia article on x86 virtualization says they are binary translated, i.e. there is a recompilation phase before running the code on the host CPU.