diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-06-18 06:02:47 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2007-06-18 06:02:47 -0400 |
commit | 0630e45c887b3d3d8d6ad27af03ec4054926d635 (patch) | |
tree | 251261af762d9f5f7a706ba3e75920f7cb0bccc6 /arch/sh/mm/fault.c | |
parent | fc1d4c9c3761ca8db52b647c6a4ba50771900a12 (diff) |
sh: Check oops_may_print() in unhandled fault.
Only print out pgd/pte data in the oops path if oops_may_print()
holds true. Follows the i386 implementation.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm/fault.c')
-rw-r--r-- | arch/sh/mm/fault.c | 45 |
1 files changed, 29 insertions, 16 deletions
diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c index c878faa4ae46..0b3eaf6fbb28 100644 --- a/arch/sh/mm/fault.c +++ b/arch/sh/mm/fault.c | |||
@@ -32,7 +32,6 @@ asmlinkage void __kprobes do_page_fault(struct pt_regs *regs, | |||
32 | struct task_struct *tsk; | 32 | struct task_struct *tsk; |
33 | struct mm_struct *mm; | 33 | struct mm_struct *mm; |
34 | struct vm_area_struct * vma; | 34 | struct vm_area_struct * vma; |
35 | unsigned long page; | ||
36 | int si_code; | 35 | int si_code; |
37 | siginfo_t info; | 36 | siginfo_t info; |
38 | 37 | ||
@@ -170,24 +169,38 @@ no_context: | |||
170 | * terminate things with extreme prejudice. | 169 | * terminate things with extreme prejudice. |
171 | * | 170 | * |
172 | */ | 171 | */ |
173 | if (address < PAGE_SIZE) | 172 | |
174 | printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference"); | 173 | bust_spinlocks(1); |
175 | else | 174 | |
176 | printk(KERN_ALERT "Unable to handle kernel paging request"); | 175 | if (oops_may_print()) { |
177 | printk(" at virtual address %08lx\n", address); | 176 | __typeof__(pte_val(__pte(0))) page; |
178 | printk(KERN_ALERT "pc = %08lx\n", regs->pc); | 177 | |
179 | page = (unsigned long)get_TTB(); | 178 | if (address < PAGE_SIZE) |
180 | if (page) { | 179 | printk(KERN_ALERT "Unable to handle kernel NULL " |
181 | page = ((unsigned long *) page)[address >> PGDIR_SHIFT]; | 180 | "pointer dereference"); |
182 | printk(KERN_ALERT "*pde = %08lx\n", page); | 181 | else |
183 | if (page & _PAGE_PRESENT) { | 182 | printk(KERN_ALERT "Unable to handle kernel paging " |
184 | page &= PAGE_MASK; | 183 | "request"); |
185 | address &= 0x003ff000; | 184 | printk(" at virtual address %08lx\n", address); |
186 | page = ((unsigned long *) __va(page))[address >> PAGE_SHIFT]; | 185 | printk(KERN_ALERT "pc = %08lx\n", regs->pc); |
187 | printk(KERN_ALERT "*pte = %08lx\n", page); | 186 | page = (unsigned long)get_TTB(); |
187 | if (page) { | ||
188 | page = ((__typeof__(page) *) __va(page))[address >> | ||
189 | PGDIR_SHIFT]; | ||
190 | printk(KERN_ALERT "*pde = %08lx\n", page); | ||
191 | if (page & _PAGE_PRESENT) { | ||
192 | page &= PAGE_MASK; | ||
193 | address &= 0x003ff000; | ||
194 | page = ((__typeof__(page) *) | ||
195 | __va(page))[address >> | ||
196 | PAGE_SHIFT]; | ||
197 | printk(KERN_ALERT "*pte = %08lx\n", page); | ||
198 | } | ||
188 | } | 199 | } |
189 | } | 200 | } |
201 | |||
190 | die("Oops", regs, writeaccess); | 202 | die("Oops", regs, writeaccess); |
203 | bust_spinlocks(0); | ||
191 | do_exit(SIGKILL); | 204 | do_exit(SIGKILL); |
192 | 205 | ||
193 | /* | 206 | /* |