diff options
author | Paul Mundt <lethal@linux-sh.org> | 2008-05-19 06:39:33 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-05-19 06:39:33 -0400 |
commit | 336f1d326831873ffab6de5fcec4b3be05103ae0 (patch) | |
tree | 832dfd3be4d03275fa0a609df47b5115fa3ebac1 /arch | |
parent | 9a33fc217d2248838d52f8ef214b1909073f3eb4 (diff) |
sh: Fix up restorer in debug_trap exception return path.
There are a few different types of debug trap exceptions, though now
that they are all going through a special jump table, the restorer needs
to be unified as well.
Presently this is falling through the ret_from_fork path, which more or
less does the right thing on SH-3/4 whilst being completely unsuitable on
MMU-less targets.
Ultimately what we want here is a branch through the platform's
restore_all directly, without worrying about the retval being clobbered.
We can accomplish that through a branch to __restore_all directly, so
switch it so we come back from the jump table and branch to the restorer.
This fixes up a recursion in the nommu WARN_ON() path, as well as some
other userspace nastiness where said recursion caused serious stack
corruption.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/kernel/entry-common.S | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index 9a1837d5b54e..718bd2356b34 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S | |||
@@ -1,9 +1,6 @@ | |||
1 | /* $Id: entry.S,v 1.37 2004/06/11 13:02:46 doyu Exp $ | 1 | /* |
2 | * | ||
3 | * linux/arch/sh/entry.S | ||
4 | * | ||
5 | * Copyright (C) 1999, 2000, 2002 Niibe Yutaka | 2 | * Copyright (C) 1999, 2000, 2002 Niibe Yutaka |
6 | * Copyright (C) 2003 Paul Mundt | 3 | * Copyright (C) 2003 - 2008 Paul Mundt |
7 | * | 4 | * |
8 | * This file is subject to the terms and conditions of the GNU General Public | 5 | * This file is subject to the terms and conditions of the GNU General Public |
9 | * License. See the file "COPYING" in the main directory of this archive | 6 | * License. See the file "COPYING" in the main directory of this archive |
@@ -282,7 +279,9 @@ debug_trap: | |||
282 | mov.l 1f, r8 | 279 | mov.l 1f, r8 |
283 | add r0, r8 | 280 | add r0, r8 |
284 | mov.l @r8, r8 | 281 | mov.l @r8, r8 |
285 | jmp @r8 | 282 | jsr @r8 |
283 | nop | ||
284 | bra __restore_all | ||
286 | nop | 285 | nop |
287 | 286 | ||
288 | .align 2 | 287 | .align 2 |