[kvm-unit-tests PATCH v2 0/4] Better backtraces for leaf functions

Mathias Krause
2025-09-15T21:54:48Z

This is v2 of [1], trying to enhance backtraces involving leaf
functions.

This version fixes backtraces on ARM and ARM64 as well, as ARM currently
fails hard for leaf functions lacking a proper stack frame setup, making
it dereference invalid pointers. ARM64 just skips frames, much like x86
does.

v2 fixes this by introducing the concept of "late CFLAGS" that get
evaluated in the top-level Makefile once all other optional flags have
been added to $(CFLAGS), which is needed for x86's version at least.

Please apply!

Thanks,
Mathias

[1] https://lore.kernel.org/kvm/20250724181759.1974692-1-minipli@grsecurity.net/

Mathias Krause (4):
Makefile: Provide a concept of late CFLAGS
x86: Better backtraces for leaf functions
arm64: Better backtraces for leaf functions
arm: Fix backtraces involving leaf functions

Makefile | 4 ++++
arm/Makefile.arm | 8 ++++++++
arm/Makefile.arm64 | 6 ++++++
x86/Makefile.common | 11 +++++++++++
lib/arm/stack.c | 18 ++++++++++++++++--
5 files changed, 45 insertions(+), 2 deletions(-)

--
2.47.3