Skip to content

Commit a39cada

Browse files
hbruecknerborkmann
authored andcommitted
arm64/bpf: correct broken uapi for BPF_PROG_TYPE_PERF_EVENT program type
Correct the broken uapi for the BPF_PROG_TYPE_PERF_EVENT program type by exporting the user_pt_regs structure instead of the pt_regs structure that is in-kernel only. Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Reviewed-by: Thomas Richter <tmricht@linux.vnet.ibm.com> Acked-by: Alexei Starovoitov <ast@kernel.org> Cc: Will Deacon <will.deacon@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
1 parent 466698e commit a39cada

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

arch/arm64/include/asm/perf_event.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#define __ASM_PERF_EVENT_H
1919

2020
#include <asm/stack_pointer.h>
21+
#include <asm/ptrace.h>
2122

2223
#define ARMV8_PMU_MAX_COUNTERS 32
2324
#define ARMV8_PMU_COUNTER_MASK (ARMV8_PMU_MAX_COUNTERS - 1)
@@ -79,6 +80,7 @@ struct pt_regs;
7980
extern unsigned long perf_instruction_pointer(struct pt_regs *regs);
8081
extern unsigned long perf_misc_flags(struct pt_regs *regs);
8182
#define perf_misc_flags(regs) perf_misc_flags(regs)
83+
#define perf_arch_bpf_user_pt_regs(regs) &regs->user_regs
8284
#endif
8385

8486
#define perf_arch_fetch_caller_regs(regs, __ip) { \
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _UAPI__ASM_BPF_PERF_EVENT_H__
3+
#define _UAPI__ASM_BPF_PERF_EVENT_H__
4+
5+
#include <asm/ptrace.h>
6+
7+
typedef struct user_pt_regs bpf_user_pt_regs_t;
8+
9+
#endif /* _UAPI__ASM_BPF_PERF_EVENT_H__ */

0 commit comments

Comments
 (0)