It is possible for more than one exception to occur while attempting to execute an instruction. In order to determine what will happen if two simultaneous exceptions occur on the same instruction, use the following table:
┌────────────┬─┬────────────┬─┬────────────────────┐ │First │ │Second │ │Resulting │ ├────────────┼─┼────────────┼─┼────────────────────┤ │Exception │ │Exception │ │Action │ ├────────────┼─┼────────────┼─┼────────────────────┤ ├────────────┼─┼────────────┼─┼────────────────────┤ │Benign │ │Benign │ │OK │ ├────────────┼─┼────────────┼─┼────────────────────┤ │Benign │ │Contributory│ │OK │ ├────────────┼─┼────────────┼─┼────────────────────┤ │Benign │ │Page Fault │ │OK │ ├────────────┼─┼────────────┼─┼────────────────────┤ │Contributory│ │Benign │ │OK │ ├────────────┼─┼────────────┼─┼────────────────────┤ │Contributory│ │Contributory│ │Double Fault │ ├────────────┼─┼────────────┼─┼────────────────────┤ │Contributory│ │Page Fault │ │OK │ ├────────────┼─┼────────────┼─┼────────────────────┤ │Page Fault │ │Benign │ │OK │ ├────────────┼─┼────────────┼─┼────────────────────┤ │Page Fault │ │Contributory│ │Double Fault │ ├────────────┼─┼────────────┼─┼────────────────────┤ │Page Fault │ │Page Fault │ │Double Fault │ └────────────┴─┴────────────┴─┴────────────────────┘
Note: OK means the faults are processed consecutively.
Note: Double Fault means the faults are reported together.
Note: If any other exception occurs trying to enter the DoubleFault handler, the processor shuts down until RESET; although, if the NMI handler has not been entered, NMI will be recognized and accepted.
Note: A trap C in Ring 0 is usually a double fault.
When the processor detects a Stack Exception it needs to push an error code and a return address onto the stack of the exception handler. If this happens in Ring 0, there will be no privilege level transition, which includes switching to a new, protected stack. If the exception is due to stack growth, there is no place to push the error code or return address.
RESULT: TRAP 8