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

riscv, bpf: Add missing uapi header for BPF_PROG_TYPE_PERF_EVENT programs

Add missing uapi header the BPF_PROG_TYPE_PERF_EVENT programs by
exporting struct user_regs_struct instead of struct pt_regs which is
in-kernel only.

Signed-off-by: Björn Töpel <bjorn.topel@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20191216091343.23260-9-bjorn.topel@gmail.com

authored by

Björn Töpel and committed by
Daniel Borkmann
eb9928be e368b64f

+11
+9
arch/riscv/include/uapi/asm/bpf_perf_event.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 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_regs_struct bpf_user_pt_regs_t; 8 + 9 + #endif /* _UAPI__ASM_BPF_PERF_EVENT_H__ */
+2
tools/include/uapi/asm/bpf_perf_event.h
··· 2 2 #include "../../arch/arm64/include/uapi/asm/bpf_perf_event.h" 3 3 #elif defined(__s390__) 4 4 #include "../../arch/s390/include/uapi/asm/bpf_perf_event.h" 5 + #elif defined(__riscv) 6 + #include "../../arch/riscv/include/uapi/asm/bpf_perf_event.h" 5 7 #else 6 8 #include <uapi/asm-generic/bpf_perf_event.h> 7 9 #endif