Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp419668pxu; Fri, 11 Dec 2020 05:39:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqwcXC98NlPXt80O6j6und8BPmqwq+t+BW0VBOxjtShRoK8C/sennpgPZulL20CiIok2op X-Received: by 2002:a17:906:34ca:: with SMTP id h10mr11206241ejb.417.1607693952046; Fri, 11 Dec 2020 05:39:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607693952; cv=none; d=google.com; s=arc-20160816; b=rDafIaCC8fwtctA/hqwMfmwPja7q9asAM9eZdh9oq4CAJGntYFcG9eUmhAqBHcCSyE YfpglKTihTjDlsMqQfa2KUXtxDb5VxU2HmvBbWkknNJVBggNZBzYPTpBpDwOEdkBiGZY Ij+X3uINmPIR5PLMFczrAEAqkCUkW4JI/zWmREctA0wg40fXTE4XLxB5KCnpfZT2JFC8 X2lp07IK6IW6pPhXhddyNxPZyQWLThmL24bAM5vwi0jdDcw+WvSYeFaTvZZmB7w8Gmx0 hBKaueAp711jUEbs8jxyyC8Ei/ncaoMqCEl4DskVEqlKckc4En55jeUYX/eDuuN16Rtq R+1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=+a6QYaLLtQVUGRba+jhsALBggCtQxblElkcyP4rFf+0=; b=enAYgj7VKlBK4wQkbbqE0KOLSNiXZ4BLvi3sp9k0DE6h3DAekCR/s0tQ8vxYvb9S23 QUwKK7pkjgZHiZ63Jsqf9zYS1yowRniVL1h8FP2U6Bi2HuV8iPdZC0UmsIGhj0xzT/eZ f7PHJGhsh8TfcV4LjBIhqFNwqKr8wn9mUNaxgHnDEEipKUQc38g3SCoNfmtRTzGSWDJ4 lww3S9RsDfBntyJsoi1DlanBtpPfZT+5A0uEkv1aMtZMAZZqY8v1dKRO1PMutrbecGxz 8Rt2xovXLz0b1l/9nR4/aKN4JLfzdu1Pj+vyl/IYM0ebMiFvpceGPYocu6sEiDLtkVVZ b/rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KtEmvc1q; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p1si4343310ejw.42.2020.12.11.05.38.48; Fri, 11 Dec 2020 05:39:12 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KtEmvc1q; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727323AbgLKKnn (ORCPT + 99 others); Fri, 11 Dec 2020 05:43:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:50336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390233AbgLKKnA (ORCPT ); Fri, 11 Dec 2020 05:43:00 -0500 X-Gm-Message-State: AOAM530MCtu4PcfNQP21mxYujqHnCY/WzzcuFgTxJtJx4K+aRy3PY6UZ HU7J42V5XPPDjPJsl5YyTYUE8IPx7iysm2P20sw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607683340; bh=2t9pEWVw7pzE9pIhgFfJ7Q4L3pamisj5RJVp5inOjD0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=KtEmvc1q3PU+vPnml1LfDUExrnFo0OtoTi9yY0ywuHZQxcOtRtwa69VkzZpD+9WN5 ReGTYwQ3cHVd+qaFVEZzDbohc7hjG2HlkmAhUjeCLKErH713XpLOpb272FeElDh180 t8IA0468Ru+aEZV9P7qwPFHykMQI6c8zLvJTVJL/eSzjkx65ugt/nhHiEZhTVeLDrU wDBcovwAypLLoPsKVdsKu2Jq6nBwvYhpwAuwQem02uAFzNkhcR4sJJ4JNroLtg1517 odGZEZKyoLvgls+mHdvLIkX9R+qnQZBbRy7OoG1C9UNluLvYXyruikNFYxoygOMXbN XTDjP1OvCjjTw== X-Received: by 2002:aca:b809:: with SMTP id i9mr8674838oif.174.1607683339167; Fri, 11 Dec 2020 02:42:19 -0800 (PST) MIME-Version: 1.0 References: <20201201142451.138221-1-giovanni.cabiddu@intel.com> <20201201142451.138221-3-giovanni.cabiddu@intel.com> <20201211100748.GA994@gondor.apana.org.au> In-Reply-To: <20201211100748.GA994@gondor.apana.org.au> From: Ard Biesheuvel Date: Fri, 11 Dec 2020 11:42:08 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/3] crypto: qat - add AES-XTS support for QAT GEN4 devices To: Herbert Xu Cc: Giovanni Cabiddu , Linux Crypto Mailing List , qat-linux , Marco Chiappero , Tomaszx Kowalik Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, 11 Dec 2020 at 11:07, Herbert Xu wrote: > > On Tue, Dec 01, 2020 at 02:24:50PM +0000, Giovanni Cabiddu wrote: > > > > @@ -1293,6 +1366,12 @@ static int qat_alg_skcipher_init_xts_tfm(struct crypto_skcipher *tfm) > > if (IS_ERR(ctx->ftfm)) > > return PTR_ERR(ctx->ftfm); > > > > + ctx->tweak = crypto_alloc_cipher("aes", 0, 0); > > + if (IS_ERR(ctx->tweak)) { > > + crypto_free_skcipher(ctx->ftfm); > > + return PTR_ERR(ctx->tweak); > > + } > > + > > reqsize = max(sizeof(struct qat_crypto_request), > > sizeof(struct skcipher_request) + > > crypto_skcipher_reqsize(ctx->ftfm)); > > This may clash with the work that Ard is doing on simpler ciphers. > > So I think this should switch over to using the library interface > for aes. What do you think Ard? > I think this is a valid use of a bare cipher - it lives as long as the TFM itself, and may be used on a hot path. I need to respin the bare cipher change I sent the other day anyway, so I'll make sure this driver gets the right treatment as well (which shouldn't cause any conflicts so the changes can be merged in any order)