diff options
author | Peter Zijlstra <peterz@infradead.org> | 2022-09-15 13:11:31 +0200 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2022-10-17 16:41:16 +0200 |
commit | 7825451fa4dc04660f1f53d236e4302161d0ebd1 (patch) | |
tree | 60fb5490d9e73fc9b505e941af7a2259a879318d /arch/x86/kernel/static_call.c | |
parent | f5c1bb2afe93396d41c5cbdcb909b08a75b8dde4 (diff) |
static_call: Add call depth tracking support
When indirect calls are switched to direct calls then it has to be ensured
that the call target is not the function, but the call thunk when call
depth tracking is enabled. But static calls are available before call
thunks have been set up.
Ensure a second run through the static call patching code after call thunks
have been created. When call thunks are not enabled this has no side
effects.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220915111148.306100465@infradead.org
Diffstat (limited to 'arch/x86/kernel/static_call.c')
-rw-r--r-- | arch/x86/kernel/static_call.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kernel/static_call.c b/arch/x86/kernel/static_call.c index 5d3844a98373..2ebc338980bc 100644 --- a/arch/x86/kernel/static_call.c +++ b/arch/x86/kernel/static_call.c @@ -34,6 +34,7 @@ static void __ref __static_call_transform(void *insn, enum insn_type type, switch (type) { case CALL: + func = callthunks_translate_call_dest(func); code = text_gen_insn(CALL_INSN_OPCODE, insn, func); if (func == &__static_call_return0) { emulate = code; |