On 4/6/26 11:49 AM, Dylan Hatch wrote:
> Build with -Wa,--gsframe-3 flags to generate a .sframe section. This
> will be used for in-kernel reliable stacktrace in cases where the frame
> pointer alone is insufficient.
> 
> Currently, the sframe format only supports arm64, x86_64 and s390x
> architectures.
> 
> Signed-off-by: Weinan Liu <[email protected]>
> Signed-off-by: Dylan Hatch <[email protected]>
> Reviewed-by: Prasanna Kumar T S M <[email protected]>
> ---
>  MAINTAINERS                            |  1 +
>  Makefile                               |  8 ++++++++
>  arch/Kconfig                           |  7 +++++++
>  arch/arm64/Kconfig                     |  1 +
>  arch/arm64/Kconfig.debug               | 13 +++++++++++++
>  arch/arm64/include/asm/unwind_sframe.h | 12 ++++++++++++
>  arch/arm64/kernel/vdso/Makefile        |  2 +-
>  include/asm-generic/vmlinux.lds.h      | 15 +++++++++++++++
>  8 files changed, 58 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm64/include/asm/unwind_sframe.h
> 


> diff --git a/arch/Kconfig b/arch/Kconfig
> index 6695c222c728..c87e489fa978 100644
> --- a/arch/Kconfig
> +++ b/arch/Kconfig
> @@ -520,6 +520,13 @@ config SFRAME_VALIDATION
>  
>         If unsure, say N.
>  
> +config ARCH_SUPPORTS_SFRAME_UNWINDER
> +     bool
> +     help
> +       An architecture can select this if it  enables the sframe (Simple

                                 drop one space^^    (if it)
        
> +       Frame) unwinder for unwinding kernel stack traces. It uses unwind

                                                                     an unwind

> +       table that is directly generatedby toolchain based on DWARF CFI 
> information.

                                 generated by the toolchain

> +
>  config HAVE_PERF_REGS
>       bool
>       help


> index 265c4461031f..df291d64812f 100644
> --- a/arch/arm64/Kconfig.debug
> +++ b/arch/arm64/Kconfig.debug
> @@ -20,4 +20,17 @@ config ARM64_RELOC_TEST
>       depends on m
>       tristate "Relocation testing module"
>  
> +config SFRAME_UNWINDER
> +     bool "Sframe unwinder"
> +     depends on AS_SFRAME3
> +     depends on 64BIT
> +     depends on ARCH_SUPPORTS_SFRAME_UNWINDER
> +     select SFRAME_LOOKUP
> +     help
> +       This option enables the sframe (Simple Frame) unwinder for unwinding
> +       kernel stack traces. It uses unwind table that is directly generated

                                  uses an unwind table

> +       by toolchain based on DWARF CFI information. In, practice this can

          by the toolchain

> +       provide more reliable stacktrace results than unwinding with frame
> +       pointers alone.
> +
>  source "drivers/hwtracing/coresight/Kconfig"


-- 
~Randy


Reply via email to