Re: [PATCH v3] On ppc64le we HAVE_RELIABLE_STACKTRACE

From: Josh Poimboeuf
Date: Mon May 07 2018 - 11:42:17 EST


On Fri, May 04, 2018 at 02:38:34PM +0200, Torsten Duwe wrote:
>
> The "Power Architecture 64-Bit ELF V2 ABI" says in section 2.3.2.3:
>
> [...] There are several rules that must be adhered to in order to ensure
> reliable and consistent call chain backtracing:
>
> * Before a function calls any other function, it shall establish its
> own stack frame, whose size shall be a multiple of 16 bytes.
>
> â In instances where a functionâs prologue creates a stack frame, the
> back-chain word of the stack frame shall be updated atomically with
> the value of the stack pointer (r1) when a back chain is implemented.
> (This must be supported as default by all ELF V2 ABI-compliant
> environments.)
> [...]
> â The function shall save the link register that contains its return
> address in the LR save doubleword of its callerâs stack frame before
> calling another function.
>
> To me this sounds like the equivalent of HAVE_RELIABLE_STACKTRACE.
> This patch may be unneccessarily limited to ppc64le, but OTOH the only
> user of this flag so far is livepatching, which is only implemented on
> PPCs with 64-LE, a.k.a. ELF ABI v2.
>
> Feel free to add other ppc variants, but so far only ppc64le got tested.
>
> This change also implements save_stack_trace_tsk_reliable() for ppc64le
> that checks for the above conditions, where possible.
>
> Signed-off-by: Torsten Duwe <duwe@xxxxxxx>
> Signed-off-by: Nicolai Stange <nstange@xxxxxxx>

The subject doesn't actively describe what the patch does, maybe change
it to something like:

powerpc: Add support for HAVE_RELIABLE_STACKTRACE

or maybe

powerpc: Add support for livepatch consistency model

Otherwise it looks great to me.

Acked-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>

--
Josh