From patchwork Tue Sep 1 17:30:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Jarzmik X-Patchwork-Id: 7106321 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8E6469F36E for ; Tue, 1 Sep 2015 17:38:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B50E20608 for ; Tue, 1 Sep 2015 17:38:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F68120263 for ; Tue, 1 Sep 2015 17:38:09 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZWpTP-0001JA-60; Tue, 01 Sep 2015 17:35:55 +0000 Received: from smtp06.smtpout.orange.fr ([80.12.242.128] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZWpTL-00019o-U9 for linux-arm-kernel@lists.infradead.org; Tue, 01 Sep 2015 17:35:53 +0000 Received: from belgarion ([109.222.247.56]) by mwinf5d11 with ME id BtbQ1r00J1DkrDp03tbR42; Tue, 01 Sep 2015 19:35:29 +0200 X-ME-Helo: belgarion X-ME-Auth: amFyem1pay5yb2JlcnRAb3JhbmdlLmZy X-ME-Date: Tue, 01 Sep 2015 19:35:29 +0200 X-ME-IP: 109.222.247.56 From: Robert Jarzmik To: Russell King - ARM Linux Subject: Re: Possible regression: module insertion, relocation misalignement References: <87egil26sn.fsf@belgarion.home> <87vbbvysfc.fsf@belgarion.home> <20150831234638.GI21084@n2100.arm.linux.org.uk> X-URL: http://belgarath.falguerolles.org/ Date: Tue, 01 Sep 2015 19:30:53 +0200 Message-ID: <87k2sayrle.fsf@belgarion.home> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150901_103552_566231_A9DD496A X-CRM114-Status: GOOD ( 26.87 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org 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,FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_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 Russell King - ARM Linux writes: > On Tue, Sep 01, 2015 at 01:00:39AM +0200, Robert Jarzmik wrote: >> [2] readelf -Sr pxa3xx_nand.ko >> ============================== >> [12] __bug_table PROGBITS 00000000 002232 000018 00 A 0 0 1 > > This shows that the bug table has an alignment of 1, which is silly as > it contains 32-bit values - this really ought to be indicating an > alignment of 4. > > I notice that a bunch of my modules are the same as well. Try adding > ".align 2" into arch/arm/include/asm/bug.h, __BUG() macro, just after > ".pushsection __bug_table" which should have the effect of increasing > the alignment of the section. Okay, I made the change, and tested it now I'm after work. Your fix does indeed remove the problem. > It probably hasn't been noticed on ARMv6 and later because they'll > always fix up these relocations transparently. > > For ARMv5 and older, you really ought to have the alignment handler > enabled - IP networking pretty much relies on this being present to > catch corner cases (eg, with TCP options mis-aligning subsequent data.) That is curious, because I have this in my configuration : #define CONFIG_ALIGNMENT_TRAP 1. And yet it happens ... I will remove the fix and try to follow the data abort path to understand why the alignment fault is not dealt with. diff --git a/arch/arm/include/asm/bug.h b/arch/arm/include/asm/bug.h index b274bde24905..e7335a92144e 100644 --- a/arch/arm/include/asm/bug.h +++ b/arch/arm/include/asm/bug.h @@ -40,6 +40,7 @@ do { \ "2:\t.asciz " #__file "\n" \ ".popsection\n" \ ".pushsection __bug_table,\"a\"\n" \ + ".align 2\n" \ "3:\t.word 1b, 2b\n" \ "\t.hword " #__line ", 0\n" \ ".popsection"); \