Vol. 3 6-49
INTERRUPT AND EXCEPTION HANDLING
Program State Change
A program-state change does not generally accompany a stack-fault exception,
because the instruction that generated the fault is not executed. Here, the instruction
can be restarted after the exception handler has corrected the stack fault condition.
If a stack fault occurs during a task switch, it occurs after the commit-to-new-task
point (see Section 7.3, “Task Switching”). Here, the processor loads all the state
information from the new TSS (without performing any additional limit, present, or
type checks) before it generates the exception. The stack fault handler should thus
not rely on being able to use the segment selectors found in the CS, SS, DS, ES, FS,
and GS registers without causing another exception. The exception h an dl er sh ou ld
check all segment registers before trying to resume the new task; otherwise, general
protection faults may result later under conditions that are more difficult to diagnose.
(See the Program State Change description for “Interrupt 10—Invalid TSS Exception
(#TS)” in this chapter for additional information on how to handle this situation.)