> RIP仅从64位偏移量中获取吗？或者RIP =偏移(符号扩展到64位)段选择器基数？
In long mode, the effects of segmentation depend on whether the processor is running in compatibility
mode or 64-bit mode:
- In compatibility mode, segmentation functions just as it does in legacy mode, using legacy 16-bit or 32-bit protected mode semantics.
- 64-bit mode, segmentation is disabled, creating a flat 64-bit virtual-address space. As will be seen, certain functions of some
segment registers, particularly the system-segment registers, continue
to be used in 64-bit mode.
Fields Ignored in 64-Bit Mode. Segmentation is disabled in 64-bit
mode, and code segments span all of virtual memory. In this mode, code-segment base addresses are ignored. For the purpose of virtual-address calculations, the base address is treated as if it has a value of zero.
因此,这将回答我认为的第一个问题 – RIP被视为64位偏移值.从同章的门描述符页面：
In long mode, gate descriptors are expanded by 64 bits, allowing them to hold 64-bit offsets.
Data segments referenced by the FS and GS segment registers receive special treatment in 64-bit
mode. For these segments, the base address field is not ignored, and a non-zero value can be used
in virtual-address calculations. A 64-bit segment-base address can be specified using model-
specific registers. See “FS and GS Registers in 64-Bit Mode” on page 70 for more information.
FS and GS Registers in 64-Bit Mode. Unlike the CS, DS, ES, and SS segments, the FS and GS
segment overrides can be used in 64-bit mode. When FS and GS segment overrides are used in 64-bit
mode, their respective base addresses are used in the effective-address (EA) calculation. The complete
EA calculation then becomes (FS or GS).base + base + (scale ∗ index) + displacement. The FS.base
and GS.base values are also expanded to the full 64-bit virtual-address size, as shown in Figure 4-5.
The resulting EA calculation is allowed to wrap across positive and negative addresses.
In 64-bit mode, FS-segment and GS-segment overrides are not checked for limit or attributes. Instead,
the processor checks that all virtual-address references are in canonical form.