History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf

Cross-merge bpf fixes after downstream PR. No conflicts. Adjacent changes in: include/linux/bpf.h include/uapi/linux/bpf.h kernel/bpf/btf.c kernel/bpf/helpers.c kernel/bpf/syscall.c kernel/bpf/verifier.c kernel/trace/bpf_trace.c mm/slab_common.c tools/include/uapi/linux/bpf.h tools/testing/selftests/bpf/Makefile

Alexei Starovoitov committed 2 years ago

Commit bfa7b5c2 parents c6fb803 ae90f6a1167 files · +15425 −10300Browse files

Showing the changes to scripts (9 of 1167 files). Show all

Unified · Split

9 files
  1. scripts/Kconfig.include +3 −0
  2. scripts/Makefile.compiler +7 −7
  3. scripts/Makefile.dtbs +3 −1
  4. scripts/include/list.h +50 −0
  5. scripts/kconfig/expr.c +1 −0
  6. scripts/kconfig/parser.y +8 −2
  7. scripts/kconfig/qconf.cc +3 −3
  8. scripts/package/builddeb +0 −1
  9. scripts/rustc-llvm-version.sh +22 −0
scripts/Kconfig.include+3−0
@@ -65,6 +65,9 @@ cc-option-bit = $(if-success,$(CC) -Werror $(1) -E -x c /dev/null -o /dev/null,$ · 64 unmodified lines
6565 m32-flag := $(cc-option-bit,-m32)
6666 m64-flag := $(cc-option-bit,-m64)
6767
68+rustc-version := $(shell,$(srctree)/scripts/rustc-version.sh $(RUSTC))
69+rustc-llvm-version := $(shell,$(srctree)/scripts/rustc-llvm-version.sh $(RUSTC))
70+
6871 # $(rustc-option,<flag>)
6972 # Return y if the Rust compiler supports <flag>, n otherwise
7073 # Calls to this should be guarded so that they are not evaluated if
scripts/Makefile.compiler+7−7
@@ -53,13 +53,11 @@ cc-option = $(call __cc-option, $(CC),\ · 52 unmodified lines
5353
5454 # cc-option-yn
5555 # Usage: flag := $(call cc-option-yn,-march=winchip-c6)
56−cc-option-yn = $(call try-run,\
57− $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
56+cc-option-yn = $(if $(call cc-option,$1),y,n)
5857
5958 # cc-disable-warning
6059 # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
61−cc-disable-warning = $(call try-run,\
62− $(CC) -Werror $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
60+cc-disable-warning = $(if $(call cc-option,-W$(strip $1)),-Wno-$(strip $1))
6361
6462 # gcc-min-version
6563 # Usage: cflags-$(call gcc-min-version, 70100) += -foo
@@ -75,8 +73,11 @@ ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3)) · 9 unmodified lines
7573
7674 # __rustc-option
7775 # Usage: MY_RUSTFLAGS += $(call __rustc-option,$(RUSTC),$(MY_RUSTFLAGS),-Cinstrument-coverage,-Zinstrument-coverage)
76+# TODO: remove RUSTC_BOOTSTRAP=1 when we raise the minimum GNU Make version to 4.4
7877 __rustc-option = $(call try-run,\
79− $(1) $(2) $(3) --crate-type=rlib /dev/null --out-dir=$$TMPOUT -o "$$TMP",$(3),$(4))
78+ echo '#![allow(missing_docs)]#![feature(no_core)]#![no_core]' | RUSTC_BOOTSTRAP=1\
79+ $(1) --sysroot=/dev/null $(filter-out --sysroot=/dev/null,$(2)) $(3)\
80+ --crate-type=rlib --out-dir=$(TMPOUT) --emit=obj=- - >/dev/null,$(3),$(4))
8081
8182 # rustc-option
8283 # Usage: rustflags-y += $(call rustc-option,-Cinstrument-coverage,-Zinstrument-coverage)
@@ -85,5 +86,4 @@ rustc-option = $(call __rustc-option, $(RUSTC),\ · 2 unmodified lines
8586
8687 # rustc-option-yn
8788 # Usage: flag := $(call rustc-option-yn,-Cinstrument-coverage)
88−rustc-option-yn = $(call try-run,\
89− $(RUSTC) $(KBUILD_RUSTFLAGS) $(1) --crate-type=rlib /dev/null --out-dir=$$TMPOUT -o "$$TMP",y,n)
89+rustc-option-yn = $(if $(call rustc-option,$1),y,n)
scripts/Makefile.dtbs+3−1
@@ -34,12 +34,14 @@ $(obj)/dtbs-list: $(dtb-y) FORCE · 33 unmodified lines
3434 # Assembly file to wrap dtb(o)
3535 # ---------------------------------------------------------------------------
3636
37+builtin-dtb-section = $(if $(filter arch/$(SRCARCH)/boot/dts%, $(obj)),.dtb.init.rodata,.rodata)
38+
3739 # Generate an assembly file to wrap the output of the device tree compiler
3840 quiet_cmd_wrap_S_dtb = WRAP $@
3941 cmd_wrap_S_dtb = { \
4042 symbase=__$(patsubst .%,%,$(suffix $<))_$(subst -,_,$(notdir $*)); \
4143 echo '\#include <asm-generic/vmlinux.lds.h>'; \
42− echo '.section .dtb.init.rodata,"a"'; \
44+ echo '.section $(builtin-dtb-section),"a"'; \
4345 echo '.balign STRUCT_ALIGNMENT'; \
4446 echo ".global $${symbase}_begin"; \
4547 echo "$${symbase}_begin:"; \
scripts/include/list.h+50−0
@@ -127,6 +127,36 @@ static inline void list_del(struct list_head *entry) · 126 unmodified lines
127127 entry->prev = LIST_POISON2;
128128 }
129129
130+/**
131+ * list_replace - replace old entry by new one
132+ * @old : the element to be replaced
133+ * @new : the new element to insert
134+ *
135+ * If @old was empty, it will be overwritten.
136+ */
137+static inline void list_replace(struct list_head *old,
138+ struct list_head *new)
139+{
140+ new->next = old->next;
141+ new->next->prev = new;
142+ new->prev = old->prev;
143+ new->prev->next = new;
144+}
145+
146+/**
147+ * list_replace_init - replace old entry by new one and initialize the old one
148+ * @old : the element to be replaced
149+ * @new : the new element to insert
150+ *
151+ * If @old was empty, it will be overwritten.
152+ */
153+static inline void list_replace_init(struct list_head *old,
154+ struct list_head *new)
155+{
156+ list_replace(old, new);
157+ INIT_LIST_HEAD(old);
158+}
159+
130160 /**
131161 * list_move - delete from one list and add as another's head
132162 * @list: the entry to move
@@ -150,6 +180,26 @@ static inline void list_move_tail(struct list_head *list, · 17 unmodified lines
150180 list_add_tail(list, head);
151181 }
152182
183+/**
184+ * list_is_first -- tests whether @list is the first entry in list @head
185+ * @list: the entry to test
186+ * @head: the head of the list
187+ */
188+static inline int list_is_first(const struct list_head *list, const struct list_head *head)
189+{
190+ return list->prev == head;
191+}
192+
193+/**
194+ * list_is_last - tests whether @list is the last entry in list @head
195+ * @list: the entry to test
196+ * @head: the head of the list
197+ */
198+static inline int list_is_last(const struct list_head *list, const struct list_head *head)
199+{
200+ return list->next == head;
201+}
202+
153203 /**
154204 * list_is_head - tests whether @list is the list @head
155205 * @list: the entry to test
scripts/kconfig/expr.c+1−0
@@ -47,6 +47,7 @@ static struct expr *expr_lookup(enum expr_type type, void *l, void *r) · 46 unmodified lines
4747 e->type = type;
4848 e->left._initdata = l;
4949 e->right._initdata = r;
50+ e->val_is_valid = false;
5051
5152 hash_add(expr_hashtable, &e->node, hash);
5253
scripts/kconfig/parser.y+8−2
@@ -159,8 +159,14 @@ config_stmt: config_entry_start config_option_list · 158 unmodified lines
159159 yynerrs++;
160160 }
161161
162− list_add_tail(&current_entry->sym->choice_link,
163− &current_choice->choice_members);
162+ /*
163+ * If the same symbol appears twice in a choice block, the list
164+ * node would be added twice, leading to a broken linked list.
165+ * list_empty() ensures that this symbol has not yet added.
166+ */
167+ if (list_empty(&current_entry->sym->choice_link))
168+ list_add_tail(&current_entry->sym->choice_link,
169+ &current_choice->choice_members);
164170 }
165171
166172 printd(DEBUG_PARSE, "%s:%d:endconfig\n", cur_filename, cur_lineno);
scripts/kconfig/qconf.cc+3−3
@@ -1166,7 +1166,7 @@ void ConfigInfoView::clicked(const QUrl &url) · 1165 unmodified lines
11661166 {
11671167 QByteArray str = url.toEncoded();
11681168 const std::size_t count = str.size();
1169− char *data = new char[count + 1];
1169+ char *data = new char[count + 2]; // '$' + '\0'
11701170 struct symbol **result;
11711171 struct menu *m = NULL;
11721172
@@ -1505,6 +1505,8 @@ ConfigMainWindow::ConfigMainWindow(void) · 332 unmodified lines
15051505 connect(helpText, &ConfigInfoView::menuSelected,
15061506 this, &ConfigMainWindow::setMenuLink);
15071507
1508+ conf_read(NULL);
1509+
15081510 QString listMode = configSettings->value("/listMode", "symbol").toString();
15091511 if (listMode == "single")
15101512 showSingleView();
@@ -1906,8 +1908,6 @@ int main(int ac, char** av) · 395 unmodified lines
19061908 configApp->connect(configApp, SIGNAL(lastWindowClosed()), SLOT(quit()));
19071909 configApp->connect(configApp, SIGNAL(aboutToQuit()), v, SLOT(saveSettings()));
19081910
1909− conf_read(NULL);
1910−
19111911 v->show();
19121912 configApp->exec();
19131913
scripts/package/builddeb+0−1
@@ -74,7 +74,6 @@ install_linux_image () { · 73 unmodified lines
7474
7575 mkdir -p "${pdir}/DEBIAN"
7676 cat <<-EOF > "${pdir}/DEBIAN/${script}"
77−
7877 #!/bin/sh
7978
8079 set -e
scripts/rustc-llvm-version.sh+22−0
@@ -0,0 +1,22 @@
1+#!/bin/sh
2+# SPDX-License-Identifier: GPL-2.0
3+#
4+# Usage: $ ./rustc-llvm-version.sh rustc
5+#
6+# Print the LLVM version that the Rust compiler uses in a 6 digit form.
7+
8+# Convert the version string x.y.z to a canonical up-to-6-digits form.
9+get_canonical_version()
10+{
11+ IFS=.
12+ set -- $1
13+ echo $((10000 * $1 + 100 * $2 + $3))
14+}
15+
16+if output=$("$@" --version --verbose 2>/dev/null | grep LLVM); then
17+ set -- $output
18+ get_canonical_version $3
19+else
20+ echo 0
21+ exit 1
22+fi