From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752306AbeCERJh (ORCPT ); Mon, 5 Mar 2018 12:09:37 -0500 Received: from gate.crashing.org ([63.228.1.57]:58744 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751965AbeCERJf (ORCPT ); Mon, 5 Mar 2018 12:09:35 -0500 Date: Mon, 5 Mar 2018 11:09:01 -0600 From: Segher Boessenkool To: Torsten Duwe Cc: Michael Ellerman , Jiri Kosina , linux-kernel@vger.kernel.org, Nicholas Piggin , Josh Poimboeuf , live-patching@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v2] On ppc64le we HAVE_RELIABLE_STACKTRACE Message-ID: <20180305170901.GS21977@gate.crashing.org> References: <20180305164928.GA17953@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180305164928.GA17953@lst.de> User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 05, 2018 at 05:49:28PM +0100, 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. All of this is also true for the other PowerPC ABIs, fwiw (both 32-bit and 64-bit; the offset of the LR save slot isn't the same in all ABIs). Segher