sh: Fix pgd mismatch from cached TTB in unhandled fault.
authorPaul Mundt <lethal@linux-sh.org>
Wed, 1 Aug 2007 07:39:51 +0000 (16:39 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Wed, 1 Aug 2007 07:39:51 +0000 (16:39 +0900)
When reading the cached TTB value and extracting the pgd, we
accidentally applied a __va() to it and bumped it off in to bogus
space which ended up causing multiple faults in the error path.

Fix it up so unhandled faults don't do strange and highly unorthodox
things when oopsing.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/mm/fault.c

index 964c676..04a39aa 100644 (file)
@@ -184,8 +184,7 @@ no_context:
                printk(KERN_ALERT "pc = %08lx\n", regs->pc);
                page = (unsigned long)get_TTB();
                if (page) {
-                       page = ((__typeof__(page) *) __va(page))[address >>
-                                                                PGDIR_SHIFT];
+                       page = ((__typeof__(page) *)page)[address >> PGDIR_SHIFT];
                        printk(KERN_ALERT "*pde = %08lx\n", page);
                        if (page & _PAGE_PRESENT) {
                                page &= PAGE_MASK;