Skip to content

Commit

Permalink
sh: Fix up recursive fault in oops with unset TTB.
Browse files Browse the repository at this point in the history
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: [email protected]
Signed-off-by: Paul Mundt <[email protected]>
  • Loading branch information
pmundt committed Jul 25, 2012
1 parent 92f53a8 commit 90eed7d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arch/sh/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 90eed7d

Please sign in to comment.