upgrade to linux 2.6.10-1.12_FC2
[linux-2.6.git] / arch / i386 / kernel / traps.c
index 4c16d9f..2c4351d 100644 (file)
@@ -25,8 +25,7 @@
 #include <linux/highmem.h>
 #include <linux/kallsyms.h>
 #include <linux/ptrace.h>
-#include <linux/version.h>
-#include <linux/dump.h>
+#include <linux/utsname.h>
 #include <linux/kprobes.h>
 
 #ifdef CONFIG_EISA
@@ -58,8 +57,6 @@
 #include "mach_traps.h"
 
 asmlinkage int system_call(void);
-asmlinkage void lcall7(void);
-asmlinkage void lcall27(void);
 
 struct desc_struct default_ldt[] = { { 0, 0 }, { 0, 0 }, { 0, 0 },
                { 0, 0 }, { 0, 0 } };
@@ -221,7 +218,7 @@ void show_registers(struct pt_regs *regs)
        printk("CPU:    %d\nEIP:    %04x:[<%08lx>]    %s VLI\nEFLAGS: %08lx"
                        "   (%s) \n",
                smp_processor_id(), 0xffff & regs->xcs, regs->eip,
-               print_tainted(), regs->eflags, UTS_RELEASE);
+               print_tainted(), regs->eflags, system_utsname.release);
        print_symbol("EIP is at %s\n", regs->eip);
        printk("eax: %08lx   ebx: %08lx   ecx: %08lx   edx: %08lx\n",
                regs->eax, regs->ebx, regs->ecx, regs->edx);
@@ -337,12 +334,7 @@ void die(const char * str, struct pt_regs * regs, long err)
                        printk("\n");
                notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV);
                show_registers(regs);
-#warning MEF netdump_func not part of 2.6.9-1.11-FC2; taking out call for now
-#if 0
-               if (netdump_func)
-                       netdump_func(regs);
-#endif
-               dump((char *)str, regs);
+               try_crashdump(regs);
        } else
                printk(KERN_ERR "Recursive die() failure, output suppressed\n");
 
@@ -353,6 +345,8 @@ void die(const char * str, struct pt_regs * regs, long err)
                panic("Fatal exception in interrupt");
 
        if (panic_on_oops) {
+               if (netdump_func)
+                       netdump_func = NULL;
                printk(KERN_EMERG "Fatal exception: panic in 5 seconds\n");
                set_current_state(TASK_UNINTERRUPTIBLE);
                schedule_timeout(5 * HZ);
@@ -367,16 +361,7 @@ static inline void die_if_kernel(const char * str, struct pt_regs * regs, long e
                die(str, regs, err);
 }
 
-static inline unsigned long get_cr2(void)
-{
-       unsigned long address;
-
-       /* get the address */
-       __asm__("movl %%cr2,%0":"=r" (address));
-       return address;
-}
-
-static inline void do_trap(int trapnr, int signr, char *str, int vm86,
+static void do_trap(int trapnr, int signr, char *str, int vm86,
                           struct pt_regs * regs, long error_code, siginfo_t *info)
 {
        if (regs->eflags & VM_MASK) {
@@ -413,7 +398,7 @@ static inline void do_trap(int trapnr, int signr, char *str, int vm86,
 }
 
 #define DO_ERROR(trapnr, signr, str, name) \
-asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
+fastcall void do_##name(struct pt_regs * regs, long error_code) \
 { \
        if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
                                                == NOTIFY_STOP) \
@@ -422,7 +407,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
 }
 
 #define DO_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr) \
-asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
+fastcall void do_##name(struct pt_regs * regs, long error_code) \
 { \
        siginfo_t info; \
        info.si_signo = signr; \
@@ -436,7 +421,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
 }
 
 #define DO_VM86_ERROR(trapnr, signr, str, name) \
-asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
+fastcall void do_##name(struct pt_regs * regs, long error_code) \
 { \
        if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
                                                == NOTIFY_STOP) \
@@ -445,7 +430,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
 }
 
 #define DO_VM86_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr) \
-asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
+fastcall void do_##name(struct pt_regs * regs, long error_code) \
 { \
        siginfo_t info; \
        info.si_signo = signr; \
@@ -475,7 +460,7 @@ DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0)
  * the original non-exec stack patch was written by
  * Solar Designer <solar at openwall.com>. Thanks!
  */
-asmlinkage void do_general_protection(struct pt_regs * regs, long error_code)
+fastcall void do_general_protection(struct pt_regs * regs, long error_code)
 {
        int cpu = get_cpu();
        struct tss_struct *tss = &per_cpu(init_tss, cpu);
@@ -566,7 +551,7 @@ gp_in_vm86:
 gp_in_kernel:
        if (!fixup_exception(regs)) {
                if (notify_die(DIE_GPF, "general protection fault", regs,
-                               error_code, 13, SIGSEGV) == NOTIFY_STOP);
+                               error_code, 13, SIGSEGV) == NOTIFY_STOP)
                        return;
                die("general protection fault", regs, error_code);
        }
@@ -636,7 +621,11 @@ void die_nmi (struct pt_regs *regs, const char *msg)
 
 static void default_do_nmi(struct pt_regs * regs)
 {
-       unsigned char reason = get_nmi_reason();
+       unsigned char reason = 0;
+
+       /* Only the BSP gets external NMIs from the system.  */
+       if (!smp_processor_id())
+               reason = get_nmi_reason();
  
        if (!(reason & 0xc0)) {
                if (notify_die(DIE_NMI_IPI, "nmi_ipi", regs, reason, 0, SIGINT)
@@ -675,7 +664,7 @@ static int dummy_nmi_callback(struct pt_regs * regs, int cpu)
  
 static nmi_callback_t nmi_callback = dummy_nmi_callback;
  
-asmlinkage void do_nmi(struct pt_regs * regs, long error_code)
+fastcall void do_nmi(struct pt_regs * regs, long error_code)
 {
        int cpu;
 
@@ -701,7 +690,7 @@ void unset_nmi_callback(void)
 }
 
 #ifdef CONFIG_KPROBES
-asmlinkage int do_int3(struct pt_regs *regs, long error_code)
+fastcall int do_int3(struct pt_regs *regs, long error_code)
 {
        if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP)
                        == NOTIFY_STOP)
@@ -736,7 +725,7 @@ asmlinkage int do_int3(struct pt_regs *regs, long error_code)
  * find every occurrence of the TF bit that could be saved away even
  * by user code)
  */
-asmlinkage void do_debug(struct pt_regs * regs, long error_code)
+fastcall void do_debug(struct pt_regs * regs, long error_code)
 {
        unsigned int condition;
        struct task_struct *tsk = current;
@@ -875,7 +864,7 @@ void math_error(void __user *eip)
        force_sig_info(SIGFPE, &info, task);
 }
 
-asmlinkage void do_coprocessor_error(struct pt_regs * regs, long error_code)
+fastcall void do_coprocessor_error(struct pt_regs * regs, long error_code)
 {
        ignore_fpu_irq = 1;
        math_error((void __user *)regs->eip);
@@ -929,7 +918,7 @@ void simd_math_error(void __user *eip)
        force_sig_info(SIGFPE, &info, task);
 }
 
-asmlinkage void do_simd_coprocessor_error(struct pt_regs * regs,
+fastcall void do_simd_coprocessor_error(struct pt_regs * regs,
                                          long error_code)
 {
        if (cpu_has_xmm) {
@@ -953,7 +942,7 @@ asmlinkage void do_simd_coprocessor_error(struct pt_regs * regs,
        }
 }
 
-asmlinkage void do_spurious_interrupt_bug(struct pt_regs * regs,
+fastcall void do_spurious_interrupt_bug(struct pt_regs * regs,
                                          long error_code)
 {
 #if 0
@@ -1053,11 +1042,6 @@ static void __init set_system_gate(unsigned int n, void *addr)
        _set_gate(idt_table+n,15,3,addr,__KERNEL_CS);
 }
 
-static void __init set_call_gate(void *a, void *addr)
-{
-       _set_gate(a,12,3,addr,__KERNEL_CS);
-}
-
 static void __init set_task_gate(unsigned int n, unsigned int gdt_entry)
 {
        _set_gate(idt_table+n,5,0,0,(gdt_entry<<3));
@@ -1101,14 +1085,6 @@ void __init trap_init(void)
 
        set_system_gate(SYSCALL_VECTOR,&system_call);
 
-       /*
-        * default LDT is a single-entry callgate to lcall7 for iBCS
-        * and a callgate to lcall27 for Solaris/x86 binaries
-        */
-#if 0   
-       set_call_gate(&default_ldt[0],lcall7);
-       set_call_gate(&default_ldt[4],lcall27);
-#endif
        /*
         * Should be a barrier for any external CPU state.
         */