summaryrefslogtreecommitdiff
path: root/arch/x86/lib
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2022-09-15 14:11:30 +0300
committerPeter Zijlstra <peterz@infradead.org>2022-10-17 17:41:16 +0300
commitf5c1bb2afe93396d41c5cbdcb909b08a75b8dde4 (patch)
treeea7d2c0ffd9a4c54bb865b0b3fdccbfb21f4189a /arch/x86/lib
parentbbaceb189a21d7245e8063701fe10985396028f9 (diff)
downloadlinux-f5c1bb2afe93396d41c5cbdcb909b08a75b8dde4.tar.xz
x86/calldepth: Add ret/call counting for debug
Add a debuigfs mechanism to validate the accounting, e.g. vs. call/ret balance and to gather statistics about the stuffing to call ratio. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20220915111148.204285506@infradead.org
Diffstat (limited to 'arch/x86/lib')
-rw-r--r--arch/x86/lib/retpoline.S7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S
index e00206077ae9..5f61c65322be 100644
--- a/arch/x86/lib/retpoline.S
+++ b/arch/x86/lib/retpoline.S
@@ -203,13 +203,18 @@ EXPORT_SYMBOL(__x86_return_thunk)
.align 64
SYM_FUNC_START(__x86_return_skl)
ANNOTATE_NOENDBR
- /* Keep the hotpath in a 16byte I-fetch */
+ /*
+ * Keep the hotpath in a 16byte I-fetch for the non-debug
+ * case.
+ */
+ CALL_THUNKS_DEBUG_INC_RETS
shlq $5, PER_CPU_VAR(pcpu_hot + X86_call_depth)
jz 1f
ANNOTATE_UNRET_SAFE
ret
int3
1:
+ CALL_THUNKS_DEBUG_INC_STUFFS
.rept 16
ANNOTATE_INTRA_FUNCTION_CALL
call 2f