Vol. 3 6-51
INTERRUPT AND EXCEPTION HANDLING
• Loading the CR0 register with a set NW flag and a clear CD flag.
• Referencing an entry in the IDT (following an interrupt or exception) that is not
an interrupt, trap, or task gate.
• Attempting to access an interrupt or exception handler through an interrupt or
trap gate from virtual-8086 mode when the handler’s code segment DPL is
greater than 0.
• Attempting to write a 1 into a reserved bit of CR4.
• Attempting to execute a privileged instruction when the CPL is not equal to 0 (see
Section 5.9, “Privileged Instructions,” for a list of privileged instructions).
• Writing to a reserved bit in an MSR.
• Accessing a gate that contains a null segment selector.
• Executing the INT n instruction when the CPL is greater than the DPL of the
referenced interrupt, trap, or task gate.
• The segment selector in a call, interrupt, or trap gate does not point to a code
segment.
• The segment selector operand in the LLDT instruction is a local type (TI flag is
set) or does not point to a segment descriptor of the LDT type.
• The segment selector operand in the LTR instruction is local or points to a TSS
that is not available.
• The target code-segment selector for a call, jump, or return is null.
• If the PAE and/or PSE flag in control register CR4 is set and the processor detects
any reserved bits in a page-directory-pointer-table entry set to 1. These bits are
checked during a write to control registers CR0, CR3, or CR4 that causes a
reloading of the page-directory-pointer-table entry.
• Attempting to write a non-zero value into the reserved bits of the MXCSR register.
• Executing an SSE/SSE2/SSE3 instruction that attempts to access a 128-bit
memory location that is not aligned on a 16-byte boundary when the instruction
requires 16-byte alignment. This condition also applies to the stack segment.
A program or task can be restarted following any general-protection exception. If the
exception occurs while attempting to call an interrupt handler, the interrupted
program can be restartable, but the interrupt may be lost.
Exception Error Code
The processor pushes an error code onto the exception handler's stack. If the fault
condition was detected while loading a segment descriptor, the error code contains a
segment selector to or IDT vector number for the descriptor; otherwise, the error
code is 0. The source of the selector in an error code may be any of the following:
• An operand of the instruction.
• A selector from a gate which is the operand of the instruction.