Received: by 10.223.185.116 with SMTP id b49csp2821377wrg; Mon, 5 Mar 2018 09:11:11 -0800 (PST) X-Google-Smtp-Source: AG47ELvzYVcpgXLwjF6mGiSnBjz6PQGD8AWbPllgN06oUKzRM86KtDjjoGllbwyRCq+dzNGG8rN1 X-Received: by 2002:a17:902:24a5:: with SMTP id w34-v6mr13515698pla.221.1520269871259; Mon, 05 Mar 2018 09:11:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520269871; cv=none; d=google.com; s=arc-20160816; b=YmhaOhsQnzsZ3CpzH7mOea0f5AZbP6/hgF70snoECrcntYSkz/GLHcnsljTG18cRfO uQC2fIXYL3PcLdyn8+jHloXXr0lCt7Jmb/WaSk3JCq9xL7hpP7ARSWxvmb62bKcWafBW Mg6HRMyQiVvzEn5c5fy6wgWt7jr3fpQtU7FkmMm26bhFOAsm27j3FivsB3oyJEqlXcGJ UqM2jIjQUPs801/dYdW6QILhT0WqALiBSYX9R30y+jf0UpLCr2ic4x7rWqfkdlui3ZHH 4SB6AVYSehyTi9ozwTK7g+ylgi/BRDrkNtKf+D+2HWd1OxZbo6bsedXSN0kc8K686J/5 Oblg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=7vbfYPIVUM/S3au0tnQEB7OTCXefy8URbGIEPseNCF0=; b=sD0i/vkeoNVL74b28s2SLOsmxM7l7/E611F2Yhg+M1HTMVKrg6hCdhxvGYCJetLCiq id37f+S0XR2RvKsiw7eCN2Bm1UtIYlepvfO94YYPMgJ43EVVuItKGMD0X4nYrdtqSo9f qZo1p3oafxhQXOkvsI+e8p9rJ4x7BZ3yciBA2gFb8d5RfnwS/n38nyFAYh19DWxcWtLd lSKN1hYKxwxDN1fsFNiUl5zfZ910tA5xWLE2zT4Hl+rDf2vm0lK3qjPqtliP6enVbRbR nnivgpXa2VLhHM263nkpbN6zFYJwx+SWFoYMCQX46h/PPBvnzPa7lm09Qkcs3VFVOBZ9 fQag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si10399917pfg.279.2018.03.05.09.10.56; Mon, 05 Mar 2018 09:11:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752177AbeCERJg (ORCPT + 99 others); Mon, 5 Mar 2018 12:09:36 -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 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id w25H94fg003590; Mon, 5 Mar 2018 11:09:04 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id w25H92kD003578; Mon, 5 Mar 2018 11:09:02 -0600 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 Precedence: bulk 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