From patchwork Wed Feb 12 21:51:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guy Martin X-Patchwork-Id: 3641191 Return-Path: X-Original-To: patchwork-linux-parisc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3DD459F1EE for ; Wed, 12 Feb 2014 21:50:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 551F42012D for ; Wed, 12 Feb 2014 21:50:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 08C0020149 for ; Wed, 12 Feb 2014 21:50:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753451AbaBLVuW (ORCPT ); Wed, 12 Feb 2014 16:50:22 -0500 Received: from venus.vo.lu ([80.90.45.96]:58314 "EHLO venus.vo.lu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753199AbaBLVuT (ORCPT ); Wed, 12 Feb 2014 16:50:19 -0500 Received: from ibiza.lux.tuxicoman.be (vodsl-8217.vo.lu [85.93.199.25]) by venus.vo.lu with SMTP (version=TLS\Tls cipher=Aes128 bits=128); Wed, 12 Feb 2014 22:49:03 +0100 Received: from [2001:7e8:2221:300:baca:3aff:fed6:432d] (helo=dellete) by ibiza.lux.tuxicoman.be with esmtpsa (SSLv3:DHE-RSA-AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1WDhh0-0005Cw-2w; Wed, 12 Feb 2014 22:50:06 +0100 Date: Wed, 12 Feb 2014 22:51:16 +0100 From: Guy Martin To: John David Anglin Cc: Helge Deller , linux-parisc@vger.kernel.org Subject: Re: Ftrace broken on parisc Message-ID: <20140212225116.470e8521@dellete> In-Reply-To: References: <20140129205944.4f71ca1c@dellete> <52E96811.7000403@gmx.de> X-Mailer: Claws Mail 3.9.0 (GTK+ 2.24.22; x86_64-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, 29 Jan 2014 16:09:24 -0500 John David Anglin wrote: > On 1/29/2014 3:44 PM, Helge Deller wrote: > > Can you try > > BL ftrace_return_to_handler, %r0 > > (I'm not good in hppa assembly - as you can see if you take a look > > at this assembly code section :-)). > > > BL might not reach on PA 1.1. The PA 2.0 b,l instruction is only > "long" when the link > register is %rp and it is used for the return_trampoline. > > I would say replace "b" with the following as it will always reach > target: load32 ftrace_return_to_handler, %r20 > bv %r0(%r20) > > %r1 is another register alternative. Thanks, however, I later found out that this part of the code isn't used if you set CONFIG_FUNCTION_GRAPH_TRACER=n. In my config, I've enabled only this : CONFIG_FTRACE=y CONFIG_FUNCTION_TRACER=y Full config can be found here : http://bpaste.net/show/178555/ So far I came up with the attached patch to try to get a booting kernel but I don't even have the first line being printed, the box HPMC and reboot. As far as I understand, compiling with -pg will make each function jump to _mcount before being actually executed. This is why I tried to make the _mcount function simply jump back to %rp but this doesn't seem to be helpful. What am I missing here ? GUy diff --git a/arch/parisc/Kconfig.debug b/arch/parisc/Kconfig.debug index bc989e5..6d23a1a 100644 --- a/arch/parisc/Kconfig.debug +++ b/arch/parisc/Kconfig.debug @@ -1,5 +1,8 @@ menu "Kernel hacking" +config TRACE_IRQFLAGS_SUPPORT + def_bool y + source "lib/Kconfig.debug" config DEBUG_RODATA diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S index e8f07dd..bdb4d33 100644 --- a/arch/parisc/kernel/entry.S +++ b/arch/parisc/kernel/entry.S @@ -1999,11 +1999,15 @@ ENDPROC(syscall_exit) #ifdef CONFIG_FUNCTION_TRACER .import ftrace_function_trampoline,code ENTRY(_mcount) + bv %r0(%rp) + nop + /* not reached */ copy %r3, %arg2 b ftrace_function_trampoline nop ENDPROC(_mcount) +#ifdef CONFIG_FUNCTION_GRAPH_TRACER ENTRY(return_to_handler) load32 return_trampoline, %rp copy %ret0, %arg0 @@ -2019,7 +2023,19 @@ return_trampoline: ftrace_stub: bv %r0(%rp) nop +#else /* CONFIG_FUNCTION_GRAPH_TRACER */ + +ENTRY(ftrace_stub) + bv %r0(%rp) + nop +ENDPROC(ftrace_stub) + +#endif /* CONFIG_FUNCTION_GRAPH_TRACER */ + +#ifdef CONFIG_FUNCTION_GRAPH_TRACER ENDPROC(return_to_handler) +#endif /* CONFIG_FUNCTION_GRAPH_TRACER */ + #endif /* CONFIG_FUNCTION_TRACER */ #ifdef CONFIG_IRQSTACKS diff --git a/arch/parisc/kernel/ftrace.c b/arch/parisc/kernel/ftrace.c index 5beb97b..8c9f757 100644 --- a/arch/parisc/kernel/ftrace.c +++ b/arch/parisc/kernel/ftrace.c @@ -156,7 +156,7 @@ void ftrace_function_trampoline(unsigned long parent, return; if (ftrace_trace_function != ftrace_stub) { - ftrace_trace_function(parent, self_addr); + ftrace_trace_function(parent, self_addr, NULL, NULL); return; } #ifdef CONFIG_FUNCTION_GRAPH_TRACER