diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-12-28 19:55:46 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-12-28 19:55:46 -0500 |
| commit | f346b0becb1bc62e45495f9cdbae3eef35d0b635 (patch) | |
| tree | ae79f3dfb8e031da51d38f0f095f89d7d23f3643 /scripts | |
| parent | 00d59fde8532b2d42e80909d2e58678755e04da9 (diff) | |
| parent | 0f4991e8fd48987ae476a92cdee6bfec4aff31b8 (diff) | |
Merge branch 'akpm' (patches from Andrew)
Merge misc updates from Andrew Morton:
- large KASAN update to use arm's "software tag-based mode"
- a few misc things
- sh updates
- ocfs2 updates
- just about all of MM
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (167 commits)
kernel/fork.c: mark 'stack_vm_area' with __maybe_unused
memcg, oom: notify on oom killer invocation from the charge path
mm, swap: fix swapoff with KSM pages
include/linux/gfp.h: fix typo
mm/hmm: fix memremap.h, move dev_page_fault_t callback to hmm
hugetlbfs: Use i_mmap_rwsem to fix page fault/truncate race
hugetlbfs: use i_mmap_rwsem for more pmd sharing synchronization
memory_hotplug: add missing newlines to debugging output
mm: remove __hugepage_set_anon_rmap()
include/linux/vmstat.h: remove unused page state adjustment macro
mm/page_alloc.c: allow error injection
mm: migrate: drop unused argument of migrate_page_move_mapping()
blkdev: avoid migration stalls for blkdev pages
mm: migrate: provide buffer_migrate_page_norefs()
mm: migrate: move migrate_page_lock_buffers()
mm: migrate: lock buffers before migrate_page_move_mapping()
mm: migration: factor out code to compute expected number of page references
mm, page_alloc: enable pcpu_drain with zone capability
kmemleak: add config to select auto scan
mm/page_alloc.c: don't call kasan_free_pages() at deferred mem init
...
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/Makefile.kasan | 53 | ||||
| -rwxr-xr-x | scripts/bloat-o-meter | 1 | ||||
| -rwxr-xr-x | scripts/checkstack.pl | 2 | ||||
| -rwxr-xr-x | scripts/decode_stacktrace.sh | 2 | ||||
| -rwxr-xr-x | scripts/decodecode | 7 | ||||
| -rw-r--r-- | scripts/spdxcheck-test.sh | 12 | ||||
| -rwxr-xr-x | scripts/tags.sh | 13 |
7 files changed, 65 insertions, 25 deletions
diff --git a/scripts/Makefile.kasan b/scripts/Makefile.kasan index 69552a39951d..25c259df8ffa 100644 --- a/scripts/Makefile.kasan +++ b/scripts/Makefile.kasan | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | # SPDX-License-Identifier: GPL-2.0 | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | ifdef CONFIG_KASAN | 2 | ifdef CONFIG_KASAN_GENERIC |
| 3 | |||
| 3 | ifdef CONFIG_KASAN_INLINE | 4 | ifdef CONFIG_KASAN_INLINE |
| 4 | call_threshold := 10000 | 5 | call_threshold := 10000 |
| 5 | else | 6 | else |
| @@ -12,36 +13,44 @@ CFLAGS_KASAN_MINIMAL := -fsanitize=kernel-address | |||
| 12 | 13 | ||
| 13 | cc-param = $(call cc-option, -mllvm -$(1), $(call cc-option, --param $(1))) | 14 | cc-param = $(call cc-option, -mllvm -$(1), $(call cc-option, --param $(1))) |
| 14 | 15 | ||
| 15 | ifeq ($(call cc-option, $(CFLAGS_KASAN_MINIMAL) -Werror),) | 16 | # -fasan-shadow-offset fails without -fsanitize |
| 16 | ifneq ($(CONFIG_COMPILE_TEST),y) | 17 | CFLAGS_KASAN_SHADOW := $(call cc-option, -fsanitize=kernel-address \ |
| 17 | $(warning Cannot use CONFIG_KASAN: \ | ||
| 18 | -fsanitize=kernel-address is not supported by compiler) | ||
| 19 | endif | ||
| 20 | else | ||
| 21 | # -fasan-shadow-offset fails without -fsanitize | ||
| 22 | CFLAGS_KASAN_SHADOW := $(call cc-option, -fsanitize=kernel-address \ | ||
| 23 | -fasan-shadow-offset=$(KASAN_SHADOW_OFFSET), \ | 18 | -fasan-shadow-offset=$(KASAN_SHADOW_OFFSET), \ |
| 24 | $(call cc-option, -fsanitize=kernel-address \ | 19 | $(call cc-option, -fsanitize=kernel-address \ |
| 25 | -mllvm -asan-mapping-offset=$(KASAN_SHADOW_OFFSET))) | 20 | -mllvm -asan-mapping-offset=$(KASAN_SHADOW_OFFSET))) |
| 26 | 21 | ||
| 27 | ifeq ($(strip $(CFLAGS_KASAN_SHADOW)),) | 22 | ifeq ($(strip $(CFLAGS_KASAN_SHADOW)),) |
| 28 | CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL) | 23 | CFLAGS_KASAN := $(CFLAGS_KASAN_MINIMAL) |
| 29 | else | 24 | else |
| 30 | # Now add all the compiler specific options that are valid standalone | 25 | # Now add all the compiler specific options that are valid standalone |
| 31 | CFLAGS_KASAN := $(CFLAGS_KASAN_SHADOW) \ | 26 | CFLAGS_KASAN := $(CFLAGS_KASAN_SHADOW) \ |
| 32 | $(call cc-param,asan-globals=1) \ | 27 | $(call cc-param,asan-globals=1) \ |
| 33 | $(call cc-param,asan-instrumentation-with-call-threshold=$(call_threshold)) \ | 28 | $(call cc-param,asan-instrumentation-with-call-threshold=$(call_threshold)) \ |
| 34 | $(call cc-param,asan-stack=1) \ | 29 | $(call cc-param,asan-stack=1) \ |
| 35 | $(call cc-param,asan-use-after-scope=1) \ | 30 | $(call cc-param,asan-use-after-scope=1) \ |
| 36 | $(call cc-param,asan-instrument-allocas=1) | 31 | $(call cc-param,asan-instrument-allocas=1) |
| 37 | endif | ||
| 38 | |||
| 39 | endif | 32 | endif |
| 40 | 33 | ||
| 41 | ifdef CONFIG_KASAN_EXTRA | 34 | ifdef CONFIG_KASAN_EXTRA |
| 42 | CFLAGS_KASAN += $(call cc-option, -fsanitize-address-use-after-scope) | 35 | CFLAGS_KASAN += $(call cc-option, -fsanitize-address-use-after-scope) |
| 43 | endif | 36 | endif |
| 44 | 37 | ||
| 45 | CFLAGS_KASAN_NOSANITIZE := -fno-builtin | 38 | endif # CONFIG_KASAN_GENERIC |
| 46 | 39 | ||
| 40 | ifdef CONFIG_KASAN_SW_TAGS | ||
| 41 | |||
| 42 | ifdef CONFIG_KASAN_INLINE | ||
| 43 | instrumentation_flags := -mllvm -hwasan-mapping-offset=$(KASAN_SHADOW_OFFSET) | ||
| 44 | else | ||
| 45 | instrumentation_flags := -mllvm -hwasan-instrument-with-calls=1 | ||
| 46 | endif | ||
| 47 | |||
| 48 | CFLAGS_KASAN := -fsanitize=kernel-hwaddress \ | ||
| 49 | -mllvm -hwasan-instrument-stack=0 \ | ||
| 50 | $(instrumentation_flags) | ||
| 51 | |||
| 52 | endif # CONFIG_KASAN_SW_TAGS | ||
| 53 | |||
| 54 | ifdef CONFIG_KASAN | ||
| 55 | CFLAGS_KASAN_NOSANITIZE := -fno-builtin | ||
| 47 | endif | 56 | endif |
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter index a923f05edb36..8c965f6a9881 100755 --- a/scripts/bloat-o-meter +++ b/scripts/bloat-o-meter | |||
| @@ -32,6 +32,7 @@ def getsizes(file, format): | |||
| 32 | if name.startswith("__mod_"): continue | 32 | if name.startswith("__mod_"): continue |
| 33 | if name.startswith("__se_sys"): continue | 33 | if name.startswith("__se_sys"): continue |
| 34 | if name.startswith("__se_compat_sys"): continue | 34 | if name.startswith("__se_compat_sys"): continue |
| 35 | if name.startswith("__addressable_"): continue | ||
| 35 | if name == "linux_banner": continue | 36 | if name == "linux_banner": continue |
| 36 | # statics and some other optimizations adds random .NUMBER | 37 | # statics and some other optimizations adds random .NUMBER |
| 37 | name = re_NUMBER.sub('', name) | 38 | name = re_NUMBER.sub('', name) |
diff --git a/scripts/checkstack.pl b/scripts/checkstack.pl index 34414c6efad6..122aef5e4e14 100755 --- a/scripts/checkstack.pl +++ b/scripts/checkstack.pl | |||
| @@ -48,7 +48,9 @@ my (@stack, $re, $dre, $x, $xs, $funcre); | |||
| 48 | $funcre = qr/^$x* <(.*)>:$/; | 48 | $funcre = qr/^$x* <(.*)>:$/; |
| 49 | if ($arch eq 'aarch64') { | 49 | if ($arch eq 'aarch64') { |
| 50 | #ffffffc0006325cc: a9bb7bfd stp x29, x30, [sp, #-80]! | 50 | #ffffffc0006325cc: a9bb7bfd stp x29, x30, [sp, #-80]! |
| 51 | #a110: d11643ff sub sp, sp, #0x590 | ||
| 51 | $re = qr/^.*stp.*sp, \#-([0-9]{1,8})\]\!/o; | 52 | $re = qr/^.*stp.*sp, \#-([0-9]{1,8})\]\!/o; |
| 53 | $dre = qr/^.*sub.*sp, sp, #(0x$x{1,8})/o; | ||
| 52 | } elsif ($arch eq 'arm') { | 54 | } elsif ($arch eq 'arm') { |
| 53 | #c0008ffc: e24dd064 sub sp, sp, #100 ; 0x64 | 55 | #c0008ffc: e24dd064 sub sp, sp, #100 ; 0x64 |
| 54 | $re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o; | 56 | $re = qr/.*sub.*sp, sp, #(([0-9]{2}|[3-9])[0-9]{2})/o; |
diff --git a/scripts/decode_stacktrace.sh b/scripts/decode_stacktrace.sh index 64220e36ce3b..98a7d63a723e 100755 --- a/scripts/decode_stacktrace.sh +++ b/scripts/decode_stacktrace.sh | |||
| @@ -78,7 +78,7 @@ parse_symbol() { | |||
| 78 | fi | 78 | fi |
| 79 | 79 | ||
| 80 | # Strip out the base of the path | 80 | # Strip out the base of the path |
| 81 | code=${code//$basepath/""} | 81 | code=${code//^$basepath/""} |
| 82 | 82 | ||
| 83 | # In the case of inlines, move everything to same line | 83 | # In the case of inlines, move everything to same line |
| 84 | code=${code//$'\n'/' '} | 84 | code=${code//$'\n'/' '} |
diff --git a/scripts/decodecode b/scripts/decodecode index 9cef558528aa..ba8b8d5834e6 100755 --- a/scripts/decodecode +++ b/scripts/decodecode | |||
| @@ -60,6 +60,13 @@ case $width in | |||
| 60 | 4) type=4byte ;; | 60 | 4) type=4byte ;; |
| 61 | esac | 61 | esac |
| 62 | 62 | ||
| 63 | if [ -z "$ARCH" ]; then | ||
| 64 | case `uname -m` in | ||
| 65 | aarch64*) ARCH=arm64 ;; | ||
| 66 | arm*) ARCH=arm ;; | ||
| 67 | esac | ||
| 68 | fi | ||
| 69 | |||
| 63 | disas() { | 70 | disas() { |
| 64 | ${CROSS_COMPILE}as $AFLAGS -o $1.o $1.s > /dev/null 2>&1 | 71 | ${CROSS_COMPILE}as $AFLAGS -o $1.o $1.s > /dev/null 2>&1 |
| 65 | 72 | ||
diff --git a/scripts/spdxcheck-test.sh b/scripts/spdxcheck-test.sh new file mode 100644 index 000000000000..cfea6a0d1cc0 --- /dev/null +++ b/scripts/spdxcheck-test.sh | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | for PYTHON in python2 python3; do | ||
| 4 | # run check on a text and a binary file | ||
| 5 | for FILE in Makefile Documentation/logo.gif; do | ||
| 6 | $PYTHON scripts/spdxcheck.py $FILE | ||
| 7 | $PYTHON scripts/spdxcheck.py - < $FILE | ||
| 8 | done | ||
| 9 | |||
| 10 | # run check on complete tree to catch any other issues | ||
| 11 | $PYTHON scripts/spdxcheck.py > /dev/null | ||
| 12 | done | ||
diff --git a/scripts/tags.sh b/scripts/tags.sh index 4fa070f9231a..f470d9919ed7 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh | |||
| @@ -191,7 +191,7 @@ regex_c=( | |||
| 191 | '/^DEF_PCI_AC_\(\|NO\)RET(\([[:alnum:]_]*\).*/\2/' | 191 | '/^DEF_PCI_AC_\(\|NO\)RET(\([[:alnum:]_]*\).*/\2/' |
| 192 | '/^PCI_OP_READ(\(\w*\).*[1-4])/pci_bus_read_config_\1/' | 192 | '/^PCI_OP_READ(\(\w*\).*[1-4])/pci_bus_read_config_\1/' |
| 193 | '/^PCI_OP_WRITE(\(\w*\).*[1-4])/pci_bus_write_config_\1/' | 193 | '/^PCI_OP_WRITE(\(\w*\).*[1-4])/pci_bus_write_config_\1/' |
| 194 | '/\<DEFINE_\(MUTEX\|SEMAPHORE\|SPINLOCK\)(\([[:alnum:]_]*\)/\2/v/' | 194 | '/\<DEFINE_\(RT_MUTEX\|MUTEX\|SEMAPHORE\|SPINLOCK\)(\([[:alnum:]_]*\)/\2/v/' |
| 195 | '/\<DEFINE_\(RAW_SPINLOCK\|RWLOCK\|SEQLOCK\)(\([[:alnum:]_]*\)/\2/v/' | 195 | '/\<DEFINE_\(RAW_SPINLOCK\|RWLOCK\|SEQLOCK\)(\([[:alnum:]_]*\)/\2/v/' |
| 196 | '/\<DECLARE_\(RWSEM\|COMPLETION\)(\([[:alnum:]_]\+\)/\2/v/' | 196 | '/\<DECLARE_\(RWSEM\|COMPLETION\)(\([[:alnum:]_]\+\)/\2/v/' |
| 197 | '/\<DECLARE_BITMAP(\([[:alnum:]_]*\)/\1/v/' | 197 | '/\<DECLARE_BITMAP(\([[:alnum:]_]*\)/\1/v/' |
| @@ -204,6 +204,15 @@ regex_c=( | |||
| 204 | '/\(^\s\)OFFSET(\([[:alnum:]_]*\)/\2/v/' | 204 | '/\(^\s\)OFFSET(\([[:alnum:]_]*\)/\2/v/' |
| 205 | '/\(^\s\)DEFINE(\([[:alnum:]_]*\)/\2/v/' | 205 | '/\(^\s\)DEFINE(\([[:alnum:]_]*\)/\2/v/' |
| 206 | '/\<\(DEFINE\|DECLARE\)_HASHTABLE(\([[:alnum:]_]*\)/\2/v/' | 206 | '/\<\(DEFINE\|DECLARE\)_HASHTABLE(\([[:alnum:]_]*\)/\2/v/' |
| 207 | '/\<DEFINE_ID\(R\|A\)(\([[:alnum:]_]\+\)/\2/' | ||
| 208 | '/\<DEFINE_WD_CLASS(\([[:alnum:]_]\+\)/\1/' | ||
| 209 | '/\<ATOMIC_NOTIFIER_HEAD(\([[:alnum:]_]\+\)/\1/' | ||
| 210 | '/\<RAW_NOTIFIER_HEAD(\([[:alnum:]_]\+\)/\1/' | ||
| 211 | '/\<DECLARE_FAULT_ATTR(\([[:alnum:]_]\+\)/\1/' | ||
| 212 | '/\<BLOCKING_NOTIFIER_HEAD(\([[:alnum:]_]\+\)/\1/' | ||
| 213 | '/\<DEVICE_ATTR_\(RW\|RO\|WO\)(\([[:alnum:]_]\+\)/dev_attr_\2/' | ||
| 214 | '/\<DRIVER_ATTR_\(RW\|RO\|WO\)(\([[:alnum:]_]\+\)/driver_attr_\2/' | ||
| 215 | '/\<\(DEFINE\|DECLARE\)_STATIC_KEY_\(TRUE\|FALSE\)\(\|_RO\)(\([[:alnum:]_]\+\)/\4/' | ||
| 207 | ) | 216 | ) |
| 208 | regex_kconfig=( | 217 | regex_kconfig=( |
| 209 | '/^[[:blank:]]*\(menu\|\)config[[:blank:]]\+\([[:alnum:]_]\+\)/\2/' | 218 | '/^[[:blank:]]*\(menu\|\)config[[:blank:]]\+\([[:alnum:]_]\+\)/\2/' |
| @@ -249,7 +258,7 @@ exuberant() | |||
| 249 | -I __initdata,__exitdata,__initconst,__ro_after_init \ | 258 | -I __initdata,__exitdata,__initconst,__ro_after_init \ |
| 250 | -I __initdata_memblock \ | 259 | -I __initdata_memblock \ |
| 251 | -I __refdata,__attribute,__maybe_unused,__always_unused \ | 260 | -I __refdata,__attribute,__maybe_unused,__always_unused \ |
| 252 | -I __acquires,__releases,__deprecated \ | 261 | -I __acquires,__releases,__deprecated,__always_inline \ |
| 253 | -I __read_mostly,__aligned,____cacheline_aligned \ | 262 | -I __read_mostly,__aligned,____cacheline_aligned \ |
| 254 | -I ____cacheline_aligned_in_smp \ | 263 | -I ____cacheline_aligned_in_smp \ |
| 255 | -I __cacheline_aligned,__cacheline_aligned_in_smp \ | 264 | -I __cacheline_aligned,__cacheline_aligned_in_smp \ |
