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 F27DAD2A530 for ; Wed, 16 Oct 2024 16:31:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FC4/Q36FEy0+VhMYBEmnuMEK54SN8dtN6mU8FblIMlo=; b=M9fCD2AU05Jzvui0ce0B389urN veGZRGIx1QPod4psCwq1goRm2iBqZIT6qz9lc64DTbhit6jjlp7vzd64N7sEE9/WLoivgbC2CPXpd VKQrpqin3UhfA+xVDpMERcu8z+1FzMDiUYZN/kzR0iNzqlQJZep4s9O42HsjncVD1zXjnTiT0k/bK jTfM/ZGfhy/kWXKJwVzhssvPTBTZ5D61bd7UmrgAR6SuWGf2CsN7z4ybfi1afLziqRsIiJeU+KhUr K0K32vKxUpvfmIfCjQ9WbLTtmEjbr5dgSW7l9g3H2XkcExUrnC4+X0mnDrXxkBbKidGAN63PRWClC 5EG91sIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t16vA-0000000CQUs-2Hky; Wed, 16 Oct 2024 16:30:48 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t16op-0000000CPHc-1PRl for linux-arm-kernel@lists.infradead.org; Wed, 16 Oct 2024 16:24:16 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 95B54A40131; Wed, 16 Oct 2024 16:24:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 238EBC4CEC5; Wed, 16 Oct 2024 16:24:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1729095853; bh=ELkQCkvnvsqAkcqwDniUM4x92rERmqEI7Yu0ccyKwIQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LI1p4dZ0tqVMNN2oq8AWE3gnu4GavO7BVvIZE+MP92vuVOQ9b5kFaDnCJbr0k3l+j 10CIWlynzgTSz9CnLiXHZROmYp8a040ZXnuDwnW6/CJDxq9DaZMNCYUOHtH95XaAqt PA6nn93gtOgH9k6lj1mmfoi0A2+pWKWoLJfgGVIa+19P5aEq/x2J/dWoPkajOVxORO XFfSRURIiS7A2ZSKdGgrgLUuE5T/vcD1Jrwip43/lERBW0IcTNSgIedKMZsM8uSVqp 5gtLUO9F0KcGpRZ2UakmZd1ElpWWJQp26iZTSaS/TjVCykxE2tZ3pQDPIOV0p4Fo1q cAbjMnKQL33HA== Date: Wed, 16 Oct 2024 16:24:11 +0000 From: Eric Biggers To: Ard Biesheuvel Cc: Ard Biesheuvel , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, herbert@gondor.apana.org.au, will@kernel.org, catalin.marinas@arm.com, Kees Cook Subject: Re: [PATCH 2/2] arm64/crc32: Implement 4-way interleave using PMULL Message-ID: <20241016162411.GA3228925@google.com> References: <20241015104138.2875879-4-ardb+git@google.com> <20241015104138.2875879-6-ardb+git@google.com> <20241016030349.GD1138@sol.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241016_092415_466752_17DDF336 X-CRM114-Status: GOOD ( 14.13 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Oct 16, 2024 at 09:12:41AM +0200, Ard Biesheuvel wrote: > > I'd recommend calling the file crc32-4way.S and the functions > > crc32*_arm64_4way(), rather than crc32-pmull.S and crc32*_pmull(). This would > > avoid confusion with a CRC implementation that is actually based entirely on > > pmull (which is possible). > > I'm well aware :-) > > commit 8fefde90e90c9f5c2770e46ceb127813d3f20c34 > Author: Ard Biesheuvel > Date: Mon Dec 5 18:42:27 2016 +0000 > > crypto: arm64/crc32 - accelerated support based on x86 SSE implementation > > commit 598b7d41e544322c8c4f3737ee8ddf905a44175e > Author: Ard Biesheuvel > Date: Mon Aug 27 13:02:45 2018 +0200 > > crypto: arm64/crc32 - remove PMULL based CRC32 driver > > I removed it because it wasn't actually faster, although that might be > different on modern cores. The PMULL-based code removed by commit 598b7d41e544 was only 4-wide. On Apple M1, a 12-wide PMULL-based CRC32 is actually faster than 4-way CRC32, especially if the eor3 instruction from the sha3 extension is utilized. This was not the case on non-Apple CPUs I tested (in 2022), though. 12-wide is very wide and is a bit inconvenient, and IMO it's not worth doing in the kernel at this point. It would be interesting to test the very latest CPUs, though. - Eric