]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf annotate-data: Invalidate caller-saved regs for all calls
authorZecheng Li <zli94@ncsu.edu>
Mon, 9 Mar 2026 17:55:22 +0000 (13:55 -0400)
committerNamhyung Kim <namhyung@kernel.org>
Thu, 19 Mar 2026 21:42:29 +0000 (14:42 -0700)
commitd35b0d5877109ecca106cc3835d4d23ac2cdc33c
treed62ea1e4bcdb16cc380565bc5fbe68731f01c335
parent22b320777c5f496a36867f16f18870e67b123020
perf annotate-data: Invalidate caller-saved regs for all calls

Previously, the x86 call handler returned early without invalidating
caller-saved registers when the call target symbol could not be resolved
(func == NULL). This violated the ABI which requires caller-saved
registers to be considered clobbered after any call instruction.

Fix this by:
1. Always invalidating caller-saved registers for any call instruction
   (except __fentry__ which preserves registers)
2. Using dl->ops.target.name as fallback when func->name is unavailable,
   allowing return type lookup for more call targets

This is a conservative change that may reduce type coverage for indirect
calls (e.g., callq *(%rax)) where we cannot determine the return type
but it ensures correctness.

Signed-off-by: Zecheng Li <zli94@ncsu.edu>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/util/annotate-arch/annotate-x86.c