From patchwork Fri Aug 11 09:27:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herbert Xu X-Patchwork-Id: 13350274 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94D6FC001B0 for ; Fri, 11 Aug 2023 09:27:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234897AbjHKJ1o (ORCPT ); Fri, 11 Aug 2023 05:27:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233925AbjHKJ1n (ORCPT ); Fri, 11 Aug 2023 05:27:43 -0400 Received: from 167-179-156-38.a7b39c.syd.nbn.aussiebb.net (167-179-156-38.a7b39c.syd.nbn.aussiebb.net [167.179.156.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F8D7110 for ; Fri, 11 Aug 2023 02:27:40 -0700 (PDT) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1qUOQh-0020V0-EN; Fri, 11 Aug 2023 17:27:36 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 11 Aug 2023 17:27:35 +0800 Date: Fri, 11 Aug 2023 17:27:35 +0800 From: Herbert Xu To: Linux Crypto Mailing List Cc: Gaurav Jain Subject: [PATCH 0/36] Move crypto_engine callback into algorithm object Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org As it stands, every crypto_engine user sets up callbacks in struct crypto_engine_ctx which is stored at the head of the tfm context. This is error-prone because there is no guarantee for that callback to be there at all. In fact this is exactly what happened when the tfm context was moved for DMA alignment. The first part of this series eliminates the unnecessary prepare and unprepare callbacks so that only one function remains. Then that last callback is moved into the algorithm object. This is checked by using special register/unregister functions that are specific to crypto_engine. Cheers,