]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf annotate: Invalidate register states for untracked instructions
authorZecheng Li <zecheng@google.com>
Mon, 13 Oct 2025 18:16:02 +0000 (18:16 +0000)
committerNamhyung Kim <namhyung@kernel.org>
Tue, 21 Oct 2025 13:02:49 +0000 (06:02 -0700)
commita1d8548c23076c66d96647f5f6f25aa43567f247
treeca4f5480437ba241ae33344d01b737f12febbf9c
parent109218718de2f7173fabdd507cc6786e79ad1690
perf annotate: Invalidate register states for untracked instructions

When tracking variable types, instructions that modify a pointer value
in an untracked way can lead to incorrect type propagation. To prevent
this, invalidate the register state when encountering such instructions.

This change invalidates pointer types for various arithmetic and bitwise
operations that current pointer offset tracking doesn't support, like
imul, shl, and, inc, etc.

A special case is added for 'xor reg, reg', which is a common idiom for
zeroing a register. For this, the register state is updated to be a
constant with a value of 0.

This could introduce slight regressions if a variable is zeroed and then
reused. This can be addressed in the future by using all DWARF locations
for instruction tracking instead of only the first one.

Signed-off-by: Zecheng Li <zecheng@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/arch/x86/annotate/instructions.c