[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <910e6b23-4637-4c95-8202-01212af2d59c@linux.ibm.com>
Date: Wed, 19 Nov 2025 15:59:13 +0100
From: Jens Remus <jremus@...ux.ibm.com>
To: Dylan Hatch <dylanbhatch@...gle.com>,
Josh Poimboeuf
<jpoimboe@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Indu Bhagat <indu.bhagat@...cle.com>,
Peter Zijlstra <peterz@...radead.org>, Will Deacon <will@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Jiri Kosina <jikos@...nel.org>
Cc: Roman Gushchin <roman.gushchin@...ux.dev>, Weinan Liu <wnliu@...gle.com>,
Mark Rutland <mark.rutland@....com>, Ian Rogers <irogers@...gle.com>,
linux-toolchains@...r.kernel.org, linux-kernel@...r.kernel.org,
live-patching@...r.kernel.org, joe.lawrence@...hat.com,
Puranjay Mohan <puranjay@...nel.org>, Song Liu <song@...nel.org>,
Prasanna Kumar T S M <ptsm@...ux.microsoft.com>,
Heiko Carstens <hca@...ux.ibm.com>, Vasily Gorbik <gor@...ux.ibm.com>
Subject: Re: [PATCH v2 1/6] unwind: build kernel with sframe info
Hello Dylan!
On 9/5/2025 12:38 AM, Dylan Hatch wrote:
> Use the -Wa,--gsframe flags to build the code, so GAS will generate
> a new .sframe section for the stack trace information.
> Currently, the sframe format only supports arm64 and x86_64
> architectures. Add this configuration on arm64 to enable sframe
> unwinder in the future.
>
> Signed-off-by: Weinan Liu <wnliu@...gle.com>
> Signed-off-by: Dylan Hatch <dylanbhatch@...gle.com>
> Reviewed-by: Prasanna Kumar T S M <ptsm@...ux.microsoft.com>
> diff --git a/arch/Kconfig b/arch/Kconfig
> @@ -1782,4 +1782,10 @@ config ARCH_WANTS_PRE_LINK_VMLINUX
> config ARCH_HAS_CPU_ATTACK_VECTORS
> bool
>
> +config AS_SFRAME
> + def_bool $(as-instr,.cfi_sections .sframe\n.cfi_startproc\n.cfi_endproc)
As you will soon be requiring SFrame V2 with the new PC-relative FDE
function start address encoding you may want to extend this check as
follows:
config AS_SFRAME
def_bool y
depends on $(as-instr,.cfi_sections .sframe\n.cfi_startproc\n.cfi_endproc)
depends on $(success,printf "%b\n" ".cfi_sections .sframe\n.cfi_startproc\n.cfi_endproc" | $(CC) $(CLANG_FLAGS) -Wa$(comma)--fatal-warnings -c -x assembler-with-cpp -o "$$TMP" - && $(OBJDUMP) --sframe "$$TMP" | grep -q "SFRAME_VERSION_2")
depends on $(success,printf "%b\n" ".cfi_sections .sframe\n.cfi_startproc\n.cfi_endproc" | $(CC) $(CLANG_FLAGS) -Wa$(comma)--fatal-warnings -c -x assembler-with-cpp -o "$$TMP" - && $(OBJDUMP) --sframe "$$TMP" | grep -q "SFRAME_F_FDE_FUNC_START_PCREL")
Or you could change it into multiple config options, which might be
overkill:
config AS_SFRAME
def_bool $(as-instr,.cfi_sections .sframe\n.cfi_startproc\n.cfi_endproc)
config AS_SFRAME_V2
def_bool y
depends on AS_SFRAME
depends on $(success,printf "%b\n" ".cfi_sections .sframe\n.cfi_startproc\n.cfi_endproc" | $(CC) $(CLANG_FLAGS) -Wa$(comma)--fatal-warnings -c -x assembler-with-cpp -o "$$TMP" - && $(OBJDUMP) --sframe "$$TMP" | grep -q "SFRAME_VERSION_2")
config AS_SFRAME_V2_PCREL_FDE
def_bool y
depends on AS_SFRAME_V2
depends on $(success,printf "%b\n" ".cfi_sections .sframe\n.cfi_startproc\n.cfi_endproc" | $(CC) $(CLANG_FLAGS) -Wa$(comma)--fatal-warnings -c -x assembler-with-cpp -o "$$TMP" - && $(OBJDUMP) --sframe "$$TMP" | grep -q "SFRAME_F_FDE_FUNC_START_PCREL")
> +
> +config SFRAME_UNWIND_TABLE
> + bool
> +
> endmenu
Regards,
Jens
--
Jens Remus
Linux on Z Development (D3303)
+49-7031-16-1128 Office
jremus@...ibm.com
IBM
IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Böblingen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/
Powered by blists - more mailing lists