Commit 49b38c34 authored by Russell King's avatar Russell King

ARM: arrange show_pte() to issue severity-based messages

show_pte() is used to print information after various other kernel
messages, which themselves are printed at different severities.
Include the severity in the show_pte() information so that associated
messages are printed with the same severity.
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
parent bafeb7a0
...@@ -85,7 +85,7 @@ void hook_ifault_code(int nr, int (*fn)(unsigned long, unsigned int, ...@@ -85,7 +85,7 @@ void hook_ifault_code(int nr, int (*fn)(unsigned long, unsigned int,
extern asmlinkage void c_backtrace(unsigned long fp, int pmode); extern asmlinkage void c_backtrace(unsigned long fp, int pmode);
struct mm_struct; struct mm_struct;
extern void show_pte(struct mm_struct *mm, unsigned long addr); void show_pte(const char *lvl, struct mm_struct *mm, unsigned long addr);
extern void __show_regs(struct pt_regs *); extern void __show_regs(struct pt_regs *);
#endif #endif
...@@ -729,7 +729,7 @@ baddataabort(int code, unsigned long instr, struct pt_regs *regs) ...@@ -729,7 +729,7 @@ baddataabort(int code, unsigned long instr, struct pt_regs *regs)
pr_err("[%d] %s: bad data abort: code %d instr 0x%08lx\n", pr_err("[%d] %s: bad data abort: code %d instr 0x%08lx\n",
task_pid_nr(current), current->comm, code, instr); task_pid_nr(current), current->comm, code, instr);
dump_instr(KERN_ERR, regs); dump_instr(KERN_ERR, regs);
show_pte(current->mm, addr); show_pte(KERN_ERR, current->mm, addr);
} }
#endif #endif
......
...@@ -56,17 +56,16 @@ static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr) ...@@ -56,17 +56,16 @@ static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr)
* This is useful to dump out the page tables associated with * This is useful to dump out the page tables associated with
* 'addr' in mm 'mm'. * 'addr' in mm 'mm'.
*/ */
void show_pte(struct mm_struct *mm, unsigned long addr) void show_pte(const char *lvl, struct mm_struct *mm, unsigned long addr)
{ {
pgd_t *pgd; pgd_t *pgd;
if (!mm) if (!mm)
mm = &init_mm; mm = &init_mm;
pr_alert("pgd = %p\n", mm->pgd); printk("%spgd = %p\n", lvl, mm->pgd);
pgd = pgd_offset(mm, addr); pgd = pgd_offset(mm, addr);
pr_alert("[%08lx] *pgd=%08llx", printk("%s[%08lx] *pgd=%08llx", lvl, addr, (long long)pgd_val(*pgd));
addr, (long long)pgd_val(*pgd));
do { do {
pud_t *pud; pud_t *pud;
...@@ -121,7 +120,7 @@ void show_pte(struct mm_struct *mm, unsigned long addr) ...@@ -121,7 +120,7 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
pr_cont("\n"); pr_cont("\n");
} }
#else /* CONFIG_MMU */ #else /* CONFIG_MMU */
void show_pte(struct mm_struct *mm, unsigned long addr) void show_pte(const char *lvl, struct mm_struct *mm, unsigned long addr)
{ } { }
#endif /* CONFIG_MMU */ #endif /* CONFIG_MMU */
...@@ -147,7 +146,7 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr, ...@@ -147,7 +146,7 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
(addr < PAGE_SIZE) ? "NULL pointer dereference" : (addr < PAGE_SIZE) ? "NULL pointer dereference" :
"paging request", addr); "paging request", addr);
show_pte(mm, addr); show_pte(KERN_ALERT, mm, addr);
die("Oops", regs, fsr); die("Oops", regs, fsr);
bust_spinlocks(0); bust_spinlocks(0);
do_exit(SIGKILL); do_exit(SIGKILL);
...@@ -169,9 +168,9 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr, ...@@ -169,9 +168,9 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr,
if (((user_debug & UDBG_SEGV) && (sig == SIGSEGV)) || if (((user_debug & UDBG_SEGV) && (sig == SIGSEGV)) ||
((user_debug & UDBG_BUS) && (sig == SIGBUS))) { ((user_debug & UDBG_BUS) && (sig == SIGBUS))) {
pr_err("8<--- cut here ---\n"); pr_err("8<--- cut here ---\n");
printk(KERN_DEBUG "%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n", pr_err("%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n",
tsk->comm, sig, addr, fsr); tsk->comm, sig, addr, fsr);
show_pte(tsk->mm, addr); show_pte(KERN_ERR, tsk->mm, addr);
show_regs(regs); show_regs(regs);
} }
#endif #endif
...@@ -561,7 +560,7 @@ do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs) ...@@ -561,7 +560,7 @@ do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
pr_alert("8<--- cut here ---\n"); pr_alert("8<--- cut here ---\n");
pr_alert("Unhandled fault: %s (0x%03x) at 0x%08lx\n", pr_alert("Unhandled fault: %s (0x%03x) at 0x%08lx\n",
inf->name, fsr, addr); inf->name, fsr, addr);
show_pte(current->mm, addr); show_pte(KERN_ALERT, current->mm, addr);
arm_notify_die("", regs, inf->sig, inf->code, (void __user *)addr, arm_notify_die("", regs, inf->sig, inf->code, (void __user *)addr,
fsr, 0); fsr, 0);
......
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