Commit 93f8230d authored by Anton Blanchard's avatar Anton Blanchard

ppc64: use common die() function in bad_page_fault, from ppc32

parent 88c2a765
...@@ -45,9 +45,7 @@ extern int (*debugger_dabr_match)(struct pt_regs *); ...@@ -45,9 +45,7 @@ extern int (*debugger_dabr_match)(struct pt_regs *);
int debugger_kernel_faults = 1; int debugger_kernel_faults = 1;
#endif #endif
extern void die_if_kernel(char *, struct pt_regs *, long); void bad_page_fault(struct pt_regs *, unsigned long, int);
void bad_page_fault(struct pt_regs *, unsigned long);
void do_page_fault(struct pt_regs *, unsigned long, unsigned long);
/* /*
* For 600- and 800-family processors, the error_code parameter is DSISR * For 600- and 800-family processors, the error_code parameter is DSISR
...@@ -86,7 +84,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, ...@@ -86,7 +84,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
#endif /* CONFIG_XMON || CONFIG_KGDB */ #endif /* CONFIG_XMON || CONFIG_KGDB */
if (in_interrupt() || mm == NULL) { if (in_interrupt() || mm == NULL) {
bad_page_fault(regs, address); bad_page_fault(regs, address, SIGSEGV);
return; return;
} }
down_read(&mm->mmap_sem); down_read(&mm->mmap_sem);
...@@ -143,7 +141,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, ...@@ -143,7 +141,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
bad_area: bad_area:
up_read(&mm->mmap_sem); up_read(&mm->mmap_sem);
/* User mode accesses cause a SIGSEGV */ /* User mode accesses cause a SIGSEGV */
if (user_mode(regs)) { if (user_mode(regs)) {
info.si_signo = SIGSEGV; info.si_signo = SIGSEGV;
...@@ -159,7 +157,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, ...@@ -159,7 +157,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
return; return;
} }
bad_page_fault(regs, address); bad_page_fault(regs, address, SIGSEGV);
return; return;
/* /*
...@@ -176,7 +174,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, ...@@ -176,7 +174,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
printk("VM: killing process %s\n", current->comm); printk("VM: killing process %s\n", current->comm);
if (user_mode(regs)) if (user_mode(regs))
do_exit(SIGKILL); do_exit(SIGKILL);
bad_page_fault(regs, address); bad_page_fault(regs, address, SIGKILL);
return; return;
do_sigbus: do_sigbus:
...@@ -187,7 +185,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, ...@@ -187,7 +185,7 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
info.si_addr = (void *)address; info.si_addr = (void *)address;
force_sig_info (SIGBUS, &info, current); force_sig_info (SIGBUS, &info, current);
if (!user_mode(regs)) if (!user_mode(regs))
bad_page_fault(regs, address); bad_page_fault(regs, address, SIGBUS);
} }
/* /*
...@@ -196,8 +194,10 @@ void do_page_fault(struct pt_regs *regs, unsigned long address, ...@@ -196,8 +194,10 @@ void do_page_fault(struct pt_regs *regs, unsigned long address,
* in traps.c. * in traps.c.
*/ */
void void
bad_page_fault(struct pt_regs *regs, unsigned long address) bad_page_fault(struct pt_regs *regs, unsigned long address, int sig)
{ {
extern void die(const char *, struct pt_regs *, long);
unsigned long fixup; unsigned long fixup;
/* Are we prepared to handle this fault? */ /* Are we prepared to handle this fault? */
...@@ -207,13 +207,10 @@ bad_page_fault(struct pt_regs *regs, unsigned long address) ...@@ -207,13 +207,10 @@ bad_page_fault(struct pt_regs *regs, unsigned long address)
} }
/* kernel has accessed a bad area */ /* kernel has accessed a bad area */
show_regs(regs);
#if defined(CONFIG_XMON) || defined(CONFIG_KGDB) #if defined(CONFIG_XMON) || defined(CONFIG_KGDB)
if (debugger_kernel_faults) if (debugger_kernel_faults)
debugger(regs); debugger(regs);
#endif #endif
print_backtrace( (unsigned long *)regs->gpr[1] ); die("Kernel access of bad area", regs, sig);
panic("kernel access of bad area pc %lx lr %lx address %lX tsk %s/%d",
regs->nip,regs->link,address,current->comm,current->pid);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment