Skip to contentSkip to conversation

libbpf: Fix arm syscall regs spec in bpf_tracing.h

PATCH Applied Puranjay Mohan 3 participants 3 messages Feb 23, 2023 – Feb 27, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 libbpf: Fix arm syscall regs spec in bpf_tracing.h

The syscall register definitions for ARM in bpf_tracing.h doesn't define the fifth parameter for the syscalls. Because of this some KPROBES based selftests fail to compile for ARM architecture.

Define the fifth parameter that is passed in the R5 register (uregs[4]).

Fixes 3a95c42d65d5 ("libbpf: Define arm syscall regs spec in bpf_tracing.h")

---
Changes in V1[1]->V2:
- Fix signed-off-by and send-from emails.

[1] https://lore.kernel.org/bpf/[email protected]/T/#u

---
 tools/lib/bpf/bpf_tracing.h | 1 +
 1 file changed, 1 insertion(+)
tools/lib/bpf/bpf_tracing.h +1 -0
index 6db88f41fa0d..2cd888733b1c 100644
@@ -204,6 +204,7 @@ struct pt_regs___s390 {
 #define __PT_PARM2_SYSCALL_REG __PT_PARM2_REG
 #define __PT_PARM3_SYSCALL_REG __PT_PARM3_REG
 #define __PT_PARM4_SYSCALL_REG __PT_PARM4_REG
+#define __PT_PARM5_SYSCALL_REG uregs[4]
 #define __PT_PARM6_SYSCALL_REG uregs[5]
 #define __PT_PARM7_SYSCALL_REG uregs[6]
 
Signature · 1 line
2.39.1
#1 lore raw
Quoted 23 lines · Puranjay Mohan

The syscall register definitions for ARM in bpf_tracing.h doesn't define the fifth parameter for the syscalls. Because of this some KPROBES based selftests fail to compile for ARM architecture.

Define the fifth parameter that is passed in the R5 register (uregs[4]).

Fixes 3a95c42d65d5 ("libbpf: Define arm syscall regs spec in bpf_tracing.h")

---
Changes in V1[1]->V2:
- Fix signed-off-by and send-from emails.

[1] https://lore.kernel.org/bpf/[email protected]/T/#u

---
 tools/lib/bpf/bpf_tracing.h | 1 +
 1 file changed, 1 insertion(+)
tools/lib/bpf/bpf_tracing.h +0 -0
index 6db88f41fa0d..2cd888733b1c 100644

tools/lib/bpf/bpf_tracing.h struct pt_regs___s390 { · line 207

Quoted 4 lines
tools/lib/bpf/bpf_tracing.h +1 -0
@@ -204,6 +204,7 @@ struct pt_regs___s390 {
 #define __PT_PARM2_SYSCALL_REG __PT_PARM2_REG
 #define __PT_PARM3_SYSCALL_REG __PT_PARM3_REG
 #define __PT_PARM4_SYSCALL_REG __PT_PARM4_REG
+#define __PT_PARM5_SYSCALL_REG uregs[4]

that's an "interesting" omission on my part, thanks for catching and fixing!

Quoted 6 lines
tools/lib/bpf/bpf_tracing.h +0 -1
 #define __PT_PARM6_SYSCALL_REG uregs[5]
 #define __PT_PARM7_SYSCALL_REG uregs[6]
 
--

2.39.1

#2 lore raw
In reply to Puranjay Mohan
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:

Hello:

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

Quoted 10 lines · On Thu, 23 Feb 2023 09:53:46 +0000 you wrote:

The syscall register definitions for ARM in bpf_tracing.h doesn't define the fifth parameter for the syscalls. Because of this some KPROBES based selftests fail to compile for ARM architecture.

Define the fifth parameter that is passed in the R5 register (uregs[4]).

Fixes 3a95c42d65d5 ("libbpf: Define arm syscall regs spec in bpf_tracing.h")

[...]

Here is the summary with links:
- [v2] libbpf: Fix arm syscall regs spec in bpf_tracing.h

    https://git.kernel.org/bpf/bpf-next/c/06943ae67594

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html