WSL2-Linux-Kernel/scripts
Steven Rostedt (Google) 4ed308c445 ftrace: Have architectures opt-in for mcount build time sorting
First S390 complained that the sorting of the mcount sections at build
time caused the kernel to crash on their architecture. Now PowerPC is
complaining about it too. And also ARM64 appears to be having issues.

It may be necessary to also update the relocation table for the values
in the mcount table. Not only do we have to sort the table, but also
update the relocations that may be applied to the items in the table.

If the system is not relocatable, then it is fine to sort, but if it is,
some architectures may have issues (although x86 does not as it shifts all
addresses the same).

Add a HAVE_BUILDTIME_MCOUNT_SORT that an architecture can set to say it is
safe to do the sorting at build time.

Also update the config to compile in build time sorting in the sorttable
code in scripts/ to depend on CONFIG_BUILDTIME_MCOUNT_SORT.

Link: https://lore.kernel.org/all/944D10DA-8200-4BA9-8D0A-3BED9AA99F82@linux.ibm.com/
Link: https://lkml.kernel.org/r/20220127153821.3bc1ac6e@gandalf.local.home

Cc: Ingo Molnar <mingo@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Yinan Liu <yinan@linux.alibaba.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Kees Cook <keescook@chromium.org>
Reported-by: Sachin Sant <sachinp@linux.ibm.com>
Reviewed-by: Mark Rutland <mark.rutland@arm.com>
Tested-by: Mark Rutland <mark.rutland@arm.com> [arm64]
Tested-by: Sachin Sant <sachinp@linux.ibm.com>
Fixes: 72b3942a17 ("scripts: ftrace - move the sort-processing in ftrace_init")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
2022-01-27 19:15:44 -05:00
..
atomic locking/atomics, kcsan: Add instrumentation for barriers 2021-12-09 16:42:27 -08:00
basic
clang-tools
coccinelle drop fen.cocci 2022-01-15 12:15:35 +01:00
dtc scripts/dtc: dtx_diff: remove broken example from help text 2022-01-17 16:26:44 -06:00
dummy-tools
gcc-plugins
gdb scripts/gdb: lx-dmesg: read records individually 2021-12-16 15:52:38 +01:00
genksyms
kconfig kbuild: do not quote string values in include/config/auto.conf 2022-01-08 18:03:57 +09:00
ksymoops
mod RISC-V Patches for the 5.17 Merge Window, Part 1 2022-01-19 11:38:21 +02:00
package
selinux
tracing
.gitignore certs: move scripts/extract-cert to certs/ 2022-01-08 18:28:21 +09:00
Kbuild.include certs: simplify $(srctree)/ handling and remove config_filename macro 2022-01-08 17:46:35 +09:00
Kconfig.include
Lindent
Makefile ftrace: Have architectures opt-in for mcount build time sorting 2022-01-27 19:15:44 -05:00
Makefile.asm-generic
Makefile.build x86: Add straight-line-speculation mitigation 2021-12-09 13:32:25 +01:00
Makefile.clang
Makefile.clean
Makefile.compiler
Makefile.debug
Makefile.dtbinst
Makefile.extrawarn
Makefile.gcc-plugins
Makefile.headersinst
Makefile.host
Makefile.kasan
Makefile.kcov
Makefile.kcsan kcsan: Ignore GCC 11+ warnings about TSan runtime support 2021-12-09 16:42:27 -08:00
Makefile.lib Kbuild updates for v5.17 2022-01-19 11:15:19 +02:00
Makefile.modfinal
Makefile.modinst kbuild: do not quote string values in include/config/auto.conf 2022-01-08 18:03:57 +09:00
Makefile.modpost
Makefile.package
Makefile.ubsan ubsan: remove CONFIG_UBSAN_OBJECT_SIZE 2022-01-20 08:52:55 +02:00
Makefile.userprogs
adjust_autoksyms.sh
as-version.sh
asn1_compiler.c
bin2c.c
bloat-o-meter
bootgraph.pl
bpf_doc.py
cc-can-link.sh
cc-version.sh
check-sysctl-docs
check_extable.sh
checkdeclares.pl
checkincludes.pl
checkkconfigsymbols.py
checkpatch.pl checkpatch: improve Kconfig help test 2022-01-20 08:52:54 +02:00
checkstack.pl
checksyscalls.sh
checkversion.pl
cleanfile
cleanpatch
coccicheck
config
const_structs.checkpatch const_structs.checkpatch: add frequently used ops structs 2022-01-20 08:52:54 +02:00
decode_stacktrace.sh
decodecode scripts/decodecode: fix faulting instruction no print when opps.file is DOS format 2021-11-06 13:30:32 -07:00
depmod.sh
dev-needs.sh
diffconfig
documentation-file-ref-check
export_report.pl
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
extract_xc3028.pl
faddr2line
file-size.sh
find-unused-docs.sh
gcc-goto.sh
gcc-ld
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen_autoksyms.sh kbuild: do not quote string values in include/config/auto.conf 2022-01-08 18:03:57 +09:00
gen_ksymdeps.sh
generate_initcall_order.pl
get_abi.pl
get_dvb_firmware
get_feat.pl
get_maintainer.pl get_maintainer: don't remind about no git repo when --nogit is used 2022-01-20 08:52:53 +02:00
gfp-translate
headerdep.pl
headers_install.sh
insert-sys-cert.c
jobserver-exec
kallsyms.c
kernel-doc
ld-version.sh
leaking_addresses.pl
link-vmlinux.sh Kbuild updates for v5.17 2022-01-19 11:15:19 +02:00
makelst
markup_oops.pl
min-tool-version.sh Documentation: Raise the minimum supported version of LLVM to 11.0.0 2021-12-02 17:24:32 +09:00
mkcompile_h
mksysmap
mkuboot.sh
module.lds.S
modules-check.sh
nsdeps
objdiff
pahole-flags.sh
parse-maintainers.pl
patch-kernel
profile2linkerlist.pl
prune-kernel
recordmcount.c
recordmcount.h
recordmcount.pl recordmcount.pl: fix typo in s390 mcount regex 2021-12-24 10:20:12 +01:00
remove-stale-files Kbuild updates for v5.17 2022-01-19 11:15:19 +02:00
setlocalversion kbuild: do not quote string values in include/config/auto.conf 2022-01-08 18:03:57 +09:00
show_delta
sign-file.c
sorttable.c RISC-V Patches for the 5.17 Merge Window, Part 1 2022-01-19 11:38:21 +02:00
sorttable.h script/sorttable: Fix some initialization problems 2022-01-18 10:17:18 -05:00
spdxcheck-test.sh
spdxcheck.py
spelling.txt scripts/spelling.txt: add "oveflow" 2022-01-15 16:30:24 +02:00
sphinx-pre-install scripts: sphinx-pre-install: Fix ctex support on Debian 2022-01-07 09:33:13 -07:00
split-man.pl
stackdelta
stackusage
subarch.include
syscallhdr.sh
syscallnr.sh
syscalltbl.sh
tags.sh scripts/tags: add space regexs to all regex_c 2021-11-26 16:58:55 +01:00
test_fortify.sh
tools-support-relr.sh
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh