Skip to content

Commit

Permalink
static_call_inline: Provide trampoline address when updating sites
Browse files Browse the repository at this point in the history
In preparation of support of inline static calls on powerpc, provide
trampoline address when updating sites, so that when the destination
function is too far for a direct function call, the call site is
patched with a call to the trampoline.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/5efe0cffc38d6f69b1ec13988a99f1acff551abf.1733245362.git.christophe.leroy@csgroup.eu
  • Loading branch information
Christophe Leroy authored and Madhavan Srinivasan committed Feb 26, 2025
1 parent 65acbd1 commit d856bc3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/x86/kernel/static_call.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void arch_static_call_transform(void *site, void *tramp, void *func, bool tail)
{
mutex_lock(&text_mutex);

if (tramp) {
if (tramp && !site) {
__static_call_validate(tramp, true, true);
__static_call_transform(tramp, __sc_insn(!func, true), func, false);
}
Expand Down
2 changes: 1 addition & 1 deletion kernel/static_call_inline.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func)
continue;
}

arch_static_call_transform(site_addr, NULL, func,
arch_static_call_transform(site_addr, tramp, func,
static_call_is_tail(site));
}
}
Expand Down

0 comments on commit d856bc3

Please sign in to comment.