Received: by 10.223.185.116 with SMTP id b49csp2039401wrg; Thu, 22 Feb 2018 07:16:12 -0800 (PST) X-Google-Smtp-Source: AH8x226ZAVH4m1Qob0IjgxrhuR6sDJlmvkZXMetXqRPskCqZoprftiorFSp8xSPLqHwIn3eTvskc X-Received: by 10.98.76.215 with SMTP id e84mr7316107pfj.45.1519312572424; Thu, 22 Feb 2018 07:16:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519312572; cv=none; d=google.com; s=arc-20160816; b=NupJ0H34tQNv0FmnypPknrXDoINr8ESFjqTY4k0LjeXB+pGqK15RYxQ6lw366sJmcI HiIXDyw4mhWrX5Vxdy19MgSqPFhGpWzjl9vGgqZM+1Gj3uePKaNG1yjg57p9+fduXOoj AtrRs069YA1y7W/sLu65+4uBrxfnjXcau95Tq6lE4ANUD9mawu1lxNkp5yKPcvMAcJdR Y54BOeLtcbkryGVteLd6veSaE9xEkLlkJ3PApALTHDdndQx5pU8AEZ1GcTAtQ6MozJGU 125qPBOswSpu6ojy8lg1dnqkDWSMICDtmCBhnnO6aqu5XTyR+AhsqZ/oq9Jl+TIitAYf kQ1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=Mu40vySqXNcWd7KxsqUpF+PSj7DhqW2nGCdji/PXS1k=; b=Zh6QgBwLucn9o1TqFxWwAaWf1GsgDBogAopM1fefMk7XYT0tHbObhjWEANp5HsPAiT 7t4R94oWIbSfzlBxtf2LesqEljTnixLn8HxyaQkLBbCp/gA+zK3Q2phxA8Rj5tmhtyZx +QwjfmKXY+yteWb9P++YK8c0KAYWy2Dbzukj6/yeV023Uoh2TiLp+zrqh9M4Xe24LUYk zdi/WVDq1Q6JOgMVLZRF6hcpkKR9eCZZnnnAVoU9hPg8XEvVdYkSAmFJUUwrSdduQ8hu QUXoLy/6hVkNPB/vFxwjHBEWRzSd4nY+pp0vh35ZvrzhfC+SrZy7YCosB3+8c7QMfzbL 89Vw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y21si190735pfk.28.2018.02.22.07.15.57; Thu, 22 Feb 2018 07:16:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933011AbeBVPNc (ORCPT + 99 others); Thu, 22 Feb 2018 10:13:32 -0500 Received: from orcrist.hmeau.com ([104.223.48.154]:57130 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932861AbeBVPNb (ORCPT ); Thu, 22 Feb 2018 10:13:31 -0500 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtp (Exim 4.84_2 #2 (Debian)) id 1eosYZ-0000Td-HN; Thu, 22 Feb 2018 23:13:11 +0800 Received: from herbert by gondobar with local (Exim 4.84_2) (envelope-from ) id 1eosYR-0007qw-MY; Thu, 22 Feb 2018 23:13:03 +0800 Date: Thu, 22 Feb 2018 23:13:03 +0800 From: Herbert Xu To: Dave Watson Cc: Junaid Shahid , Steffen Klassert , linux-crypto@vger.kernel.org, "David S. Miller" , Hannes Frederic Sowa , Tim Chen , Sabrina Dubroca , linux-kernel@vger.kernel.org, Stephan Mueller , Ilya Lesokhin Subject: Re: [PATCH v2 00/14] x86/crypto gcmaes SSE scatter/gather support Message-ID: <20180222151303.GI29815@gondor.apana.org.au> References: <20180214173751.GA61573@davejwatson-mba> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180214173751.GA61573@davejwatson-mba> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 14, 2018 at 09:37:51AM -0800, Dave Watson wrote: > This patch set refactors the x86 aes/gcm SSE crypto routines to > support true scatter/gather by adding gcm_enc/dec_update methods. > > The layout is: > > * First 5 patches refactor the code to use macros, so changes only > need to be applied once for encode and decode. There should be no > functional changes. > > * The next 6 patches introduce a gcm_context structure to be passed > between scatter/gather calls to maintain state. The struct is also > used as scratch space for the existing enc/dec routines. > > * The last 2 set up the asm function entry points for scatter gather > support, and then call the new routines per buffer in the passed in > sglist in aesni-intel_glue. > > Testing: > asm itself fuzz tested vs. existing code and isa-l asm. > Ran libkcapi test suite, passes. > > perf of a large (16k messages) TLS sends sg vs. no sg: > > no-sg > > 33287255597 cycles > 53702871176 instructions > > 43.47% _crypt_by_4 > 17.83% memcpy > 16.36% aes_loop_par_enc_done > > sg > > 27568944591 cycles > 54580446678 instructions > > 49.87% _crypt_by_4 > 17.40% aes_loop_par_enc_done > 1.79% aes_loop_initial_5416 > 1.52% aes_loop_initial_4974 > 1.27% gcmaes_encrypt_sg.constprop.15 > > V1 -> V2: > > patch 14: merge enc/dec > also use new routine if cryptlen < AVX_GEN2_OPTSIZE > optimize case if assoc is already linear > > Dave Watson (14): > x86/crypto: aesni: Merge INITIAL_BLOCKS_ENC/DEC > x86/crypto: aesni: Macro-ify func save/restore > x86/crypto: aesni: Add GCM_INIT macro > x86/crypto: aesni: Add GCM_COMPLETE macro > x86/crypto: aesni: Merge encode and decode to GCM_ENC_DEC macro > x86/crypto: aesni: Introduce gcm_context_data > x86/crypto: aesni: Split AAD hash calculation to separate macro > x86/crypto: aesni: Fill in new context data structures > x86/crypto: aesni: Move ghash_mul to GCM_COMPLETE > x86/crypto: aesni: Move HashKey computation from stack to gcm_context > x86/crypto: aesni: Introduce partial block macro > x86/crypto: aesni: Add fast path for > 16 byte update > x86/crypto: aesni: Introduce scatter/gather asm function stubs > x86/crypto: aesni: Update aesni-intel_glue to use scatter/gather > > arch/x86/crypto/aesni-intel_asm.S | 1414 ++++++++++++++++++------------------ > arch/x86/crypto/aesni-intel_glue.c | 230 +++++- > 2 files changed, 899 insertions(+), 745 deletions(-) All applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt