It's very odd. I keep getting this VM exit when I'm trying to run a guest in real mode. EPT is setup and VM entry seems to be successful. But immediately a VM exit would occur and the exit reason is zero, so it means it's due to an exception or NMI. The VM exit Interrupt Information contains the value that ends with an 'E', which is the exception vector number 14, a page fault!
How can this be possible when the guest is running in real mode? Am I missing anything?
Any help is appreciated.
Processor: i7-2600 Sandy Bridge.
hello, I got some feedback from my peers on this topic:
It is possible to get a VM exit due to a page-fault exception (#PF) from guest software that is operating with CR0.PG = 0.
It is possible if the guest software was operating with VPIDs enabled and the VMM had earlier run guest software with VPIDs enabled, with CR0.PG = 1, and with the same VPID value. (It does not matter whether it is the “same guest” — as long as it ran with the same VPID value.)
A properly written VMM should use an instruction such as INVVPID or INVEPT to ensure that no TLB translations persist from the earlier execution (with paging on) to the later execution (with paging off).
If software fails to do this, it is possible that an attempt to write to a page may cause a #PF (even with paging disabled) if that page had been read-only earlier in execution when paging had been enabled. A similar situation may occur for a code fetch from a page that had execute-disabled earlier in execution.