Thread (2 messages) flat view 2 messages, 2 authors, 2021-03-04

Re: [PATCH v2] powerpc: Fix save_stack_trace_regs() to have running function as first entry

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2021-03-04 11:38:23
Also in: lkml

Christophe Leroy [off-list ref] 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 <redacted>
Fixes: 35de3b1aa168 ("powerpc: Implement save_stack_trace_regs() to enable kprobe stack tracing")
Cc: stable@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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help