Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
[powerpc.git] / arch / powerpc / mm / fault.c
index 3df641f..a4815d3 100644 (file)
@@ -80,7 +80,9 @@ static int store_updates_sp(struct pt_regs *regs)
        return 0;
 }
 
-static void do_dabr(struct pt_regs *regs, unsigned long error_code)
+#if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
+static void do_dabr(struct pt_regs *regs, unsigned long address,
+                   unsigned long error_code)
 {
        siginfo_t info;
 
@@ -98,9 +100,10 @@ static void do_dabr(struct pt_regs *regs, unsigned long error_code)
        info.si_signo = SIGTRAP;
        info.si_errno = 0;
        info.si_code = TRAP_HWBKPT;
-       info.si_addr = (void __user *)regs->nip;
+       info.si_addr = (void __user *)address;
        force_sig_info(SIGTRAP, &info, current);
 }
+#endif /* !(CONFIG_4xx || CONFIG_BOOKE)*/
 
 /*
  * For 600- and 800-family processors, the error_code parameter is DSISR
@@ -157,7 +160,7 @@ int __kprobes do_page_fault(struct pt_regs *regs, unsigned long address,
 #if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE))
        if (error_code & DSISR_DABRMATCH) {
                /* DABR match */
-               do_dabr(regs, error_code);
+               do_dabr(regs, address, error_code);
                return 0;
        }
 #endif /* !(CONFIG_4xx || CONFIG_BOOKE)*/
@@ -387,5 +390,22 @@ void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig)
        }
 
        /* kernel has accessed a bad area */
+
+       printk(KERN_ALERT "Unable to handle kernel paging request for ");
+       switch (regs->trap) {
+               case 0x300:
+               case 0x380:
+                       printk("data at address 0x%08lx\n", regs->dar);
+                       break;
+               case 0x400:
+               case 0x480:
+                       printk("instruction fetch\n");
+                       break;
+               default:
+                       printk("unknown fault\n");
+       }
+       printk(KERN_ALERT "Faulting instruction address: 0x%08lx\n",
+               regs->nip);
+
        die("Kernel access of bad area", regs, sig);
 }