[PATCH v2] powerpc: Fix save_stack_trace_regs() to have running function as first entry
Michael Ellerman
mpe at ellerman.id.au
Thu Mar 4 22:36:49 AEDT 2021
Christophe Leroy <christophe.leroy at csgroup.eu> writes:
> It seems like other architectures, namely x86 and arm64
> at least, include the running function as top entry when saving
> stack trace with save_stack_trace_regs().
Also riscv AFAICS.
> Functionnalities like KFENCE expect it.
>
> Do the same on powerpc, it allows KFENCE to properly identify the faulting
> function as depicted below. Before the patch KFENCE was identifying
> finish_task_switch.isra as the faulting function.
Thanks, I think this is the right approach. There's kfence but also
several other users from what I can see with a quick grep.
...
>
> Signed-off-by: Christophe Leroy <christophe.leroy at csgroup.eu>
> Fixes: 35de3b1aa168 ("powerpc: Implement save_stack_trace_regs() to enable kprobe stack tracing")
> Cc: stable at vger.kernel.org
I'm not sure about the Cc to stable. I think we are fixing the behaviour
to match the (implied) intent of the API, but that doesn't mean we won't
break something by accident. I'll think about it :)
cheers
More information about the Linuxppc-dev
mailing list