Skip to content

Commit

Permalink
MIPS: Fix BREAK code interpretation heuristics
Browse files Browse the repository at this point in the history
Do not lose the other half of the BREAK code where there is an upper
half.  This is so that e.g. `BREAK 7, 7' is not interpreted as a divide
by zero trap, while `BREAK 0, 7' or `BREAK 7, 0' still are.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9697/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Maciej W. Rozycki authored and Ralf Baechle committed Apr 7, 2015
1 parent f6a31da commit c987503
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/mips/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ asmlinkage void do_bp(struct pt_regs *regs)
* We handle both cases with a simple heuristics. --macro
*/
if (bcode >= (1 << 10))
bcode >>= 10;
bcode = ((bcode & ((1 << 10) - 1)) << 10) | (bcode >> 10);

/*
* notify the kprobe handlers, if instruction is likely to
Expand Down

0 comments on commit c987503

Please sign in to comment.