From patchwork Tue Jan 7 15:48:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 3449011 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0728DC02DC for ; Tue, 7 Jan 2014 15:49:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DBB8E2010C for ; Tue, 7 Jan 2014 15:49:14 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A996F20109 for ; Tue, 7 Jan 2014 15:49:13 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W0Ytw-0004Hi-Dw; Tue, 07 Jan 2014 15:49:08 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W0Ytt-0003RK-SU; Tue, 07 Jan 2014 15:49:05 +0000 Received: from moutng.kundenserver.de ([212.227.17.10]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W0Ytr-0003QR-1y for linux-arm-kernel@lists.infradead.org; Tue, 07 Jan 2014 15:49:03 +0000 Received: from wuerfel.localnet (HSI-KBW-085-216-031-165.hsi.kabelbw.de [85.216.31.165]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0LrIS4-1VFRtF48j6-013Ynz; Tue, 07 Jan 2014 16:48:26 +0100 From: Arnd Bergmann To: Russell King - ARM Linux Subject: Re: [PATCH 19/19] [INCOMPLETE] ARM: make return_address available for ARM_UNWIND Date: Tue, 07 Jan 2014 16:48:25 +0100 Message-ID: <4325142.7drL5ndxN9@wuerfel> User-Agent: KMail/4.11 rc1 (Linux/3.10.0-5-generic; KDE/4.11.2; x86_64; ; ) In-Reply-To: <20140107144130.GJ27432@n2100.arm.linux.org.uk> References: <1359123276-15833-1-git-send-email-arnd@arndb.de> <201401071533.35309.arnd@arndb.de> <20140107144130.GJ27432@n2100.arm.linux.org.uk> MIME-Version: 1.0 X-Provags-ID: V02:K0:VYU18J/I6ugaZq2c4v1LkQ214cZ6e/PJc0HFluDO4Ii cegSu0yyy+eIkmgMWxuQJRHwQCgDHk+LRQ13k/3oix9UppvSWO jyLzuXZTc9vDLZbP5F6H7T5RdlxH9anDvYxXqZwbAwTCAGKW4A VsbeSfEPREkv7sEdmAe0XpkqYOBoKh66mdf4W+GJcFXiE1nWQM 4frSYLVe6PuMOQhhtdA8eUMQpZRZUmNmP1BoMxRJ25HPiCN81q AiGoTHEZB2Q/cKay7JJePN/mw9SNSnJxeCpIgtuom3z0c5f5p+ 0UzgLhF+x/3p5OB8NgQ4FwwMbBkCttzypWOVJB+8d3JnPKZ54Z Oge8VCIUzeKWgSYeeZnA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140107_104903_326555_8478AA56 X-CRM114-Status: GOOD ( 18.42 ) X-Spam-Score: -1.9 (-) Cc: sahara , linux-kernel@vger.kernel.org, Steven Rostedt , Keun-O Park , Dave Martin , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Tuesday 07 January 2014 14:41:30 Russell King - ARM Linux wrote: > On Tue, Jan 07, 2014 at 03:33:34PM +0100, Arnd Bergmann wrote: > > > > > > It's been almost a year since we last discussed the patches that were > > posted by Dave and sahara, but nothing has changed in the mainline kernel. > > > > Any chance that someone could be motivated to pick this work up again > > and finally fix return_address(). > > I thought that we had _actively_ decided that we would not use the > unwinder for these paths - that it was too expensive for these paths, > and you had to use frame pointers instead. I don't remember that discussion, but it may well be. What does that mean for the #warning in return_address.c then? Can we just use the frame pointer version based on CONFIG_FRAME_POINTER and ignore whether CONFIG_ARM_UNWIND is set as the patch below, or did I misunderstand? Arnd diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h index f89515a..3247370 100644 --- a/arch/arm/include/asm/ftrace.h +++ b/arch/arm/include/asm/ftrace.h @@ -32,7 +32,7 @@ extern void ftrace_call_old(void); #ifndef __ASSEMBLY__ -#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) +#if defined(CONFIG_FRAME_POINTER) /* * return_address uses walk_stackframe to do it's work. If both * CONFIG_FRAME_POINTER=y and CONFIG_ARM_UNWIND=y walk_stackframe uses unwind diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index a30fc9b..c713f46 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile @@ -16,13 +16,14 @@ CFLAGS_REMOVE_return_address.o = -pg # Object file lists. obj-y := elf.o entry-common.o irq.o opcodes.o \ - process.o ptrace.o return_address.o \ + process.o ptrace.o \ setup.o signal.o sigreturn_codes.o \ stacktrace.o sys_arm.o time.o traps.o obj-$(CONFIG_ATAGS) += atags_parse.o obj-$(CONFIG_ATAGS_PROC) += atags_proc.o obj-$(CONFIG_DEPRECATED_PARAM_STRUCT) += atags_compat.o +obj-$(CONFIG_FRAME_POINTER) += return_address.o ifeq ($(CONFIG_CPU_V7M),y) obj-y += entry-v7m.o v7m.o diff --git a/arch/arm/kernel/return_address.c b/arch/arm/kernel/return_address.c index fafedd8..d9f2c15 100644 --- a/arch/arm/kernel/return_address.c +++ b/arch/arm/kernel/return_address.c @@ -10,8 +10,6 @@ */ #include #include - -#if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) #include #include @@ -56,18 +54,4 @@ void *return_address(unsigned int level) else return NULL; } - -#else /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) */ - -#if defined(CONFIG_ARM_UNWIND) -#warning "TODO: return_address should use unwind tables" -#endif - -void *return_address(unsigned int level) -{ - return NULL; -} - -#endif /* if defined(CONFIG_FRAME_POINTER) && !defined(CONFIG_ARM_UNWIND) / else */ - EXPORT_SYMBOL_GPL(return_address);