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
This commit is contained in:

committed by
Ingo Molnar

parent
452cddbff7
commit
5b06fd3bb9
@@ -16,6 +16,13 @@
|
||||
#define STATIC_CALL_TRAMP(name) __PASTE(STATIC_CALL_TRAMP_PREFIX, name)
|
||||
#define STATIC_CALL_TRAMP_STR(name) __stringify(STATIC_CALL_TRAMP(name))
|
||||
|
||||
/*
|
||||
* Flags in the low bits of static_call_site::key.
|
||||
*/
|
||||
#define STATIC_CALL_SITE_TAIL 1UL /* tail call */
|
||||
#define STATIC_CALL_SITE_INIT 2UL /* init section */
|
||||
#define STATIC_CALL_SITE_FLAGS 3UL
|
||||
|
||||
/*
|
||||
* The static call site table needs to be created by external tooling (objtool
|
||||
* or a compiler plugin).
|
||||
|
Reference in New Issue
Block a user