public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] riscv: alternative: proceed one more instruction for auipc/jalr pair
@ 2023-01-15 16:28 Jisheng Zhang
  2023-01-19  8:45 ` Andrew Jones
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jisheng Zhang @ 2023-01-15 16:28 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Andrew Jones,
	Heiko Stuebner
  Cc: linux-riscv, linux-kernel

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 <jszhang@kernel.org>
Suggested-by: Andrew Jones <ajones@ventanamicro.com>
---
 arch/riscv/kernel/alternative.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/riscv/kernel/alternative.c b/arch/riscv/kernel/alternative.c
index fc341b69bf62..2354c69dc7d1 100644
--- a/arch/riscv/kernel/alternative.c
+++ b/arch/riscv/kernel/alternative.c
@@ -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)) {
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] riscv: alternative: proceed one more instruction for auipc/jalr pair
  2023-01-15 16:28 [PATCH] riscv: alternative: proceed one more instruction for auipc/jalr pair Jisheng Zhang
@ 2023-01-19  8:45 ` Andrew Jones
  2023-01-19 17:21 ` Heiko Stübner
  2023-02-22 15:00 ` patchwork-bot+linux-riscv
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Jones @ 2023-01-19  8:45 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Heiko Stuebner,
	linux-riscv, linux-kernel

On Mon, Jan 16, 2023 at 12:28:11AM +0800, Jisheng Zhang 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 <jszhang@kernel.org>
> Suggested-by: Andrew Jones <ajones@ventanamicro.com>
> ---
>  arch/riscv/kernel/alternative.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/riscv/kernel/alternative.c b/arch/riscv/kernel/alternative.c
> index fc341b69bf62..2354c69dc7d1 100644
> --- a/arch/riscv/kernel/alternative.c
> +++ b/arch/riscv/kernel/alternative.c
> @@ -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)) {
> -- 
> 2.38.1
>

Reviewed-by: Andrew Jones <ajones@ventanamicro.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] riscv: alternative: proceed one more instruction for auipc/jalr pair
  2023-01-15 16:28 [PATCH] riscv: alternative: proceed one more instruction for auipc/jalr pair Jisheng Zhang
  2023-01-19  8:45 ` Andrew Jones
@ 2023-01-19 17:21 ` Heiko Stübner
  2023-02-22 15:00 ` patchwork-bot+linux-riscv
  2 siblings, 0 replies; 4+ messages in thread
From: Heiko Stübner @ 2023-01-19 17:21 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Andrew Jones,
	linux-riscv
  Cc: linux-riscv, linux-kernel, Jisheng Zhang

Am Sonntag, 15. Januar 2023, 17:28:11 CET schrieb 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 <jszhang@kernel.org>
> Suggested-by: Andrew Jones <ajones@ventanamicro.com>

Reviewed-by: Heiko Stuebner <heiko@sntech.de>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] riscv: alternative: proceed one more instruction for auipc/jalr pair
  2023-01-15 16:28 [PATCH] riscv: alternative: proceed one more instruction for auipc/jalr pair Jisheng Zhang
  2023-01-19  8:45 ` Andrew Jones
  2023-01-19 17:21 ` Heiko Stübner
@ 2023-02-22 15:00 ` patchwork-bot+linux-riscv
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+linux-riscv @ 2023-02-22 15:00 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: linux-riscv, paul.walmsley, palmer, aou, ajones, heiko.stuebner,
	linux-kernel

Hello:

This patch was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <palmer@rivosinc.com>:

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 <jszhang@kernel.org>
> Suggested-by: Andrew Jones <ajones@ventanamicro.com>
> 
> [...]

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-22 15:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-15 16:28 [PATCH] riscv: alternative: proceed one more instruction for auipc/jalr pair Jisheng Zhang
2023-01-19  8:45 ` Andrew Jones
2023-01-19 17:21 ` Heiko Stübner
2023-02-22 15:00 ` patchwork-bot+linux-riscv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox