2023-10-04 11:09:35

by Björn Töpel

[permalink] [raw]
Subject: [PATCH bpf 0/3] libbpf/selftests syscall wrapper fixes for RISC-V

From: Björn Töpel <[email protected]>

Commit 08d0ce30e0e4 ("riscv: Implement syscall wrappers") introduced
some regressions in libbpf, and the kselftests BPF suite, which are
fixed with these three patches.

Note that there's an outstanding fix [1] for ftrace syscall tracing
which is also a fallout from the commit above.


Björn

[1] https://lore.kernel.org/linux-riscv/[email protected]/

Alexandre Ghiti (1):
libbpf: Fix syscall access arguments on riscv

Björn Töpel (2):
selftests/bpf: Define SYS_PREFIX for riscv
selftests/bpf: Define SYS_NANOSLEEP_KPROBE_NAME for riscv

tools/lib/bpf/bpf_tracing.h | 2 --
tools/testing/selftests/bpf/progs/bpf_misc.h | 3 +++
tools/testing/selftests/bpf/test_progs.h | 2 ++
3 files changed, 5 insertions(+), 2 deletions(-)


base-commit: 9077fc228f09c9f975c498c55f5d2e882cd0da59
--
2.39.2


2023-10-04 11:09:38

by Björn Töpel

[permalink] [raw]
Subject: [PATCH bpf 3/3] selftests/bpf: Define SYS_NANOSLEEP_KPROBE_NAME for riscv

From: Björn Töpel <[email protected]>

Add missing sys_nanosleep name for RISC-V, which is used by some tests
(e.g. attach_probe).

Fixes: 08d0ce30e0e4 ("riscv: Implement syscall wrappers")
Signed-off-by: Björn Töpel <[email protected]>
---
tools/testing/selftests/bpf/test_progs.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/bpf/test_progs.h b/tools/testing/selftests/bpf/test_progs.h
index 77bd492c6024..2f9f6f250f17 100644
--- a/tools/testing/selftests/bpf/test_progs.h
+++ b/tools/testing/selftests/bpf/test_progs.h
@@ -417,6 +417,8 @@ int get_bpf_max_tramp_links(void);
#define SYS_NANOSLEEP_KPROBE_NAME "__s390x_sys_nanosleep"
#elif defined(__aarch64__)
#define SYS_NANOSLEEP_KPROBE_NAME "__arm64_sys_nanosleep"
+#elif defined(__riscv)
+#define SYS_NANOSLEEP_KPROBE_NAME "__riscv_sys_nanosleep"
#else
#define SYS_NANOSLEEP_KPROBE_NAME "sys_nanosleep"
#endif
--
2.39.2

2023-10-04 11:09:58

by Björn Töpel

[permalink] [raw]
Subject: [PATCH bpf 2/3] selftests/bpf: Define SYS_PREFIX for riscv

From: Björn Töpel <[email protected]>

SYS_PREFIX was missing for a RISC-V, which made a couple of kprobe
tests fail.

Add missing SYS_PREFIX for RISC-V.

Fixes: 08d0ce30e0e4 ("riscv: Implement syscall wrappers")
Signed-off-by: Björn Töpel <[email protected]>
---
tools/testing/selftests/bpf/progs/bpf_misc.h | 3 +++
1 file changed, 3 insertions(+)

diff --git a/tools/testing/selftests/bpf/progs/bpf_misc.h b/tools/testing/selftests/bpf/progs/bpf_misc.h
index 38a57a2e70db..799fff4995d8 100644
--- a/tools/testing/selftests/bpf/progs/bpf_misc.h
+++ b/tools/testing/selftests/bpf/progs/bpf_misc.h
@@ -99,6 +99,9 @@
#elif defined(__TARGET_ARCH_arm64)
#define SYSCALL_WRAPPER 1
#define SYS_PREFIX "__arm64_"
+#elif defined(__TARGET_ARCH_riscv)
+#define SYSCALL_WRAPPER 1
+#define SYS_PREFIX "__riscv_"
#else
#define SYSCALL_WRAPPER 0
#define SYS_PREFIX "__se_"
--
2.39.2

2023-10-04 16:53:28

by Sami Tolvanen

[permalink] [raw]
Subject: Re: [PATCH bpf 0/3] libbpf/selftests syscall wrapper fixes for RISC-V

Hi Björn,

On Wed, Oct 4, 2023 at 4:09 AM Björn Töpel <[email protected]> wrote:
>
> From: Björn Töpel <[email protected]>
>
> Commit 08d0ce30e0e4 ("riscv: Implement syscall wrappers") introduced
> some regressions in libbpf, and the kselftests BPF suite, which are
> fixed with these three patches.

This series looks good to me. Thanks for fixing the issues!

Reviewed-by: Sami Tolvanen <[email protected]>

Sami

2023-10-04 20:41:44

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH bpf 0/3] libbpf/selftests syscall wrapper fixes for RISC-V

Hello:

This series was applied to bpf/bpf-next.git (master)
by Andrii Nakryiko <[email protected]>:

On Wed, 4 Oct 2023 13:09:02 +0200 you wrote:
> From: Björn Töpel <[email protected]>
>
> Commit 08d0ce30e0e4 ("riscv: Implement syscall wrappers") introduced
> some regressions in libbpf, and the kselftests BPF suite, which are
> fixed with these three patches.
>
> Note that there's an outstanding fix [1] for ftrace syscall tracing
> which is also a fallout from the commit above.
>
> [...]

Here is the summary with links:
- [bpf,1/3] libbpf: Fix syscall access arguments on riscv
https://git.kernel.org/bpf/bpf-next/c/8a412c5c1cd6
- [bpf,2/3] selftests/bpf: Define SYS_PREFIX for riscv
https://git.kernel.org/bpf/bpf-next/c/0f2692ee4324
- [bpf,3/3] selftests/bpf: Define SYS_NANOSLEEP_KPROBE_NAME for riscv
https://git.kernel.org/bpf/bpf-next/c/b55b775f0316

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html