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
Showing the changes to scripts (9 of 1167 files). Show all
Unified · Split
| @@ -65,6 +65,9 @@ cc-option-bit = $(if-success,$(CC) -Werror $(1) -E -x c /dev/null -o /dev/null,$ · 64 unmodified lines | ||
| 65 | 65 | m32-flag := $(cc-option-bit,-m32) |
| 66 | 66 | m64-flag := $(cc-option-bit,-m64) |
| 67 | 67 | |
| 68 | +rustc-version := $(shell,$(srctree)/scripts/rustc-version.sh $(RUSTC)) | |
| 69 | +rustc-llvm-version := $(shell,$(srctree)/scripts/rustc-llvm-version.sh $(RUSTC)) | |
| 70 | + | |
| 68 | 71 | # $(rustc-option,<flag>) |
| 69 | 72 | # Return y if the Rust compiler supports <flag>, n otherwise |
| 70 | 73 | # Calls to this should be guarded so that they are not evaluated if |
| @@ -53,13 +53,11 @@ cc-option = $(call __cc-option, $(CC),\ · 52 unmodified lines | ||
| 53 | 53 | |
| 54 | 54 | # cc-option-yn |
| 55 | 55 | # 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) | |
| 58 | 57 | |
| 59 | 58 | # cc-disable-warning |
| 60 | 59 | # 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)) | |
| 63 | 61 | |
| 64 | 62 | # gcc-min-version |
| 65 | 63 | # 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 | ||
| 75 | 73 | |
| 76 | 74 | # __rustc-option |
| 77 | 75 | # 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 | |
| 78 | 77 | __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)) | |
| 80 | 81 | |
| 81 | 82 | # rustc-option |
| 82 | 83 | # Usage: rustflags-y += $(call rustc-option,-Cinstrument-coverage,-Zinstrument-coverage) |
| @@ -85,5 +86,4 @@ rustc-option = $(call __rustc-option, $(RUSTC),\ · 2 unmodified lines | ||
| 85 | 86 | |
| 86 | 87 | # rustc-option-yn |
| 87 | 88 | # 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) | |
| @@ -34,12 +34,14 @@ $(obj)/dtbs-list: $(dtb-y) FORCE · 33 unmodified lines | ||
| 34 | 34 | # Assembly file to wrap dtb(o) |
| 35 | 35 | # --------------------------------------------------------------------------- |
| 36 | 36 | |
| 37 | +builtin-dtb-section = $(if $(filter arch/$(SRCARCH)/boot/dts%, $(obj)),.dtb.init.rodata,.rodata) | |
| 38 | + | |
| 37 | 39 | # Generate an assembly file to wrap the output of the device tree compiler |
| 38 | 40 | quiet_cmd_wrap_S_dtb = WRAP $@ |
| 39 | 41 | cmd_wrap_S_dtb = { \ |
| 40 | 42 | symbase=__$(patsubst .%,%,$(suffix $<))_$(subst -,_,$(notdir $*)); \ |
| 41 | 43 | echo '\#include <asm-generic/vmlinux.lds.h>'; \ |
| 42 | − echo '.section .dtb.init.rodata,"a"'; \ | |
| 44 | + echo '.section $(builtin-dtb-section),"a"'; \ | |
| 43 | 45 | echo '.balign STRUCT_ALIGNMENT'; \ |
| 44 | 46 | echo ".global $${symbase}_begin"; \ |
| 45 | 47 | echo "$${symbase}_begin:"; \ |
| @@ -127,6 +127,36 @@ static inline void list_del(struct list_head *entry) · 126 unmodified lines | ||
| 127 | 127 | entry->prev = LIST_POISON2; |
| 128 | 128 | } |
| 129 | 129 | |
| 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 | + | |
| 130 | 160 | /** |
| 131 | 161 | * list_move - delete from one list and add as another's head |
| 132 | 162 | * @list: the entry to move |
| @@ -150,6 +180,26 @@ static inline void list_move_tail(struct list_head *list, · 17 unmodified lines | ||
| 150 | 180 | list_add_tail(list, head); |
| 151 | 181 | } |
| 152 | 182 | |
| 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 | + | |
| 153 | 203 | /** |
| 154 | 204 | * list_is_head - tests whether @list is the list @head |
| 155 | 205 | * @list: the entry to test |
| @@ -47,6 +47,7 @@ static struct expr *expr_lookup(enum expr_type type, void *l, void *r) · 46 unmodified lines | ||
| 47 | 47 | e->type = type; |
| 48 | 48 | e->left._initdata = l; |
| 49 | 49 | e->right._initdata = r; |
| 50 | + e->val_is_valid = false; | |
| 50 | 51 | |
| 51 | 52 | hash_add(expr_hashtable, &e->node, hash); |
| 52 | 53 | |
| @@ -159,8 +159,14 @@ config_stmt: config_entry_start config_option_list · 158 unmodified lines | ||
| 159 | 159 | yynerrs++; |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | − list_add_tail(¤t_entry->sym->choice_link, | |
| 163 | − ¤t_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(¤t_entry->sym->choice_link)) | |
| 168 | + list_add_tail(¤t_entry->sym->choice_link, | |
| 169 | + ¤t_choice->choice_members); | |
| 164 | 170 | } |
| 165 | 171 | |
| 166 | 172 | printd(DEBUG_PARSE, "%s:%d:endconfig\n", cur_filename, cur_lineno); |
| @@ -1166,7 +1166,7 @@ void ConfigInfoView::clicked(const QUrl &url) · 1165 unmodified lines | ||
| 1166 | 1166 | { |
| 1167 | 1167 | QByteArray str = url.toEncoded(); |
| 1168 | 1168 | const std::size_t count = str.size(); |
| 1169 | − char *data = new char[count + 1]; | |
| 1169 | + char *data = new char[count + 2]; // '$' + '\0' | |
| 1170 | 1170 | struct symbol **result; |
| 1171 | 1171 | struct menu *m = NULL; |
| 1172 | 1172 | |
| @@ -1505,6 +1505,8 @@ ConfigMainWindow::ConfigMainWindow(void) · 332 unmodified lines | ||
| 1505 | 1505 | connect(helpText, &ConfigInfoView::menuSelected, |
| 1506 | 1506 | this, &ConfigMainWindow::setMenuLink); |
| 1507 | 1507 | |
| 1508 | + conf_read(NULL); | |
| 1509 | + | |
| 1508 | 1510 | QString listMode = configSettings->value("/listMode", "symbol").toString(); |
| 1509 | 1511 | if (listMode == "single") |
| 1510 | 1512 | showSingleView(); |
| @@ -1906,8 +1908,6 @@ int main(int ac, char** av) · 395 unmodified lines | ||
| 1906 | 1908 | configApp->connect(configApp, SIGNAL(lastWindowClosed()), SLOT(quit())); |
| 1907 | 1909 | configApp->connect(configApp, SIGNAL(aboutToQuit()), v, SLOT(saveSettings())); |
| 1908 | 1910 | |
| 1909 | − conf_read(NULL); | |
| 1910 | − | |
| 1911 | 1911 | v->show(); |
| 1912 | 1912 | configApp->exec(); |
| 1913 | 1913 | |
| @@ -74,7 +74,6 @@ install_linux_image () { · 73 unmodified lines | ||
| 74 | 74 | |
| 75 | 75 | mkdir -p "${pdir}/DEBIAN" |
| 76 | 76 | cat <<-EOF > "${pdir}/DEBIAN/${script}" |
| 77 | − | |
| 78 | 77 | #!/bin/sh |
| 79 | 78 | |
| 80 | 79 | set -e |
| @@ -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 | |