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

Table Of Contents
Vol. 3 23-27
VM EXITS
23.3.2 Saving Segment Registers and Descriptor-Table Registers
For each segment register (CS, SS, DS, ES, FS, GS, LDTR, or TR), the values saved
for the base-address, segment-limit, and access rights are based on whether the
register was unusable (see Section 20.4.1) before the VM exit:
If the register was unusable, the values saved into the following fields are
undefined: (1) base address; (2) segment limit; and (3) bits 7:0 and bits 15:12
in the access-rights field. The following exceptions apply:
—CS.
The base-address and segment-limit fields are saved.
The L, D, and G bits are saved in the access-rights field.
SS.
DPL is saved in the access-rights field.
On processors that support Intel 64 architecture, bits 63:32 of the value
saved for the base address are always zero.
DS and ES. On processors that support Intel 64 architecture, bits 63:32 of
the values saved for the base addresses are always zero.
FS and GS. The base-address field is saved.
LDTR. The value saved for the base address is always canonical.
If the register was not unusable, the values saved into the following fields are
those which were in the register before the VM exit: (1) base address;
(2) segment limit; and (3) bits 7:0 and bits 15:12 in access rights.
Bits 31:17 and 11:8 in the access-rights field are always cleared. Bit 16 is set to
1 if and only if the segment is unusable.
The contents of the GDTR and IDTR registers are saved into the corresponding base-
address and limit fields.
23.3.3 Saving RIP, RSP, and RFLAGS
The contents of the RIP, RSP, and RFLAGS registers are saved as follows:
The value saved in the RIP field is determined by the nature and cause of the
VM exit:
If the VM exit occurs due to by an attempt to execute an instruction that
causes VM exits unconditionally or that has been configured to cause a
VM exit via the VM-execution controls, the value saved references that
instruction.
If the VM exit is caused by an occurrence of an INIT signal, a start-up IPI
(SIPI), or system-management interrupt (SMI), the value saved is that which
was in RIP before the event occurred.