From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753096AbcAUV4p (ORCPT ); Thu, 21 Jan 2016 16:56:45 -0500 Received: from verein.lst.de ([213.95.11.211]:47141 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752648AbcAUV4k (ORCPT ); Thu, 21 Jan 2016 16:56:40 -0500 Date: Thu, 21 Jan 2016 22:56:38 +0100 From: Torsten Duwe To: Jiri Kosina Cc: Michael Ellerman , Petr Mladek , Denis Kirjanov , linux-kernel@vger.kernel.org, Steven Rostedt , live-patching@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v5 0/9] ftrace with regs + live patching for ppc64 LE (ABI v2) Message-ID: <20160121215638.GA5033@lst.de> References: <20151204152419.28E0D691D2@newverein.lst.de> <20160106141730.GL3178@pathway.suse.cz> <1453269803.14751.10.camel@ellerman.id.au> <1453380891.28627.3.camel@ellerman.id.au> <20160121150633.GA12374@lst.de> <20160121151213.GB12374@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 21, 2016 at 10:29:13PM +0100, Jiri Kosina wrote: > On Thu, 21 Jan 2016, Torsten Duwe wrote: > > > > mcount call sites looks normal on first sight... > > > > Not quite. > > LR is not saved on the stack before the call. > > Argh! > > > > Petr, this looks like 12 bytes offset for gcc-6. > > I think I can work around the rest. > > Are we sure that gcc is doing the right thing here? > > I am far from claiming understanding of ppc64 ABI, but from what Vojtech > told me I understood that saving link register is necessary for (at least) > graph tracer to work properly. It is held in R0 only, and saved right after _mcount. Thus, _mcount just must not clobber R0 or save it the same way as it's done afterwards or like gcc4 does it. I'll make a v6 that's compiler agnostic. It's a few lines to change for the kernel proper, and I'll have to have a look at the trampolines for modules. Torsten