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

selftests/bpf: Fix build error for LoongArch

There exists build error when make -C tools/testing/selftests/bpf/
on LoongArch:

BINARY test_verifier
In file included from test_verifier.c:27:
tools/include/uapi/linux/bpf_perf_event.h:14:28: error: field 'regs' has incomplete type
14 | bpf_user_pt_regs_t regs;
| ^~~~
make: *** [Makefile:577: tools/testing/selftests/bpf/test_verifier] Error 1
make: Leaving directory 'tools/testing/selftests/bpf'

Add missing uapi header for LoongArch to use the following definition:
typedef struct user_pt_regs bpf_user_pt_regs_t;

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Link: https://lore.kernel.org/r/1676458867-22052-1-git-send-email-yangtiezhu@loongson.cn
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Tiezhu Yang and committed by
Alexei Starovoitov
524581d1 e2d323a1

+2
+2
tools/include/uapi/asm/bpf_perf_event.h
··· 6 6 #include "../../arch/s390/include/uapi/asm/bpf_perf_event.h" 7 7 #elif defined(__riscv) 8 8 #include "../../arch/riscv/include/uapi/asm/bpf_perf_event.h" 9 + #elif defined(__loongarch__) 10 + #include "../../arch/loongarch/include/uapi/asm/bpf_perf_event.h" 9 11 #else 10 12 #include <uapi/asm-generic/bpf_perf_event.h> 11 13 #endif