bpf: powerpc: fix broken uapi for BPF_PROG_TYPE_PERF_EVENT
Subsystems (4)
PATCH 1/1 bpf: powerpc: 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.
--- arch/powerpc/include/asm/perf_event.h | 2 ++ arch/powerpc/include/uapi/asm/Kbuild | 1 - arch/powerpc/include/uapi/asm/bpf_perf_event.h | 9 +++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 arch/powerpc/include/uapi/asm/bpf_perf_event.h
arch/powerpc/include/asm/perf_event.h +2 -0
@@ -26,6 +26,8 @@#include <asm/ptrace.h> #include <asm/reg.h> +#define perf_arch_bpf_user_pt_regs (regs) ®s->user_regs +/* * Overload regs->result to specify whether we should use the MSR (result * is zero) or the SIAR (result is non zero).
arch/powerpc/include/uapi/asm/Kbuild +0 -1
@@ -1,7 +1,6 @@ # UAPI Header export list include include/uapi/asm-generic/Kbuild.asm -generic-y += bpf_perf_event.h generic-y += param.h generic-y += poll.h generic-y += resource.h
arch/powerpc/include/uapi/asm/bpf_perf_event.h new file +9 -0
@@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _UAPI__ASM_BPF_PERF_EVENT_H__ +#define _UAPI__ASM_BPF_PERF_EVENT_H__ + +#include <asm/ptrace.h> + +typedef struct user_pt_regs bpf_user_pt_regs_t ; + +#endif /* _UAPI__ASM_BPF_PERF_EVENT_H__ */
Signature · 1 line
2.19.2
Alexei Starovoitov
AppliedQuoted 7 lines · Sandipan Das
Now that there are different variants of
pt_regsfor userspace and kernel, the uapi for theBPF_PROG_TYPE_PERF_EVENTprogram type must be changed by exporting theuser_pt_regsstructure instead of thept_regsstructure that is in-kernel only.Fixes 002af9391bfb ("powerpc: Split user/kernel definitions of struct pt_regs")Signed-off-by Sandipan Das <[email protected]>
Thanks! Applied to bpf tree.
Michael Ellerman
reviewerQuoted 10 lines · Alexei Starovoitov
Quoted 7 lines · Sandipan Das
Now that there are different variants of
pt_regsfor userspace and kernel, the uapi for theBPF_PROG_TYPE_PERF_EVENTprogram type must be changed by exporting theuser_pt_regsstructure instead of thept_regsstructure that is in-kernel only.Fixes 002af9391bfb ("powerpc: Split user/kernel definitions of struct pt_regs")Signed-off-by Sandipan Das <[email protected]>Thanks! Applied to bpf tree.
I already have this in the fixes branch of the powerpc tree. I don't mind if you take it also, git should probably handle the merge OK.
cheers
Michael Ellerman
AppliedQuoted 7 lines · Sandipan Das
Now that there are different variants of
pt_regsfor userspace and kernel, the uapi for theBPF_PROG_TYPE_PERF_EVENTprogram type must be changed by exporting theuser_pt_regsstructure instead of thept_regsstructure that is in-kernel only.Fixes 002af9391bfb ("powerpc: Split user/kernel definitions of struct pt_regs")Signed-off-by Sandipan Das <[email protected]>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/a6460b03f945ee216dbf42a0d9ee78
cheers