Skip to content

Commit cbcb199

Browse files
committed
Merge branch 'libbpf/selftests syscall wrapper fixes for RISC-V'
Björn Töpel says: ==================== From: Björn Töpel <bjorn@rivosinc.com> Commit 08d0ce3 ("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/20231003182407.32198-1-alexghiti@rivosinc.com/ Alexandre Ghiti (1): libbpf: Fix syscall access arguments on riscv ==================== Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
2 parents 93fb277 + b55b775 commit cbcb199

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

tools/lib/bpf/bpf_tracing.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,6 @@ struct pt_regs___arm64 {
362362
#define __PT_PARM7_REG a6
363363
#define __PT_PARM8_REG a7
364364

365-
/* riscv does not select ARCH_HAS_SYSCALL_WRAPPER. */
366-
#define PT_REGS_SYSCALL_REGS(ctx) ctx
367365
#define __PT_PARM1_SYSCALL_REG __PT_PARM1_REG
368366
#define __PT_PARM2_SYSCALL_REG __PT_PARM2_REG
369367
#define __PT_PARM3_SYSCALL_REG __PT_PARM3_REG

tools/testing/selftests/bpf/progs/bpf_misc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@
9999
#elif defined(__TARGET_ARCH_arm64)
100100
#define SYSCALL_WRAPPER 1
101101
#define SYS_PREFIX "__arm64_"
102+
#elif defined(__TARGET_ARCH_riscv)
103+
#define SYSCALL_WRAPPER 1
104+
#define SYS_PREFIX "__riscv_"
102105
#else
103106
#define SYSCALL_WRAPPER 0
104107
#define SYS_PREFIX "__se_"

tools/testing/selftests/bpf/test_progs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,8 @@ int get_bpf_max_tramp_links(void);
417417
#define SYS_NANOSLEEP_KPROBE_NAME "__s390x_sys_nanosleep"
418418
#elif defined(__aarch64__)
419419
#define SYS_NANOSLEEP_KPROBE_NAME "__arm64_sys_nanosleep"
420+
#elif defined(__riscv)
421+
#define SYS_NANOSLEEP_KPROBE_NAME "__riscv_sys_nanosleep"
420422
#else
421423
#define SYS_NANOSLEEP_KPROBE_NAME "sys_nanosleep"
422424
#endif

0 commit comments

Comments
 (0)