Skip to content

Commit a6460b0

Browse files
sandip4nmpe
authored andcommitted
powerpc/bpf: Fix broken uapi for BPF_PROG_TYPE_PERF_EVENT
Now that there are different variants of pt_regs for userspace and kernel, the uapi for the BPF_PROG_TYPE_PERF_EVENT program type must be changed by exporting the user_pt_regs structure instead of the pt_regs structure that is in-kernel only. Fixes: 002af93 ("powerpc: Split user/kernel definitions of struct pt_regs") Signed-off-by: Sandipan Das <sandipan@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent e41b93a commit a6460b0

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

arch/powerpc/include/asm/perf_event.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
#include <asm/ptrace.h>
2727
#include <asm/reg.h>
2828

29+
#define perf_arch_bpf_user_pt_regs(regs) &regs->user_regs
30+
2931
/*
3032
* Overload regs->result to specify whether we should use the MSR (result
3133
* is zero) or the SIAR (result is non zero).

arch/powerpc/include/uapi/asm/Kbuild

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# UAPI Header export list
22
include include/uapi/asm-generic/Kbuild.asm
33

4-
generic-y += bpf_perf_event.h
54
generic-y += param.h
65
generic-y += poll.h
76
generic-y += resource.h
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)