static_call: Handle tail-calls
authorPeter Zijlstra <peterz@infradead.org>
Tue, 18 Aug 2020 13:57:49 +0000 (15:57 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 1 Sep 2020 07:58:06 +0000 (09:58 +0200)
commit5b06fd3bb9cdce4f3e731c48eb5b74c4acc47997
tree533fcad5bdd98fd31ccd3956dec2e3478f15ca91
parent452cddbff74b6a15b9354505671011700fe03710
static_call: Handle tail-calls

GCC can turn our static_call(name)(args...) into a tail call, in which
case we get a JMP.d32 into the trampoline (which then does a further
tail-call).

Teach objtool to recognise and mark these in .static_call_sites and
adjust the code patching to deal with this.

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/20200818135805.101186767@infradead.org
arch/x86/kernel/static_call.c
include/linux/static_call.h
include/linux/static_call_types.h
kernel/static_call.c
tools/include/linux/static_call_types.h
tools/objtool/check.c