Re: [RFC PATCH v2 00/30] unwind: Minimal DWARF CFI unwinding for user and kernel space
From: Peter Zijlstra
Date: Wed Dec 02 2026 - 08:39:02 EST
On Tue, Nov 24, 2026 at 10:14:53PM -0800, Ian Rogers wrote:
> Overview
> ========
>
> This RFC v2 series introduces Minimal DWARF Call Frame Information (CFI)
> stack unwinding in the Linux kernel for both user-space deferred
> callchains (unwind_user / PERF_RECORD_CALLCHAIN_DEFERRED) and
> kernel-space stack traces (stacktrace.h / HAVE_RELIABLE_STACKTRACE)
> across x86-64, ARM64, and RISC-V, paired with an optional standalone C
> build-time .eh_frame minifier (scripts/min_eh_frame.c).
>
> It enables reliable stack unwinding across kernel and user-space
> binaries compiled with or without frame pointers (-fomit-frame-pointer),
> without introducing duplicate .sframe sections in user-space ELF files
> or requiring new compiler, assembler, or dynamic-loader formats.
> - x86-64 (arch/x86/kernel/unwind_dwarf.c & stacktrace.c): Unwinds
> vmlinux and RCU module .eh_frame tables, recovers CFA-keyed
> ftrace_graph and rethook return addresses, sets state->error on any
> missing or invalid FDE, and rejects stacks containing in-kernel
> pt_regs boundaries in arch_stack_walk_reliable() (matching
> CONFIG_FRAME_POINTER because inline asm such as pushf; pop adjusts
> %rsp without .cfi_adjust_cfa_offset across preemption).
I'm thinking we very much to not want .eh_frame unwinding for kernel
space on x86_64. There is no interest in adding .cfi annotations to the
asm files and even less interest in chasing toolchain bugs in this area.
ORC works and is fully under our own control.