From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933161AbcBYPLR (ORCPT ); Thu, 25 Feb 2016 10:11:17 -0500 Received: from verein.lst.de ([213.95.11.211]:48808 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932950AbcBYPLP (ORCPT ); Thu, 25 Feb 2016 10:11:15 -0500 Date: Thu, 25 Feb 2016 16:11:13 +0100 From: Torsten Duwe To: Balbir Singh Cc: Michael Ellerman , linuxppc-dev@ozlabs.org, pmladek@suse.com, jeyu@redhat.com, jkosina@suse.cz, linux-kernel@vger.kernel.org, rostedt@goodmis.org, kamalesh@linux.vnet.ibm.com, live-patching@vger.kernel.org, mbenes@suse.cz Subject: Re: [PATCH 07/12] powerpc/ftrace: FTRACE_WITH_REGS implementation for ppc64le Message-ID: <20160225151113.GK21932@lst.de> References: <1456324115-21144-1-git-send-email-mpe@ellerman.id.au> <1456324115-21144-7-git-send-email-mpe@ellerman.id.au> <56CE4F7B.7050704@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56CE4F7B.7050704@gmail.com> 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, Feb 25, 2016 at 11:48:59AM +1100, Balbir Singh wrote: > > @@ -608,6 +621,9 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, > > return -ENOENT; > > if (!restore_r2((u32 *)location + 1, me)) > > return -ENOEXEC; > > + /* Squash the TOC saver for profiler calls */ > > + if (!strcmp("_mcount", strtab+sym->st_name)) > > + SQUASH_TOC_SAVE_INSN(value); > I don't think we need this anymore, do we? I'm not sure. Once a module is loaded, are all the "bl _mcount"s NOPed out before any of its functions are run? If not, the _mcount trampoline will be used, and it must not save R2! Torsten