linux-brain/scripts/mod
Thomas Gleixner 4f5416710e vmlinux.lds.h: Create section for protection against instrumentation
[ Upstream commit 6553896666433e7efec589838b400a2a652b3ffa ]

Some code pathes, especially the low level entry code, must be protected
against instrumentation for various reasons:

 - Low level entry code can be a fragile beast, especially on x86.

 - With NO_HZ_FULL RCU state needs to be established before using it.

Having a dedicated section for such code allows to validate with tooling
that no unsafe functions are invoked.

Add the .noinstr.text section and the noinstr attribute to mark
functions. noinstr implies notrace. Kprobes will gain a section check
later.

Provide also a set of markers: instrumentation_begin()/end()

These are used to mark code inside a noinstr function which calls
into regular instrumentable text section as safe.

The instrumentation markers are only active when CONFIG_DEBUG_ENTRY is
enabled as the end marker emits a NOP to prevent the compiler from merging
the annotation points. This means the objtool verification requires a
kernel compiled with this option.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200505134100.075416272@linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-02-17 10:35:16 +01:00
..
.gitignore kbuild: trivial - remove trailing empty lines 2014-06-10 00:04:06 +02:00
Makefile kbuild: move modpost out of 'scripts' target 2018-12-01 23:09:34 +09:00
devicetable-offsets.c platform-drivers-x86 for v5.1-1 2019-03-10 13:16:37 -07:00
empty.c
file2alias.c modpost: add guid_t type definition 2019-09-04 22:55:42 +09:00
mk_elfconfig.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
modpost.c vmlinux.lds.h: Create section for protection against instrumentation 2021-02-17 10:35:16 +01:00
modpost.h symbol namespaces: revert to previous __ksymtab name scheme 2019-10-18 15:32:52 +02:00
sumversion.c kbuild: remove the first line of *.mod files 2019-07-18 02:19:31 +09:00