From patchwork Tue Aug 6 21:41:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 2839642 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 E73E7BF535 for ; Tue, 6 Aug 2013 21:42:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 08F93201DA for ; Tue, 6 Aug 2013 21:42:05 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CC62A201D3 for ; Tue, 6 Aug 2013 21:42:03 +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 1V6p0z-000449-U3; Tue, 06 Aug 2013 21:42:02 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V6p0x-0002qe-It; Tue, 06 Aug 2013 21:41:59 +0000 Received: from mail-qa0-f73.google.com ([209.85.216.73]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V6p0v-0002pt-0w for linux-arm-kernel@lists.infradead.org; Tue, 06 Aug 2013 21:41:58 +0000 Received: by mail-qa0-f73.google.com with SMTP id f14so134904qak.0 for ; Tue, 06 Aug 2013 14:41:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=zr15jrdVBfcjBfHyaTJOLO7TMmn0ji2+VQ9H1lnqVfE=; b=N+BWzHupVai4cJE5dZHmhBCFGq5h7SBxySV3hTHySiPB4O1tjgAhEuEuNeXI9Q1u0R E/6H0cv9Sbss3A/FzOCqw4xiyf7MIBhJiHJV4emsrfRwzM4hB+4zlE/k5nTP+ulHM/+Z X6JX2v16nPLYVAlimR6HALeR27urfQeY1lC8WKrda586NOBCTj5GuysnJFjXCgif3B3I RL2QPglR9shtXwvG36P/+EUk1J78/GV+6dvp6Ow9NCvptsqgYZ4r0cvIrP5aGCVncjnB KmIMZey5y+BCZNylZXFnaI5ji/2UCKXJAK+3Ynw5QDyVouUNTrttZ3LXlLGvAoilfdxp K/kg== X-Gm-Message-State: ALoCoQlHylGWACtofl01Z3ss/ZNYP+wcTQ9PZUov4jJmg2rodJER2HYS0H/A3TdEBY6bcSD7B+r7wF6vByrnNsHTUDx+NNN7kWWWZCzNE2pOrKvKTJQdWQK3He0b5/dlyQlPr5oVejO65vMQD0mbS5lZ5lC5d0pbwTWqg25Xmv02pIzA3JPokFhe7X0CeuA5/496DLts+5Cu+YXr7jPp5dl8o5KZtR33vQ== X-Received: by 10.236.147.50 with SMTP id s38mr46545yhj.44.1375825295690; Tue, 06 Aug 2013 14:41:35 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id v70si284666yhv.3.2013.08.06.14.41.35 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Tue, 06 Aug 2013 14:41:35 -0700 (PDT) Received: from tictac.mtv.corp.google.com (tictac.mtv.corp.google.com [172.22.162.34]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 7ED6E5A41A3; Tue, 6 Aug 2013 14:41:35 -0700 (PDT) Received: by tictac.mtv.corp.google.com (Postfix, from userid 121310) id 0C44880AC0; Tue, 6 Aug 2013 14:41:34 -0700 (PDT) From: Doug Anderson To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: Add ".text.unlikely" and ".text.hot" to arm unwind tables Date: Tue, 6 Aug 2013 14:41:15 -0700 Message-Id: <1375825275-21962-1-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 1.8.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130806_174157_120640_8ABCDF18 X-CRM114-Status: GOOD ( 10.92 ) X-Spam-Score: -0.9 (/) Cc: Stephen Rothwell , Mike Frysinger , Mauro Carvalho Chehab , Sam Ravnborg , Rusty Russell , Doug Anderson , linux-kernel@vger.kernel.org, David Howells , Hans Verkuil , Greg Kroah-Hartman , Olof Johansson , Russell King , Sonny Rao 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,KHOP_BIG_TO_CC, 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 It appears that gcc may put some code in ".text.unlikely" or ".text.hot" sections. Right now those aren't accounted for in unwind tables. Add them. I found some docs about this at: http://gcc.gnu.org/onlinedocs/gcc-4.6.2/gcc.pdf Without this, if you have slub_debug turned on, you can get messages that look like this: unwind: Index not found 7f008c50 Signed-off-by: Doug Anderson Acked-by: Mike Frysinger --- arch/arm/include/asm/module.h | 2 ++ arch/arm/kernel/module.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/arch/arm/include/asm/module.h b/arch/arm/include/asm/module.h index 0d3a28d..ed690c4 100644 --- a/arch/arm/include/asm/module.h +++ b/arch/arm/include/asm/module.h @@ -12,6 +12,8 @@ enum { ARM_SEC_CORE, ARM_SEC_EXIT, ARM_SEC_DEVEXIT, + ARM_SEC_HOT, + ARM_SEC_UNLIKELY, ARM_SEC_MAX, }; diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c index 85c3fb6..084dc88 100644 --- a/arch/arm/kernel/module.c +++ b/arch/arm/kernel/module.c @@ -292,12 +292,20 @@ int module_finalize(const Elf32_Ehdr *hdr, const Elf_Shdr *sechdrs, maps[ARM_SEC_CORE].unw_sec = s; else if (strcmp(".ARM.exidx.exit.text", secname) == 0) maps[ARM_SEC_EXIT].unw_sec = s; + else if (strcmp(".ARM.exidx.text.unlikely", secname) == 0) + maps[ARM_SEC_UNLIKELY].unw_sec = s; + else if (strcmp(".ARM.exidx.text.hot", secname) == 0) + maps[ARM_SEC_HOT].unw_sec = s; else if (strcmp(".init.text", secname) == 0) maps[ARM_SEC_INIT].txt_sec = s; else if (strcmp(".text", secname) == 0) maps[ARM_SEC_CORE].txt_sec = s; else if (strcmp(".exit.text", secname) == 0) maps[ARM_SEC_EXIT].txt_sec = s; + else if (strcmp(".text.unlikely", secname) == 0) + maps[ARM_SEC_UNLIKELY].txt_sec = s; + else if (strcmp(".text.hot", secname) == 0) + maps[ARM_SEC_HOT].txt_sec = s; } for (i = 0; i < ARM_SEC_MAX; i++)