Re: [PATCH v2 1/6] unwind: build kernel with sframe info
Jens Remus <[email protected]> Wed, 19 Nov 2025 15:59:13 +0100
| Newsgroups | org.kernel.vger.linux-toolchains,org.kernel.vger.linux-kernel,org.kernel.vger.live-patching |
|---|---|
| Organization | IBM Deutschland Research & Development GmbH |
| Message-ID | <[email protected]> |
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 <[email protected]> > Signed-off-by: Dylan Hatch <[email protected]> > Reviewed-by: Prasanna Kumar T S M <[email protected]> > 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 [email protected] 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/