asm-generic: Unify uapi bitsperlong.h for arm64, riscv and loongarchNow we specify the minimal version of GCC as 5.1 and Clang/LLVM as 11.0.0in Documentation/process/changes.rst, __CHAR_BIT__ and
asm-generic: Unify uapi bitsperlong.h for arm64, riscv and loongarchNow we specify the minimal version of GCC as 5.1 and Clang/LLVM as 11.0.0in Documentation/process/changes.rst, __CHAR_BIT__ and __SIZEOF_LONG__ areusable, it is probably fine to unify the definition of __BITS_PER_LONG as(__CHAR_BIT__ * __SIZEOF_LONG__) in asm-generic uapi bitsperlong.h.In order to keep safe and avoid regression, only unify uapi bitsperlong.hfor some archs such as arm64, riscv and loongarch which are using newertoolchains that have the definitions of __CHAR_BIT__ and __SIZEOF_LONG__.Suggested-by: Xi Ruoyao <[email protected]>Link: https://lore.kernel.org/all/[email protected]/Suggested-by: Arnd Bergmann <[email protected]>Link: https://lore.kernel.org/linux-arch/[email protected]/Signed-off-by: Tiezhu Yang <[email protected]>Signed-off-by: Arnd Bergmann <[email protected]>
show more ...
selftests/bpf: Fix build error for LoongArchThere exists build error when make -C tools/testing/selftests/bpf/on LoongArch: BINARY test_verifierIn file included from test_verifier.c:27:tool
selftests/bpf: Fix build error for LoongArchThere exists build error when make -C tools/testing/selftests/bpf/on LoongArch: BINARY test_verifierIn 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 1make: 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 <[email protected]>Link: https://lore.kernel.org/r/[email protected]Signed-off-by: Alexei Starovoitov <[email protected]>
tools/include/uapi: Fix <asm/errno.h> for parisc and xtensatools/include/uapi/asm/errno.h currently attempts to includenon-existent arch-specific errno.h header for xtensa.Remove this case so tha
tools/include/uapi: Fix <asm/errno.h> for parisc and xtensatools/include/uapi/asm/errno.h currently attempts to includenon-existent arch-specific errno.h header for xtensa.Remove this case so that <asm-generic/errno.h> is used instead,and add the missing arch-specific header for parisc.References: https://buildd.debian.org/status/fetch.php?pkg=linux&arch=ia64&ver=5.8.3-1%7Eexp1&stamp=1598340829&raw=1Signed-off-by: Ben Hutchings <[email protected]>Signed-off-by: Salvatore Bonaccorso <[email protected]>Cc: <[email protected]> # 5.10+Signed-off-by: Helge Deller <[email protected]>
LoongArch: Add other common headersAdd some other common headers for basic LoongArch support.Reviewed-by: WANG Xuerui <[email protected]>Reviewed-by: Jiaxun Yang <[email protected]>Signed-of
LoongArch: Add other common headersAdd some other common headers for basic LoongArch support.Reviewed-by: WANG Xuerui <[email protected]>Reviewed-by: Jiaxun Yang <[email protected]>Signed-off-by: Huacai Chen <[email protected]>
libbpf: Add ARC support to bpf_tracing.hAdd PT_REGS macros suitable for ARCompact and ARCv2.Signed-off-by: Vladimir Isaev <[email protected]>Signed-off-by: Sergey Matyukevich <[email protected]
libbpf: Add ARC support to bpf_tracing.hAdd PT_REGS macros suitable for ARCompact and ARCv2.Signed-off-by: Vladimir Isaev <[email protected]>Signed-off-by: Sergey Matyukevich <[email protected]>Signed-off-by: Andrii Nakryiko <[email protected]>Acked-by: Song Liu <[email protected]>Link: https://lore.kernel.org/bpf/[email protected]
ia64: tools: remove inclusion of ia64-specific version of errno.h headerThere is no longer an ia64-specific version of the errno.h header belowarch/ia64/include/uapi/asm/, so trying to build tools
ia64: tools: remove inclusion of ia64-specific version of errno.h headerThere is no longer an ia64-specific version of the errno.h header belowarch/ia64/include/uapi/asm/, so trying to build tools/bpf fails with: CC /usr/src/linux/tools/bpf/bpftool/btf_dumper.o In file included from /usr/src/linux/tools/include/linux/err.h:8, from btf_dumper.c:11: /usr/src/linux/tools/include/uapi/asm/errno.h:13:10: fatal error: ../../../arch/ia64/include/uapi/asm/errno.h: No such file or directory 13 | #include "../../../arch/ia64/include/uapi/asm/errno.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.Thus, just remove the inclusion of the ia64-specific errno.h so that thebuild will use the generic errno.h header on this target which was usedthere anyway as the ia64-specific errno.h was just a wrapper for thegeneric header.Fixes: c25f867ddd00 ("ia64: remove unneeded uapi asm-generic wrappers")Signed-off-by: John Paul Adrian Glaubitz <[email protected]>Signed-off-by: Andrew Morton <[email protected]>Signed-off-by: Linus Torvalds <[email protected]>
tools: Fix off-by 1 relative directory includesThis is currently working due to extra include paths in the build.Committer testing: $ cd tools/include/uapi/asm/Before this patch: $ ls -la
tools: Fix off-by 1 relative directory includesThis is currently working due to extra include paths in the build.Committer testing: $ cd tools/include/uapi/asm/Before this patch: $ ls -la ../../arch/x86/include/uapi/asm/errno.h ls: cannot access '../../arch/x86/include/uapi/asm/errno.h': No such file or directory $After this patch; $ ls -la ../../../arch/x86/include/uapi/asm/errno.h -rw-rw-r--. 1 acme acme 31 Feb 20 12:42 ../../../arch/x86/include/uapi/asm/errno.h $Check that that is still under tools/, i.e. hasn't escaped into the mainkernel sources: $ cd ../../../arch/x86/include/uapi/asm/ $ pwd /home/acme/git/perf/tools/arch/x86/include/uapi/asm $Signed-off-by: Ian Rogers <[email protected]>Tested-by: Arnaldo Carvalho de Melo <[email protected]>Acked-by: Jiri Olsa <[email protected]>Cc: Adrian Hunter <[email protected]>Cc: Alexander Shishkin <[email protected]>Cc: Alexios Zavras <[email protected]>Cc: Andi Kleen <[email protected]>Cc: Greg Kroah-Hartman <[email protected]>Cc: Igor Lubashev <[email protected]>Cc: Kan Liang <[email protected]>Cc: Mark Rutland <[email protected]>Cc: Mathieu Poirier <[email protected]>Cc: Namhyung Kim <[email protected]>Cc: Nick Desaulniers <[email protected]>Cc: Peter Zijlstra <[email protected]>Cc: Stephane Eranian <[email protected]>Cc: Thomas Gleixner <[email protected]>Cc: Wei Li <[email protected]>Link: http://lore.kernel.org/lkml/[email protected]Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
riscv, bpf: Add missing uapi header for BPF_PROG_TYPE_PERF_EVENT programsAdd missing uapi header the BPF_PROG_TYPE_PERF_EVENT programs byexporting struct user_regs_struct instead of struct pt_regs
riscv, bpf: Add missing uapi header for BPF_PROG_TYPE_PERF_EVENT programsAdd missing uapi header the BPF_PROG_TYPE_PERF_EVENT programs byexporting struct user_regs_struct instead of struct pt_regs which isin-kernel only.Signed-off-by: Björn Töpel <[email protected]>Signed-off-by: Daniel Borkmann <[email protected]>Link: https://lore.kernel.org/bpf/[email protected]
tools headers: Fixup bitsperlong per arch includesWe were getting the file by luck, from one of the paths in -I, fix it toget it from the proper place: $ cd tools/include/uapi/asm/ [acme@quac
tools headers: Fixup bitsperlong per arch includesWe were getting the file by luck, from one of the paths in -I, fix it toget it from the proper place: $ cd tools/include/uapi/asm/ [acme@quaco asm]$ grep include bitsperlong.h #include "../../arch/x86/include/uapi/asm/bitsperlong.h" #include "../../arch/arm64/include/uapi/asm/bitsperlong.h" #include "../../arch/powerpc/include/uapi/asm/bitsperlong.h" #include "../../arch/s390/include/uapi/asm/bitsperlong.h" #include "../../arch/sparc/include/uapi/asm/bitsperlong.h" #include "../../arch/mips/include/uapi/asm/bitsperlong.h" #include "../../arch/ia64/include/uapi/asm/bitsperlong.h" #include "../../arch/riscv/include/uapi/asm/bitsperlong.h" #include "../../arch/alpha/include/uapi/asm/bitsperlong.h" #include <asm-generic/bitsperlong.h> $ ls -la ../../arch/x86/include/uapi/asm/bitsperlong.h ls: cannot access '../../arch/x86/include/uapi/asm/bitsperlong.h': No such file or directory $ ls -la ../../../arch/*/include/uapi/asm/bitsperlong.h -rw-rw-r--. 1 237 ../../../arch/alpha/include/uapi/asm/bitsperlong.h -rw-rw-r--. 1 841 ../../../arch/arm64/include/uapi/asm/bitsperlong.h -rw-rw-r--. 1 966 ../../../arch/hexagon/include/uapi/asm/bitsperlong.h -rw-rw-r--. 1 234 ../../../arch/ia64/include/uapi/asm/bitsperlong.h -rw-rw-r--. 1 100 ../../../arch/microblaze/include/uapi/asm/bitsperlong.h -rw-rw-r--. 1 244 ../../../arch/mips/include/uapi/asm/bitsperlong.h -rw-rw-r--. 1 352 ../../../arch/parisc/include/uapi/asm/bitsperlong.h -rw-rw-r--. 1 312 ../../../arch/powerpc/include/uapi/asm/bitsperlong.h -rw-rw-r--. 1 353 ../../../arch/riscv/include/uapi/asm/bitsperlong.h -rw-rw-r--. 1 292 ../../../arch/s390/include/uapi/asm/bitsperlong.h -rw-rw-r--. 1 323 ../../../arch/sparc/include/uapi/asm/bitsperlong.h -rw-rw-r--. 1 320 ../../../arch/x86/include/uapi/asm/bitsperlong.h $Found while fixing some other problem, before it was escaping thetools/ chroot and using stuff in the kernel sources: CC /tmp/build/perf/util/find_bit.oIn file included from /git/linux/tools/include/../../arch/x86/include/uapi/asm/bitsperlong.h:11, from /git/linux/tools/include/uapi/asm/bitsperlong.h:3, from /git/linux/tools/include/linux/bits.h:6, from /git/linux/tools/include/linux/bitops.h:13, from ../lib/find_bit.c:17: # cd /git/linux/tools/include/../../arch/x86/include/uapi/asm/ # pwd /git/linux/arch/x86/include/uapi/asm #Now it is getting the one we want it to, i.e. the one inside tools/: CC /tmp/build/perf/util/find_bit.o In file included from /git/linux/tools/arch/x86/include/uapi/asm/bitsperlong.h:11, from /git/linux/tools/include/linux/bits.h:6, from /git/linux/tools/include/linux/bitops.h:13,Cc: Adrian Hunter <[email protected]>Cc: Jiri Olsa <[email protected]>Cc: Namhyung Kim <[email protected]>Link: https://lkml.kernel.org/n/[email protected]Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools uapi: fix Alpha supportCc: [email protected] # v4.18+Signed-off-by: Bob Tracy <[email protected]>Signed-off-by: Matt Turner <[email protected]>
tools uapi: fix RISC-V 64-bit supportThe BPF library is not built on 64-bit RISC-V, as the BPF feature isnot detected. Looking more in details, feature/test-bpf.c fails to buildwith the following
tools uapi: fix RISC-V 64-bit supportThe BPF library is not built on 64-bit RISC-V, as the BPF feature isnot detected. Looking more in details, feature/test-bpf.c fails to buildwith the following error:| In file included from /tmp/linux-4.19.12/tools/include/uapi/asm/bitsperlong.h:17,| from /tmp/linux-4.19.12/tools/include/uapi/asm-generic/unistd.h:2,| from /usr/include/riscv64-linux-gnu/asm/unistd.h:1,| from test-bpf.c:2:| /tmp/linux-4.19.12/tools/include/asm-generic/bitsperlong.h:14:2: error: #error Inconsistent word size. Check asm/bitsperlong.h| #error Inconsistent word size. Check asm/bitsperlong.h| ^~~~~The UAPI from the tools directory is missing RISC-V support, thereforebitsperlong.h from asm-generic is used, defaulting to 32 bits.Fix that by adding tools/arch/riscv/include/uapi/asm/bitsperlong.h asa copy of arch/riscv/include/uapi/asm/bitsperlong.h and by updatingtools/include/uapi/asm/bitsperlong.h.Signed-off-by: Aurelien Jarno <[email protected]>Signed-off-by: Palmer Dabbelt <[email protected]>
selftests/bpf: add architecture-agnostic headersThe BPF selftests fail to build with missing headers'asm/bitsperlong.h' and 'asm/errno.h'.These already exist in 'tools/arch/[arch]/include';add
selftests/bpf: add architecture-agnostic headersThe BPF selftests fail to build with missing headers'asm/bitsperlong.h' and 'asm/errno.h'.These already exist in 'tools/arch/[arch]/include';add architecture-agnostic header files in 'tools/include/uapi'to reference them.Signed-off-by: Sirio Balmelli <[email protected]>Signed-off-by: Daniel Borkmann <[email protected]>
bpf: fix broken BPF selftest buildAt least on x86_64, the kernel's BPF selftests seemed to have stoppedto build due to 618e165b2a8e ("selftests/bpf: sync kernel headers andintroduce arch support
bpf: fix broken BPF selftest buildAt least on x86_64, the kernel's BPF selftests seemed to have stoppedto build due to 618e165b2a8e ("selftests/bpf: sync kernel headers andintroduce arch support in Makefile"): [...] In file included from test_verifier.c:29:0: ../../../include/uapi/linux/bpf_perf_event.h:11:32: fatal error: asm/bpf_perf_event.h: No such file or directory #include <asm/bpf_perf_event.h> ^ compilation terminated. [...]While pulling in tools/arch/*/include/uapi/asm/bpf_perf_event.h seemsto work fine, there's no automated fall-back logic right now that woulddo the same out of tools/include/uapi/asm-generic/bpf_perf_event.h. Theusual convention today is to add a include/[uapi/]asm/ equivalent thatwould pull in the correct arch header or generic one as fall-back, allifdef'ed based on compiler target definition. It's similarly done alsoin other cases such as tools/include/asm/barrier.h, thus adapt the samehere.Fixes: 618e165b2a8e ("selftests/bpf: sync kernel headers and introduce arch support in Makefile")Signed-off-by: Daniel Borkmann <[email protected]>Cc: Hendrik Brueckner <[email protected]>Cc: Arnaldo Carvalho de Melo <[email protected]>Acked-by: Alexei Starovoitov <[email protected]>Signed-off-by: Alexei Starovoitov <[email protected]>