Jump to content

Triple fault: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Monkbot (talk | contribs)
m References: Task 16: replaced (3×) / removed (0×) deprecated |dead-url= and |deadurl= with |url-status=;
m Other uses: changed "Linux" link to point to "Linux kernel"
Line 18: Line 18:
The [[Intel 80286]] processor was the first x86 processor to introduce the now-ubiquitous [[protected mode]]. However, the 286 could not revert to the basic 8086-compatible "[[real mode]]" without resetting the processor, which can only be done using hardware external to the CPU. On the [[IBM Personal Computer AT|IBM AT]] and compatibles, the documented method of doing this was to use a special function on the [[Intel 8042]] keyboard controller, which would assert the RESET pin of the processor. However, intentionally triple-faulting the CPU was found to cause the transition to occur much faster and more cleanly, permitting multitasking operating systems to switch back and forth at high speed.<ref name="Osterman_2005_286"/>
The [[Intel 80286]] processor was the first x86 processor to introduce the now-ubiquitous [[protected mode]]. However, the 286 could not revert to the basic 8086-compatible "[[real mode]]" without resetting the processor, which can only be done using hardware external to the CPU. On the [[IBM Personal Computer AT|IBM AT]] and compatibles, the documented method of doing this was to use a special function on the [[Intel 8042]] keyboard controller, which would assert the RESET pin of the processor. However, intentionally triple-faulting the CPU was found to cause the transition to occur much faster and more cleanly, permitting multitasking operating systems to switch back and forth at high speed.<ref name="Osterman_2005_286"/>


Some operating system kernels, such as [[Linux]], still use triple faults as a last effort in their rebooting process if an [[Advanced Configuration and Power Interface|ACPI]] reboot fails. This is done by setting the IDT register to 0 and then issuing an interrupt.<ref name="Collins_2000_Triple"/> Since the table now has length 0, all attempts to access it fail and the processor generates a triple fault.
Some operating system kernels, such as [[Linux kernel|Linux]], still use triple faults as a last effort in their rebooting process if an [[Advanced Configuration and Power Interface|ACPI]] reboot fails. This is done by setting the IDT register to 0 and then issuing an interrupt.<ref name="Collins_2000_Triple"/> Since the table now has length 0, all attempts to access it fail and the processor generates a triple fault.


==References==
==References==

Revision as of 23:47, 27 December 2020

On the x86 computer architecture, a triple fault is a special kind of exception generated by the CPU when an exception occurs while the CPU is trying to invoke the double fault exception handler, which itself handles exceptions occurring while trying to invoke a regular exception handler.

x86 processors beginning with the 80286 will cause a shutdown cycle to occur when a triple fault is encountered. This typically causes the motherboard hardware to initiate a CPU reset, which, in turn, causes the whole computer to reboot.[1][2]

Possible causes of triple faults

Triple faults indicate a problem with the operating system kernel or device drivers. In modern operating systems, a triple fault is typically caused by a buffer overflow or underflow in a device driver which writes over the interrupt descriptor table (IDT). If the IDT is corrupted, when the next interrupt happens, the processor will be unable to call either the needed interrupt handler or the double fault handler because the descriptors in the IDT are corrupted.[citation needed]

Virtual machines

In QEMU, a triple fault produces a dump of the virtual machine in the console, with the instruction pointer set to the instruction that triggered the first exception.

When using Intel VT-x, a triple fault causes a VM exit, with exit reason 2. The exit reason is saved to the VMCS and may be handled by the VMM software.

Other uses

The Intel 80286 processor was the first x86 processor to introduce the now-ubiquitous protected mode. However, the 286 could not revert to the basic 8086-compatible "real mode" without resetting the processor, which can only be done using hardware external to the CPU. On the IBM AT and compatibles, the documented method of doing this was to use a special function on the Intel 8042 keyboard controller, which would assert the RESET pin of the processor. However, intentionally triple-faulting the CPU was found to cause the transition to occur much faster and more cleanly, permitting multitasking operating systems to switch back and forth at high speed.[3]

Some operating system kernels, such as Linux, still use triple faults as a last effort in their rebooting process if an ACPI reboot fails. This is done by setting the IDT register to 0 and then issuing an interrupt.[1] Since the table now has length 0, all attempts to access it fail and the processor generates a triple fault.

References

  1. ^ a b Collins, Robert (2000). "Triple Faulting the CPU". Productivity Enhancements and Programming Tricks. Archived from the original on 2017-09-09. Retrieved 2015-11-22.
  2. ^ Collins, Robert (2000). "ELEGANT RESET". Archived from the original on 2017-09-09. Retrieved 2017-09-09.
  3. ^ Osterman, Larry (2005-02-08). "Faster Syscall Trap redux". Larry Osterman's WebLog. MSDN Blogs. Archived from the original on 2017-09-09. Retrieved 2010-07-23.