From patchwork Wed Feb 26 11:11:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 324280 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:770:15f::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 519CB2C00A0 for ; Wed, 26 Feb 2014 22:12:31 +1100 (EST) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WIcPP-0001ZI-5V; Wed, 26 Feb 2014 11:12:15 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WIcPM-0002wK-Lv; Wed, 26 Feb 2014 11:12:12 +0000 Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WIcPG-0002uS-JH for linux-arm-kernel@lists.infradead.org; Wed, 26 Feb 2014 11:12:08 +0000 Received: from dude.hi.pengutronix.de ([2001:6f8:1178:2:21e:67ff:fe11:9c5c]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1WIcOj-0006An-V3; Wed, 26 Feb 2014 12:11:33 +0100 Received: from ukl by dude.hi.pengutronix.de with local (Exim 4.82) (envelope-from ) id 1WIcOj-00082x-0e; Wed, 26 Feb 2014 12:11:33 +0100 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: linux-arm-kernel@lists.infradead.org, Rusty Russell Subject: [PATCH] scripts/link-vmlinux.sh: correct base address for some ARM special cases Date: Wed, 26 Feb 2014 12:11:20 +0100 Message-Id: <1393413080-26942-1-git-send-email-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 1.8.5.3 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:6f8:1178:2:21e:67ff:fe11:9c5c X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140226_061206_984300_DC4C5EBF X-CRM114-Status: GOOD ( 15.91 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Ming Lei , stable@vger.kernel.org, kernel@pengutronix.de X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org The toolchain problem described in commit f6537f2f0eba (scripts/kallsyms: filter symbols not in kernel address space) makes it necessary to filter out some kernel symbols from /proc/kallsyms to make perf happy. For that to work correctly the address used to filter should be just below the kernel text segment. Depending on kernel configuration CONFIG_PAGE_OFFSET is not the right address to use. See the comments introduced by this commit for the glory details. Fixes: b9b32bf70f2f (ARM: use linker magic for vectors and vector stubs) Cc: stable@vger.kernel.org Signed-off-by: Uwe Kleine-König --- Hello, note I'm not entirely sure if the diagnose "toolchain problem" is right. That's what Arnd suggested in #armlinux. So maybe the commit log wants some fixing. This is probably stable material as 7122c3e9154b and f6537f2f0eba were considered for stable, too. As b9b32bf70f2f has a stable annotation, too, maybe older stable kernel also need fixing. Other than that I wonder if "--page-offset" is a misnomer. Better use "--kernel-start"? I didn't do this change here because patches for stable should be minimal. But maybe it's worth a followup patch? Best regards Uwe scripts/link-vmlinux.sh | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 2dcb37736d84..493b4ccdf5fc 100644 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -82,8 +82,24 @@ kallsyms() kallsymopt="${kallsymopt} --all-symbols" fi - if [ -n "${CONFIG_ARM}" ] && [ -n "${CONFIG_PAGE_OFFSET}" ]; then - kallsymopt="${kallsymopt} --page-offset=$CONFIG_PAGE_OFFSET" + if [ -n "${CONFIG_ARM}" ]; then + # There are some ARM toolchains that generate some internal + # symbols that then appear in /proc/kallsyms and these disturbe + # perf. So filter out all symbols below PAGE_OFFSET. + # ARM is a bit complicated here. The page-offset isn't + # completely determined in Kconfig as of 3.14-rc. Without MMU + # it's not CONFIG_PAGE_OFFSET that is used but (indirectly) + # CONFIG_DRAM_BASE. But for XIP we want the XIP PHYS_ADDR + # though. + if [ -n "${CONFIG_XIP_PHYS_ADDR}" ]; then + page_offset="${CONFIG_XIP_PHYS_ADDR}" + elif [ -z "${CONFIG_MMU}" ]; then + page_offset="${CONFIG_DRAM_BASE}" + else + page_offset="$CONFIG_PAGE_OFFSET" + fi + + kallsymopt="${kallsymopt} --page-offset=$page_offset" fi local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \