Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2771108imm; Fri, 20 Jul 2018 04:46:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfywdTn4F1dCedt12uc0NE7xyXHP6aEC7ShOVrYowPcxzckODg34RzG6qndiTPtQZdKewY3 X-Received: by 2002:a65:40ca:: with SMTP id u10-v6mr1771302pgp.2.1532087200255; Fri, 20 Jul 2018 04:46:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532087200; cv=none; d=google.com; s=arc-20160816; b=pDy12c+SoekMfWHiaD825vguq536FvKr0lMW2Z8TaPGi1VIW7gUmaV7N2XJwdXudga 6PpZr4lIAMVqSPr3jtdrukYArLW2Wn1O/3/uPStIPPCRwO0btS6P6TFWEHPwe4QYOlzW lCQ1pKLTR6jUQaHgs1cLwPOdLmOoBmsrW7SemLg+YJzWfRQQvARJWHXeceOBfivQZipG xwfVJzgB9foU/3ii/cwe3hWZW6Pjn7T5JBOU8dlVSvOx+tYOKLFNna+VkWMLgpwR8a9f JDvuHnmow91U5BYFNA0m/uU2U/OHp8SPU4hp6yuOjMYJGHa3f7NqzULFZpTGfkHhNZq7 fd8A== 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:dkim-signature:arc-authentication-results; bh=f818n1gZTZhbN1EYhmiY+1eRCpC3kyC0eUV5hsrW/qg=; b=KZUAxN2rFoYcnSu5uXgzJJRUqefN3acEdhYQIxr92cc4DsD8WI/72FrGQ9BqPwEMPr piwz/z7V39lmHvbvUeLkRGhxzaquQfnNYZQhud4wPqEok7METcVFAmXk7ZKShCEJ1yOT DoaFEfeOWZ44MAbtqHWOfyGfFhCuWD+kCkwHNPipaEASi0z3lptq6Uv6ngQBCrvQ+oDK XCslK3iKg+npelnXHsIEBDg8FCC4HQjT6YK+qRQdhofk5N9pvqAZSv24pcjg042csrHy SROB+dfzD75Mip4rltTdykpWVLn4QVdAvjc4rqpk4riWy6q00sFmhwOr5IQEA7m/vPrb oxjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=h2aLNmO+; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b7-v6si1879178plk.29.2018.07.20.04.46.10; Fri, 20 Jul 2018 04:46:40 -0700 (PDT) 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; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=h2aLNmO+; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728362AbeGTMdL (ORCPT + 99 others); Fri, 20 Jul 2018 08:33:11 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:36316 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727408AbeGTMdL (ORCPT ); Fri, 20 Jul 2018 08:33:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=f818n1gZTZhbN1EYhmiY+1eRCpC3kyC0eUV5hsrW/qg=; b=h2aLNmO+yksjiyJV3+CG6soY/ ji4eK+8iTm66YvCpL6c257jnObE7vd9cnxyTHHybR6tRBcqlyN0yHEjji2do0+mfZ68upyVW3zqP2 NOlNBNwih0L0E3Zwx4WjKBDicELn5GpnQ/rNRX4bIlrHgpr5e56rIn2WhqzaX2+6pIKtA=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fgTqQ-0008Ka-O0; Fri, 20 Jul 2018 11:45:10 +0000 Received: from broonie by debutante with local (Exim 4.91) (envelope-from ) id 1fgTqP-00059h-TG; Fri, 20 Jul 2018 12:45:09 +0100 Date: Fri, 20 Jul 2018 12:45:09 +0100 From: Mark Brown To: Ard Biesheuvel Cc: Xiongfeng Wang , Arnd Bergmann , Alasdair Kergon , Mike Snitzer , Herbert Xu , dm-devel@redhat.com, Linux Kernel Mailing List , Jonathan Cameron Subject: Re: [PATCH 0/5] crypto: add IV generation templates Message-ID: <20180720114509.GA10784@sirena.org.uk> References: <1531899055-29362-1-git-send-email-wangxiongfeng2@huawei.com> <5d0bb72c-862e-63be-3cc5-83ed02b9a575@huawei.com> <20180719155026.GF27938@sirena.org.uk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="0F1p//8PRICkK4MW" Content-Disposition: inline In-Reply-To: X-Cookie: This unit... must... survive. User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --0F1p//8PRICkK4MW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Jul 20, 2018 at 10:02:21AM +0900, Ard Biesheuvel wrote: > On 20 July 2018 at 00:50, Mark Brown wrote: > > Existing hardware can definitely do the IV generation and I believe that > > it can chain multiple sectors together though I'd need to confirm this, > > as mentioned elsewhere in the thread the ccree driver is for one of > > the relevant devices. I've poked some relevant people. > As far as I can infer from the ccree driver source, IV generation and > en/decryption are separate operations, and given that each sector > requires both operations to be applied in sequence, letting the crypto > layer handle an entire bio does not have any benefit *at the moment*. Interesting... they were reporting some benefits from that with their out of tree driver prior to upstreaming (and there are other implementations out there, that's the only one I definitely know about). I have to confess I didn't look at their in tree driver, looking briefly now it looks awfully like the hardware should be able to chain IV generation together with encryption without bothering the CPU which would be good enough. > In fact, it seems to me that the ability to use protected AES keys is > much more appealing than any performance argument (including 'it may > be slower but at least it does not load the CPU'), so some background > on how such a change would enable this use case would be beneficial as > well to getting this adopted. Right, that's another benefit which was on the radar for followup work. > So my recommendation would be to focus on moving the IV generation > into the crypto layer, but conservatively, and not confuse people by > making additional changes that could theoretically improve > performance, but only on hardware that does not exist. It certainly seems like splitting things up will at least allow things to progress. --0F1p//8PRICkK4MW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAltRy0UACgkQJNaLcl1U h9D4cAf/UeA1QxAG8k/NTSGp51av2cdaz/Een7dRZFxOJcXArVrBiJFvNIT//4OX F7vKF9RFwOFi+okI30UvaLKslVPryr3wi7cLubcwsrJnCgPvYFTcrfkOwZu1FCs3 BmT+w+eSiUIrd2dy+Lobb8rzSQPIJDPW5mo6zvAPK8Ml1mpNyrAgbg4AgH2KkCWm oLBEYxhg7348vL65RrYEbYNDvIpZ54chIrxwFsknVK1iSEm+orJR0k9EFMhw7wmZ XSie3/248JCKl0A/poweBaGXoxjRJM9ilSD2HICwodFJImwfmtiH6+XPMaibheTY Q6gEEiIPvz+o6snHzsD4qKSBOwRJQA== =5nTD -----END PGP SIGNATURE----- --0F1p//8PRICkK4MW--