From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 798FE1A0B71 for ; Fri, 4 Mar 2016 12:58:10 +1100 (AEDT) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D82F7140D8A for ; Fri, 4 Mar 2016 12:58:09 +1100 (AEDT) Received: by mail-pa0-x232.google.com with SMTP id fy10so25246049pac.1 for ; Thu, 03 Mar 2016 17:58:09 -0800 (PST) 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 MIME-Version: 1.0 In-Reply-To: <1456979220-10931-7-git-send-email-mpe@ellerman.id.au> Content-Type: text/plain; charset=windows-1252 List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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