@@ -56,17 +56,16 @@ static inline int notify_page_fault(struct pt_regs *regs, unsigned int fsr)
5656 * This is useful to dump out the page tables associated with
5757 * 'addr' in mm 'mm'.
5858 */
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 )
6060{
6161 pgd_t * pgd ;
6262
6363 if (!mm )
6464 mm = & init_mm ;
6565
66- pr_alert ( "pgd = %p\n" , mm -> pgd );
66+ printk ( "%spgd = %p\n", lvl , mm -> pgd );
6767 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 ));
7069
7170 do {
7271 pud_t * pud ;
@@ -121,7 +120,7 @@ void show_pte(struct mm_struct *mm, unsigned long addr)
121120 pr_cont ("\n" );
122121}
123122#else /* CONFIG_MMU */
124- void show_pte (struct mm_struct * mm , unsigned long addr )
123+ void show_pte (const char * lvl , struct mm_struct * mm , unsigned long addr )
125124{ }
126125#endif /* CONFIG_MMU */
127126
@@ -142,11 +141,12 @@ __do_kernel_fault(struct mm_struct *mm, unsigned long addr, unsigned int fsr,
142141 * No handler, we'll have to terminate things with extreme prejudice.
143142 */
144143 bust_spinlocks (1 );
144+ pr_alert ("8<--- cut here ---\n" );
145145 pr_alert ("Unable to handle kernel %s at virtual address %08lx\n" ,
146146 (addr < PAGE_SIZE ) ? "NULL pointer dereference" :
147147 "paging request" , addr );
148148
149- show_pte (mm , addr );
149+ show_pte (KERN_ALERT , mm , addr );
150150 die ("Oops" , regs , fsr );
151151 bust_spinlocks (0 );
152152 do_exit (SIGKILL );
@@ -167,9 +167,10 @@ __do_user_fault(struct task_struct *tsk, unsigned long addr,
167167#ifdef CONFIG_DEBUG_USER
168168 if (((user_debug & UDBG_SEGV ) && (sig == SIGSEGV )) ||
169169 ((user_debug & UDBG_BUS ) && (sig == SIGBUS ))) {
170- printk (KERN_DEBUG "%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n" ,
170+ pr_err ("8<--- cut here ---\n" );
171+ pr_err ("%s: unhandled page fault (%d) at 0x%08lx, code 0x%03x\n" ,
171172 tsk -> comm , sig , addr , fsr );
172- show_pte (tsk -> mm , addr );
173+ show_pte (KERN_ERR , tsk -> mm , addr );
173174 show_regs (regs );
174175 }
175176#endif
@@ -556,9 +557,10 @@ do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
556557 if (!inf -> fn (addr , fsr & ~FSR_LNX_PF , regs ))
557558 return ;
558559
560+ pr_alert ("8<--- cut here ---\n" );
559561 pr_alert ("Unhandled fault: %s (0x%03x) at 0x%08lx\n" ,
560562 inf -> name , fsr , addr );
561- show_pte (current -> mm , addr );
563+ show_pte (KERN_ALERT , current -> mm , addr );
562564
563565 arm_notify_die ("" , regs , inf -> sig , inf -> code , (void __user * )addr ,
564566 fsr , 0 );
0 commit comments