diff options
| author | Maciej W. Rozycki <macro@linux-mips.org> | 2015-04-03 18:26:32 -0400 |
|---|---|---|
| committer | Ralf Baechle <ralf@linux-mips.org> | 2015-04-07 19:09:58 -0400 |
| commit | c9875032015ec94033295382a098657d4e38bf89 (patch) | |
| tree | 8b5ddc5544878b8885b83301911592fff5e1373c /arch/mips/kernel | |
| parent | f6a31da50158c1003bd487968d89a6b27ff25bb6 (diff) | |
MIPS: Fix BREAK code interpretation heuristics
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>
Diffstat (limited to 'arch/mips/kernel')
| -rw-r--r-- | arch/mips/kernel/traps.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index a671d3358eb6..dc6eaf4d93ea 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
| @@ -943,7 +943,7 @@ asmlinkage void do_bp(struct pt_regs *regs) | |||
| 943 | * We handle both cases with a simple heuristics. --macro | 943 | * We handle both cases with a simple heuristics. --macro |
| 944 | */ | 944 | */ |
| 945 | if (bcode >= (1 << 10)) | 945 | if (bcode >= (1 << 10)) |
| 946 | bcode >>= 10; | 946 | bcode = ((bcode & ((1 << 10) - 1)) << 10) | (bcode >> 10); |
| 947 | 947 | ||
| 948 | /* | 948 | /* |
| 949 | * notify the kprobe handlers, if instruction is likely to | 949 | * notify the kprobe handlers, if instruction is likely to |
