Volume 3A System Programming Guide_ Part 1 (794103), страница 18
Текст из файла (страница 18)
. . . . . . . . . . . . . . . . . . . . . . . . . 1-7Natural-Width Guest-State Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-8Natural-Width Host-State Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . 1-9APPENDIX IVMX BASIC EXIT REASONSAPPENDIX JVM INSTRUCTION ERROR NUMBERSJ.1ERROR NUMBERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1Vol. 3A xxviiCONTENTSPAGEFIGURESFigure 1-1.Figure 1-2.Figure 2-1.Figure 2-2.Figure 2-3.Figure 2-4.Figure 2-5.Figure 2-6.Figure 3-1.Figure 3-2.Figure 3-3.Figure 3-4.Figure 3-5.Figure 3-6.Figure 3-7.Figure 3-8.Figure 3-9.Figure 3-10.Figure 3-11.Figure 3-12.Figure 3-13.Figure 3-14.Figure 3-15.Figure 3-16.Figure 3-17.Figure 3-18.Figure 3-19.Figure 3-20.Figure 3-21.Figure 3-22.Figure 3-23.Figure 3-24.Figure 3-25.Figure 3-26.Figure 3-27.Figure 3-28.Figure 4-1.Figure 4-2.Figure 4-3.Figure 4-4.Figure 4-5.Figure 4-6.Figure 4-7.Figure 4-8.xxviii Vol.
3ABit and Byte Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-7Syntax for CPUID, CR, and MSR Data Presentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-9IA-32 System-Level Registers and Data Structures . . . . .
. . . . . . . . . . . . . . . . . . . . . . . 2-3System-Level Registers and Data Structures in IA-32e Mode . . . . . . . . . . . . . . . . . . . 2-4Transitions Among the Processor’s Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . 2-11System Flags in the EFLAGS Register .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-13Memory Management Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-16Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-19Segmentation and Paging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2Flat Model . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4Protected Flat Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-4Multi-Segment Model. . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-6Logical Address to Linear Address Translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-9Segment Selector . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-10Segment Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-11Segment Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-13Segment Descriptor When Segment-Present Flag Is Clear . . . . . . . . . . . . . . . . . . . . . 3-15Global and Local Descriptor Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . 3-20Pseudo-Descriptor Formats. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-22Linear Address Translation (4-KByte Pages) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . 3-26Linear Address Translation (4-MByte Pages) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-27Format of Page-Directory and Page-Table Entries for 4-KByte Pagesand 32-Bit Physical Addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . 3-29Format of Page-Directory Entries for 4-MByte Pages and 32-Bit Addresses. . . . 3-30Format of a Page-Table or Page-Directory Entry for a Not-Present Page. . . . . . . 3-33Register CR3 Format When the Physical Address Extension is Enabled. . . . . . . . . 3-34Linear Address Translation With PAE Enabled (4-KByte Pages) . . . . . . . . . . . . . . . . 3-35Linear Address Translation With PAE Enabled (2-MByte Pages) . . . . . . .
. . . . . . . . . 3-36Format of Page-Directory-Pointer-Table, Page-Directory, and Page-TableEntries for 4-KByte Pages with PAE Enabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-38Format of Page-Directory-Pointer-Table and Page-Directory Entries for 2-MBytePages with PAE Enabled. . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-39Linear Address Translation (4-MByte Pages) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-41Format of Page-Directory Entries for 4-MByte Pages and36-Bit Physical Addresses . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-42IA-32e Mode Paging Structures (4-KByte Pages) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-44IA-32e Mode Paging Structures (2-MByte pages) . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . 3-45Format of Paging Structure Entries for 4-KByte Pages in IA-32e Mode. . . . . . . . . 3-46Format of Paging Structure Entries for 2-MByte Pages in IA-32e Mode . . . . . . . . 3-47Memory Management Convention That Assigns a Page Tableto Each Segment. . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-50Descriptor Fields Used for Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-4Descriptor Fields with Flags used in IA-32e Mode . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . 4-6Protection Rings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10Privilege Check for Data Access. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . 4-12Examples of Accessing Data Segments From Various Privilege Levels. . . . . . . . . . 4-13Privilege Check for Control Transfer Without Using a Gate . . . . . . . . . . . . . . . . . . . . 4-15Examples of Accessing Conforming and Nonconforming Code SegmentsFrom Various Privilege Levels . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-17Call-Gate Descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-19CONTENTSPAGEFigure 4-9.Figure 4-10.Figure 4-11.Figure 4-12.Figure 4-13.Figure 4-14.Figure 4-15.Figure 5-1.Figure 5-2.Figure 5-3.Figure 5-4.Figure 5-5.Figure 5-6.Figure 5-7.Figure 5-8.Figure 5-9.Figure 6-1.Figure 6-2.Figure 6-3.Figure 6-4.Figure 6-5.Figure 6-6.Figure 6-7.Figure 6-8.Figure 6-9.Figure 6-10.Figure 6-11.Figure 7-1.Figure 7-2.Figure 7-3.Figure 7-4.Figure 7-5.Figure 7-6.Figure 8-1.Figure 8-2.Figure 8-3.Figure 8-4.Figure 8-5.Figure 8-6.Figure 8-7.Figure 8-8.Figure 8-9.Figure 8-10.Figure 8-11.Figure 8-12.Figure 8-13.Figure 8-14.Figure 8-15.Figure 8-16.Call-Gate Descriptor in IA-32e Mode . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-21Call-Gate Mechanism. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-22Privilege Check for Control Transfer with Call Gate . . . . . . . . . . . .
. . . . . . . . . . . . . . . .4-23Example of Accessing Call Gates At Various Privilege Levels . . . . . . . . . . . . . . . . . . .4-25Stack Switching During an Interprivilege-Level Call . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-27MSRs Used by SYSCALL and SYSRET . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4-33Use of RPL to Weaken Privilege Level of Called Procedure . . . . . . . . . . . . . . . . . . . . .4-38Relationship of the IDTR and IDT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-14IDT Gate Descriptors. . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-15Interrupt Procedure Call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5-16Stack Usage on Transfers to Interrupt and Exception-Handling Routines . . . . . . .5-18Interrupt Task Switch. . . . . . .