x86/static_call: Add inline static call implementation for x86-64
authorJosh Poimboeuf <jpoimboe@redhat.com>
Tue, 18 Aug 2020 13:57:45 +0000 (15:57 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 1 Sep 2020 07:58:05 +0000 (09:58 +0200)
commit1e7e47883830aae5e8246a22ca2fc6883c61acdf
tree225d6e2fc34af21e42996c0434f871486c586a2f
parente6d6c071f22de29e4993784fc00cd2202b7ba149
x86/static_call: Add inline static call implementation for x86-64

Add the inline static call implementation for x86-64. The generated code
is identical to the out-of-line case, except we move the trampoline into
it's own section.

Objtool uses the trampoline naming convention to detect all the call
sites. It then annotates those call sites in the .static_call_sites
section.

During boot (and module init), the call sites are patched to call
directly into the destination function.  The temporary trampoline is
then no longer used.

[peterz: merged trampolines, put trampoline in section]

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>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/20200818135804.864271425@infradead.org
13 files changed:
arch/x86/Kconfig
arch/x86/include/asm/static_call.h
arch/x86/kernel/static_call.c
arch/x86/kernel/vmlinux.lds.S
include/asm-generic/vmlinux.lds.h
tools/include/linux/static_call_types.h [new file with mode: 0644]
tools/objtool/check.c
tools/objtool/check.h
tools/objtool/elf.c
tools/objtool/elf.h
tools/objtool/objtool.h
tools/objtool/orc_gen.c
tools/objtool/sync-check.sh