Task Gate Descriptor

TSS descriptors must reside in the GDT. Task Gate descriptors, on the other hand, may reside in the GDT, an LDT, or the IDT (Interrupt Descriptor Table). Figure 11-1 on page 195 illustrates the format of a Task Gate descriptor. It contains a 16-bit value that selects an entry in the GDT containing a TSS descriptor.

Task Gate Selected by a Far Call/Jump

When a far CALL or a far jump selects a Task Gate descriptor, the DPL of the Task Gate, rather than the DPL of the TSS descriptor, is checked during the privilege level check (the DPL of the TSS is ignored). A task switch occurs if the less-privileged of the RPL or CPL is at least as privileged as the Task Gate's DPL value. As examples:

  • A Task Gate with a DPL of three permits any program to jump to or call the task pointed to by the TSS descriptor.

  • A Task Gate with a DPL of two permits programs with privilege levels of zero through two to cause a task switch, while a program with a privilege level of three would cause a GP exception.

It should be noted that the offset portion of the branch target address is irrelevant and is discarded.

Task Gate Selected by a Hardware Interrupt or a Software Exception

When a Task Gate is placed in the IDT (see Figure 11-2 on page 196), any hardware interrupt or software exception that selects the IDT entry containing the Task Gate causes a task switch. Both the Task Gate's and the TSS descriptor's DPL are ignored. In other words, the privilege check isn't performed. More detail can be found in “Task Switch Details” on page 196.

Figure 11-2. The IDT (Interrupt Descriptor Table)


Task Gate Selected by an INT Instruction

If an INT nn/INTO/INT3 or a BOUND instruction selects an IDT entry containing a Task Gate, the privilege check is performed. The DPL of the Task Gate, rather than that of the TSS descriptor, is checked during the privilege level check (the DPL of the TSS is ignored). A task switch occurs if the less-privileged of the RPL or CPL is at least as privileged as the Task Gate's DPL value.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.143.228.40