From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 59F3DC54798 for ; Tue, 5 Mar 2024 09:27:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zBhHD+YvMRfzdhlifDGIuchDNriIe7so0t2MRWifG1s=; b=Me7pvqWQ/6RnsD kNWtEgtSUiXWv2X9t/9p7o2Zrv6VISeMcDu44yVr+frhdO72/ZxogAjXAXgL+aFgl35QiqY2xfqKc 6ZuTMNYDfDZkqkvEjNAIYuTQOLRrZLMjTC6mTqU+1BMp4q/mdHCK1KGqdaZd+0gj+lsOu9kk04mww 7o5KwDQ2Fn+yeze/MMn4miXsh6ZR6RZcxVwnyKXWz86SY/AvnYYh5np+hPkExB+5cAq/Phna1lrU4 expV3jzW7M7dDark7L3Zi4Z/KiYrHthcsxIQJLI2EJNJeS6bRpdRf5iJI426eHFjcrweT8ryUVbDy 4L2aWN53mbbH+/2lCArQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhR4g-0000000CoeR-31jc; Tue, 05 Mar 2024 09:27:05 +0000 Received: from eu-smtp-delivery-151.mimecast.com ([185.58.85.151]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rhR4b-0000000Coax-2SMC for linux-arm-kernel@lists.infradead.org; Tue, 05 Mar 2024 09:27:00 +0000 Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-312-sCqIcKGYOf6ZeDr-o4ocrw-1; Tue, 05 Mar 2024 09:26:51 +0000 X-MC-Unique: sCqIcKGYOf6ZeDr-o4ocrw-1 Received: from AcuMS.Aculab.com (10.202.163.4) by AcuMS.aculab.com (10.202.163.4) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Tue, 5 Mar 2024 09:27:22 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Tue, 5 Mar 2024 09:27:22 +0000 From: David Laight To: 'Arnd Bergmann' , Christophe Leroy , Guenter Roeck , "Russell King" CC: "linux-kernel@vger.kernel.org" , "Palmer Dabbelt" , Charlie Jenkins , "James E . J . Bottomley" , Helge Deller , Palmer Dabbelt , Geert Uytterhoeven , Andrew Morton , "Parisc List" , Linux ARM Subject: RE: [PATCH v11] lib: checksum: Use aligned accesses for ip_fast_csum and csum_ipv6_magic tests Thread-Topic: [PATCH v11] lib: checksum: Use aligned accesses for ip_fast_csum and csum_ipv6_magic tests Thread-Index: AQHabjlz2G6zh0QEYUOonhCQoX0NCrEo3thA Date: Tue, 5 Mar 2024 09:27:22 +0000 Message-ID: <55a6df07d26849e89c839f80ca5996b9@AcuMS.aculab.com> References: <20240229-fix_sparse_errors_checksum_tests-v11-1-f608d9ec7574@rivosinc.com> <62b69aaf-7633-4bd8-aefe-5ba47147dba7@roeck-us.net> <6df98c91-26b1-497a-9202-18bf86c0130d@roeck-us.net> <4e227412-ccac-4771-8aa6-a716e7c07090@csgroup.eu> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240305_012657_995508_5D4BFA9E X-CRM114-Status: GOOD ( 15.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Arnd Bergmann > Sent: 04 March 2024 13:40 ... > > If not, then the test has to be fixed to only use word-aligned IPv6 > > addresses. > > Because of the gcc issue I mentioned, net/ipv6/ip6_checksum.c > and anything else that accesses misaligned ipv6 headers may need > to be changed as well. Marking in6_addr as '__packed __aligned(2)' > should be sufficient for that. This will prevent gcc from issuing > ldm or ldrd on ARMv6+ as well as making optimization based on > the two lower bits of the address being zero on x86 and others. Eh? x86 pretty much doesn't care unless you are using AVX. > The downside is that it forces 16-bit loads and stores to be > used on architectures that don't have efficient unaligned > access (armv5, alpha, mips, sparc and xtensa among others) > even when the IP headers are fully aligned. Aren't the later accesses to the header also going to fault? IIRC there is an skb_pull() call to ensure all the IP header is in the linear skb fragment? Perhaps there should be an skb_pull_aligned() that will ensure the data is 32bit aligned on systems where the misaligned accesses fault? There might still need to be something to stop gcc generating ldm/ldrd which can fault on systems where a normal register read wouldn't. Do any recent arm cpu have the strongarm 'feature' than ldm always took 16 clocks? David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel