Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1156457ybh; Thu, 16 Jul 2020 04:55:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/tE1YyCliY5bqaNKtONdO0vqPAQePcTA5izJPcNzFk/XoeJqMeJ0KrSGSxkeQXDP66Nk+ X-Received: by 2002:a05:6402:143c:: with SMTP id c28mr4308102edx.54.1594900528266; Thu, 16 Jul 2020 04:55:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594900528; cv=none; d=google.com; s=arc-20160816; b=zfZU8x/z9jO9fooOKaEXjx25i768slFVwtIT/DnXPMLsgXb3MLkv0CMPR+mUsU/VBv uGzzexuhxwP9fhzZsZK2v+/3OKNG/XWFg/SGAKKJRIJFG7Z4Y4HKgY2kwbnVZErZWl/h 4z51sc5qqOlatZAxjaaxqxP7MJJRbRTLNLiLGKfRBQ9oXidKO10CBKnVnDt0oq2BKdpM FifzO23jptNsj3KJTPjqwbDt2NIqMC4r9WRhdYTEteRmZDS8Rr4GjQOx4cTThsIgSWMz 82hU7c4EG+N3IZPn+kVTToxIoiQEoKkza9vMC3YEV7HaIGKZG6AUyKlJBILGRFJyA30H RHUw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=VG9d2bYQnrIG4fqS5gP90rRTlVQQM2x0yFYHlsJJUQY=; b=zJH8b+GAsfwakKtMprfqULajoJuK9926OKbjde6bsMyQLIZOx/8GYd+Rd21K84u5ac jNXVo1H1Yi72NupC5aOXUWud65lmYLZizAZzovjE/OwdI9iDcmVoapmxgaXyDd/K7/yc 4JtFr4HG9w66X2LJQmSrYwI4+q8zfHPMkkmr2mrxQZAdFOt81X/8JwAbApDIKd29k7t4 u0YEjaa/RVdtDyCNVsZpRD3fKclD8kXmd5MVaAD2uSB/LrEEF4FIMvn64qiUn9xtH5Az 6Qg/E/tbouz0MPn1hEnFFDAYEsmkbBCaaWs4r6wsx9WkppIYuvZ9ARDDn3k5GcrGb8tH PymA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c11si3282571edv.140.2020.07.16.04.55.04; Thu, 16 Jul 2020 04:55:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728265AbgGPLym (ORCPT + 99 others); Thu, 16 Jul 2020 07:54:42 -0400 Received: from helcar.hmeau.com ([216.24.177.18]:40084 "EHLO fornost.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727081AbgGPLyl (ORCPT ); Thu, 16 Jul 2020 07:54:41 -0400 Received: from gwarestrin.arnor.me.apana.org.au ([192.168.0.7]) by fornost.hmeau.com with smtp (Exim 4.92 #5 (Debian)) id 1jw2SE-0008Jn-GM; Thu, 16 Jul 2020 21:53:35 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Thu, 16 Jul 2020 21:53:34 +1000 Date: Thu, 16 Jul 2020 21:53:34 +1000 From: Herbert Xu To: Ard Biesheuvel Cc: linux-crypto@vger.kernel.org, Corentin Labbe , Corentin Labbe , "David S. Miller" , Maxime Ripard , Chen-Yu Tsai , Tom Lendacky , John Allen , Ayush Sawal , Vinay Kumar Yadav , Rohit Maheshwari , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Jamie Iles , Eric Biggers , Tero Kristo , Matthias Brugger , Horia =?utf-8?Q?Geant=C4=83?= , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-amlogic@lists.infradead.org Subject: Re: [PATCH v4 00/13] crypto: permit asynchronous skciphers as driver fallbacks Message-ID: <20200716115334.GB31166@gondor.apana.org.au> References: <20200707063203.5018-1-ardb@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200707063203.5018-1-ardb@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Jul 07, 2020 at 09:31:50AM +0300, Ard Biesheuvel wrote: > The drivers for crypto accelerators in drivers/crypto all implement skciphers > of an asynchronous nature, given that they are backed by hardware DMA that > completes asynchronously wrt the execution flow. > > However, in many cases, any fallbacks they allocate are limited to the > synchronous variety, which rules out the use of SIMD implementations of > AES in ECB, CBC and XTS modes, given that they are usually built on top > of the asynchronous SIMD helper, which queues requests for asynchronous > completion if they are issued from a context that does not permit the use > of the SIMD register file. > > This may result in sub-optimal AES implementations to be selected as > fallbacks, or even less secure ones if the only synchronous alternative > is table based, and therefore not time invariant. > > So switch all these cases over to the asynchronous API, by moving the > subrequest into the skcipher request context, and permitting it to > complete asynchronously via the caller provided completion function. > > Patch #1 is not related, but touches the same driver as #2 so it is > included anyway. Patch #13 removes another sync skcipher allocation by > switching to the AES library interface. > > v4: > - add missing kerneldoc updates for sun8i-ce and sun8i-ss > - add acks from Horia, Jamie and Corentin > - rebase onto cryptodev/master > > v3: > - disregard the fallback skcipher_request when taking the request context size > for TFMs that don't need the fallback at all (picoxcell, qce) > - fix error handling in fallback skcipher allocation and remove pointless > memset()s (qce) > > v2: > - address issue found by build robot in patch #7 > - add patch #13 > - rebase onto cryptodev/master > > Cc: Corentin Labbe > Cc: Corentin Labbe > Cc: Herbert Xu > Cc: "David S. Miller" > Cc: Maxime Ripard > Cc: Chen-Yu Tsai > Cc: Tom Lendacky > Cc: John Allen > Cc: Ayush Sawal > Cc: Vinay Kumar Yadav > Cc: Rohit Maheshwari > Cc: Shawn Guo > Cc: Sascha Hauer > Cc: Pengutronix Kernel Team > Cc: Fabio Estevam > Cc: NXP Linux Team > Cc: Jamie Iles > Cc: Eric Biggers > Cc: Tero Kristo > Cc: Matthias Brugger > Cc: Horia Geantă > > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-omap@vger.kernel.org > Cc: linux-amlogic@lists.infradead.org > > Ard Biesheuvel (13): > crypto: amlogic-gxl - default to build as module > crypto: amlogic-gxl - permit async skcipher as fallback > crypto: omap-aes - permit asynchronous skcipher as fallback > crypto: sun4i - permit asynchronous skcipher as fallback > crypto: sun8i-ce - permit asynchronous skcipher as fallback > crypto: sun8i-ss - permit asynchronous skcipher as fallback > crypto: ccp - permit asynchronous skcipher as fallback > crypto: chelsio - permit asynchronous skcipher as fallback > crypto: mxs-dcp - permit asynchronous skcipher as fallback > crypto: picoxcell - permit asynchronous skcipher as fallback > crypto: qce - permit asynchronous skcipher as fallback > crypto: sahara - permit asynchronous skcipher as fallback > crypto: mediatek - use AES library for GCM key derivation > > drivers/crypto/Kconfig | 3 +- > .../allwinner/sun4i-ss/sun4i-ss-cipher.c | 46 ++++----- > drivers/crypto/allwinner/sun4i-ss/sun4i-ss.h | 3 +- > .../allwinner/sun8i-ce/sun8i-ce-cipher.c | 41 ++++---- > drivers/crypto/allwinner/sun8i-ce/sun8i-ce.h | 8 +- > .../allwinner/sun8i-ss/sun8i-ss-cipher.c | 39 ++++---- > drivers/crypto/allwinner/sun8i-ss/sun8i-ss.h | 26 ++--- > drivers/crypto/amlogic/Kconfig | 2 +- > drivers/crypto/amlogic/amlogic-gxl-cipher.c | 27 +++--- > drivers/crypto/amlogic/amlogic-gxl.h | 3 +- > drivers/crypto/ccp/ccp-crypto-aes-xts.c | 33 ++++--- > drivers/crypto/ccp/ccp-crypto.h | 4 +- > drivers/crypto/chelsio/chcr_algo.c | 57 +++++------ > drivers/crypto/chelsio/chcr_crypto.h | 3 +- > drivers/crypto/mediatek/mtk-aes.c | 63 ++---------- > drivers/crypto/mxs-dcp.c | 33 +++---- > drivers/crypto/omap-aes.c | 35 ++++--- > drivers/crypto/omap-aes.h | 3 +- > drivers/crypto/picoxcell_crypto.c | 38 ++++---- > drivers/crypto/qce/cipher.h | 3 +- > drivers/crypto/qce/skcipher.c | 42 ++++---- > drivers/crypto/sahara.c | 96 +++++++++---------- > 22 files changed, 280 insertions(+), 328 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