summaryrefslogtreecommitdiff
path: root/include/linux/static_call.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2020-08-18 15:57:49 +0200
committerIngo Molnar <mingo@kernel.org>2020-09-01 09:58:06 +0200
commit5b06fd3bb9cdce4f3e731c48eb5b74c4acc47997 (patch)
tree533fcad5bdd98fd31ccd3956dec2e3478f15ca91 /include/linux/static_call.h
parent452cddbff74b6a15b9354505671011700fe03710 (diff)
downloadlwn-5b06fd3bb9cdce4f3e731c48eb5b74c4acc47997.tar.gz
lwn-5b06fd3bb9cdce4f3e731c48eb5b74c4acc47997.zip
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
Diffstat (limited to 'include/linux/static_call.h')
-rw-r--r--include/linux/static_call.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/static_call.h b/include/linux/static_call.h
index 0f74581e0e2f..519bd666e096 100644
--- a/include/linux/static_call.h
+++ b/include/linux/static_call.h
@@ -103,7 +103,7 @@
/*
* Either @site or @tramp can be NULL.
*/
-extern void arch_static_call_transform(void *site, void *tramp, void *func);
+extern void arch_static_call_transform(void *site, void *tramp, void *func, bool tail);
#define STATIC_CALL_TRAMP_ADDR(name) &STATIC_CALL_TRAMP(name)
@@ -206,7 +206,7 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func)
{
cpus_read_lock();
WRITE_ONCE(key->func, func);
- arch_static_call_transform(NULL, tramp, func);
+ arch_static_call_transform(NULL, tramp, func, false);
cpus_read_unlock();
}