Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 002af9391bfb ("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>

authored by

Sandipan Das and committed by
Michael Ellerman
a6460b03 e41b93a6

+11 -1
+2
arch/powerpc/include/asm/perf_event.h
··· 26 26 #include <asm/ptrace.h> 27 27 #include <asm/reg.h> 28 28 29 + #define perf_arch_bpf_user_pt_regs(regs) &regs->user_regs 30 + 29 31 /* 30 32 * Overload regs->result to specify whether we should use the MSR (result 31 33 * is zero) or the SIAR (result is non zero).
-1
arch/powerpc/include/uapi/asm/Kbuild
··· 1 1 # UAPI Header export list 2 2 include include/uapi/asm-generic/Kbuild.asm 3 3 4 - generic-y += bpf_perf_event.h 5 4 generic-y += param.h 6 5 generic-y += poll.h 7 6 generic-y += resource.h
+9
arch/powerpc/include/uapi/asm/bpf_perf_event.h
··· 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__ */