assembly64-bitintelhypervisorvt-x

Why does the VMCS ES selector have a index of 0 instead of 3?


I found that the ES selector field is 0x0800 but shouldn’t it be 0x0806 since it’s the 3rd index in the list CS, SS, DS, ES, FS, GS, LDTR, TR

I got the selector list from Volume 3C: System Programming Guide, Part 3 manual and I got the field value from VMCS field encodings


Solution

  • The register ordering "CS, SS, DS, ES, FS, GS, LDTR, TR" that you show isn't relevant here. The encoding of the VMCS fields is described (for the June 2024 version) in Intel 64 and IA-32 Architectures Software Developer’s Manual - Volume 3 (3A, 3B, 3C, & 3D): System Programming Guide - Appendix B Field Encoding in VMCS.

    In Table B-2. Encodings for 16-Bit Guest-State Fields (0000_10xx_xxxx_xxx0B), the Guest ES selector is shown to have index 000000000B, encoding 00000800H.