With EPT a hypervisor can run a guest in real mode and without paging,
if the CPU has "unrestricted guest". Without it L1 has to emulate that
for L2, which is slow, and some hypervisors do not run at all. L1 is
now offered the control if the CPU has it.
- vmcs02 gets the control when L1 has set it. It needs "enable EPT" (SDM 27.2.1.1).
- CR0.PE and CR0.PG of such an L2 may be clear, which the check on L2's CR0 allows for.
- An exception that is injected into an L2 that is in real mode has no error code (27.2.1.3).
AI assistance: as D61708, this change was developed with an AI assistant (Anthropic's Claude) under my direction. The assistant wrote the code and this description. The tests in the test plan were run on real hardware.
Signed-off-by: Wanpeng Qian <wanpengqian@gmail.com>
Sponsored by: keelos.dev