Received: by 10.223.176.46 with SMTP id f43csp1069951wra; Fri, 26 Jan 2018 11:20:19 -0800 (PST) X-Google-Smtp-Source: AH8x226gN3XZMyGqE+dAA64Hun1lpDpLq28CU2dJupnSxn4xuNzbjYU0TxgfOw2aWqZHQGIyAEc9 X-Received: by 10.101.82.130 with SMTP id y2mr16767714pgp.109.1516994419448; Fri, 26 Jan 2018 11:20:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516994419; cv=none; d=google.com; s=arc-20160816; b=pZebF1ceY22I9BfAltvqo/xGQPssJEvah9QNDdfvay9SNVdgXPxi9iK/VsFIWOJa0M FcXgJN5hFgoxgrCxZpol+W5qbwUC3LHYVyKPMSbaU4bwD88OX/TPTPYZMuyhOzxMo3WF lP3wu8zZ0b7Wv8rq10tgQxWerT5iQl3bWn6DTGO0dpP4+X1CHM0HPzVLLuKvWsw00dCQ wdH+2uoLoEznARdT1k+ZPyjOdLyAPkSrDlNP/o3ot3ojdhGR0vKU1D4UaARjuUpxbnw1 0aZXqw0cl8NE5bIUzfE4JTc8v8xEZTJRNJCDEqOeddbJHnublZH3tLptl4L3uT/P6Kcq DOqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=SjpswPTll9ww7DOYL8WBzRg5vbdcqZRkZqd1Mj6dk+U=; b=V/sGARskNn8ib+ApvG4NO0deSnYI4ORl12jwuW7z65IL9L0IKikkDawXZdDRSjfU8r RalNw4Qrl/PvZzHFeNfSztJQkbCeR/zuo0rxV73jdhbYuLf71QoYLdZjN3mypZOGVL4G wJORqB+pKAeeBCubR7hCbSksAqIy3HIRUc1Ba7xgLIaUw36+JBHalSD2kjp+e4BaeBJi PboWwIJQlbFWtsvpd81zaD4l78NsvLxeykYRRGS0RZttqzlYPp3rQFciArrvbNx9OMuy j0Ey5IgjPBU2AMGKfc/nAkryVUSgww66WklU0tYMqT2h70hrgQsuwjUhgvLVDt3tMisN utbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pMWmlYg3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y90si3831926pfi.5.2018.01.26.11.20.05; Fri, 26 Jan 2018 11:20:19 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pMWmlYg3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752680AbeAZTSF (ORCPT + 99 others); Fri, 26 Jan 2018 14:18:05 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:37388 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751609AbeAZTSB (ORCPT ); Fri, 26 Jan 2018 14:18:01 -0500 Received: by mail-wr0-f194.google.com with SMTP id f11so1407716wre.4; Fri, 26 Jan 2018 11:18:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=SjpswPTll9ww7DOYL8WBzRg5vbdcqZRkZqd1Mj6dk+U=; b=pMWmlYg3z4ovESGrmkKjjYv0pNgt30zfIib39Iko60OKXBSjbXfqwdlebV9HU4nbhR IDNLMeFNKf6tSHaHFGzikHgj5A4SAAqqmf1x/w353B9ueq6wAeosCrrDLH55iiTEAGnP wU8JjXcW605f/rfNgbjlzlpIisGLXbzaIwT50QI2MrkBe2yyDwmJcH+urc4iJrsGs5rE JAUWdnk0Q5T27U1LDEAMWm3VJRPIdRfesnnCwezm5hGsPjLkMKIzCbzPdBUihBEKAKfs ZO5XNurUf8RtDL5RZRmyRQRfev5oQiWrYLb5BWeAi17WeiAriXnhC10x2P/j0gdZYxdp uLfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=SjpswPTll9ww7DOYL8WBzRg5vbdcqZRkZqd1Mj6dk+U=; b=G0oBBIoTxbSwWDcMUwK3Fmj43o4NvmCFixXmS4i1JP45XpLRcmJ5X/3hfLH2gSVDW7 omMy2iJv2WQJIdZl3p6ZTtAv2ZH9b14P3QmwaWIw2yNnVamK4c9drTM+7WbNaCYitDsP /qU+qI6xyOgxDAE3o+nyJO8FciE9dCMgzcCvt51znWWjyz7CDSu4/W3+KcFZWmXSs7dO 2zZnjlb5PNpDripvKipktpYoj7tCsFi2tgBONi13rk5vXaR/BW18VX59dSMsrX9csCec ik/4SIjQHjSTCx+RU3VW6uugj4Ojt0tueJLyMB+moknMcuP5He+ww0L0qj8NoWjrg4Er cb9Q== X-Gm-Message-State: AKwxyteG//VAK4pDGcEU0Dl9uKhWl5/uj944NIu6X+PqxMHlpGUOYeiG /R1SK0RLfewQhsqttciGPO3RRE5w X-Received: by 10.223.187.72 with SMTP id x8mr13868745wrg.179.1516994280266; Fri, 26 Jan 2018 11:18:00 -0800 (PST) Received: from Red.local (LFbn-MAR-1-494-174.w2-15.abo.wanadoo.fr. [2.15.82.174]) by smtp.googlemail.com with ESMTPSA id k125sm7587510wmd.48.2018.01.26.11.17.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jan 2018 11:17:58 -0800 (PST) From: Corentin Labbe To: alexandre.torgue@st.com, arei.gonglei@huawei.com, corbet@lwn.net, davem@davemloft.net, herbert@gondor.apana.org.au, jasowang@redhat.com, mcoquelin.stm32@gmail.com, mst@redhat.com, fabien.dessenne@st.com Cc: linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-sunxi@googlegroups.com, Corentin Labbe Subject: [PATCH v2 0/6] crypto: engine - Permit to enqueue all async requests Date: Fri, 26 Jan 2018 20:15:28 +0100 Message-Id: <20180126191534.17569-1-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.13.6 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello The current crypto_engine support only ahash and ablkcipher request. My first patch which try to add skcipher was Nacked, it will add too many functions and adding other algs(aead, asymetric_key) will make the situation worst. This patchset remove all algs specific stuff and now only process generic crypto_async_request. The requests handler function pointer are now moved out of struct engine and are now stored directly in a crypto_engine_reqctx. The original proposal of Herbert [1] cannot be done completly since the crypto_engine could only dequeue crypto_async_request and it is impossible to access any request_ctx without knowing the underlying request type. So I do something near that was requested: adding crypto_engine_reqctx in TFM context. Note that the current implementation expect that crypto_engine_reqctx is the first member of the context. The first patch is a try to document the crypto engine API. The second patch convert the crypto engine with the new way, while the following patchs convert the 4 existing users of crypto_engine. Note that this split break bisection, so probably the final commit will be all merged. Appart from virtio, all 4 latest patch were compile tested only. But the crypto engine is tested with my new sun8i-ce driver. Regards [1] https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1474434.html Changes since V1: - renamed crypto_engine_reqctx to crypto_engine_ctx - indentation fix in function parameter - do not export crypto_transfer_request - Add aead support - crypto_finalize_request is now static Changes since RFC: - Added a documentation patch - Added patch for stm32-cryp - Changed parameter of all crypto_engine_op functions from crypto_async_request to void* - Reintroduced crypto_transfer_xxx_request_to_engine functions Corentin Labbe (6): Documentation: crypto: document crypto engine API crypto: engine - Permit to enqueue all async requests crypto: omap: convert to new crypto engine API crypto: virtio: convert to new crypto engine API crypto: stm32-hash: convert to the new crypto engine API crypto: stm32-cryp: convert to the new crypto engine API Documentation/crypto/crypto_engine.rst | 48 +++++ crypto/crypto_engine.c | 301 +++++++++++++++------------ drivers/crypto/omap-aes.c | 21 +- drivers/crypto/omap-aes.h | 3 + drivers/crypto/omap-des.c | 24 ++- drivers/crypto/stm32/stm32-cryp.c | 29 ++- drivers/crypto/stm32/stm32-hash.c | 20 +- drivers/crypto/virtio/virtio_crypto_algs.c | 16 +- drivers/crypto/virtio/virtio_crypto_common.h | 3 +- drivers/crypto/virtio/virtio_crypto_core.c | 3 - include/crypto/engine.h | 68 +++--- 11 files changed, 332 insertions(+), 204 deletions(-) create mode 100644 Documentation/crypto/crypto_engine.rst -- 2.13.6