提交 c9875032 编写于 作者: M Maciej W. Rozycki 提交者: Ralf Baechle

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: NMaciej W. Rozycki <macro@linux-mips.org>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/9697/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 f6a31da5
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册