aboutsummaryrefslogtreecommitdiff
path: root/arch/ppc/kernel/traps.c
diff options
context:
space:
mode:
authorKumar Gala <galak@freescale.com>2005-05-28 15:52:13 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-28 16:46:16 -0700
commit92b4dc16257fef814ddf1c8d1d2a20f67f67ee4b (patch)
tree775c042e7b5cedf0d28b9d190956c192db49572a /arch/ppc/kernel/traps.c
parent91f9855a7afbb160ba1709bf342858732138abad (diff)
[PATCH] ppc32: Simplified load string emulation error checking
The error checking for emulation of load string instructions was overly generous and would cause certain valid forms of the instructions to be treated as illegal. We drop the range checking since the architecture allows this to be boundedly undefined. Tests on CPUs that support these instructions appear not do cause illegal instruction traps on range errors and just allow the execution to occur. Thanks to Kim Phillips for debugging this and figuring out what real HW was doing. Signed-off-by: Kumar Gala <kumar.gala@freescale.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/ppc/kernel/traps.c')
-rw-r--r--arch/ppc/kernel/traps.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
index f8e7e324a17..c65731e8bc6 100644
--- a/arch/ppc/kernel/traps.c
+++ b/arch/ppc/kernel/traps.c
@@ -408,12 +408,7 @@ static int emulate_string_inst(struct pt_regs *regs, u32 instword)
/* Early out if we are an invalid form of lswx */
if ((instword & INST_STRING_MASK) == INST_LSWX)
- if ((rA >= rT) || (NB_RB >= rT) || (rT == rA) || (rT == NB_RB))
- return -EINVAL;
-
- /* Early out if we are an invalid form of lswi */
- if ((instword & INST_STRING_MASK) == INST_LSWI)
- if ((rA >= rT) || (rT == rA))
+ if ((rT == rA) || (rT == NB_RB))
return -EINVAL;
EA = (rA == 0) ? 0 : regs->gpr[rA];