Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2009369imu; Thu, 17 Jan 2019 07:00:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN6AqwCnIptvn9mjfTYN3ux0vSkNb5TnGqv8mJSz7W5gbvIPmWkfIi3FcZT0JXcy7kfBoz8c X-Received: by 2002:a62:710a:: with SMTP id m10mr15177832pfc.69.1547737204342; Thu, 17 Jan 2019 07:00:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547737204; cv=none; d=google.com; s=arc-20160816; b=dznAHinmq9OGoQAgzA9OIDNRt1749g55TG3pR5MgyAuCkNAZe8EFzVQMrSx+ACQHbF /CzJP7re5ukjQRKUr3v0YY2sY5Syzg7dPEOBNXSnd5w3/D7JgQWmWwi4fs5O7oRE4dFR w0CD2E5eOMYU3SjTZsLpbPokr3dGI6N1IHlZoG3HSmJJvA2BtgoT8Nqr98QKT8O4bTI8 GYEfU/L1lZ5cnoLDS5EqwKkUiO2yajHODaxQnVHCujAPqn/fPQMg0AInaYGm57/F1rAU Zxw78w84rd0mHPUO1p1q6p6cynGIfQ4JiqDQbB5Lj/HKPefVS//+i080ApMVNY3JjuVt 0EGA== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=D573qAlbphHLLao7HaDX8Ppf0+zzmLGts8oblCcCYkU=; b=pa4I1gawz0abO9Wb7k9z/emMq8TDOLxqul3pKvfSEEGCOf8k/8q5O5HB3LTW3zHTY4 EanAYaCJzAa5s9Sv4HrGfqjquX9asE7cEw3wk7Af2u6zV8pcdpL3JFqRuCRylvcMHjfS KF29ijo5mwH17Zhye2qvaMyDBCWFWl4JfsEutrqWfRLvwD6TVYJuZw6Hq7UoB1b6JdAW OS+m1/HxrxCuEm1KGNEyehE/GtRMY53OSdxUoAbXHCj8vjvn4CS1uhrZG5jGyvbbtzJ0 IC27uC65KOs1DtBtVEUXM/NmTo8Muk4OqqFfjnpCp6TQwd5PvKTipuSoVGxuAkDyE/9L L3LA== 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 a34si1729623pgm.427.2019.01.17.06.59.48; Thu, 17 Jan 2019 07:00:04 -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 S1727872AbfAQO6X (ORCPT + 99 others); Thu, 17 Jan 2019 09:58:23 -0500 Received: from gate.crashing.org ([63.228.1.57]:41068 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726913AbfAQO6X (ORCPT ); Thu, 17 Jan 2019 09:58:23 -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 x0HEqabh031907; Thu, 17 Jan 2019 08:52:36 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id x0HEqYcN031906; Thu, 17 Jan 2019 08:52:34 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 17 Jan 2019 08:52:33 -0600 From: Segher Boessenkool To: Balbir Singh Cc: Joe Lawrence , Jiri Kosina , linux-kernel@vger.kernel.org, Torsten Duwe , live-patching@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: ppc64le reliable stack unwinder and scheduled tasks Message-ID: <20190117145233.GQ14180@gate.crashing.org> References: <7f468285-b149-37e2-e782-c9e538b997a9@redhat.com> <20190112010914.GB10427@350D> <20190112084541.GK14180@gate.crashing.org> <20190113123356.GA26056@350D> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190113123356.GA26056@350D> 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 Sun, Jan 13, 2019 at 11:33:56PM +1100, Balbir Singh wrote: > On Sat, Jan 12, 2019 at 02:45:41AM -0600, Segher Boessenkool wrote: > > On Sat, Jan 12, 2019 at 12:09:14PM +1100, Balbir Singh wrote: > > > Could you please define interesting frame on top a bit more? Usually > > > the topmost return address is in LR > > > > There is no reliable way (other than DWARF unwind info) to find out where > > the value of LR at function entry currently lives (if anywhere). It may or > > may not be still available in LR, it may or may not be saved to the return > > stack slot. It can also live in some GPR, or in some other stack slot. > > > > (The same is true for all other registers). > > > > The only thing the ABI guarantees you is that you can find all stack frames > > via the back chain. If you want more you can use some heuristics and do > > some heroics (like GDB does), but this is not fully reliable. Using DWARF > > unwind info is, but that requires big tables. > > > > Thanks, so are you suggesting that a reliable stack is not possible on > ppc64le? Even with the restricted scope of the kernel? It depends on what you mean with "reliable stack unwinder". You can unwind the stack reliably on Power, but you want more, you want to know where some state local to functions is kept on the stack. Segher