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

Table Of Contents
Vol. 3 25-13
SYSTEM MANAGEMENT
The default operand and address sizes are set to 16 bits, which restricts the
addressable SMRAM address space to the 1-MByte real-address mode limit for
native real-address-mode code. However, operand-size and address-size
override prefixes can be used to access the address space beyond the 1-MByte.
Near jumps and calls can be made to anywhere in the 4-GByte address space if a
32-bit operand-size override prefix is used. Due to the real-address-mode style
of base-address formation, a far call or jump cannot transfer control to a
segment with a base address of more than 20 bits (1 MByte). However, since the
segment limit in SMM is 4 GBytes, offsets into a segment that go beyond the
1-MByte limit are allowed when using 32-bit operand-size override prefixes. Any
program control transfer that does not have a 32-bit operand-size override prefix
truncates the EIP value to the 16 low-order bits.
Data and the stack can be located anywhere in the 4-GByte address space, but
can be accessed only with a 32-bit address-size override if they are located above
1 MByte. As with the code segment, the base address for a data or stack segment
cannot be more than 20 bits.
The value in segment register CS is automatically set to the default of 30000H for the
SMBASE shifted 4 bits to the right; that is, 3000H. The EIP register is set to 8000H.
When the EIP value is added to shifted CS value (the SMBASE), the resulting linear
address points to the first instruction of the SMI handler.
The other segment registers (DS, SS, ES, FS, and GS) are cleared to 0 and their
segment limits are set to 4 GBytes. In this state, the SMRAM address space may be
treated as a single flat 4-GByte linear address space. If a segment register is loaded
with a 16-bit value, that value is then shifted left by 4 bits and loaded into the
segment base (hidden part of the segment register). The limits and attributes are not
modified.
Table 25-4. Processor Register Initialization in SMM
Register Contents
General-purpose registers Undefined
EFLAGS 00000002H
EIP 00008000H
CS selector SMM Base shifted right 4 bits (default 3000H)
CS base SMM Base (default 30000H)
DS, ES, FS, GS, SS Selectors 0000H
DS, ES, FS, GS, SS Bases 000000000H
DS, ES, FS, GS, SS Limits 0FFFFFFFFH
CR0 PE, EM, TS, and PG flags set to 0; others unmodified
CR4 Cleared to zero
DR6 Undefined
DR7 00000400H