Vol. 3 17-31
8086 EMULATION
It is only possible to enter virtual-8086 mode through a task switch or the execution
of an IRET instruction, and it is only possible to leave virtual-8086 mode by faulting
to a protected-mode interrupt handler (typically the general-protection exception
handler, which in turn calls the virtual 8086-mode monitor). In both cases, the
EFLAGS register is saved and restored. This is not true, however, in protected mode
when the PVI flag is set and the processor is not in virtual-8086 mode. Here, it is
possible to call a procedure at a different privilege level, in which case the EFLAGS
register is not saved or modified. However, the states of VIF and VIP flags are never
examined by the processor when the CPL is not 3.