Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0630e45c887b3d3d8d6ad27af03ec4054926d635
Commit:     0630e45c887b3d3d8d6ad27af03ec4054926d635
Parent:     fc1d4c9c3761ca8db52b647c6a4ba50771900a12
Author:     Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Mon Jun 18 19:02:47 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Mon Jun 18 19:02:47 2007 +0900

    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 <[EMAIL PROTECTED]>
---
 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 c878faa..0b3eaf6 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,
        struct task_struct *tsk;
        struct mm_struct *mm;
        struct vm_area_struct * vma;
-       unsigned long page;
        int si_code;
        siginfo_t info;
 
@@ -170,24 +169,38 @@ no_context:
  * terminate things with extreme prejudice.
  *
  */
-       if (address < PAGE_SIZE)
-               printk(KERN_ALERT "Unable to handle kernel NULL pointer 
dereference");
-       else
-               printk(KERN_ALERT "Unable to handle kernel paging request");
-       printk(" at virtual address %08lx\n", address);
-       printk(KERN_ALERT "pc = %08lx\n", regs->pc);
-       page = (unsigned long)get_TTB();
-       if (page) {
-               page = ((unsigned long *) page)[address >> PGDIR_SHIFT];
-               printk(KERN_ALERT "*pde = %08lx\n", page);
-               if (page & _PAGE_PRESENT) {
-                       page &= PAGE_MASK;
-                       address &= 0x003ff000;
-                       page = ((unsigned long *) __va(page))[address >> 
PAGE_SHIFT];
-                       printk(KERN_ALERT "*pte = %08lx\n", page);
+
+       bust_spinlocks(1);
+
+       if (oops_may_print()) {
+               __typeof__(pte_val(__pte(0))) page;
+
+               if (address < PAGE_SIZE)
+                       printk(KERN_ALERT "Unable to handle kernel NULL "
+                                         "pointer dereference");
+               else
+                       printk(KERN_ALERT "Unable to handle kernel paging "
+                                         "request");
+               printk(" at virtual address %08lx\n", address);
+               printk(KERN_ALERT "pc = %08lx\n", regs->pc);
+               page = (unsigned long)get_TTB();
+               if (page) {
+                       page = ((__typeof__(page) *) __va(page))[address >>
+                                                                PGDIR_SHIFT];
+                       printk(KERN_ALERT "*pde = %08lx\n", page);
+                       if (page & _PAGE_PRESENT) {
+                               page &= PAGE_MASK;
+                               address &= 0x003ff000;
+                               page = ((__typeof__(page) *)
+                                               __va(page))[address >>
+                                                           PAGE_SHIFT];
+                               printk(KERN_ALERT "*pte = %08lx\n", page);
+                       }
                }
        }
+
        die("Oops", regs, writeaccess);
+       bust_spinlocks(0);
        do_exit(SIGKILL);
 
 /*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to