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

MIPS: jump_label.c: Correct the span of the J instruction

Correct the check for the span of the 256MB segment addressable by the J
instruction according to this instruction's semantics.  The calculation
of the jump target is applied to the address of the delay-slot
instruction that immediately follows.  Adjust the check accordingly by
adding 4 to `e->code' that holds the address of the J instruction
itself.
Signed-off-by: NMaciej W. Rozycki <macro@codesourcery.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/8515/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 640465bd
...@@ -27,8 +27,8 @@ void arch_jump_label_transform(struct jump_entry *e, ...@@ -27,8 +27,8 @@ void arch_jump_label_transform(struct jump_entry *e,
union mips_instruction *insn_p = union mips_instruction *insn_p =
(union mips_instruction *)(unsigned long)e->code; (union mips_instruction *)(unsigned long)e->code;
/* Jump only works within a 256MB aligned region. */ /* Jump only works within a 256MB aligned region of its delay slot. */
BUG_ON((e->target & ~J_RANGE_MASK) != (e->code & ~J_RANGE_MASK)); BUG_ON((e->target & ~J_RANGE_MASK) != ((e->code + 4) & ~J_RANGE_MASK));
/* Target must have 4 byte alignment. */ /* Target must have 4 byte alignment. */
BUG_ON((e->target & 3) != 0); BUG_ON((e->target & 3) != 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册