Nested Page Tables.
Normally, the OS swaps page tables when it ācontext switchesā between processes as it multitasks, sometimes it needs to do this just to answer a syscall or use a driver to talk to hardware.
The tables map virtual memory addresses grouped into pages of memory as seen by a process, to physical memory addresses.
Without NPT, When running a virtualized OS, virtualized OS canāt be allowed to do that, because it canāt be allowed access to all of memory, so in order to keep things working safely, when guest OS tries to do it, that generates an exception / protection fault / ⦠trying to do one of these things, host OS needs to catch that and do it on behalf of the virtualized OS, in a safe manner, pretending like that operation succeeded.
NPT allows the host OS to assign a set of pages for the guest OS in advance as pages that are owned by this guest, and allow the guest OS to work within this set of pages, without having to go through the fault / interrupt / exception/ ⦠mechanism every time the guest needs to context switch from one process to another.
Itās similar to how a process on a system normally doesnāt have direct access to all of memory directly, but ends up running in some virtual address space that maps to physical memory via page tables. Itās ānestedā because itās just one more level of that.
This sucks more for ācompilingā in the guest because thereās lots of processes created all the time which creates memory spaces which is targeting the expensive path of the guest/host interaction.
It sucks, but sucks a bit less for gaming, because usually youād run your game and only a couple of idle other things in the guest os.
But, you may notice it more during gaming cause itās interactive, whereas usually when compiling, you press enter, you take a sip of coffee, or take a walk around the apartment or an office, and it may or may not be done by the time youāre back.
edited: cause I suck at explaining apparently and tend to presume lot of prior knowledge.