Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Russell King <rmk+kernel@armlinux.org.uk>

+10 -11
+1 -1
arch/arm/include/asm/bug.h
··· 85 85 extern asmlinkage void c_backtrace(unsigned long fp, int pmode); 86 86 87 87 struct mm_struct; 88 - extern void show_pte(struct mm_struct *mm, unsigned long addr); 88 + void show_pte(const char *lvl, struct mm_struct *mm, unsigned long addr); 89 89 extern void __show_regs(struct pt_regs *); 90 90 91 91 #endif
+1 -1
arch/arm/kernel/traps.c
··· 729 729 pr_err("[%d] %s: bad data abort: code %d instr 0x%08lx\n", 730 730 task_pid_nr(current), current->comm, code, instr); 731 731 dump_instr(KERN_ERR, regs); 732 - show_pte(current->mm, addr); 732 + show_pte(KERN_ERR, current->mm, addr); 733 733 } 734 734 #endif 735 735
+8 -9
arch/arm/mm/fault.c
··· 56 56 * This is useful to dump out the page tables associated with 57 57 * 'addr' in mm 'mm'. 58 58 */ 59 - void show_pte(struct mm_struct *mm, unsigned long addr) 59 + void show_pte(const char *lvl, struct mm_struct *mm, unsigned long addr) 60 60 { 61 61 pgd_t *pgd; 62 62 63 63 if (!mm) 64 64 mm = &init_mm; 65 65 66 - pr_alert("pgd = %p\n", mm->pgd); 66 + printk("%spgd = %p\n", lvl, mm->pgd); 67 67 pgd = pgd_offset(mm, addr); 68 - pr_alert("[%08lx] *pgd=%08llx", 69 - addr, (long long)pgd_val(*pgd)); 68 + printk("%s[%08lx] *pgd=%08llx", lvl, addr, (long long)pgd_val(*pgd)); 70 69 71 70 do { 72 71 pud_t *pud; ··· 120 121 pr_cont("\n"); 121 122 } 122 123 #else /* CONFIG_MMU */ 123 - void show_pte(struct mm_struct *mm, unsigned long addr) 124 + void show_pte(const char *lvl, struct mm_struct *mm, unsigned long addr) 124 125 { } 125 126 #endif /* CONFIG_MMU */ 126 127 ··· 146 147 (addr < PAGE_SIZE) ? "NULL pointer dereference" : 147 148 "paging request", addr); 148 149 149 - show_pte(mm, addr); 150 + show_pte(KERN_ALERT, mm, addr); 150 151 die("Oops", regs, fsr); 151 152 bust_spinlocks(0); 152 153 do_exit(SIGKILL); ··· 168 169 if (((user_debug & UDBG_SEGV) && (sig == SIGSEGV)) || 169 170 ((user_debug & UDBG_BUS) && (sig == SIGBUS))) { 170 171 pr_err("8<--- cut here ---\n"); 171 - printk(KERN_DEBUG "%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n", 172 + pr_err("%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n", 172 173 tsk->comm, sig, addr, fsr); 173 - show_pte(tsk->mm, addr); 174 + show_pte(KERN_ERR, tsk->mm, addr); 174 175 show_regs(regs); 175 176 } 176 177 #endif ··· 560 561 pr_alert("8<--- cut here ---\n"); 561 562 pr_alert("Unhandled fault: %s (0x%03x) at 0x%08lx\n", 562 563 inf->name, fsr, addr); 563 - show_pte(current->mm, addr); 564 + show_pte(KERN_ALERT, current->mm, addr); 564 565 565 566 arm_notify_die("", regs, inf->sig, inf->code, (void __user *)addr, 566 567 fsr, 0);