mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-27 06:50:37 +00:00

-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE+soXsSLHKoYyzcli6rmadz2vbToFAmfi6ZAACgkQ6rmadz2v bTpLOg/+J7xUddPMhlpFAUlifQEadE5hmw6v1tXpM3zyKHzUWJiv/qsx3j8/ckgD D+d4P8bqIbI9SSuIS4oZ0+D9pr/g7GYztnoYZmPiYJ7v2AijPuof5dsagFQE8E2y rhfbt9KHTMzzkdkTvaAZaITS/HWAoJ2YVRB6gfLex2ghcXYHcgmtKRZniQrbBiFZ MIXBN8Rg6HP+pUdIVllSXFcQCb3XIgjPONRAos4hr5tIm+3Ku7Jvkgk2H/9vUcoF bdXAcg8xygyH7eY+1l3e7nEPQlG0jUZEsL+tq+vpdoLRLqlIpAUYmwUvqcmq4dPS QGFjiUcpDbXlxsUFpzjXHIFto7fXCfND7HEICQPwAncdflIIfYaATSQUfkEexn0a wBCFlAChrEzAmg2vFl4EeEr0fdSe/3jswrgKx0m6ctKieMjgloBUeeH4fXOpfkhS 9tvhuduVFuronlebM8ew4w9T/mBgbyxkE5KkvP4hNeB3ni3N0K6Mary5/u2HyN1e lqTlnZxRA4p6lrvxce/mDrR4VSwlKLcSeQVjxAL1afD5KRkuZJnUv7bUhS361vkG IjNrQX30EisDAz+X7tMn3ndBf9vVatwFT4+c3yaxlQRor1WofhDfT88HPiyB4QqQ Kdx2EHgbQxJp4vkzhp4/OXlTfkihsMEn8egzZuphdPEQ9Y+Jdwg= =aN/V -----END PGP SIGNATURE----- Merge tag 'bpf-next-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next Pull bpf updates from Alexei Starovoitov: "For this merge window we're splitting BPF pull request into three for higher visibility: main changes, res_spin_lock, try_alloc_pages. These are the main BPF changes: - Add DFA-based live registers analysis to improve verification of programs with loops (Eduard Zingerman) - Introduce load_acquire and store_release BPF instructions and add x86, arm64 JIT support (Peilin Ye) - Fix loop detection logic in the verifier (Eduard Zingerman) - Drop unnecesary lock in bpf_map_inc_not_zero() (Eric Dumazet) - Add kfunc for populating cpumask bits (Emil Tsalapatis) - Convert various shell based tests to selftests/bpf/test_progs format (Bastien Curutchet) - Allow passing referenced kptrs into struct_ops callbacks (Amery Hung) - Add a flag to LSM bpf hook to facilitate bpf program signing (Blaise Boscaccy) - Track arena arguments in kfuncs (Ihor Solodrai) - Add copy_remote_vm_str() helper for reading strings from remote VM and bpf_copy_from_user_task_str() kfunc (Jordan Rome) - Add support for timed may_goto instruction (Kumar Kartikeya Dwivedi) - Allow bpf_get_netns_cookie() int cgroup_skb programs (Mahe Tardy) - Reduce bpf_cgrp_storage_busy false positives when accessing cgroup local storage (Martin KaFai Lau) - Introduce bpf_dynptr_copy() kfunc (Mykyta Yatsenko) - Allow retrieving BTF data with BTF token (Mykyta Yatsenko) - Add BPF kfuncs to set and get xattrs with 'security.bpf.' prefix (Song Liu) - Reject attaching programs to noreturn functions (Yafang Shao) - Introduce pre-order traversal of cgroup bpf programs (Yonghong Song)" * tag 'bpf-next-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (186 commits) selftests/bpf: Add selftests for load-acquire/store-release when register number is invalid bpf: Fix out-of-bounds read in check_atomic_load/store() libbpf: Add namespace for errstr making it libbpf_errstr bpf: Add struct_ops context information to struct bpf_prog_aux selftests/bpf: Sanitize pointer prior fclose() selftests/bpf: Migrate test_xdp_vlan.sh into test_progs selftests/bpf: test_xdp_vlan: Rename BPF sections bpf: clarify a misleading verifier error message selftests/bpf: Add selftest for attaching fexit to __noreturn functions bpf: Reject attaching fexit/fmod_ret to __noreturn functions bpf: Only fails the busy counter check in bpf_cgrp_storage_get if it creates storage bpf: Make perf_event_read_output accessible in all program types. bpftool: Using the right format specifiers bpftool: Add -Wformat-signedness flag to detect format errors selftests/bpf: Test freplace from user namespace libbpf: Pass BPF token from find_prog_btf_id to BPF_BTF_GET_FD_BY_ID bpf: Return prog btf_id without capable check bpf: BPF token support for BPF_BTF_GET_FD_BY_ID bpf, x86: Fix objtool warning for timed may_goto bpf: Check map->record at the beginning of check_and_free_fields() ...
92 lines
2.9 KiB
Makefile
92 lines
2.9 KiB
Makefile
# SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
|
|
include ../../scripts/Makefile.include
|
|
|
|
OUTPUT ?= $(abspath .output)/
|
|
|
|
BPFTOOL_OUTPUT := $(OUTPUT)bpftool/
|
|
DEFAULT_BPFTOOL := $(BPFTOOL_OUTPUT)bootstrap/bpftool
|
|
BPFTOOL ?= $(DEFAULT_BPFTOOL)
|
|
BPF_TARGET_ENDIAN ?= --target=bpf
|
|
LIBBPF_SRC := $(abspath ../../lib/bpf)
|
|
BPFOBJ_OUTPUT := $(OUTPUT)libbpf/
|
|
BPFOBJ := $(BPFOBJ_OUTPUT)libbpf.a
|
|
BPF_DESTDIR := $(BPFOBJ_OUTPUT)
|
|
BPF_INCLUDE := $(BPF_DESTDIR)/include
|
|
INCLUDES := -I$(OUTPUT) -I$(BPF_INCLUDE) -I$(abspath ../../include/uapi)
|
|
CFLAGS := -g -Wall $(CLANG_CROSS_FLAGS)
|
|
CFLAGS += $(EXTRA_CFLAGS)
|
|
LDFLAGS += $(EXTRA_LDFLAGS)
|
|
LDLIBS += -lelf -lz
|
|
|
|
# Try to detect best kernel BTF source
|
|
KERNEL_REL := $(shell uname -r)
|
|
VMLINUX_BTF_PATHS := $(if $(O),$(O)/vmlinux) \
|
|
$(if $(KBUILD_OUTPUT),$(KBUILD_OUTPUT)/vmlinux) \
|
|
../../../vmlinux /sys/kernel/btf/vmlinux \
|
|
/boot/vmlinux-$(KERNEL_REL)
|
|
VMLINUX_BTF_PATH := $(or $(VMLINUX_BTF),$(firstword \
|
|
$(wildcard $(VMLINUX_BTF_PATHS))))
|
|
|
|
ifneq ($(V),1)
|
|
MAKEFLAGS += --no-print-directory
|
|
submake_extras := feature_display=0
|
|
endif
|
|
|
|
.DELETE_ON_ERROR:
|
|
|
|
.PHONY: all clean runqslower libbpf_hdrs
|
|
all: runqslower
|
|
|
|
runqslower: $(OUTPUT)/runqslower
|
|
|
|
clean:
|
|
$(call QUIET_CLEAN, runqslower)
|
|
$(Q)$(RM) -r $(BPFOBJ_OUTPUT) $(BPFTOOL_OUTPUT)
|
|
$(Q)$(RM) $(OUTPUT)*.o $(OUTPUT)*.d
|
|
$(Q)$(RM) $(OUTPUT)*.skel.h $(OUTPUT)vmlinux.h
|
|
$(Q)$(RM) $(OUTPUT)runqslower
|
|
$(Q)$(RM) -r .output
|
|
|
|
libbpf_hdrs: $(BPFOBJ)
|
|
|
|
$(OUTPUT)/runqslower: $(OUTPUT)/runqslower.o $(BPFOBJ)
|
|
$(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LDLIBS) -o $@
|
|
|
|
$(OUTPUT)/runqslower.o: runqslower.h $(OUTPUT)/runqslower.skel.h \
|
|
$(OUTPUT)/runqslower.bpf.o | libbpf_hdrs
|
|
|
|
$(OUTPUT)/runqslower.bpf.o: $(OUTPUT)/vmlinux.h runqslower.h | libbpf_hdrs
|
|
|
|
$(OUTPUT)/%.skel.h: $(OUTPUT)/%.bpf.o | $(BPFTOOL)
|
|
$(QUIET_GEN)$(BPFTOOL) gen skeleton $< > $@
|
|
|
|
$(OUTPUT)/%.bpf.o: %.bpf.c $(BPFOBJ) | $(OUTPUT)
|
|
$(QUIET_GEN)$(CLANG) -g -O2 $(BPF_TARGET_ENDIAN) $(INCLUDES) \
|
|
-c $(filter %.c,$^) -o $@ && \
|
|
$(LLVM_STRIP) -g $@
|
|
|
|
$(OUTPUT)/%.o: %.c | $(OUTPUT)
|
|
$(QUIET_CC)$(CC) $(CFLAGS) $(INCLUDES) -c $(filter %.c,$^) -o $@
|
|
|
|
$(OUTPUT) $(BPFOBJ_OUTPUT) $(BPFTOOL_OUTPUT):
|
|
$(QUIET_MKDIR)mkdir -p $@
|
|
|
|
$(OUTPUT)/vmlinux.h: $(VMLINUX_BTF_PATH) | $(OUTPUT) $(BPFTOOL)
|
|
ifeq ($(VMLINUX_H),)
|
|
$(Q)if [ ! -e "$(VMLINUX_BTF_PATH)" ] ; then \
|
|
echo "Couldn't find kernel BTF; set VMLINUX_BTF to" \
|
|
"specify its location." >&2; \
|
|
exit 1;\
|
|
fi
|
|
$(QUIET_GEN)$(BPFTOOL) btf dump file $(VMLINUX_BTF_PATH) format c > $@
|
|
else
|
|
$(Q)cp "$(VMLINUX_H)" $@
|
|
endif
|
|
|
|
$(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[ch] $(LIBBPF_SRC)/Makefile) | $(BPFOBJ_OUTPUT)
|
|
$(Q)$(MAKE) $(submake_extras) -C $(LIBBPF_SRC) OUTPUT=$(BPFOBJ_OUTPUT) \
|
|
DESTDIR=$(BPFOBJ_OUTPUT) prefix= $(abspath $@) install_headers
|
|
|
|
$(DEFAULT_BPFTOOL): | $(BPFTOOL_OUTPUT)
|
|
$(Q)$(MAKE) $(submake_extras) -C ../bpftool OUTPUT=$(BPFTOOL_OUTPUT) bootstrap
|