riscv: alternative: proceed one more instruction for auipc/jalr pair
PATCH 1/1 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."
--- arch/riscv/kernel/alternative.c | 1 + 1 file changed, 1 insertion(+)
arch/riscv/kernel/alternative.c +1 -0
@@ -122,6 +122,7 @@ void riscv_alternative_fix_offsets(void *alt_ptr, unsigned int len,riscv_alternative_fix_auipc_jalr (alt_ptr + i *sizeof (u32), insn, insn2, patch_offset); + i++; }if (riscv_insn_is_jal (insn)) {
Signature · 7 lines
2.38.1 _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 27 lines · Jisheng Zhang
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]>--- arch/riscv/kernel/alternative.c | 1 + 1 file changed, 1 insertion(+)arch/riscv/kernel/alternative.c +1
-0@@ -122,6 +122,7 @@ void riscv_alternative_fix_offsets(void *alt_ptr, unsigned int len,riscv_alternative_fix_auipc_jalr (alt_ptr + i *sizeof (u32), insn, insn2, patch_offset); + i++; }if (riscv_insn_is_jal (insn)) {Signature · 1 line
2.38.1
Am Sonntag, 15. Januar 2023, 17:28:11 CET schrieb Jisheng Zhang:
Quoted 8 lines
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]>
_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:
Hello:
This patch was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:
Quoted 10 lines · On Mon, 16 Jan 2023 00:28:11 +0800 you wrote:
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]>[...]
Here is the summary with links:
- riscv: alternative: proceed one more instruction for auipc/jalr pair
https://git.kernel.org/riscv/c/91612cfb1736
You are awesome, thank you!
Signature · 9 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv