From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752091AbcBZKOZ (ORCPT ); Fri, 26 Feb 2016 05:14:25 -0500 Received: from ozlabs.org ([103.22.144.67]:55378 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751139AbcBZKOX (ORCPT ); Fri, 26 Feb 2016 05:14:23 -0500 Message-ID: <1456481658.25691.6.camel@ellerman.id.au> Subject: Re: [PATCH 04/12] powerpc/ftrace: Prepare for -mprofile-kernel From: Michael Ellerman To: Torsten Duwe Cc: linuxppc-dev@ozlabs.org, bsingharora@gmail.com, linux-kernel@vger.kernel.org, rostedt@goodmis.org, kamalesh@linux.vnet.ibm.com, pmladek@suse.com, jeyu@redhat.com, jkosina@suse.cz, live-patching@vger.kernel.org, mbenes@suse.cz Date: Fri, 26 Feb 2016 21:14:18 +1100 In-Reply-To: <20160225135205.GF21932@lst.de> References: <1456324115-21144-1-git-send-email-mpe@ellerman.id.au> <1456324115-21144-4-git-send-email-mpe@ellerman.id.au> <20160225135205.GF21932@lst.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.5-1ubuntu3.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2016-02-25 at 14:52 +0100, Torsten Duwe wrote: > On Thu, Feb 25, 2016 at 01:28:27AM +1100, Michael Ellerman wrote: > > @@ -450,17 +448,44 @@ static unsigned long stub_for_addr(const Elf64_Shdr *sechdrs, > > return (unsigned long)&stubs[i]; > > } > > > > +#ifdef CC_USING_MPROFILE_KERNEL > > +static int is_early_mcount_callsite(u32 *instruction) > > +{ > > + /* -mprofile-kernel sequence starting with > > + * mflr r0 and maybe std r0, LRSAVE(r1). > > + */ > > + if ((instruction[-3] == PPC_INST_MFLR && > > + instruction[-2] == PPC_INST_STD_LR) || > > + instruction[-2] == PPC_INST_MFLR) { > > + /* Nothing to be done here, it's an _mcount > > + * call location and r2 will have to be > > + * restored in the _mcount function. > > + */ > > + return 1; > > + } > > + return 0; > > +} > > +#else > > *You* said this might page fault :) It does :) - I fixed it up in patch 6, sorry I realise that's hard to review. > Did we agree yet whether we insist on a streamlined compiler? > (GCC commit e95d0248dace required)? No we didn't really. I think you're right that it's not /too/ hard to support both sequences. But we may change our mind in future :) cheers