Skip to content

Commit d856bc3

Browse files
chleroymaddy-kerneldev
authored andcommitted
static_call_inline: Provide trampoline address when updating sites
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 <[email protected]> Signed-off-by: Madhavan Srinivasan <[email protected]> Link: https://patch.msgid.link/5efe0cffc38d6f69b1ec13988a99f1acff551abf.1733245362.git.christophe.leroy@csgroup.eu
1 parent 65acbd1 commit d856bc3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/x86/kernel/static_call.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ void arch_static_call_transform(void *site, void *tramp, void *func, bool tail)
158158
{
159159
mutex_lock(&text_mutex);
160160

161-
if (tramp) {
161+
if (tramp && !site) {
162162
__static_call_validate(tramp, true, true);
163163
__static_call_transform(tramp, __sc_insn(!func, true), func, false);
164164
}

kernel/static_call_inline.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func)
206206
continue;
207207
}
208208

209-
arch_static_call_transform(site_addr, NULL, func,
209+
arch_static_call_transform(site_addr, tramp, func,
210210
static_call_is_tail(site));
211211
}
212212
}

0 commit comments

Comments
 (0)