Intel 64 and IA-32 Architectures Software Developers Manual Volume 3B, System Programming Guide Part 2

Table Of Contents
26-2 Vol. 3
VIRTUAL-MACHINE MONITOR PROGRAMMING CONSIDERATIONS
By using the similarity between real-mode and virtual-8086 mode to support
real-mode guest execution in a virtual-8086 container. The virtual-8086
container may be implemented as a virtual-8086 container task within a monitor
that emulates real-mode guest state and instructions, or by running the guest VM
as the virtual-8086 container (by entering the guest with RFLAGS.VM
1
set).
Attempts by real-mode code to access privileged state outside the virtual-8086
container would trap to the VMM and would also need to be emulated.
Another example of such a condition is guest execution in protected mode with
paging disabled. A VMM could support such guest execution by using “identity” page
tables to emulate unpaged protected mode.
26.2.1 Emulating Guest Execution
In certain conditions, VMMs may resort to using a virtual-8086 container to support
guest execution in operating modes not supported by VMX. But for other conditions,
VMMs may need to resort to emulating guest execution.
These are example conditions that require guest emulation in the VMM:
Programming conditions that are not allowed by the VMX consistency checks.
Examples of this include transient conditions introduced when switching between
real-mode and protected mode (where some segment may not be consistent with
the operating mode).
Conditions of guest task switching. Task switches always cause VM exits. To
correctly advance the guest state, the monitor needs to emulate the guest task-
switching behavior.
When a SMM monitor is configured, conditions where the SMRAM is relocated to
an address above 1 MByte (HSEG).
When executing SMM code in a guest container by an SMM monitor. SMM
processor operation allows address space ranges from 0-4 GBytes compared to
the 1 MByte address space in real-mode operation. Also, the 64-KByte segment
limit of real-mode is increased to 4 GBytes in SMM).
26.3 MANAGING VMCS REGIONS AND POINTERS
A VMM must observe necessary procedures when working with a VMCS, the associ-
ated VMCS pointer, and the VMCS region. It must also not assume the state of persis-
tency for VMCS regions in memory or cache.
1. This chapter uses the notation RAX, RIP, RSP, RFLAGS, etc. for processor registers because most
processors that support VMX operation also support Intel 64 architecture. For processors that do
not support Intel 64 architecture, this notation refers to the 32-bit forms of those registers
(EAX, EIP, ESP, EFLAGS, etc.).