summaryrefslogtreecommitdiff
path: root/arch/sh
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-07-24 04:15:54 (GMT)
committerPaul Mundt <lethal@linux-sh.org>2012-07-25 04:11:13 (GMT)
commit90eed7d87b748f9c0d11b9bad64a4c41e31b78c4 (patch)
treec7a37d40dc33189236b343cd1831bdeaf8e6fa59 /arch/sh
parent92f53a85db3730ae088aaeb7900f85909fd1eda6 (diff)
downloadlinux-90eed7d87b748f9c0d11b9bad64a4c41e31b78c4.tar.xz
sh: Fix up recursive fault in oops with unset TTB.
Presently the oops code looks for the pgd either from the mm context or the cached TTB value. There are presently cases where the TTB can be unset or otherwise cleared by hardware, which we weren't handling, resulting in recursive faults on the NULL pgd. In these cases we can simply reload from swapper_pg_dir and continue on as normal. Cc: stable@vger.kernel.org Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/mm/fault.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c
index 1fc25d8..3bdc1ad 100644
--- a/arch/sh/mm/fault.c
+++ b/arch/sh/mm/fault.c
@@ -58,11 +58,15 @@ static void show_pte(struct mm_struct *mm, unsigned long addr)
{
pgd_t *pgd;
- if (mm)
+ if (mm) {
pgd = mm->pgd;
- else
+ } else {
pgd = get_TTB();
+ if (unlikely(!pgd))
+ pgd = swapper_pg_dir;
+ }
+
printk(KERN_ALERT "pgd = %p\n", pgd);
pgd += pgd_index(addr);
printk(KERN_ALERT "[%08lx] *pgd=%0*Lx", addr,