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 1DCAFC433F5 for ; Sat, 19 Feb 2022 01:29:34 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=34cu09hDqT1E8/aWpYa3E5ep8Om5UwO+WGUFKm24PUM=; b=dk11dMa/dOvR+H Dz/4N7nDohcpKHgWFW3ZTKVu0UYnRcDzs8FhDAx0xopdmtlU14BMQ8vbT+2tQlUhl16ddEogl3pLf mt/YJY5rdraPauVjFdLaDRjCHigDmhyOO4Ar38HFRF4Ese6Ai2gNQzyWNJMBVNhwMisA3hel6EroY Qhswj/PBDVSD7SdR73H/EPE8dh1Tix1RuFAQZAqs2EpOERLg7GlzqhcI/Rb/8PGVOpl7YOOZn9Lsz /2If2O3yeoMVCbTWT7qpmAFUP9sWnOkpN23zqC92lLw3z2rJsKVUsnyodqh4CvCj7net1uILoXpKr eP6li9PZsj/MOFEDZuiA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nLEXy-00G6Rp-Go; Sat, 19 Feb 2022 01:28:26 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nLEXu-00G6R8-C1 for linux-arm-kernel@lists.infradead.org; Sat, 19 Feb 2022 01:28:23 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CF4B661EDA; Sat, 19 Feb 2022 01:28:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0EBDBC340E9; Sat, 19 Feb 2022 01:28:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645234100; bh=meqdSYQ17as6D2gC+1QtuY2/hf013mG8sWxTTeQxu50=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rqVYBLLtb2HpAM9zDNnWMjpNt/bhxVYAPdnZA5rFCUvFDZhvilxvQrhtudrBlzWkw SfZBluri6VRZPXo63A1Q7DyGe1+22dVBCgLNmFElrTyNudB/Kv3tCL1E5gd3FGTiZn ruE9586qkAnkzHYHiXwI4UeJLTb1+45yX+oBo0GBf5Ne3n4KXu6XRJ05F4HXs8yevZ mMkwJGECmIxDUKLK+CJ4HE8RSfIp1r+mCYlnel47GRDse/HAkOK0Jubktqa6np9L0X IcDQZK9eqa4HKZ1n9Fcb4eVc8YrprENfIEEQRLgecFnpum/hoySDD8DO2dLQzaGtHV i28Rsy9W7q1yg== Date: Fri, 18 Feb 2022 17:28:18 -0800 From: Eric Biggers To: Nathan Huckleberry Cc: linux-crypto@vger.kernel.org, Herbert Xu , "David S. Miller" , linux-arm-kernel@lists.infradead.org, Paul Crowley , Sami Tolvanen , Ard Biesheuvel Subject: Re: [RFC PATCH v2 4/7] crypto: x86/aesni-xctr: Add accelerated implementation of XCTR Message-ID: References: <20220210232812.798387-1-nhuck@google.com> <20220210232812.798387-5-nhuck@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220210232812.798387-5-nhuck@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220218_172822_475647_A2D3BCA6 X-CRM114-Status: GOOD ( 20.88 ) 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 On Thu, Feb 10, 2022 at 11:28:09PM +0000, Nathan Huckleberry wrote: > diff --git a/arch/x86/crypto/aes_xctrby8_avx-x86_64.S b/arch/x86/crypto/aes_xctrby8_avx-x86_64.S > new file mode 100644 > index 000000000000..53d70cab9474 > --- /dev/null > +++ b/arch/x86/crypto/aes_xctrby8_avx-x86_64.S > @@ -0,0 +1,529 @@ > +/* SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause */ > +/* > + * AES XCTR mode by8 optimization with AVX instructions. (x86_64) > + * > + * Copyright(c) 2014 Intel Corporation. > + * > + * Contact Information: > + * James Guilford > + * Sean Gulley > + * Chandramouli Narayanan > + */ > +/* > + * Implement AES XCTR mode with AVX instructions. This code is a modified > + * version of the Linux kernel's AES CTR by8 implementation. > + * > + * This is AES128/192/256 XCTR mode optimization implementation. It requires > + * the support of Intel(R) AESNI and AVX instructions. > + * > + * This work was inspired by the AES XCTR mode optimization published > + * in Intel Optimized IPSEC Cryptographic library. > + * Additional information on it can be found at: > + * https://github.com/intel/intel-ipsec-mb > + */ So I haven't looked at this closely yet, but one thing I noticed is that this file is pretty long, and it's almost identical to aes_ctrby8_avx-x86_64.S. Perhaps it would make sense to add XCTR support to that file rather than duplicating most of it into this new file? You could add an is_xctr argument to the macros to allow making parts conditional on CTR or XCTR when needed. - Eric _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel