2 * linux/arch/x86-64/traps.c
4 * Copyright (C) 1991, 1992 Linus Torvalds
5 * Copyright (C) 2000, 2001, 2002 Andi Kleen, SuSE Labs
7 * Pentium III FXSR, SSE support
8 * Gareth Hughes <gareth@valinux.com>, May 2000
10 * $Id: traps.c,v 1.36 2002/03/24 11:09:10 ak Exp $
14 * 'Traps.c' handles hardware traps and faults after we have saved some
17 #include <linux/config.h>
18 #include <linux/sched.h>
19 #include <linux/kernel.h>
20 #include <linux/string.h>
21 #include <linux/errno.h>
22 #include <linux/ptrace.h>
23 #include <linux/timer.h>
25 #include <linux/init.h>
26 #include <linux/delay.h>
27 #include <linux/spinlock.h>
28 #include <linux/interrupt.h>
29 #include <linux/module.h>
30 #include <linux/moduleparam.h>
31 #include <linux/nmi.h>
33 #include <asm/system.h>
34 #include <asm/uaccess.h>
36 #include <asm/atomic.h>
37 #include <asm/debugreg.h>
40 #include <asm/kdebug.h>
41 #include <asm/processor.h>
44 #include <asm/pgalloc.h>
46 #include <asm/proto.h>
49 #include <linux/irq.h>
52 extern struct gate_struct idt_table[256];
54 asmlinkage void divide_error(void);
55 asmlinkage void debug(void);
56 asmlinkage void nmi(void);
57 asmlinkage void int3(void);
58 asmlinkage void overflow(void);
59 asmlinkage void bounds(void);
60 asmlinkage void invalid_op(void);
61 asmlinkage void device_not_available(void);
62 asmlinkage void double_fault(void);
63 asmlinkage void coprocessor_segment_overrun(void);
64 asmlinkage void invalid_TSS(void);
65 asmlinkage void segment_not_present(void);
66 asmlinkage void stack_segment(void);
67 asmlinkage void general_protection(void);
68 asmlinkage void page_fault(void);
69 asmlinkage void coprocessor_error(void);
70 asmlinkage void simd_coprocessor_error(void);
71 asmlinkage void reserved(void);
72 asmlinkage void alignment_check(void);
73 asmlinkage void machine_check(void);
74 asmlinkage void spurious_interrupt_bug(void);
75 asmlinkage void call_debug(void);
77 struct notifier_block *die_chain;
78 static DEFINE_SPINLOCK(die_notifier_lock);
80 int register_die_notifier(struct notifier_block *nb)
84 spin_lock_irqsave(&die_notifier_lock, flags);
85 err = notifier_chain_register(&die_chain, nb);
86 spin_unlock_irqrestore(&die_notifier_lock, flags);
90 static inline void conditional_sti(struct pt_regs *regs)
92 if (regs->eflags & X86_EFLAGS_IF)
96 static int kstack_depth_to_print = 10;
98 #ifdef CONFIG_KALLSYMS
99 #include <linux/kallsyms.h>
100 int printk_address(unsigned long address)
102 unsigned long offset = 0, symsize;
108 symname = kallsyms_lookup(address, &symsize, &offset, &modname, namebuf);
110 return printk("[<%016lx>]", address);
112 modname = delim = "";
113 return printk("<%016lx>{%s%s%s%s%+ld}",
114 address,delim,modname,delim,symname,offset);
117 int printk_address(unsigned long address)
119 return printk("[<%016lx>]", address);
123 static unsigned long *in_exception_stack(unsigned cpu, unsigned long stack,
124 unsigned *usedp, const char **idp)
126 static const char ids[N_EXCEPTION_STACKS][8] = {
127 [DEBUG_STACK - 1] = "#DB",
128 [NMI_STACK - 1] = "NMI",
129 [DOUBLEFAULT_STACK - 1] = "#DF",
130 [STACKFAULT_STACK - 1] = "#SS",
131 [MCE_STACK - 1] = "#MC",
135 for (k = 0; k < N_EXCEPTION_STACKS; k++) {
138 end = per_cpu(init_tss, cpu).ist[k];
141 if (stack >= end - EXCEPTION_STKSZ) {
142 if (*usedp & (1U << k))
146 return (unsigned long *)end;
153 * x86-64 can have upto three kernel stacks:
156 * severe exception (double fault, nmi, stack fault, debug, mce) hardware stack
159 void show_trace(unsigned long *stack)
162 const unsigned cpu = safe_smp_processor_id();
163 unsigned long *irqstack_end = (unsigned long *)cpu_pda[cpu].irqstackptr;
167 printk("\nCall Trace:");
169 #define HANDLE_STACK(cond) \
172 if (kernel_text_address(addr)) { \
174 * If the address is either in the text segment of the \
175 * kernel, or in the region which contains vmalloc'ed \
176 * memory, it *may* be the address of a calling \
177 * routine; if so, print it so that someone tracing \
178 * down the cause of the crash will be able to figure \
179 * out the call path that was taken. \
181 i += printk_address(addr); \
193 unsigned long *estack_end;
194 estack_end = in_exception_stack(cpu, (unsigned long)stack,
198 i += printk(" <%s> ", id);
199 HANDLE_STACK (stack < estack_end);
200 i += printk(" <EOE> ");
201 stack = (unsigned long *) estack_end[-2];
205 unsigned long *irqstack;
206 irqstack = irqstack_end -
207 (IRQSTACKSIZE - 64) / sizeof(*irqstack);
209 if (stack >= irqstack && stack < irqstack_end) {
210 i += printk(" <IRQ> ");
211 HANDLE_STACK (stack < irqstack_end);
212 stack = (unsigned long *) (irqstack_end[-1]);
214 i += printk(" <EOI> ");
221 HANDLE_STACK (((long) stack & (THREAD_SIZE-1)) != 0);
226 void show_stack(struct task_struct *tsk, unsigned long * rsp)
228 unsigned long *stack;
230 const int cpu = safe_smp_processor_id();
231 unsigned long *irqstack_end = (unsigned long *) (cpu_pda[cpu].irqstackptr);
232 unsigned long *irqstack = (unsigned long *) (cpu_pda[cpu].irqstackptr - IRQSTACKSIZE);
234 // debugging aid: "show_stack(NULL, NULL);" prints the
235 // back trace for this cpu.
239 rsp = (unsigned long *)tsk->thread.rsp;
241 rsp = (unsigned long *)&rsp;
245 for(i=0; i < kstack_depth_to_print; i++) {
246 if (stack >= irqstack && stack <= irqstack_end) {
247 if (stack == irqstack_end) {
248 stack = (unsigned long *) (irqstack_end[-1]);
252 if (((long) stack & (THREAD_SIZE-1)) == 0)
255 if (i && ((i % 4) == 0))
257 printk("%016lx ", *stack++);
258 touch_nmi_watchdog();
260 show_trace((unsigned long *)rsp);
264 * The architecture-independent dump_stack generator
266 void dump_stack(void)
272 EXPORT_SYMBOL(dump_stack);
274 void show_registers(struct pt_regs *regs)
277 int in_kernel = !user_mode(regs);
279 const int cpu = safe_smp_processor_id();
280 struct task_struct *cur = cpu_pda[cpu].pcurrent;
284 printk("CPU %d ", cpu);
286 printk("Process %s (pid: %d, threadinfo %p, task %p)\n",
287 cur->comm, cur->pid, cur->thread_info, cur);
290 * When in-kernel, we also print out the stack and code at the
291 * time of the fault..
296 show_stack(NULL, (unsigned long*)rsp);
299 if(regs->rip < PAGE_OFFSET)
305 if(__get_user(c, &((unsigned char*)regs->rip)[i])) {
307 printk(" Bad RIP value.");
316 void handle_BUG(struct pt_regs *regs)
323 if (__copy_from_user(&f, (struct bug_frame *) regs->rip,
324 sizeof(struct bug_frame)))
326 if ((unsigned long)f.filename < __PAGE_OFFSET ||
327 f.ud2[0] != 0x0f || f.ud2[1] != 0x0b)
329 if (__get_user(tmp, f.filename))
330 f.filename = "unmapped filename";
331 printk("----------- [cut here ] --------- [please bite here ] ---------\n");
332 printk(KERN_ALERT "Kernel BUG at %.50s:%d\n", f.filename, f.line);
336 void out_of_line_bug(void)
342 static DEFINE_SPINLOCK(die_lock);
343 static int die_owner = -1;
345 void oops_begin(void)
347 int cpu = safe_smp_processor_id();
348 /* racy, but better than risking deadlock. */
350 if (!spin_trylock(&die_lock)) {
351 if (cpu == die_owner)
352 /* nested oops. should stop eventually */;
354 spin_lock(&die_lock);
365 spin_unlock(&die_lock);
370 void __die(const char * str, struct pt_regs * regs, long err)
372 static int die_counter;
373 printk(KERN_EMERG "%s: %04lx [%u] ", str, err & 0xffff,++die_counter);
374 #ifdef CONFIG_PREEMPT
380 #ifdef CONFIG_DEBUG_PAGEALLOC
381 printk("DEBUG_PAGEALLOC");
384 notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV);
385 show_registers(regs);
386 /* Executive summary in case the oops scrolled away */
387 printk(KERN_ALERT "RIP ");
388 printk_address(regs->rip);
389 printk(" RSP <%016lx>\n", regs->rsp);
392 void die(const char * str, struct pt_regs * regs, long err)
396 __die(str, regs, err);
400 static inline void die_if_kernel(const char * str, struct pt_regs * regs, long err)
402 if (!(regs->eflags & VM_MASK) && (regs->cs == __KERNEL_CS))
406 void die_nmi(char *str, struct pt_regs *regs)
410 * We are in trouble anyway, lets at least try
411 * to get a message out.
413 printk(str, safe_smp_processor_id());
414 show_registers(regs);
415 if (panic_on_timeout || panic_on_oops)
416 panic("nmi watchdog");
417 printk("console shuts up ...\n");
422 static void do_trap(int trapnr, int signr, char *str,
423 struct pt_regs * regs, long error_code, siginfo_t *info)
425 conditional_sti(regs);
427 #ifdef CONFIG_CHECKING
430 struct x8664_pda *pda = cpu_pda + safe_smp_processor_id();
431 rdmsrl(MSR_GS_BASE, gs);
432 if (gs != (unsigned long)pda) {
433 wrmsrl(MSR_GS_BASE, pda);
434 printk("%s: wrong gs %lx expected %p rip %lx\n", str, gs, pda,
440 if (user_mode(regs)) {
441 struct task_struct *tsk = current;
443 if (exception_trace && unhandled_signal(tsk, signr))
445 "%s[%d] trap %s rip:%lx rsp:%lx error:%lx\n",
446 tsk->comm, tsk->pid, str,
447 regs->rip,regs->rsp,error_code);
449 tsk->thread.error_code = error_code;
450 tsk->thread.trap_no = trapnr;
452 force_sig_info(signr, info, tsk);
454 force_sig(signr, tsk);
461 const struct exception_table_entry *fixup;
462 fixup = search_exception_tables(regs->rip);
464 regs->rip = fixup->fixup;
466 die(str, regs, error_code);
471 #define DO_ERROR(trapnr, signr, str, name) \
472 asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
474 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
477 do_trap(trapnr, signr, str, regs, error_code, NULL); \
480 #define DO_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr) \
481 asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
484 info.si_signo = signr; \
486 info.si_code = sicode; \
487 info.si_addr = (void __user *)siaddr; \
488 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
491 do_trap(trapnr, signr, str, regs, error_code, &info); \
494 DO_ERROR_INFO( 0, SIGFPE, "divide error", divide_error, FPE_INTDIV, regs->rip)
495 DO_ERROR( 4, SIGSEGV, "overflow", overflow)
496 DO_ERROR( 5, SIGSEGV, "bounds", bounds)
497 DO_ERROR_INFO( 6, SIGILL, "invalid operand", invalid_op, ILL_ILLOPN, regs->rip)
498 DO_ERROR( 7, SIGSEGV, "device not available", device_not_available)
499 DO_ERROR( 9, SIGFPE, "coprocessor segment overrun", coprocessor_segment_overrun)
500 DO_ERROR(10, SIGSEGV, "invalid TSS", invalid_TSS)
501 DO_ERROR(11, SIGBUS, "segment not present", segment_not_present)
502 DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0)
503 DO_ERROR(18, SIGSEGV, "reserved", reserved)
504 DO_ERROR(12, SIGBUS, "stack segment", stack_segment)
505 DO_ERROR( 8, SIGSEGV, "double fault", double_fault)
507 asmlinkage void do_general_protection(struct pt_regs * regs, long error_code)
509 conditional_sti(regs);
511 #ifdef CONFIG_CHECKING
514 struct x8664_pda *pda = cpu_pda + safe_smp_processor_id();
515 rdmsrl(MSR_GS_BASE, gs);
516 if (gs != (unsigned long)pda) {
517 wrmsrl(MSR_GS_BASE, pda);
519 printk("general protection handler: wrong gs %lx expected %p\n", gs, pda);
525 if (user_mode(regs)) {
526 struct task_struct *tsk = current;
528 if (exception_trace && unhandled_signal(tsk, SIGSEGV))
530 "%s[%d] general protection rip:%lx rsp:%lx error:%lx\n",
532 regs->rip,regs->rsp,error_code);
534 tsk->thread.error_code = error_code;
535 tsk->thread.trap_no = 13;
536 force_sig(SIGSEGV, tsk);
542 const struct exception_table_entry *fixup;
543 fixup = search_exception_tables(regs->rip);
545 regs->rip = fixup->fixup;
548 if (notify_die(DIE_GPF, "general protection fault", regs,
549 error_code, 13, SIGSEGV) == NOTIFY_STOP)
551 die("general protection fault", regs, error_code);
555 static void mem_parity_error(unsigned char reason, struct pt_regs * regs)
557 printk("Uhhuh. NMI received. Dazed and confused, but trying to continue\n");
558 printk("You probably have a hardware problem with your RAM chips\n");
560 /* Clear and disable the memory parity error line. */
561 reason = (reason & 0xf) | 4;
565 static void io_check_error(unsigned char reason, struct pt_regs * regs)
567 printk("NMI: IOCK error (debug interrupt?)\n");
568 show_registers(regs);
570 /* Re-enable the IOCK line, wait for a few seconds */
571 reason = (reason & 0xf) | 8;
578 static void unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
579 { printk("Uhhuh. NMI received for unknown reason %02x.\n", reason);
580 printk("Dazed and confused, but trying to continue\n");
581 printk("Do you have a strange power saving mode enabled?\n");
584 /* Runs on IST stack. This code must keep interrupts off all the time.
585 Nested NMIs are prevented by the CPU. */
586 asmlinkage void default_do_nmi(struct pt_regs *regs)
588 unsigned char reason = 0;
591 cpu = smp_processor_id();
593 /* Only the BSP gets external NMIs from the system. */
595 reason = get_nmi_reason();
597 if (!(reason & 0xc0)) {
598 if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT)
601 #ifdef CONFIG_X86_LOCAL_APIC
603 * Ok, so this is none of the documented NMI sources,
604 * so it must be the NMI watchdog.
606 if (nmi_watchdog > 0) {
607 nmi_watchdog_tick(regs,reason);
611 unknown_nmi_error(reason, regs);
614 if (notify_die(DIE_NMI, "nmi", regs, reason, 0, SIGINT) == NOTIFY_STOP)
617 /* AK: following checks seem to be broken on modern chipsets. FIXME */
620 mem_parity_error(reason, regs);
622 io_check_error(reason, regs);
625 asmlinkage void do_int3(struct pt_regs * regs, long error_code)
627 if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) {
630 do_trap(3, SIGTRAP, "int3", regs, error_code, NULL);
634 /* Help handler running on IST stack to switch back to user stack
635 for scheduling or signal handling. The actual stack switch is done in
637 asmlinkage struct pt_regs *sync_regs(struct pt_regs *eregs)
639 struct pt_regs *regs = eregs;
640 /* Did already sync */
641 if (eregs == (struct pt_regs *)eregs->rsp)
643 /* Exception from user space */
644 else if (user_mode(eregs))
645 regs = ((struct pt_regs *)current->thread.rsp0) - 1;
646 /* Exception from kernel and interrupts are enabled. Move to
647 kernel process stack. */
648 else if (eregs->eflags & X86_EFLAGS_IF)
649 regs = (struct pt_regs *)(eregs->rsp -= sizeof(struct pt_regs));
655 /* runs on IST stack. */
656 asmlinkage void do_debug(struct pt_regs * regs, unsigned long error_code)
658 unsigned long condition;
659 struct task_struct *tsk = current;
662 #ifdef CONFIG_CHECKING
664 /* RED-PEN interaction with debugger - could destroy gs */
666 struct x8664_pda *pda = cpu_pda + safe_smp_processor_id();
667 rdmsrl(MSR_GS_BASE, gs);
668 if (gs != (unsigned long)pda) {
669 wrmsrl(MSR_GS_BASE, pda);
670 printk("debug handler: wrong gs %lx expected %p\n", gs, pda);
675 get_debugreg(condition, 6);
677 if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code,
678 SIGTRAP) == NOTIFY_STOP)
681 conditional_sti(regs);
683 /* Mask out spurious debug traps due to lazy DR7 setting */
684 if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)) {
685 if (!tsk->thread.debugreg7) {
690 tsk->thread.debugreg6 = condition;
692 /* Mask out spurious TF errors due to lazy TF clearing */
693 if (condition & DR_STEP) {
695 * The TF error should be masked out only if the current
696 * process is not traced and if the TRAP flag has been set
697 * previously by a tracing process (condition detected by
698 * the PT_DTRACE flag); remember that the i386 TRAP flag
699 * can be modified by the process itself in user mode,
700 * allowing programs to debug themselves without the ptrace()
703 if (!user_mode(regs))
704 goto clear_TF_reenable;
706 * Was the TF flag set by a debugger? If so, clear it now,
707 * so that register information is correct.
709 if (tsk->ptrace & PT_DTRACE) {
710 regs->eflags &= ~TF_MASK;
711 tsk->ptrace &= ~PT_DTRACE;
715 /* Ok, finally something we can handle */
716 tsk->thread.trap_no = 1;
717 tsk->thread.error_code = error_code;
718 info.si_signo = SIGTRAP;
720 info.si_code = TRAP_BRKPT;
721 if (!user_mode(regs))
724 info.si_addr = (void __user *)regs->rip;
725 force_sig_info(SIGTRAP, &info, tsk);
727 set_debugreg(0UL, 7);
731 set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
732 regs->eflags &= ~TF_MASK;
735 static int kernel_math_error(struct pt_regs *regs, char *str)
737 const struct exception_table_entry *fixup;
738 fixup = search_exception_tables(regs->rip);
740 regs->rip = fixup->fixup;
743 notify_die(DIE_GPF, str, regs, 0, 16, SIGFPE);
744 /* Illegal floating point operation in the kernel */
750 * Note that we play around with the 'TS' bit in an attempt to get
751 * the correct behaviour even in the presence of the asynchronous
754 asmlinkage void do_coprocessor_error(struct pt_regs *regs)
756 void __user *rip = (void __user *)(regs->rip);
757 struct task_struct * task;
759 unsigned short cwd, swd;
761 conditional_sti(regs);
762 if (!user_mode(regs) &&
763 kernel_math_error(regs, "kernel x87 math error"))
767 * Save the info for the exception handler and clear the error.
771 task->thread.trap_no = 16;
772 task->thread.error_code = 0;
773 info.si_signo = SIGFPE;
775 info.si_code = __SI_FAULT;
778 * (~cwd & swd) will mask out exceptions that are not set to unmasked
779 * status. 0x3f is the exception bits in these regs, 0x200 is the
780 * C1 reg you need in case of a stack fault, 0x040 is the stack
781 * fault bit. We should only be taking one exception at a time,
782 * so if this combination doesn't produce any single exception,
783 * then we have a bad program that isn't synchronizing its FPU usage
784 * and it will suffer the consequences since we won't be able to
785 * fully reproduce the context of the exception
787 cwd = get_fpu_cwd(task);
788 swd = get_fpu_swd(task);
789 switch (((~cwd) & swd & 0x3f) | (swd & 0x240)) {
793 case 0x001: /* Invalid Op */
794 case 0x041: /* Stack Fault */
795 case 0x241: /* Stack Fault | Direction */
796 info.si_code = FPE_FLTINV;
798 case 0x002: /* Denormalize */
799 case 0x010: /* Underflow */
800 info.si_code = FPE_FLTUND;
802 case 0x004: /* Zero Divide */
803 info.si_code = FPE_FLTDIV;
805 case 0x008: /* Overflow */
806 info.si_code = FPE_FLTOVF;
808 case 0x020: /* Precision */
809 info.si_code = FPE_FLTRES;
812 force_sig_info(SIGFPE, &info, task);
815 asmlinkage void bad_intr(void)
817 printk("bad interrupt");
820 asmlinkage void do_simd_coprocessor_error(struct pt_regs *regs)
822 void __user *rip = (void __user *)(regs->rip);
823 struct task_struct * task;
825 unsigned short mxcsr;
827 conditional_sti(regs);
828 if (!user_mode(regs) &&
829 kernel_math_error(regs, "kernel simd math error"))
833 * Save the info for the exception handler and clear the error.
837 task->thread.trap_no = 19;
838 task->thread.error_code = 0;
839 info.si_signo = SIGFPE;
841 info.si_code = __SI_FAULT;
844 * The SIMD FPU exceptions are handled a little differently, as there
845 * is only a single status/control register. Thus, to determine which
846 * unmasked exception was caught we must mask the exception mask bits
847 * at 0x1f80, and then use these to mask the exception bits at 0x3f.
849 mxcsr = get_fpu_mxcsr(task);
850 switch (~((mxcsr & 0x1f80) >> 7) & (mxcsr & 0x3f)) {
854 case 0x001: /* Invalid Op */
855 info.si_code = FPE_FLTINV;
857 case 0x002: /* Denormalize */
858 case 0x010: /* Underflow */
859 info.si_code = FPE_FLTUND;
861 case 0x004: /* Zero Divide */
862 info.si_code = FPE_FLTDIV;
864 case 0x008: /* Overflow */
865 info.si_code = FPE_FLTOVF;
867 case 0x020: /* Precision */
868 info.si_code = FPE_FLTRES;
871 force_sig_info(SIGFPE, &info, task);
874 asmlinkage void do_spurious_interrupt_bug(struct pt_regs * regs)
878 asmlinkage void __attribute__((weak)) smp_thermal_interrupt(void)
883 * 'math_state_restore()' saves the current math information in the
884 * old math state array, and gets the new ones from the current task
886 * Careful.. There are problems with IBM-designed IRQ13 behaviour.
887 * Don't touch unless you *really* know how it works.
889 asmlinkage void math_state_restore(void)
891 struct task_struct *me = current;
892 clts(); /* Allow maths ops (or we recurse) */
896 restore_fpu_checking(&me->thread.i387.fxsave);
897 me->thread_info->status |= TS_USEDFPU;
900 void do_call_debug(struct pt_regs *regs)
902 notify_die(DIE_CALL, "debug call", regs, 0, 255, SIGINT);
905 void __init trap_init(void)
907 set_intr_gate(0,÷_error);
908 set_intr_gate_ist(1,&debug,DEBUG_STACK);
909 set_intr_gate_ist(2,&nmi,NMI_STACK);
910 set_system_gate(3,&int3);
911 set_system_gate(4,&overflow); /* int4-5 can be called from all */
912 set_system_gate(5,&bounds);
913 set_intr_gate(6,&invalid_op);
914 set_intr_gate(7,&device_not_available);
915 set_intr_gate_ist(8,&double_fault, DOUBLEFAULT_STACK);
916 set_intr_gate(9,&coprocessor_segment_overrun);
917 set_intr_gate(10,&invalid_TSS);
918 set_intr_gate(11,&segment_not_present);
919 set_intr_gate_ist(12,&stack_segment,STACKFAULT_STACK);
920 set_intr_gate(13,&general_protection);
921 set_intr_gate(14,&page_fault);
922 set_intr_gate(15,&spurious_interrupt_bug);
923 set_intr_gate(16,&coprocessor_error);
924 set_intr_gate(17,&alignment_check);
925 #ifdef CONFIG_X86_MCE
926 set_intr_gate_ist(18,&machine_check, MCE_STACK);
928 set_intr_gate(19,&simd_coprocessor_error);
930 #ifdef CONFIG_IA32_EMULATION
931 set_system_gate(IA32_SYSCALL_VECTOR, ia32_syscall);
934 set_intr_gate(KDB_VECTOR, call_debug);
937 * Should be a barrier for any external CPU state.
943 /* Actual parsing is done early in setup.c. */
944 static int __init oops_dummy(char *s)
949 __setup("oops=", oops_dummy);
951 static int __init kstack_setup(char *s)
953 kstack_depth_to_print = simple_strtoul(s,NULL,0);
956 __setup("kstack=", kstack_setup);