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

Andrew Jones
2025-09-16T13:04:49Z

On Mon, Sep 15, 2025 at 11:54:28PM +0200, Mathias Krause wrote:
> 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.

Hi Mathias,

Thank you for the arm/arm64 fixes!

For the arm/arm64 patches

Reviewed-by: Andrew Jones <andrew.jones@linux.dev>
Tested-by: Andrew Jones <andrew.jones@linux.dev>

Thanks,
drew

>
> 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
>