linux_dsm_epyc7002/tools/objtool
Josh Poimboeuf a63068e939 static_call: Allow module use without exposing static_call_key
[ Upstream commit 73f44fe19d359635a607e8e8daa0da4001c1cfc2 ]

When exporting static_call_key; with EXPORT_STATIC_CALL*(), the module
can use static_call_update() to change the function called.  This is
not desirable in general.

Not exporting static_call_key however also disallows usage of
static_call(), since objtool needs the key to construct the
static_call_site.

Solve this by allowing objtool to create the static_call_site using
the trampoline address when it builds a module and cannot find the
static_call_key symbol. The module loader will then try and map the
trampole back to a key before it constructs the normal sites list.

Doing this requires a trampoline -> key associsation, so add another
magic section that keeps those.

Originally-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lkml.kernel.org/r/20210127231837.ifddpn7rhwdaepiu@treble
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-30 14:31:53 +02:00
..
arch/x86 objtool: Fix retpoline detection in asm code 2021-03-04 11:38:00 +01:00
Documentation
.gitignore
arch.h
Build
builtin-check.c
builtin-orc.c
builtin.h
cfi.h
check.c static_call: Allow module use without exposing static_call_key 2021-03-30 14:31:53 +02:00
check.h objtool: Fix retpoline detection in asm code 2021-03-04 11:38:00 +01:00
elf.c
elf.h
Makefile
objtool.c
objtool.h
orc_dump.c
orc_gen.c
special.c
special.h
sync-check.sh
warn.h
weak.c