Skip to content

Commit 91612cf

Browse files
xhackerustcpalmer-dabbelt
authored andcommitted
riscv: alternative: proceed one more instruction for auipc/jalr pair
If we patched auipc + jalr pair, we'd better proceed one more instruction. Andrew pointed out "There's not a problem now, since we're only adding a fixup for jal, not jalr, but we should future-proof this and there's no reason to revisit an already fixed-up instruction anyway." Signed-off-by: Jisheng Zhang <[email protected]> Suggested-by: Andrew Jones <[email protected]> Reviewed-by: Andrew Jones <[email protected]> Reviewed-by: Heiko Stuebner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent f3af3b0 commit 91612cf

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/riscv/kernel/alternative.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ void riscv_alternative_fix_offsets(void *alt_ptr, unsigned int len,
122122

123123
riscv_alternative_fix_auipc_jalr(alt_ptr + i * sizeof(u32),
124124
insn, insn2, patch_offset);
125+
i++;
125126
}
126127

127128
if (riscv_insn_is_jal(insn)) {

0 commit comments

Comments
 (0)