* [PATCH] riscv, libbpf: use a0 for RC register
@ 2022-07-06 14:02 Yixun Lan
2022-07-07 8:53 ` Björn Töpel
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Yixun Lan @ 2022-07-06 14:02 UTC (permalink / raw)
To: linux-riscv, Björn Töpel, bpf
Cc: Palmer Dabbelt, Alexei Starovoitov, Daniel Borkmann,
Andrii Nakryiko, Martin KaFai Lau, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Paul Walmsley, Albert Ou, Hengqi Chen,
netdev, linux-kernel, Yixun Lan
According to the RISC-V calling convention register usage here[1],
a0 is used as return value register, so rename it to make it consistent
with the spec.
[1] section 18.2, table 18.2
https://riscv.org/wp-content/uploads/2015/01/riscv-calling.pdf
Fixes: 589fed479ba1 ("riscv, libbpf: Add RISC-V (RV64) support to bpf_tracing.h")
Signed-off-by: Yixun Lan <dlan@gentoo.org>
---
I'm adding a Fixes tag here, although the original version may just work fine,
and shouldn't be considered as a real error. But, the benefit is that we could
make it consistent with RISC-V spec, and all other tools will follow the same usage.
thanks, and let's me if there is any issue that I may not noticed..
---
tools/lib/bpf/bpf_tracing.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/lib/bpf/bpf_tracing.h b/tools/lib/bpf/bpf_tracing.h
index 01ce121c302df..11f9096407fc4 100644
--- a/tools/lib/bpf/bpf_tracing.h
+++ b/tools/lib/bpf/bpf_tracing.h
@@ -233,7 +233,7 @@ struct pt_regs___arm64 {
#define __PT_PARM5_REG a4
#define __PT_RET_REG ra
#define __PT_FP_REG s0
-#define __PT_RC_REG a5
+#define __PT_RC_REG a0
#define __PT_SP_REG sp
#define __PT_IP_REG pc
/* riscv does not select ARCH_HAS_SYSCALL_WRAPPER. */
--
2.35.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] riscv, libbpf: use a0 for RC register
2022-07-06 14:02 [PATCH] riscv, libbpf: use a0 for RC register Yixun Lan
@ 2022-07-07 8:53 ` Björn Töpel
2022-07-07 14:04 ` Amjad Ouled-Ameur
2022-07-07 14:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Björn Töpel @ 2022-07-07 8:53 UTC (permalink / raw)
To: Yixun Lan
Cc: linux-riscv, bpf, Palmer Dabbelt, Alexei Starovoitov,
Daniel Borkmann, Andrii Nakryiko, Martin KaFai Lau, Song Liu,
Yonghong Song, John Fastabend, KP Singh, Paul Walmsley,
Albert Ou, Hengqi Chen, Netdev, LKML
On Wed, 6 Jul 2022 at 16:03, Yixun Lan <dlan@gentoo.org> wrote:
>
> According to the RISC-V calling convention register usage here[1],
> a0 is used as return value register, so rename it to make it consistent
> with the spec.
>
> [1] section 18.2, table 18.2
> https://riscv.org/wp-content/uploads/2015/01/riscv-calling.pdf
>
> Fixes: 589fed479ba1 ("riscv, libbpf: Add RISC-V (RV64) support to bpf_tracing.h")
> Signed-off-by: Yixun Lan <dlan@gentoo.org>
Nice catch!
Acked-by: Björn Töpel <bjorn@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] riscv, libbpf: use a0 for RC register
2022-07-06 14:02 [PATCH] riscv, libbpf: use a0 for RC register Yixun Lan
2022-07-07 8:53 ` Björn Töpel
@ 2022-07-07 14:04 ` Amjad Ouled-Ameur
2022-07-07 14:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Amjad Ouled-Ameur @ 2022-07-07 14:04 UTC (permalink / raw)
To: dlan
Cc: andrii, aou, ast, bjorn, bpf, chenhengqi, daniel, john.fastabend,
kafai, kpsingh, linux-kernel, linux-riscv, netdev, palmer,
paul.walmsley, songliubraving, yhs
Acked-by: Amjad OULED-AMEUR <ouledameur.amjad@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] riscv, libbpf: use a0 for RC register
2022-07-06 14:02 [PATCH] riscv, libbpf: use a0 for RC register Yixun Lan
2022-07-07 8:53 ` Björn Töpel
2022-07-07 14:04 ` Amjad Ouled-Ameur
@ 2022-07-07 14:40 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-07-07 14:40 UTC (permalink / raw)
To: Yixun Lan
Cc: linux-riscv, bjorn, bpf, palmer, ast, daniel, andrii, kafai,
songliubraving, yhs, john.fastabend, kpsingh, paul.walmsley, aou,
chenhengqi, netdev, linux-kernel
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:
On Wed, 6 Jul 2022 22:02:04 +0800 you wrote:
> According to the RISC-V calling convention register usage here[1],
> a0 is used as return value register, so rename it to make it consistent
> with the spec.
>
> [1] section 18.2, table 18.2
> https://riscv.org/wp-content/uploads/2015/01/riscv-calling.pdf
>
> [...]
Here is the summary with links:
- riscv, libbpf: use a0 for RC register
https://git.kernel.org/bpf/bpf-next/c/935dc35c7531
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:[~2022-07-07 14:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06 14:02 [PATCH] riscv, libbpf: use a0 for RC register Yixun Lan
2022-07-07 8:53 ` Björn Töpel
2022-07-07 14:04 ` Amjad Ouled-Ameur
2022-07-07 14:40 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).