Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758015AbcCDB6N (ORCPT ); Thu, 3 Mar 2016 20:58:13 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:32889 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757940AbcCDB6J (ORCPT ); Thu, 3 Mar 2016 20:58:09 -0500 Subject: Re: [PATCH v3 7/8] powerpc/ftrace: Add support for -mprofile-kernel ftrace ABI To: Michael Ellerman , linuxppc-dev@ozlabs.org References: <1456979220-10931-1-git-send-email-mpe@ellerman.id.au> <1456979220-10931-7-git-send-email-mpe@ellerman.id.au> Cc: duwe@lst.de, 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 From: Balbir Singh Message-ID: <56D8EBA4.5090807@gmail.com> Date: Fri, 4 Mar 2016 12:57:56 +1100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <1456979220-10931-7-git-send-email-mpe@ellerman.id.au> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1343 Lines: 35 On 03/03/16 15:26, Michael Ellerman wrote: > From: Torsten Duwe > > The gcc switch -mprofile-kernel defines a new ABI for calling _mcount() > very early in the function with minimal overhead. > > Although mprofile-kernel has been available since GCC 3.4, there were > bugs which were only fixed recently. Currently it is known to work in > GCC 4.9, 5 and 6. > > Additionally there are two possible code sequences generated by the > flag, the first uses mflr/std/bl and the second is optimised to omit the > std. Currently only gcc 6 has the optimised sequence. This patch > supports both sequences. > > Initial work started by Vojtech Pavlik, used with permission. > > Key changes: > - rework _mcount() to work for both the old and new ABIs. > - implement new versions of ftrace_caller() and ftrace_graph_caller() > which deal with the new ABI. > - updates to __ftrace_make_nop() to recognise the new mcount calling > sequence. > - updates to __ftrace_make_call() to recognise the nop'ed sequence. > - implement ftrace_modify_call(). > - updates to the module loader to surpress the toc save in the module > stub when calling mcount with the new ABI. > > Signed-off-by: Torsten Duwe > Signed-off-by: Michael Ellerman > --- > Reviewed-by: Balbir Singh