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>
32 #include <asm/system.h>
33 #include <asm/uaccess.h>
35 #include <asm/atomic.h>
36 #include <asm/debugreg.h>
39 #include <asm/kdebug.h>
40 #include <asm/processor.h>
43 #include <asm/pgalloc.h>
45 #include <asm/proto.h>
48 #include <linux/irq.h>
51 extern struct gate_struct idt_table[256];
53 asmlinkage void divide_error(void);
54 asmlinkage void debug(void);
55 asmlinkage void nmi(void);
56 asmlinkage void int3(void);
57 asmlinkage void overflow(void);
58 asmlinkage void bounds(void);
59 asmlinkage void invalid_op(void);
60 asmlinkage void device_not_available(void);
61 asmlinkage void double_fault(void);
62 asmlinkage void coprocessor_segment_overrun(void);
63 asmlinkage void invalid_TSS(void);
64 asmlinkage void segment_not_present(void);
65 asmlinkage void stack_segment(void);
66 asmlinkage void general_protection(void);
67 asmlinkage void page_fault(void);
68 asmlinkage void coprocessor_error(void);
69 asmlinkage void simd_coprocessor_error(void);
70 asmlinkage void reserved(void);
71 asmlinkage void alignment_check(void);
72 asmlinkage void machine_check(void);
73 asmlinkage void spurious_interrupt_bug(void);
74 asmlinkage void call_debug(void);
76 struct notifier_block *die_chain;
77 static spinlock_t die_notifier_lock = SPIN_LOCK_UNLOCKED;
79 int register_die_notifier(struct notifier_block *nb)
83 spin_lock_irqsave(&die_notifier_lock, flags);
84 err = notifier_chain_register(&die_chain, nb);
85 spin_unlock_irqrestore(&die_notifier_lock, flags);
89 static inline void conditional_sti(struct pt_regs *regs)
91 if (regs->eflags & X86_EFLAGS_IF)
95 static int kstack_depth_to_print = 10;
97 #ifdef CONFIG_KALLSYMS
98 #include <linux/kallsyms.h>
99 int printk_address(unsigned long address)
101 unsigned long offset = 0, symsize;
107 symname = kallsyms_lookup(address, &symsize, &offset, &modname, namebuf);
109 return printk("[<%016lx>]", address);
111 modname = delim = "";
112 return printk("<%016lx>{%s%s%s%s%+ld}",
113 address,delim,modname,delim,symname,offset);
116 int printk_address(unsigned long address)
118 return printk("[<%016lx>]", address);
122 unsigned long *in_exception_stack(int cpu, unsigned long stack)
125 for (k = 0; k < N_EXCEPTION_STACKS; k++) {
126 struct tss_struct *tss = &per_cpu(init_tss, cpu);
127 unsigned long end = tss->ist[k] + EXCEPTION_STKSZ;
129 if (stack >= tss->ist[k] && stack <= end)
130 return (unsigned long *)end;
136 * x86-64 can have upto three kernel stacks:
139 * severe exception (double fault, nmi, stack fault) hardware stack
140 * Check and process them in order.
143 void show_trace(unsigned long *stack)
146 unsigned long *irqstack, *irqstack_end, *estack_end;
147 const int cpu = safe_smp_processor_id();
150 printk("\nCall Trace:");
153 estack_end = in_exception_stack(cpu, (unsigned long)stack);
155 while (stack < estack_end) {
157 if (__kernel_text_address(addr)) {
158 i += printk_address(addr);
166 i += printk(" <EOE> ");
168 stack = (unsigned long *) estack_end[-2];
171 irqstack_end = (unsigned long *) (cpu_pda[cpu].irqstackptr);
172 irqstack = (unsigned long *) (cpu_pda[cpu].irqstackptr - IRQSTACKSIZE + 64);
174 if (stack >= irqstack && stack < irqstack_end) {
176 while (stack < irqstack_end) {
179 * If the address is either in the text segment of the
180 * kernel, or in the region which contains vmalloc'ed
181 * memory, it *may* be the address of a calling
182 * routine; if so, print it so that someone tracing
183 * down the cause of the crash will be able to figure
184 * out the call path that was taken.
186 if (__kernel_text_address(addr)) {
187 i += printk_address(addr);
195 stack = (unsigned long *) (irqstack_end[-1]);
200 while (((long) stack & (THREAD_SIZE-1)) != 0) {
202 if (__kernel_text_address(addr)) {
203 i += printk_address(addr);
214 void show_stack(struct task_struct *tsk, unsigned long * rsp)
216 unsigned long *stack;
218 const int cpu = safe_smp_processor_id();
219 unsigned long *irqstack_end = (unsigned long *) (cpu_pda[cpu].irqstackptr);
220 unsigned long *irqstack = (unsigned long *) (cpu_pda[cpu].irqstackptr - IRQSTACKSIZE);
222 // debugging aid: "show_stack(NULL, NULL);" prints the
223 // back trace for this cpu.
227 rsp = (unsigned long *)tsk->thread.rsp;
229 rsp = (unsigned long *)&rsp;
233 for(i=0; i < kstack_depth_to_print; i++) {
234 if (stack >= irqstack && stack <= irqstack_end) {
235 if (stack == irqstack_end) {
236 stack = (unsigned long *) (irqstack_end[-1]);
240 if (((long) stack & (THREAD_SIZE-1)) == 0)
243 if (i && ((i % 4) == 0))
245 printk("%016lx ", *stack++);
247 show_trace((unsigned long *)rsp);
251 * The architecture-independent dump_stack generator
253 void dump_stack(void)
259 EXPORT_SYMBOL(dump_stack);
261 void show_registers(struct pt_regs *regs)
264 int in_kernel = (regs->cs & 3) == 0;
266 const int cpu = safe_smp_processor_id();
267 struct task_struct *cur = cpu_pda[cpu].pcurrent;
271 printk("CPU %d ", cpu);
273 printk("Process %s (pid: %d, threadinfo %p, task %p)\n",
274 cur->comm, cur->pid, cur->thread_info, cur);
277 * When in-kernel, we also print out the stack and code at the
278 * time of the fault..
283 show_stack(NULL, (unsigned long*)rsp);
286 if(regs->rip < PAGE_OFFSET)
292 if(__get_user(c, &((unsigned char*)regs->rip)[i])) {
294 printk(" Bad RIP value.");
303 void handle_BUG(struct pt_regs *regs)
310 if (__copy_from_user(&f, (struct bug_frame *) regs->rip,
311 sizeof(struct bug_frame)))
313 if ((unsigned long)f.filename < __PAGE_OFFSET ||
314 f.ud2[0] != 0x0f || f.ud2[1] != 0x0b)
316 if (__get_user(tmp, f.filename))
317 f.filename = "unmapped filename";
318 printk("----------- [cut here ] --------- [please bite here ] ---------\n");
319 printk(KERN_ALERT "Kernel BUG at %.50s:%d\n", f.filename, f.line);
322 void out_of_line_bug(void)
327 static spinlock_t die_lock = SPIN_LOCK_UNLOCKED;
328 static int die_owner = -1;
330 void oops_begin(void)
332 int cpu = safe_smp_processor_id();
333 /* racy, but better than risking deadlock. */
335 if (!spin_trylock(&die_lock)) {
336 if (cpu == die_owner)
337 /* nested oops. should stop eventually */;
339 spin_lock(&die_lock);
350 spin_unlock(&die_lock);
351 local_irq_enable(); /* make sure back scroll still works */
359 void __die(const char * str, struct pt_regs * regs, long err)
361 static int die_counter;
362 printk(KERN_EMERG "%s: %04lx [%u] ", str, err & 0xffff,++die_counter);
363 #ifdef CONFIG_PREEMPT
369 #ifdef CONFIG_DEBUG_PAGEALLOC
370 printk("DEBUG_PAGEALLOC");
373 notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV);
374 show_registers(regs);
375 /* Executive summary in case the oops scrolled away */
376 printk(KERN_ALERT "RIP ");
377 printk_address(regs->rip);
378 printk(" RSP <%016lx>\n", regs->rsp);
381 void die(const char * str, struct pt_regs * regs, long err)
385 __die(str, regs, err);
390 static inline void die_if_kernel(const char * str, struct pt_regs * regs, long err)
392 if (!(regs->eflags & VM_MASK) && (regs->cs == __KERNEL_CS))
396 void die_nmi(char *str, struct pt_regs *regs)
400 * We are in trouble anyway, lets at least try
401 * to get a message out.
403 printk(str, safe_smp_processor_id());
404 show_registers(regs);
405 if (panic_on_timeout || panic_on_oops)
406 panic("nmi watchdog");
407 printk("console shuts up ...\n");
412 static inline unsigned long get_cr2(void)
414 unsigned long address;
416 /* get the address */
417 __asm__("movq %%cr2,%0":"=r" (address));
421 static void do_trap(int trapnr, int signr, char *str,
422 struct pt_regs * regs, long error_code, siginfo_t *info)
424 conditional_sti(regs);
426 #ifdef CONFIG_CHECKING
429 struct x8664_pda *pda = cpu_pda + safe_smp_processor_id();
430 rdmsrl(MSR_GS_BASE, gs);
431 if (gs != (unsigned long)pda) {
432 wrmsrl(MSR_GS_BASE, pda);
433 printk("%s: wrong gs %lx expected %p rip %lx\n", str, gs, pda,
439 if ((regs->cs & 3) != 0) {
440 struct task_struct *tsk = current;
442 if (exception_trace && unhandled_signal(tsk, signr))
444 "%s[%d] trap %s rip:%lx rsp:%lx error:%lx\n",
445 tsk->comm, tsk->pid, str,
446 regs->rip,regs->rsp,error_code);
448 tsk->thread.error_code = error_code;
449 tsk->thread.trap_no = trapnr;
451 force_sig_info(signr, info, tsk);
453 force_sig(signr, tsk);
460 const struct exception_table_entry *fixup;
461 fixup = search_exception_tables(regs->rip);
463 regs->rip = fixup->fixup;
465 die(str, regs, error_code);
470 #define DO_ERROR(trapnr, signr, str, name) \
471 asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
473 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
476 do_trap(trapnr, signr, str, regs, error_code, NULL); \
479 #define DO_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr) \
480 asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
483 info.si_signo = signr; \
485 info.si_code = sicode; \
486 info.si_addr = (void __user *)siaddr; \
487 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
490 do_trap(trapnr, signr, str, regs, error_code, &info); \
493 DO_ERROR_INFO( 0, SIGFPE, "divide error", divide_error, FPE_INTDIV, regs->rip)
494 DO_ERROR( 4, SIGSEGV, "overflow", overflow)
495 DO_ERROR( 5, SIGSEGV, "bounds", bounds)
496 DO_ERROR_INFO( 6, SIGILL, "invalid operand", invalid_op, ILL_ILLOPN, regs->rip)
497 DO_ERROR( 7, SIGSEGV, "device not available", device_not_available)
498 DO_ERROR( 9, SIGFPE, "coprocessor segment overrun", coprocessor_segment_overrun)
499 DO_ERROR(10, SIGSEGV, "invalid TSS", invalid_TSS)
500 DO_ERROR(11, SIGBUS, "segment not present", segment_not_present)
501 DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0)
502 DO_ERROR(18, SIGSEGV, "reserved", reserved)
504 #define DO_ERROR_STACK(trapnr, signr, str, name) \
505 asmlinkage void *do_##name(struct pt_regs * regs, long error_code) \
507 struct pt_regs *pr = ((struct pt_regs *)(current->thread.rsp0))-1; \
508 if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
511 if (regs->cs & 3) { \
512 memcpy(pr, regs, sizeof(struct pt_regs)); \
515 do_trap(trapnr, signr, str, regs, error_code, NULL); \
519 DO_ERROR_STACK(12, SIGBUS, "stack segment", stack_segment)
520 DO_ERROR_STACK( 8, SIGSEGV, "double fault", double_fault)
522 asmlinkage void do_general_protection(struct pt_regs * regs, long error_code)
524 conditional_sti(regs);
526 #ifdef CONFIG_CHECKING
529 struct x8664_pda *pda = cpu_pda + safe_smp_processor_id();
530 rdmsrl(MSR_GS_BASE, gs);
531 if (gs != (unsigned long)pda) {
532 wrmsrl(MSR_GS_BASE, pda);
534 printk("general protection handler: wrong gs %lx expected %p\n", gs, pda);
540 if ((regs->cs & 3)!=0) {
541 struct task_struct *tsk = current;
543 if (exception_trace && unhandled_signal(tsk, SIGSEGV))
545 "%s[%d] general protection rip:%lx rsp:%lx error:%lx\n",
547 regs->rip,regs->rsp,error_code);
549 tsk->thread.error_code = error_code;
550 tsk->thread.trap_no = 13;
551 force_sig(SIGSEGV, tsk);
557 const struct exception_table_entry *fixup;
558 fixup = search_exception_tables(regs->rip);
560 regs->rip = fixup->fixup;
563 notify_die(DIE_GPF, "general protection fault", regs, error_code,
565 die("general protection fault", regs, error_code);
569 static void mem_parity_error(unsigned char reason, struct pt_regs * regs)
571 printk("Uhhuh. NMI received. Dazed and confused, but trying to continue\n");
572 printk("You probably have a hardware problem with your RAM chips\n");
574 /* Clear and disable the memory parity error line. */
575 reason = (reason & 0xf) | 4;
579 static void io_check_error(unsigned char reason, struct pt_regs * regs)
581 printk("NMI: IOCK error (debug interrupt?)\n");
582 show_registers(regs);
584 /* Re-enable the IOCK line, wait for a few seconds */
585 reason = (reason & 0xf) | 8;
592 static void unknown_nmi_error(unsigned char reason, struct pt_regs * regs)
593 { printk("Uhhuh. NMI received for unknown reason %02x.\n", reason);
594 printk("Dazed and confused, but trying to continue\n");
595 printk("Do you have a strange power saving mode enabled?\n");
598 asmlinkage void default_do_nmi(struct pt_regs *regs)
600 unsigned char reason = 0;
602 /* Only the BSP gets external NMIs from the system. */
603 if (!smp_processor_id())
604 reason = get_nmi_reason();
606 if (!(reason & 0xc0)) {
607 if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT)
610 #ifdef CONFIG_X86_LOCAL_APIC
612 * Ok, so this is none of the documented NMI sources,
613 * so it must be the NMI watchdog.
615 if (nmi_watchdog > 0) {
616 nmi_watchdog_tick(regs,reason);
620 unknown_nmi_error(reason, regs);
623 if (notify_die(DIE_NMI, "nmi", regs, reason, 0, SIGINT) == NOTIFY_STOP)
626 /* AK: following checks seem to be broken on modern chipsets. FIXME */
629 mem_parity_error(reason, regs);
631 io_check_error(reason, regs);
634 * Reassert NMI in case it became active meanwhile
635 * as it's edge-triggered.
638 inb(0x71); /* dummy */
640 inb(0x71); /* dummy */
643 asmlinkage void do_int3(struct pt_regs * regs, long error_code)
645 if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) {
648 do_trap(3, SIGTRAP, "int3", regs, error_code, NULL);
652 /* runs on IST stack. */
653 asmlinkage void *do_debug(struct pt_regs * regs, unsigned long error_code)
656 unsigned long condition;
657 struct task_struct *tsk = current;
660 pr = (struct pt_regs *)(current->thread.rsp0)-1;
662 memcpy(pr, regs, sizeof(struct pt_regs));
666 #ifdef CONFIG_CHECKING
668 /* RED-PEN interaction with debugger - could destroy gs */
670 struct x8664_pda *pda = cpu_pda + safe_smp_processor_id();
671 rdmsrl(MSR_GS_BASE, gs);
672 if (gs != (unsigned long)pda) {
673 wrmsrl(MSR_GS_BASE, pda);
674 printk("debug handler: wrong gs %lx expected %p\n", gs, pda);
679 asm("movq %%db6,%0" : "=r" (condition));
681 if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code,
682 SIGTRAP) == NOTIFY_STOP) {
685 conditional_sti(regs);
687 /* Mask out spurious debug traps due to lazy DR7 setting */
688 if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)) {
689 if (!tsk->thread.debugreg7) {
694 tsk->thread.debugreg6 = condition;
696 /* Mask out spurious TF errors due to lazy TF clearing */
697 if (condition & DR_STEP) {
699 * The TF error should be masked out only if the current
700 * process is not traced and if the TRAP flag has been set
701 * previously by a tracing process (condition detected by
702 * the PT_DTRACE flag); remember that the i386 TRAP flag
703 * can be modified by the process itself in user mode,
704 * allowing programs to debug themselves without the ptrace()
707 if ((regs->cs & 3) == 0)
708 goto clear_TF_reenable;
709 if ((tsk->ptrace & (PT_DTRACE|PT_PTRACED)) == PT_DTRACE)
713 /* Ok, finally something we can handle */
714 tsk->thread.trap_no = 1;
715 tsk->thread.error_code = error_code;
716 info.si_signo = SIGTRAP;
718 info.si_code = TRAP_BRKPT;
719 if ((regs->cs & 3) == 0)
722 info.si_addr = (void __user *)regs->rip;
723 force_sig_info(SIGTRAP, &info, tsk);
725 asm volatile("movq %0,%%db7"::"r"(0UL));
726 notify_die(DIE_DEBUG, "debug", regs, condition, 1, SIGTRAP);
730 set_tsk_thread_flag(tsk, TIF_SINGLESTEP);
733 /* RED-PEN could cause spurious errors */
734 if (notify_die(DIE_DEBUG, "debug2", regs, condition, 1, SIGTRAP)
736 regs->eflags &= ~TF_MASK;
740 static int kernel_math_error(struct pt_regs *regs, char *str)
742 const struct exception_table_entry *fixup;
743 fixup = search_exception_tables(regs->rip);
745 regs->rip = fixup->fixup;
748 notify_die(DIE_GPF, str, regs, 0, 16, SIGFPE);
750 /* This should be a die, but warn only for now */
753 printk(KERN_DEBUG "%s: %s at ", current->comm, str);
754 printk_address(regs->rip);
761 * Note that we play around with the 'TS' bit in an attempt to get
762 * the correct behaviour even in the presence of the asynchronous
765 asmlinkage void do_coprocessor_error(struct pt_regs *regs)
767 void __user *rip = (void __user *)(regs->rip);
768 struct task_struct * task;
770 unsigned short cwd, swd;
772 conditional_sti(regs);
773 if ((regs->cs & 3) == 0 &&
774 kernel_math_error(regs, "kernel x87 math error"))
778 * Save the info for the exception handler and clear the error.
782 task->thread.trap_no = 16;
783 task->thread.error_code = 0;
784 info.si_signo = SIGFPE;
786 info.si_code = __SI_FAULT;
789 * (~cwd & swd) will mask out exceptions that are not set to unmasked
790 * status. 0x3f is the exception bits in these regs, 0x200 is the
791 * C1 reg you need in case of a stack fault, 0x040 is the stack
792 * fault bit. We should only be taking one exception at a time,
793 * so if this combination doesn't produce any single exception,
794 * then we have a bad program that isn't synchronizing its FPU usage
795 * and it will suffer the consequences since we won't be able to
796 * fully reproduce the context of the exception
798 cwd = get_fpu_cwd(task);
799 swd = get_fpu_swd(task);
800 switch (((~cwd) & swd & 0x3f) | (swd & 0x240)) {
804 case 0x001: /* Invalid Op */
805 case 0x041: /* Stack Fault */
806 case 0x241: /* Stack Fault | Direction */
807 info.si_code = FPE_FLTINV;
809 case 0x002: /* Denormalize */
810 case 0x010: /* Underflow */
811 info.si_code = FPE_FLTUND;
813 case 0x004: /* Zero Divide */
814 info.si_code = FPE_FLTDIV;
816 case 0x008: /* Overflow */
817 info.si_code = FPE_FLTOVF;
819 case 0x020: /* Precision */
820 info.si_code = FPE_FLTRES;
823 force_sig_info(SIGFPE, &info, task);
826 asmlinkage void bad_intr(void)
828 printk("bad interrupt");
831 asmlinkage void do_simd_coprocessor_error(struct pt_regs *regs)
833 void __user *rip = (void __user *)(regs->rip);
834 struct task_struct * task;
836 unsigned short mxcsr;
838 conditional_sti(regs);
839 if ((regs->cs & 3) == 0 &&
840 kernel_math_error(regs, "simd math error"))
844 * Save the info for the exception handler and clear the error.
848 task->thread.trap_no = 19;
849 task->thread.error_code = 0;
850 info.si_signo = SIGFPE;
852 info.si_code = __SI_FAULT;
855 * The SIMD FPU exceptions are handled a little differently, as there
856 * is only a single status/control register. Thus, to determine which
857 * unmasked exception was caught we must mask the exception mask bits
858 * at 0x1f80, and then use these to mask the exception bits at 0x3f.
860 mxcsr = get_fpu_mxcsr(task);
861 switch (~((mxcsr & 0x1f80) >> 7) & (mxcsr & 0x3f)) {
865 case 0x001: /* Invalid Op */
866 info.si_code = FPE_FLTINV;
868 case 0x002: /* Denormalize */
869 case 0x010: /* Underflow */
870 info.si_code = FPE_FLTUND;
872 case 0x004: /* Zero Divide */
873 info.si_code = FPE_FLTDIV;
875 case 0x008: /* Overflow */
876 info.si_code = FPE_FLTOVF;
878 case 0x020: /* Precision */
879 info.si_code = FPE_FLTRES;
882 force_sig_info(SIGFPE, &info, task);
885 asmlinkage void do_spurious_interrupt_bug(struct pt_regs * regs)
890 * 'math_state_restore()' saves the current math information in the
891 * old math state array, and gets the new ones from the current task
893 * Careful.. There are problems with IBM-designed IRQ13 behaviour.
894 * Don't touch unless you *really* know how it works.
896 asmlinkage void math_state_restore(void)
898 struct task_struct *me = current;
899 clts(); /* Allow maths ops (or we recurse) */
903 restore_fpu_checking(&me->thread.i387.fxsave);
904 me->thread_info->status |= TS_USEDFPU;
907 void do_call_debug(struct pt_regs *regs)
909 notify_die(DIE_CALL, "debug call", regs, 0, 255, SIGINT);
912 void __init trap_init(void)
914 set_intr_gate(0,÷_error);
915 set_intr_gate_ist(1,&debug,DEBUG_STACK);
916 set_intr_gate_ist(2,&nmi,NMI_STACK);
917 set_intr_gate(3,&int3);
918 set_system_gate(4,&overflow); /* int4-5 can be called from all */
919 set_system_gate(5,&bounds);
920 set_intr_gate(6,&invalid_op);
921 set_intr_gate(7,&device_not_available);
922 set_intr_gate_ist(8,&double_fault, DOUBLEFAULT_STACK);
923 set_intr_gate(9,&coprocessor_segment_overrun);
924 set_intr_gate(10,&invalid_TSS);
925 set_intr_gate(11,&segment_not_present);
926 set_intr_gate_ist(12,&stack_segment,STACKFAULT_STACK);
927 set_intr_gate(13,&general_protection);
928 set_intr_gate(14,&page_fault);
929 set_intr_gate(15,&spurious_interrupt_bug);
930 set_intr_gate(16,&coprocessor_error);
931 set_intr_gate(17,&alignment_check);
932 #ifdef CONFIG_X86_MCE
933 set_intr_gate_ist(18,&machine_check, MCE_STACK);
935 set_intr_gate(19,&simd_coprocessor_error);
937 #ifdef CONFIG_IA32_EMULATION
938 set_system_gate(IA32_SYSCALL_VECTOR, ia32_syscall);
941 set_intr_gate(KDB_VECTOR, call_debug);
944 * Should be a barrier for any external CPU state.
950 /* Actual parsing is done early in setup.c. */
951 static int __init oops_dummy(char *s)
956 __setup("oops=", oops_dummy);
958 static int __init kstack_setup(char *s)
960 kstack_depth_to_print = simple_strtoul(s,NULL,0);
963 __setup("kstack=", kstack_setup);