static_call: Add call depth tracking support
authorPeter Zijlstra <peterz@infradead.org>
Thu, 15 Sep 2022 11:11:31 +0000 (13:11 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 17 Oct 2022 14:41:16 +0000 (16:41 +0200)
commit7825451fa4dc04660f1f53d236e4302161d0ebd1
tree60fb5490d9e73fc9b505e941af7a2259a879318d
parentf5c1bb2afe93396d41c5cbdcb909b08a75b8dde4
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
arch/x86/include/asm/alternative.h
arch/x86/kernel/callthunks.c
arch/x86/kernel/static_call.c
include/linux/static_call.h
kernel/static_call_inline.c