From patchwork Wed May 5 20:26:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 12240967 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2941C433B4 for ; Wed, 5 May 2021 20:26:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 86AF2613FE for ; Wed, 5 May 2021 20:26:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235007AbhEEU1Z (ORCPT ); Wed, 5 May 2021 16:27:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234960AbhEEU1Z (ORCPT ); Wed, 5 May 2021 16:27:25 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7599AC061761 for ; Wed, 5 May 2021 13:26:27 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id l14so3219604wrx.5 for ; Wed, 05 May 2021 13:26:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=S273ylil1PBH+oZMCXQ1Btaew0sXCYLtOcO/7ouch+o=; b=Bp6HZMSaLNoIULe4qbu9CLZlGZ7utjPsMXEQtuOG8/BtcvADcx19+D/9ww7KNqF+7D M2n4Cqq4ih3tGNbo+PgFTs0taaA9Lt6AwnZLPhEj/2mJbsrsYAiE/RrCugW52xwX68Fu hYK511GB88qex+LnAw07rP3R+dluaG4oJdjUVJDMkSSS2CX80QwZb0HKA9d60K9HKzs7 9hZNNnHfxeIhQZ9zd0EL1PabJh8kjYxdFoxfsBHr0EFRLCVbEa0U3pv/yKgyYsI/yul+ YeifOi1qU/6UP0n2Vitst52NyhU514Z2fzc2vLNgTrVqOmJFHOhbfJDUuUrRYbx++G5L ae1A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=S273ylil1PBH+oZMCXQ1Btaew0sXCYLtOcO/7ouch+o=; b=W8D3A8QHIKVtVPmH7Ifo5Gt3Q8ScvqbHcdJ8S4f5QaJ3zAkX2TLLVVFFSUhTDYD8uT kpOukM/2n2SNDd7XCnTDHs/1Ptue7ev8oefI4R68cbAYAbLcvrzN4aFkNB1koAVtjXA0 6D/XHDEAgrZOZs8qZl6gBAPtbthru4QqMoWGj96sgYVQjICoz5SxzGnpae4R7HyAF1Vi br0DzqF6OsKOkAF91NlTE4xK4LtEXH0ujDzbyrywqepYWM9n3i1MOJoZKDHDKVL9Sh99 IxikgY8TOvL2oDbWpcOR+8c7G4NcFT2PwLbK9MDtee/qDXRrMjNhnzxfYCBHCobI5Ios lpjQ== X-Gm-Message-State: AOAM5306XlJUPKiaOJg35I8hRXWpYW9di0vNIKBZdufkYjUZ7OcPwxCb ySrwFsS1zM6RvPO9bgvc/pCORg== X-Google-Smtp-Source: ABdhPJxACmwt02PG410uR0gx8Unli3fyhvkP/Vj4uJ7iNpjW4OQhnE9zZ1GjnCbbKd0+5wCmoamg/A== X-Received: by 2002:a5d:4e06:: with SMTP id p6mr880333wrt.378.1620246386091; Wed, 05 May 2021 13:26:26 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a15sm497245wrr.53.2021.05.05.13.26.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 13:26:25 -0700 (PDT) From: Corentin Labbe To: chohnstaedt@innominate.com, davem@davemloft.net, herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH 01/11] crypto: ixp4xx: dma_unmap the correct address Date: Wed, 5 May 2021 20:26:08 +0000 Message-Id: <20210505202618.2663889-2-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210505202618.2663889-1-clabbe@baylibre.com> References: <20210505202618.2663889-1-clabbe@baylibre.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Testing ixp4xx_crypto with CONFIG_DMA_API_DEBUG lead to the following error: DMA-API: platform ixp4xx_crypto.0: device driver tries to free DMA memory it has not allocated [device address=0x0000000000000000] [size=24 bytes] This is due to dma_unmap using the wrong address. Fixes: 0d44dc59b2b4 ("crypto: ixp4xx - Fix handling of chained sg buffers") Signed-off-by: Corentin Labbe --- drivers/crypto/ixp4xx_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index 0616e369522e..ed3deaa5ed2b 100644 --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/crypto/ixp4xx_crypto.c @@ -330,7 +330,7 @@ static void free_buf_chain(struct device *dev, struct buffer_desc *buf, buf1 = buf->next; phys1 = buf->phys_next; - dma_unmap_single(dev, buf->phys_next, buf->buf_len, buf->dir); + dma_unmap_single(dev, buf->phys_addr, buf->buf_len, buf->dir); dma_pool_free(buffer_pool, buf, phys); buf = buf1; phys = phys1; From patchwork Wed May 5 20:26:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 12240971 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE56EC43461 for ; Wed, 5 May 2021 20:26:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9BF3C61401 for ; Wed, 5 May 2021 20:26:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234960AbhEEU10 (ORCPT ); Wed, 5 May 2021 16:27:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234987AbhEEU1Z (ORCPT ); Wed, 5 May 2021 16:27:25 -0400 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E81FC06174A for ; Wed, 5 May 2021 13:26:28 -0700 (PDT) Received: by mail-wm1-x334.google.com with SMTP id n84so2181015wma.0 for ; Wed, 05 May 2021 13:26:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=geSaV6u3XqnSyXvPUEqcEIkcIHLSdxJiGRaPxg2uuDM=; b=2CYr0rnZRPnS5emc9+jzaU3nBdpUQiMsCZINuwplZ1aNmCXhl7qL1YezNJyUFcfOoQ fiAbbwHdjI8w18qPAH3Q1Idw5bcXAw+2enxtWgB4Fet3v6yVCrggBFvyv/sEkeCixBmj bjE6BFRRSo6msfmEnzCmeD2qkaV+MLrYU+MZnQ963AKCRgPP6x/BgPk17tYWePzaQeuy ldfvs/Nkw5Xbr/VC9SyfJlrKgcGNE1RI3dFFbV9wvQvN0D9yKp6g38dnFENlcAfBr0Xp Legpoxrvo7tw1viDkUR1N9tJS+Xw2vq+2cfj8inow2ffYj9Z7dtpZd8IiKh+/NxUfmOQ 8eDg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=geSaV6u3XqnSyXvPUEqcEIkcIHLSdxJiGRaPxg2uuDM=; b=S/Z5n39mjHWdIpXcsejcRDF3x2vq6RcU/PD/+K8qjW0GW+XFinQR/rzgiH8aAYzAwd RocXp56MLEOYWhxAKPc6bc0WGCUY26ybsh/dcnlJV0jGJuFcXQyS0hYwFz5tcRAUF/GX dk+th3cJpehYVeWLsruM2tnhm0ZGfY+x2raXcxDa3rjWzqpydRTdz4ASp7S7IXg0l2LN q8wSNSobV7Jpl8GtKAm9oROPnw2cH2nkEYYFh+e/17tuRv5Ko9atETzI3MXwj8Zuq8Su /kxZcQ61EB1JU8u168T/VpiVWAoF4Sd/vfje5W74MS6KMKcZ8pJiL/VbMPZA1jbwuFcB TYWw== X-Gm-Message-State: AOAM530+sXlYDpCHLpeHSAq9PtJj8qahimMU/WEYabTeIPsabYu9DCF7 4nrEbuCECFVY11i7zNPzfwsLGA== X-Google-Smtp-Source: ABdhPJz4jwSCHfYQdFcvocO9Uyyjdfg6thYq+WyJkC1A6vR1jLLoHo3E3+t+8qjoQLRGH/E0pY1pfQ== X-Received: by 2002:a1c:7209:: with SMTP id n9mr553944wmc.60.1620246386839; Wed, 05 May 2021 13:26:26 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a15sm497245wrr.53.2021.05.05.13.26.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 13:26:26 -0700 (PDT) From: Corentin Labbe To: chohnstaedt@innominate.com, davem@davemloft.net, herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH 02/11] crypto: ixp4xx: update IV after requests Date: Wed, 5 May 2021 20:26:09 +0000 Message-Id: <20210505202618.2663889-3-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210505202618.2663889-1-clabbe@baylibre.com> References: <20210505202618.2663889-1-clabbe@baylibre.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Crypto selftests fail on ixp4xx since it do not update IV after skcipher requests. Fixes: 81bef0150074 ("crypto: ixp4xx - Hardware crypto support for IXP4xx CPUs") Signed-off-by: Corentin Labbe --- drivers/crypto/ixp4xx_crypto.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index ed3deaa5ed2b..f577ee4afd06 100644 --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/crypto/ixp4xx_crypto.c @@ -149,6 +149,8 @@ struct crypt_ctl { struct ablk_ctx { struct buffer_desc *src; struct buffer_desc *dst; + u8 iv[MAX_IVLEN]; + bool encrypt; }; struct aead_ctx { @@ -381,6 +383,20 @@ static void one_packet(dma_addr_t phys) case CTL_FLAG_PERFORM_ABLK: { struct skcipher_request *req = crypt->data.ablk_req; struct ablk_ctx *req_ctx = skcipher_request_ctx(req); + struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); + unsigned int ivsize = crypto_skcipher_ivsize(tfm); + unsigned int offset; + + if (ivsize > 0) { + offset = req->cryptlen - ivsize; + if (req_ctx->encrypt) { + scatterwalk_map_and_copy(req->iv, req->dst, + offset, ivsize, 0); + } else { + memcpy(req->iv, req_ctx->iv, ivsize); + memzero_explicit(req_ctx->iv, ivsize); + } + } if (req_ctx->dst) { free_buf_chain(dev, req_ctx->dst, crypt->dst_buf); @@ -876,6 +892,7 @@ static int ablk_perform(struct skcipher_request *req, int encrypt) struct ablk_ctx *req_ctx = skcipher_request_ctx(req); struct buffer_desc src_hook; struct device *dev = &pdev->dev; + unsigned int offset; gfp_t flags = req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ? GFP_KERNEL : GFP_ATOMIC; @@ -885,6 +902,7 @@ static int ablk_perform(struct skcipher_request *req, int encrypt) return -EAGAIN; dir = encrypt ? &ctx->encrypt : &ctx->decrypt; + req_ctx->encrypt = encrypt; crypt = get_crypt_desc(); if (!crypt) @@ -900,6 +918,10 @@ static int ablk_perform(struct skcipher_request *req, int encrypt) BUG_ON(ivsize && !req->iv); memcpy(crypt->iv, req->iv, ivsize); + if (ivsize > 0 && !encrypt) { + offset = req->cryptlen - ivsize; + scatterwalk_map_and_copy(req_ctx->iv, req->src, offset, ivsize, 0); + } if (req->src != req->dst) { struct buffer_desc dst_hook; crypt->mode |= NPE_OP_NOT_IN_PLACE; From patchwork Wed May 5 20:26:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 12240969 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85B7FC43462 for ; Wed, 5 May 2021 20:26:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 658BD613E3 for ; Wed, 5 May 2021 20:26:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235095AbhEEU11 (ORCPT ); Wed, 5 May 2021 16:27:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235083AbhEEU1Z (ORCPT ); Wed, 5 May 2021 16:27:25 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF0B6C061574 for ; Wed, 5 May 2021 13:26:28 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id v12so3206272wrq.6 for ; Wed, 05 May 2021 13:26:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CgrHm6Q90zjDRy0KRwh+JENVRSFDVxbeIMRBWZ7YN/A=; b=rqDNGo7A6N3zbpzj1Qdw0DbYSYpZLOEglDtMw0CcUfdBTgjCF7erUBAvHYAnUXYifz 3v63Kpgu/LyAGmtm2iKVY+nsDcZDABPADDqEpA6NgHKsAb+bSp5jGCxcT6tPkJ22ij5g 0mCCRg20lonItxaM3F9XzdzacwL1MxO5RnKxTBlFdsIhL4BH4DPr2xt/RN4o7dvZiDat mZYz8WO2ztQSRhBZ1XqFTv8tKuxvqXz+NJT+XT5ze7II38KdOdj3HgMQPxSg8gySUg9Y a0QXivhHuatbgEOucqOA+rY8gAfDnEK0kM7ahJjN3FesaUJzudcsZL1DC2z+NSuewSsF G3Gw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=CgrHm6Q90zjDRy0KRwh+JENVRSFDVxbeIMRBWZ7YN/A=; b=WGIXaG7HJgwsqkFDBRl4OZxcN0BiprCWTcedOAZIW0qWCuA0UMXuIOlu2rdUhwPFkc zO+cnWrRQU/YY9cdrFAFWvVZn4q7EloYKi9OkE3ZuBo66x4TMSKQdQztRCTd6NVdJdy/ u94z1OBiHKANbwC9CxtZ+ZPgbRdgWCC1CQUv9Blkw7nVLuvzCc8PpwBLlIaAaIk7WsdR lXHkJDjpMQP9b4b503BQtaeT++HyV5dPDqf8vJMIQ5EQTaP7SeGA6R9/rB3H2rLY/s2q 2tJaFMdQRnqmo+ZWzoofq6y9ijFWau7blvTqkj2iOmq6fEy75T+EjedDrpYXehR20b9C VmFg== X-Gm-Message-State: AOAM532r8aM4YdEtNmBJV1XtGi9Iaw/kor6niDS1BwEE3Qv4O8XKNv7B CfNT2rZsn4V2JYDOcaxDkpWkkszxFz9DkUog X-Google-Smtp-Source: ABdhPJyxRKuwmCU24zeemGcj/kmbc/ZFilTchkkJpzY6NwsyHgMGqngG8eTPbcoVfGqIDm62McaULQ== X-Received: by 2002:adf:9d48:: with SMTP id o8mr867886wre.183.1620246387606; Wed, 05 May 2021 13:26:27 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a15sm497245wrr.53.2021.05.05.13.26.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 13:26:27 -0700 (PDT) From: Corentin Labbe To: chohnstaedt@innominate.com, davem@davemloft.net, herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH 03/11] crypto: ixp4xx: fallback when having more than one SG Date: Wed, 5 May 2021 20:26:10 +0000 Message-Id: <20210505202618.2663889-4-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210505202618.2663889-1-clabbe@baylibre.com> References: <20210505202618.2663889-1-clabbe@baylibre.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Testing ixp4xx_crypto lead to: alg: skcipher: ecb(des)-ixp4xx encryption overran dst buffer on test vector 0, cfg="two even aligned splits" The HW overwrites destination always when sg_nents() > 1. The problem seems that the HW always write areq->cryptlen bytes on the last SG. A comment in driver's code seems to give a clue that multiple SG was not planned "This was never tested by Intel for more than one dst buffer, I think". So let's add a fallback for this situation. Signed-off-by: Corentin Labbe --- drivers/crypto/Kconfig | 5 +++ drivers/crypto/ixp4xx_crypto.c | 56 ++++++++++++++++++++++++++++++++-- 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 11487ac526ff..9dbed5e2e8a5 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig @@ -344,6 +344,11 @@ config CRYPTO_DEV_TALITOS2 config CRYPTO_DEV_IXP4XX tristate "Driver for IXP4xx crypto hardware acceleration" depends on ARCH_IXP4XX && IXP4XX_QMGR && IXP4XX_NPE + select CRYPTO_AES + select CRYPTO_DES + select CRYPTO_ECB + select CRYPTO_CBC + select CRYPTO_CTR select CRYPTO_LIB_DES select CRYPTO_AEAD select CRYPTO_AUTHENC diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index f577ee4afd06..8bbf2ead6e79 100644 --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/crypto/ixp4xx_crypto.c @@ -151,6 +151,7 @@ struct ablk_ctx { struct buffer_desc *dst; u8 iv[MAX_IVLEN]; bool encrypt; + struct skcipher_request fallback_req; // keep at the end }; struct aead_ctx { @@ -186,6 +187,7 @@ struct ixp_ctx { unsigned salted; atomic_t configuring; struct completion completion; + struct crypto_skcipher *fallback_tfm; }; struct ixp_alg { @@ -590,7 +592,23 @@ static int init_tfm(struct crypto_tfm *tfm) static int init_tfm_ablk(struct crypto_skcipher *tfm) { - crypto_skcipher_set_reqsize(tfm, sizeof(struct ablk_ctx)); + struct crypto_tfm *ctfm = crypto_skcipher_tfm(tfm); + struct ixp_ctx *ctx = crypto_tfm_ctx(ctfm); + const char *name = crypto_tfm_alg_name(ctfm); + + ctx->fallback_tfm = crypto_alloc_skcipher(name, 0, CRYPTO_ALG_NEED_FALLBACK); + if (IS_ERR(ctx->fallback_tfm)) { + pr_err("ERROR: Cannot allocate fallback for %s %ld\n", + name, PTR_ERR(ctx->fallback_tfm)); + return PTR_ERR(ctx->fallback_tfm); + } + + pr_info("Fallback for %s is %s\n", + crypto_tfm_alg_driver_name(&tfm->base), + crypto_tfm_alg_driver_name(crypto_skcipher_tfm(ctx->fallback_tfm)) + ); + + crypto_skcipher_set_reqsize(tfm, sizeof(struct ablk_ctx) + crypto_skcipher_reqsize(ctx->fallback_tfm)); return init_tfm(crypto_skcipher_tfm(tfm)); } @@ -609,6 +627,10 @@ static void exit_tfm(struct crypto_tfm *tfm) static void exit_tfm_ablk(struct crypto_skcipher *tfm) { + struct crypto_tfm *ctfm = crypto_skcipher_tfm(tfm); + struct ixp_ctx *ctx = crypto_tfm_ctx(ctfm); + + crypto_free_skcipher(ctx->fallback_tfm); exit_tfm(crypto_skcipher_tfm(tfm)); } @@ -854,7 +876,12 @@ static int ablk_setkey(struct crypto_skcipher *tfm, const u8 *key, out: if (!atomic_dec_and_test(&ctx->configuring)) wait_for_completion(&ctx->completion); - return ret; + if (ret) + return ret; + crypto_skcipher_clear_flags(ctx->fallback_tfm, CRYPTO_TFM_REQ_MASK); + crypto_skcipher_set_flags(ctx->fallback_tfm, tfm->base.crt_flags & CRYPTO_TFM_REQ_MASK); + + return crypto_skcipher_setkey(ctx->fallback_tfm, key, key_len); } static int ablk_des3_setkey(struct crypto_skcipher *tfm, const u8 *key, @@ -880,6 +907,25 @@ static int ablk_rfc3686_setkey(struct crypto_skcipher *tfm, const u8 *key, return ablk_setkey(tfm, key, key_len); } +static int ixp4xx_cipher_fallback(struct skcipher_request *areq, int encrypt) +{ + struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(areq); + struct ixp_ctx *op = crypto_skcipher_ctx(tfm); + struct ablk_ctx *rctx = skcipher_request_ctx(areq); + int err; + + skcipher_request_set_tfm(&rctx->fallback_req, op->fallback_tfm); + skcipher_request_set_callback(&rctx->fallback_req, areq->base.flags, + areq->base.complete, areq->base.data); + skcipher_request_set_crypt(&rctx->fallback_req, areq->src, areq->dst, + areq->cryptlen, areq->iv); + if (encrypt) + err = crypto_skcipher_encrypt(&rctx->fallback_req); + else + err = crypto_skcipher_decrypt(&rctx->fallback_req); + return err; +} + static int ablk_perform(struct skcipher_request *req, int encrypt) { struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); @@ -896,6 +942,9 @@ static int ablk_perform(struct skcipher_request *req, int encrypt) gfp_t flags = req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ? GFP_KERNEL : GFP_ATOMIC; + if (sg_nents(req->src) > 1 || sg_nents(req->dst) > 1) + return ixp4xx_cipher_fallback(req, encrypt); + if (qmgr_stat_full(SEND_QID)) return -EAGAIN; if (atomic_read(&ctx->configuring)) @@ -1422,7 +1471,8 @@ static int __init ixp_module_init(void) /* block ciphers */ cra->base.cra_flags = CRYPTO_ALG_KERN_DRIVER_ONLY | CRYPTO_ALG_ASYNC | - CRYPTO_ALG_ALLOCATES_MEMORY; + CRYPTO_ALG_ALLOCATES_MEMORY | + CRYPTO_ALG_NEED_FALLBACK; if (!cra->setkey) cra->setkey = ablk_setkey; if (!cra->encrypt) From patchwork Wed May 5 20:26:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 12240975 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16039C43460 for ; Wed, 5 May 2021 20:26:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA38C61057 for ; Wed, 5 May 2021 20:26:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235444AbhEEU1c (ORCPT ); Wed, 5 May 2021 16:27:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235254AbhEEU11 (ORCPT ); Wed, 5 May 2021 16:27:27 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 981FEC061574 for ; Wed, 5 May 2021 13:26:29 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id l13so3203073wru.11 for ; Wed, 05 May 2021 13:26:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qNHcmRakO4ShV9Tx/kw4hZ3DZlWxxa2CciC+xe4iDkw=; b=ZGHzV3C0LweoW7LZFx17Cue7cb1oRbtXcybhex81gLaPOYS/x3q8xHNV0ndBEBh+u6 6T+rhqzodln3fzWoMJCk5sbQdTEgJhJFvG+vh4JAJCFTHsD1NJkvFTBjjZyAChFNL+ry tFw6uJb65nh9atC93vEo6A3SXrJv/3xoeUIqetLTsuwEipPxLzLTwrU8qYRABT8DomCu 7T+WUVGDJbkj/wsaXIu/LK/hyRdIvaS8i54dN+2ARwlIPjTH4M+kVINXl0YApaBDF1w0 VhXRwq8+sNUQeulqSExfio9FKyhu87k6oAn41DRHYf9qkI7qrct2oZsXIMLhI/WPTJA7 AW3g== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=qNHcmRakO4ShV9Tx/kw4hZ3DZlWxxa2CciC+xe4iDkw=; b=oejdqMvxV6JqOF+QTknQXnNjKsEtGh5WrT++2Yf0n1mlZZ0VuW6R7oRlO1XJX9Ctli ebWYoEmbymNHWISYgoB0zOkxYX3ndlbHCyhZuUKUcOilvA2Ca1n8Wjxj5+49psikJsdu x23w0JtqeSji+gWK2id92x09c+op0juUf7p0ek1pNjMxpskgtxa5SPBZLEDF0Sv5hzgX raDXQOlakztqoDOrCTH6oPO/5BOrYz1CBZ+8SsmmkeuFCsUgy7BFGGjCzGstqsJMdfZ2 iejxpFTyABcbK0DapgG9lxUry/kyzb8McjzLtZLF/r3R/o6+95XV75Wf7H/fpMbvFnjb a2Tw== X-Gm-Message-State: AOAM532UQ+DyY01nV7+LFLYJJRXNLZIAzsZJ2NhdHH5vUGBE/oVRCzLN TBrOtBe5z/nfznvT06GhGAGlwA== X-Google-Smtp-Source: ABdhPJx3HAtoecZ3LrqPdXeOVl4Y6DnFRP713ydPKXezA4AaHQl/5MlcA4VJMRR2hH6IWyu1opcTTg== X-Received: by 2002:a5d:4e0b:: with SMTP id p11mr903183wrt.220.1620246388414; Wed, 05 May 2021 13:26:28 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a15sm497245wrr.53.2021.05.05.13.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 13:26:28 -0700 (PDT) From: Corentin Labbe To: chohnstaedt@innominate.com, davem@davemloft.net, herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH 04/11] crypto: ixp4xx: convert unsigned to unsigned int Date: Wed, 5 May 2021 20:26:11 +0000 Message-Id: <20210505202618.2663889-5-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210505202618.2663889-1-clabbe@baylibre.com> References: <20210505202618.2663889-1-clabbe@baylibre.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Fixes all issues reported by checkpatch about "unsigned", lets convert them to unsigned int. Signed-off-by: Corentin Labbe --- drivers/crypto/ixp4xx_crypto.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index 8bbf2ead6e79..17de9e60adad 100644 --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/crypto/ixp4xx_crypto.c @@ -136,7 +136,7 @@ struct crypt_ctl { u32 crypto_ctx; /* NPE Crypto Param structure address */ /* Used by Host: 4*4 bytes*/ - unsigned ctl_flags; + unsigned int ctl_flags; union { struct skcipher_request *ablk_req; struct aead_request *aead_req; @@ -184,7 +184,7 @@ struct ixp_ctx { u8 enckey[MAX_KEYLEN]; u8 salt[MAX_IVLEN]; u8 nonce[CTR_RFC3686_NONCE_SIZE]; - unsigned salted; + unsigned int salted; atomic_t configuring; struct completion completion; struct crypto_skcipher *fallback_tfm; @@ -695,8 +695,8 @@ static int register_chain_var(struct crypto_tfm *tfm, u8 xpad, u32 target, return 0; } -static int setup_auth(struct crypto_tfm *tfm, int encrypt, unsigned authsize, - const u8 *key, int key_len, unsigned digest_len) +static int setup_auth(struct crypto_tfm *tfm, int encrypt, unsigned int authsize, + const u8 *key, int key_len, unsigned int digest_len) { u32 itarget, otarget, npe_ctx_addr; unsigned char *cinfo; @@ -823,12 +823,12 @@ static int setup_cipher(struct crypto_tfm *tfm, int encrypt, } static struct buffer_desc *chainup_buffers(struct device *dev, - struct scatterlist *sg, unsigned nbytes, + struct scatterlist *sg, unsigned int nbytes, struct buffer_desc *buf, gfp_t flags, enum dma_data_direction dir) { for (; nbytes > 0; sg = sg_next(sg)) { - unsigned len = min(nbytes, sg->length); + unsigned int len = min(nbytes, sg->length); struct buffer_desc *next_buf; dma_addr_t next_buf_phys; void *ptr; @@ -930,7 +930,7 @@ static int ablk_perform(struct skcipher_request *req, int encrypt) { struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); struct ixp_ctx *ctx = crypto_skcipher_ctx(tfm); - unsigned ivsize = crypto_skcipher_ivsize(tfm); + unsigned int ivsize = crypto_skcipher_ivsize(tfm); struct ix_sa_dir *dir; struct crypt_ctl *crypt; unsigned int nbytes = req->cryptlen; @@ -1045,8 +1045,8 @@ static int aead_perform(struct aead_request *req, int encrypt, { struct crypto_aead *tfm = crypto_aead_reqtfm(req); struct ixp_ctx *ctx = crypto_aead_ctx(tfm); - unsigned ivsize = crypto_aead_ivsize(tfm); - unsigned authsize = crypto_aead_authsize(tfm); + unsigned int ivsize = crypto_aead_ivsize(tfm); + unsigned int authsize = crypto_aead_authsize(tfm); struct ix_sa_dir *dir; struct crypt_ctl *crypt; unsigned int cryptlen; @@ -1157,7 +1157,7 @@ static int aead_perform(struct aead_request *req, int encrypt, static int aead_setup(struct crypto_aead *tfm, unsigned int authsize) { struct ixp_ctx *ctx = crypto_aead_ctx(tfm); - unsigned digest_len = crypto_aead_maxauthsize(tfm); + unsigned int digest_len = crypto_aead_maxauthsize(tfm); int ret; if (!ctx->enckey_len && !ctx->authkey_len) From patchwork Wed May 5 20:26:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 12240973 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99BCAC433B4 for ; Wed, 5 May 2021 20:26:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 72D0261057 for ; Wed, 5 May 2021 20:26:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235417AbhEEU1b (ORCPT ); Wed, 5 May 2021 16:27:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235233AbhEEU11 (ORCPT ); Wed, 5 May 2021 16:27:27 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77E54C061761 for ; Wed, 5 May 2021 13:26:30 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id a10-20020a05600c068ab029014dcda1971aso2014611wmn.3 for ; Wed, 05 May 2021 13:26:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DPi3GWFf6k778V89ksbErMgoKxDVX/Ki9ZfOEswj8Wc=; b=mu8aSZVBwYaPSF8UH/aaPLDoKDGLMm2P7jX1e+72RGxjGqhiquhRbvpngx8ak/j5JG vppOayT09Wvbpx3gDY9pVeF60+Qa9BqLJlhCVJCf2uEti+6fChf2+llFon20P2Gy7Bsl kV6b32k5xN+MNkKW3ZM1HoWaThc8OSRxs3NdAnoHc9r5J+iJiVkCfEB9qJfaProaEAr/ eybmzMqRBW12ZoIV5eoouA6UBvlwWJMI0kmjDNkKwJjj/mrVOY7CRUcgmbtZPvF7kF+o 6feH6cLmdZVe01D8FLQFl5iTOMZgJuf237zVIXD7IHpdPNlh6YB222wxs7UT7EMKrPQO sqJA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=DPi3GWFf6k778V89ksbErMgoKxDVX/Ki9ZfOEswj8Wc=; b=rMWMF5KIGBr0H/lobB7NZc85I19k1oRBFZVJuY2CyA93tX3eFjAdiICB/ckxm7rF/+ 2j6CHYu1n9feHqBV6LlRlHBMzisXyPSZBjGlHbF+TVpGD/lqjWGauBzZPPKF3i6LFmM8 0ta/5kbG1C3yjBPYfg7tkAu7ULbhWixAGEeO/Bz3NajP9k4TTDGk/x5HZMZBypCm3ltN nF1xaRN9npRroSXRI3t8rmjUdzAEFkR8rny0x0I0xLvfOCpnAH8leDeXTv12F6FNALXE 21kVLP2cZioVlAHrj3nsefjT2gmD0ZDmJlDbF8zQEvRRem3Kl9rIvVw7eS/T7Lvp1Eef 5eXw== X-Gm-Message-State: AOAM533r5QKNy7hl7+8jr5nCgVZUWZn4J+LXYs3JfsCOeyZCzGlmxnwh 02gcsCHOq+Teg2Zy4aTaqoYcJg== X-Google-Smtp-Source: ABdhPJwKq/kRYVK1eC9epDFRwCi1he4uYcedqIqwnaRlTJ+gR4PxjYAyPW6kePP1pp+RxJJxyZZBQg== X-Received: by 2002:a7b:c191:: with SMTP id y17mr11586488wmi.19.1620246389196; Wed, 05 May 2021 13:26:29 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a15sm497245wrr.53.2021.05.05.13.26.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 13:26:28 -0700 (PDT) From: Corentin Labbe To: chohnstaedt@innominate.com, davem@davemloft.net, herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH 05/11] crypto: ixp4xx: convert all printk to dev_xxx Date: Wed, 5 May 2021 20:26:12 +0000 Message-Id: <20210505202618.2663889-6-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210505202618.2663889-1-clabbe@baylibre.com> References: <20210505202618.2663889-1-clabbe@baylibre.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Convert all old printk to dev_xxx. Signed-off-by: Corentin Labbe --- drivers/crypto/ixp4xx_crypto.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index 17de9e60adad..486a388c909f 100644 --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/crypto/ixp4xx_crypto.c @@ -452,7 +452,7 @@ static int init_ixp_crypto(struct device *dev) if (! ( ~(*IXP4XX_EXP_CFG2) & (IXP4XX_FEATURE_HASH | IXP4XX_FEATURE_AES | IXP4XX_FEATURE_DES))) { - printk(KERN_ERR "ixp_crypto: No HW crypto available\n"); + dev_err(dev, "ixp_crypto: No HW crypto available\n"); return ret; } npe_c = npe_request(NPE_ID); @@ -475,8 +475,7 @@ static int init_ixp_crypto(struct device *dev) switch ((msg[1]>>16) & 0xff) { case 3: - printk(KERN_WARNING "Firmware of %s lacks AES support\n", - npe_name(npe_c)); + dev_warn(dev, "Firmware of %s lacks AES support\n", npe_name(npe_c)); support_aes = 0; break; case 4: @@ -484,8 +483,7 @@ static int init_ixp_crypto(struct device *dev) support_aes = 1; break; default: - printk(KERN_ERR "Firmware of %s lacks crypto support\n", - npe_name(npe_c)); + dev_err(dev, "Firmware of %s lacks crypto support\n", npe_name(npe_c)); ret = -ENODEV; goto npe_release; } @@ -521,7 +519,7 @@ static int init_ixp_crypto(struct device *dev) return 0; npe_error: - printk(KERN_ERR "%s not responding\n", npe_name(npe_c)); + dev_err(dev, "%s not responding\n", npe_name(npe_c)); ret = -EIO; err: dma_pool_destroy(ctx_pool); @@ -1487,7 +1485,7 @@ static int __init ixp_module_init(void) cra->base.cra_alignmask = 3; cra->base.cra_priority = 300; if (crypto_register_skcipher(cra)) - printk(KERN_ERR "Failed to register '%s'\n", + dev_err(&pdev->dev, "Failed to register '%s'\n", cra->base.cra_name); else ixp4xx_algos[i].registered = 1; @@ -1520,7 +1518,7 @@ static int __init ixp_module_init(void) cra->base.cra_priority = 300; if (crypto_register_aead(cra)) - printk(KERN_ERR "Failed to register '%s'\n", + dev_err(&pdev->dev, "Failed to register '%s'\n", cra->base.cra_driver_name); else ixp4xx_aeads[i].registered = 1; From patchwork Wed May 5 20:26:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 12240977 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EFCBC433B4 for ; Wed, 5 May 2021 20:26:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8343A61132 for ; Wed, 5 May 2021 20:26:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235485AbhEEU1g (ORCPT ); Wed, 5 May 2021 16:27:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235349AbhEEU1a (ORCPT ); Wed, 5 May 2021 16:27:30 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C4C8C06138B for ; Wed, 5 May 2021 13:26:31 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id t18so3221050wry.1 for ; Wed, 05 May 2021 13:26:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=up2i6BSkNCXIRfVxIx1vgf9CT89LYsI7fxJGSIwU7yA=; b=OCN/arZi01XT5TrIGcmybaG9S+5x8cxjpNdF+9gKr76V6k7UJW8IZyDNihMCLuBTD7 ee3n2e5l8/KaxPlsywXE5C1O8qxfVzPOU/uMdXMLfilJfB0BnjDdpXorse4tKI2+a8JY CVwQKR25wtwGLfauJ4Tw3qhdZO1P1Q8XsPanYCD2SsJ17xUeECBnifKJT1fL608LZhfE BZAbEMehbmwawkrNUf0T/imqfwcMzBPPsi5mDRh7YypusAefHx2KxjvVH1kPN1+jZ3Da ZTNJG/yhydYqVMesmyaXFEMRVo0H/i9ydgFD3PFkfEobuqZiLVgTHv+/cfkllCgaWXyV NKHA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=up2i6BSkNCXIRfVxIx1vgf9CT89LYsI7fxJGSIwU7yA=; b=NgQH52wo7Y97FZhvN4qIanFORUMln7JXEXqHg/VeLWagOWrQE/hi+mUmJP7YkyrUpK M56e8/TheG95g1VdPuFQ4BzGLN+6CgCNqKfQ9Ccxtv2HiIb51xqWiJnCSICwjdxR4+Ee W+WTh0D6BdFBPaII0n3k82eJE86O3V+EuEmqwEjatR0V9Z/lcqiWWKcKP5AExk7hXy6B yNyLdrVBZIeOzccRkwdrMKQ00DGuJooyJbUYPGWPy7lR+934QygBqepNJEYUKntyd6IS UJxy/DgVv2D/ZLm3wIVwzrAqodjoUaeSl6gLneR/ZcfiEPMDBCCFYDWitF7crFm0X3O5 XgvA== X-Gm-Message-State: AOAM530UkQ9v/bcqhLB8jxcBsZdW1zGfW+Umjx8T38n+Nt9uJGRGYMB4 kHdetG8Z4hnYHWzC3+/tDKLKvA== X-Google-Smtp-Source: ABdhPJyjCguIwk/Z+HydyU/P+TiAkfOu0bhIJn0wH1WjnBcyXFGyPyrHLa+UzGMJR09EIOGZvInqiQ== X-Received: by 2002:adf:f80a:: with SMTP id s10mr823496wrp.319.1620246390069; Wed, 05 May 2021 13:26:30 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a15sm497245wrr.53.2021.05.05.13.26.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 13:26:29 -0700 (PDT) From: Corentin Labbe To: chohnstaedt@innominate.com, davem@davemloft.net, herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH 06/11] crypto: ixp4xx: whitespace fixes Date: Wed, 5 May 2021 20:26:13 +0000 Message-Id: <20210505202618.2663889-7-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210505202618.2663889-1-clabbe@baylibre.com> References: <20210505202618.2663889-1-clabbe@baylibre.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Fixes all whitespace issues reported by checkpatch Signed-off-by: Corentin Labbe --- drivers/crypto/ixp4xx_crypto.c | 43 +++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index 486a388c909f..5b8ffa4db45d 100644 --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/crypto/ixp4xx_crypto.c @@ -213,6 +213,7 @@ static const struct ix_hash_algo hash_alg_md5 = { .icv = "\x01\x23\x45\x67\x89\xAB\xCD\xEF" "\xFE\xDC\xBA\x98\x76\x54\x32\x10", }; + static const struct ix_hash_algo hash_alg_sha1 = { .cfgword = 0x00000005, .icv = "\x67\x45\x23\x01\xEF\xCD\xAB\x89\x98\xBA" @@ -244,12 +245,12 @@ static inline struct crypt_ctl *crypt_phys2virt(dma_addr_t phys) static inline u32 cipher_cfg_enc(struct crypto_tfm *tfm) { - return container_of(tfm->__crt_alg, struct ixp_alg,crypto.base)->cfg_enc; + return container_of(tfm->__crt_alg, struct ixp_alg, crypto.base)->cfg_enc; } static inline u32 cipher_cfg_dec(struct crypto_tfm *tfm) { - return container_of(tfm->__crt_alg, struct ixp_alg,crypto.base)->cfg_dec; + return container_of(tfm->__crt_alg, struct ixp_alg, crypto.base)->cfg_dec; } static inline const struct ix_hash_algo *ix_hash(struct crypto_tfm *tfm) @@ -260,6 +261,7 @@ static inline const struct ix_hash_algo *ix_hash(struct crypto_tfm *tfm) static int setup_crypt_desc(void) { struct device *dev = &pdev->dev; + BUILD_BUG_ON(sizeof(struct crypt_ctl) != 64); crypt_virt = dma_alloc_coherent(dev, NPE_QLEN * sizeof(struct crypt_ctl), @@ -290,7 +292,7 @@ static struct crypt_ctl *get_crypt_desc(void) idx = 0; crypt_virt[i].ctl_flags = CTL_FLAG_USED; spin_unlock_irqrestore(&desc_lock, flags); - return crypt_virt +i; + return crypt_virt + i; } else { spin_unlock_irqrestore(&desc_lock, flags); return NULL; @@ -318,7 +320,7 @@ static struct crypt_ctl *get_crypt_desc_emerg(void) idx = NPE_QLEN; crypt_virt[i].ctl_flags = CTL_FLAG_USED; spin_unlock_irqrestore(&emerg_lock, flags); - return crypt_virt +i; + return crypt_virt + i; } else { spin_unlock_irqrestore(&emerg_lock, flags); return NULL; @@ -417,7 +419,7 @@ static void one_packet(dma_addr_t phys) break; case CTL_FLAG_GEN_REVAES: ctx = crypto_tfm_ctx(crypt->data.tfm); - *(u32*)ctx->decrypt.npe_ctx &= cpu_to_be32(~CIPH_ENCR); + *(u32 *)ctx->decrypt.npe_ctx &= cpu_to_be32(~CIPH_ENCR); if (atomic_dec_and_test(&ctx->configuring)) complete(&ctx->completion); break; @@ -436,8 +438,9 @@ static void crypto_done_action(unsigned long arg) { int i; - for(i=0; i<4; i++) { + for (i = 0; i < 4; i++) { dma_addr_t phys = qmgr_get_entry(RECV_QID); + if (!phys) return; one_packet(phys); @@ -473,7 +476,7 @@ static int init_ixp_crypto(struct device *dev) goto npe_error; } - switch ((msg[1]>>16) & 0xff) { + switch ((msg[1] >> 16) & 0xff) { case 3: dev_warn(dev, "Firmware of %s lacks AES support\n", npe_name(npe_c)); support_aes = 0; @@ -619,6 +622,7 @@ static int init_tfm_aead(struct crypto_aead *tfm) static void exit_tfm(struct crypto_tfm *tfm) { struct ixp_ctx *ctx = crypto_tfm_ctx(tfm); + free_sa_dir(&ctx->encrypt); free_sa_dir(&ctx->decrypt); } @@ -709,11 +713,11 @@ static int setup_auth(struct crypto_tfm *tfm, int encrypt, unsigned int authsize algo = ix_hash(tfm); /* write cfg word to cryptinfo */ - cfgword = algo->cfgword | ( authsize << 6); /* (authsize/4) << 8 */ + cfgword = algo->cfgword | (authsize << 6); /* (authsize/4) << 8 */ #ifndef __ARMEB__ cfgword ^= 0xAA000000; /* change the "byte swap" flags */ #endif - *(u32*)cinfo = cpu_to_be32(cfgword); + *(u32 *)cinfo = cpu_to_be32(cfgword); cinfo += sizeof(cfgword); /* write ICV to cryptinfo */ @@ -750,7 +754,7 @@ static int gen_rev_aes_key(struct crypto_tfm *tfm) if (!crypt) { return -EAGAIN; } - *(u32*)dir->npe_ctx |= cpu_to_be32(CIPH_ENCR); + *(u32 *)dir->npe_ctx |= cpu_to_be32(CIPH_ENCR); crypt->data.tfm = tfm; crypt->crypt_offs = 0; @@ -802,21 +806,21 @@ static int setup_cipher(struct crypto_tfm *tfm, int encrypt, return err; } /* write cfg word to cryptinfo */ - *(u32*)cinfo = cpu_to_be32(cipher_cfg); + *(u32 *)cinfo = cpu_to_be32(cipher_cfg); cinfo += sizeof(cipher_cfg); /* write cipher key to cryptinfo */ memcpy(cinfo, key, key_len); /* NPE wants keylen set to DES3_EDE_KEY_SIZE even for single DES */ if (key_len < DES3_EDE_KEY_SIZE && !(cipher_cfg & MOD_AES)) { - memset(cinfo + key_len, 0, DES3_EDE_KEY_SIZE -key_len); + memset(cinfo + key_len, 0, DES3_EDE_KEY_SIZE - key_len); key_len = DES3_EDE_KEY_SIZE; } dir->npe_ctx_idx = sizeof(cipher_cfg) + key_len; dir->npe_mode |= NPE_OP_CRYPT_ENABLE; - if ((cipher_cfg & MOD_AES) && !encrypt) { + if ((cipher_cfg & MOD_AES) && !encrypt) return gen_rev_aes_key(tfm); - } + return 0; } @@ -971,6 +975,7 @@ static int ablk_perform(struct skcipher_request *req, int encrypt) } if (req->src != req->dst) { struct buffer_desc dst_hook; + crypt->mode |= NPE_OP_NOT_IN_PLACE; /* This was never tested by Intel * for more than one dst buffer, I think. */ @@ -1025,7 +1030,7 @@ static int ablk_rfc3686_crypt(struct skcipher_request *req) int ret; /* set up counter block */ - memcpy(iv, ctx->nonce, CTR_RFC3686_NONCE_SIZE); + memcpy(iv, ctx->nonce, CTR_RFC3686_NONCE_SIZE); memcpy(iv + CTR_RFC3686_NONCE_SIZE, info, CTR_RFC3686_IV_SIZE); /* initialize counter portion of counter block */ @@ -1067,7 +1072,7 @@ static int aead_perform(struct aead_request *req, int encrypt, } else { dir = &ctx->decrypt; /* req->cryptlen includes the authsize when decrypting */ - cryptlen = req->cryptlen -authsize; + cryptlen = req->cryptlen - authsize; eff_cryptlen -= authsize; } crypt = get_crypt_desc(); @@ -1188,7 +1193,7 @@ static int aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize) { int max = crypto_aead_maxauthsize(tfm) >> 2; - if ((authsize>>2) < 1 || (authsize>>2) > max || (authsize & 3)) + if ((authsize >> 2) < 1 || (authsize >> 2) > max || (authsize & 3)) return -EINVAL; return aead_setup(tfm, authsize); } @@ -1453,7 +1458,7 @@ static int __init ixp_module_init(void) platform_device_unregister(pdev); return err; } - for (i=0; i< num; i++) { + for (i = 0; i < num; i++) { struct skcipher_alg *cra = &ixp4xx_algos[i].crypto; if (snprintf(cra->base.cra_driver_name, CRYPTO_MAX_ALG_NAME, @@ -1536,7 +1541,7 @@ static void __exit ixp_module_exit(void) crypto_unregister_aead(&ixp4xx_aeads[i].crypto); } - for (i=0; i< num; i++) { + for (i = 0; i < num; i++) { if (ixp4xx_algos[i].registered) crypto_unregister_skcipher(&ixp4xx_algos[i].crypto); } From patchwork Wed May 5 20:26:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 12240979 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D01AC433ED for ; Wed, 5 May 2021 20:26:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4E5E9613D6 for ; Wed, 5 May 2021 20:26:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235520AbhEEU1k (ORCPT ); Wed, 5 May 2021 16:27:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235083AbhEEU1b (ORCPT ); Wed, 5 May 2021 16:27:31 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1406BC06138D for ; Wed, 5 May 2021 13:26:32 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id l13so3203175wru.11 for ; Wed, 05 May 2021 13:26:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TsTr8xhyvOq2/KUMVDYhNF2zkO3qagBOj+gKv7W+VAE=; b=xwhYVR3pXtNBDDAdWPckdTbhc5SdSF3gpi71wNopA7snaNRwF0AJMIdZMpCIXIBdpd 01HVLi77gO/8O5MqHXuCxsinWxrIH4ny3UpahG3+YeIks5nGfDodRRLuRvJveqYzS+LX QyB1aX0tKGnEhFmKnVTrO/8iGDbbElMyKb19z0ZF9GKqE9Ahb5yyNwnFXHiANMS/p5qL Mvpdds1lJEE/mwRVhaaTckHWQQ0slAT3pp6/oC6deyNLoNSPWJbqfrOcFWXAN/6jM6oe VeHCy39MoUH9PXf64zgrwhYEfz0iGEn/NBQCbgeKa8GjBKL/CKIHw4hr58TU1QA3UpvH QA2g== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=TsTr8xhyvOq2/KUMVDYhNF2zkO3qagBOj+gKv7W+VAE=; b=jZbPGGPSfyTnklSmotIt8Aa/govxQ0kN895cTPTNkfx0lNV7AsBdWzvEYDrke3gkbu aiVPPNGVmLLCbqpyC7BA2CP+KCeRjyeXtTlHj0/8M6cyCH2vIuuoMCW58fBineQ4W7oN 04NA9Pm5HHN7iflTGr5e0Xm9Zi21xhVQHeSyHHZv+qi3XsWNehFox8mwiG96M2t2jfxg nZUmm73J2HoM2MKxyqL6GN2tGFWb2mr510tokLhJ20bKwzHApWS8FkgV5kCm019txPms DkLI1LzmePk6MxjK2YJB0jt+DioDNNOVEZofm9hOduuT03omg4UTI5XlV8PX4kMyM+px Vi5A== X-Gm-Message-State: AOAM531fONxyyUEBX7KTe/NLxlWNmBJAlmWwxY+nrUxYc+7yqyg1x8GP XZHtCvMf/XJN8CPNf4Jo78gg0A== X-Google-Smtp-Source: ABdhPJzJwSWhqGP8eX2CBd79ELjEJRHC/2Mz/y4/G3T2FEYUUPGebl79MKevNoKTcP0DX7ZqC1c+zg== X-Received: by 2002:adf:efc3:: with SMTP id i3mr875780wrp.243.1620246390870; Wed, 05 May 2021 13:26:30 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a15sm497245wrr.53.2021.05.05.13.26.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 13:26:30 -0700 (PDT) From: Corentin Labbe To: chohnstaedt@innominate.com, davem@davemloft.net, herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH 07/11] crypto: ixp4xx: Do not initialize static to NULL Date: Wed, 5 May 2021 20:26:14 +0000 Message-Id: <20210505202618.2663889-8-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210505202618.2663889-1-clabbe@baylibre.com> References: <20210505202618.2663889-1-clabbe@baylibre.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This patch fixes all checkpatch report about static init. Signed-off-by: Corentin Labbe --- drivers/crypto/ixp4xx_crypto.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index 5b8ffa4db45d..954696a39875 100644 --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/crypto/ixp4xx_crypto.c @@ -221,10 +221,10 @@ static const struct ix_hash_algo hash_alg_sha1 = { }; static struct npe *npe_c; -static struct dma_pool *buffer_pool = NULL; -static struct dma_pool *ctx_pool = NULL; +static struct dma_pool *buffer_pool; +static struct dma_pool *ctx_pool; -static struct crypt_ctl *crypt_virt = NULL; +static struct crypt_ctl *crypt_virt; static dma_addr_t crypt_phys; static int support_aes = 1; @@ -275,7 +275,7 @@ static DEFINE_SPINLOCK(desc_lock); static struct crypt_ctl *get_crypt_desc(void) { int i; - static int idx = 0; + static int idx; unsigned long flags; spin_lock_irqsave(&desc_lock, flags); From patchwork Wed May 5 20:26:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 12240981 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21638C433B4 for ; Wed, 5 May 2021 20:26:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 02922613E6 for ; Wed, 5 May 2021 20:26:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235083AbhEEU1l (ORCPT ); Wed, 5 May 2021 16:27:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235421AbhEEU1c (ORCPT ); Wed, 5 May 2021 16:27:32 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6914C061344 for ; Wed, 5 May 2021 13:26:32 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id a4so3221011wrr.2 for ; Wed, 05 May 2021 13:26:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NQ4i6VepGC85yKCiRGHCxje44Up7BPnW12yV53TjPfY=; b=bbinMmHThj9lVrlJfoVBtQBlNaO0BanDfEbacp8tPmg2IPh8Muf4yKF+OFVEXs44HV tTSNSDWgzneZ72u5oebPfFWGHXpIJHPix6BfAJnGzqwIA1hfWFzADQDJON2Dv4Op8t5Q 7VLACgrfacsvIaJSGEvlq3yQBr2IxDFsPMQGgsfLMBT6kLpJ1CEfaRLmN6+olPEtfg4m znG9Szua8mXVqXtT/PMA5laiPHvqkZqCoaKNl8zvODueSVeOGV+RhqjB7oGc5XYMF3TJ uEykAr1QMqiep9DXZKM1AwIb0sZuDM26j554ZAAA6yQFKAvkr+sXMjTawezcfflek9pi MBsg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=NQ4i6VepGC85yKCiRGHCxje44Up7BPnW12yV53TjPfY=; b=Vnpp3AH8BvvzeDaJTW0cx8XJA4O2AUAfGU5SQLqu7cAUg02oD0llsyG1qT+dMw7sfj ZfAHP4rIXsOJlpjC1STFUE6KYUYcyn/yRz/Cl74NrKqt5cxHl0+Vuj/QtscHXQ4Fs6GL AEYVLQDcURF3KWW00pNFrriu2UQ0xvPYzsQn1kUk6vShBo+eviv5uTzBboYd2X+hkVL8 ZnzTk+NuuJI4feJmTdK1TddI0q5+akRTEbS9vnt/Aw/19NuUjX6U1C4I7ftZ8qLXyqZu Fj70SiemeOdEFkdXMmXKtkhKHzjakozm6j+l5owPvlqJOHUU94sJ7inWXbY0pnJExv2Z AsIw== X-Gm-Message-State: AOAM533Tluo8piON7xNZiZ6Gp+q29rAxDXlzccs3ONSNAGDQYdNdg28V eEaHWgmOQVQM8VVVeencTAu04g== X-Google-Smtp-Source: ABdhPJypTFFnYBukviNVTtchvaTNHYaoNIQ/Aj1kL+QF/CK72HFyZIFHRlckd20mUX2gICF4AXVw2g== X-Received: by 2002:adf:fa50:: with SMTP id y16mr927628wrr.63.1620246391655; Wed, 05 May 2021 13:26:31 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a15sm497245wrr.53.2021.05.05.13.26.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 13:26:31 -0700 (PDT) From: Corentin Labbe To: chohnstaedt@innominate.com, davem@davemloft.net, herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH 08/11] crypto: ixp4xx: remove brackets from single statement Date: Wed, 5 May 2021 20:26:15 +0000 Message-Id: <20210505202618.2663889-9-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210505202618.2663889-1-clabbe@baylibre.com> References: <20210505202618.2663889-1-clabbe@baylibre.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org fixes all single statement issues reported by checkpatch Signed-off-by: Corentin Labbe --- drivers/crypto/ixp4xx_crypto.c | 47 +++++++++++++++------------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index 954696a39875..03ae9c3a8d97 100644 --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/crypto/ixp4xx_crypto.c @@ -378,9 +378,9 @@ static void one_packet(dma_addr_t phys) free_buf_chain(dev, req_ctx->src, crypt->src_buf); free_buf_chain(dev, req_ctx->dst, crypt->dst_buf); - if (req_ctx->hmac_virt) { + if (req_ctx->hmac_virt) finish_scattered_hmac(crypt); - } + req->base.complete(&req->base, failed); break; } @@ -402,9 +402,9 @@ static void one_packet(dma_addr_t phys) } } - if (req_ctx->dst) { + if (req_ctx->dst) free_buf_chain(dev, req_ctx->dst, crypt->dst_buf); - } + free_buf_chain(dev, req_ctx->src, crypt->src_buf); req->base.complete(&req->base, failed); break; @@ -497,14 +497,14 @@ static int init_ixp_crypto(struct device *dev) buffer_pool = dma_pool_create("buffer", dev, sizeof(struct buffer_desc), 32, 0); ret = -ENOMEM; - if (!buffer_pool) { + if (!buffer_pool) goto err; - } + ctx_pool = dma_pool_create("context", dev, NPE_CTX_LEN, 16, 0); - if (!ctx_pool) { + if (!ctx_pool) goto err; - } + ret = qmgr_request_queue(SEND_QID, NPE_QLEN_TOTAL, 0, 0, "ixp_crypto:out", NULL); if (ret) @@ -545,11 +545,10 @@ static void release_ixp_crypto(struct device *dev) npe_release(npe_c); - if (crypt_virt) { + if (crypt_virt) dma_free_coherent(dev, NPE_QLEN * sizeof(struct crypt_ctl), crypt_virt, crypt_phys); - } } static void reset_sa_dir(struct ix_sa_dir *dir) @@ -562,9 +561,9 @@ static void reset_sa_dir(struct ix_sa_dir *dir) static int init_sa_dir(struct ix_sa_dir *dir) { dir->npe_ctx = dma_pool_alloc(ctx_pool, GFP_KERNEL, &dir->npe_ctx_phys); - if (!dir->npe_ctx) { + if (!dir->npe_ctx) return -ENOMEM; - } + reset_sa_dir(dir); return 0; } @@ -585,9 +584,9 @@ static int init_tfm(struct crypto_tfm *tfm) if (ret) return ret; ret = init_sa_dir(&ctx->decrypt); - if (ret) { + if (ret) free_sa_dir(&ctx->encrypt); - } + return ret; } @@ -669,9 +668,8 @@ static int register_chain_var(struct crypto_tfm *tfm, u8 xpad, u32 target, memcpy(pad, key, key_len); memset(pad + key_len, 0, HMAC_PAD_BLOCKLEN - key_len); - for (i = 0; i < HMAC_PAD_BLOCKLEN; i++) { + for (i = 0; i < HMAC_PAD_BLOCKLEN; i++) pad[i] ^= xpad; - } crypt->data.tfm = tfm; crypt->regist_ptr = pad; @@ -751,9 +749,9 @@ static int gen_rev_aes_key(struct crypto_tfm *tfm) struct ix_sa_dir *dir = &ctx->decrypt; crypt = get_crypt_desc_emerg(); - if (!crypt) { + if (!crypt) return -EAGAIN; - } + *(u32 *)dir->npe_ctx |= cpu_to_be32(CIPH_ENCR); crypt->data.tfm = tfm; @@ -1004,9 +1002,9 @@ static int ablk_perform(struct skcipher_request *req, int encrypt) free_buf_src: free_buf_chain(dev, req_ctx->src, crypt->src_buf); free_buf_dest: - if (req->src != req->dst) { + if (req->src != req->dst) free_buf_chain(dev, req_ctx->dst, crypt->dst_buf); - } + crypt->ctl_flags = CTL_FLAG_UNUSED; return -ENOMEM; } @@ -1462,14 +1460,11 @@ static int __init ixp_module_init(void) struct skcipher_alg *cra = &ixp4xx_algos[i].crypto; if (snprintf(cra->base.cra_driver_name, CRYPTO_MAX_ALG_NAME, - "%s"IXP_POSTFIX, cra->base.cra_name) >= - CRYPTO_MAX_ALG_NAME) - { + "%s"IXP_POSTFIX, cra->base.cra_name) >= + CRYPTO_MAX_ALG_NAME) continue; - } - if (!support_aes && (ixp4xx_algos[i].cfg_enc & MOD_AES)) { + if (!support_aes && (ixp4xx_algos[i].cfg_enc & MOD_AES)) continue; - } /* block ciphers */ cra->base.cra_flags = CRYPTO_ALG_KERN_DRIVER_ONLY | From patchwork Wed May 5 20:26:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 12240983 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5BC1C43460 for ; Wed, 5 May 2021 20:26:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9C95613D6 for ; Wed, 5 May 2021 20:26:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235421AbhEEU1n (ORCPT ); Wed, 5 May 2021 16:27:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235434AbhEEU1c (ORCPT ); Wed, 5 May 2021 16:27:32 -0400 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB633C06174A for ; Wed, 5 May 2021 13:26:33 -0700 (PDT) Received: by mail-wm1-x32d.google.com with SMTP id n84so2181136wma.0 for ; Wed, 05 May 2021 13:26:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fXYl2Kd9Z6DQd+07hwt5I3DejWQEV84aSXZywdSKmBg=; b=gQwq39oS6hiFY8oCq851HXtNpZypSZVJ8gFMcTbUbVPYtJAh888yMkV2QWPTtn5bpV JfGNOSS06+ggZrmcvIM7RXycCFkDUkx6fi5tfNvAjN7eSl9Jsof+tVxVSyWVWVTPq/BJ QVXusoJK5qVqDGxkz15LRFUHu+eDjHSK4eZyklRF+tHvSXP8rxnP+EzEy8nE/yHVZ9Cp ba1nPjfTV/xzb/2hkdzWr8SqsA9yB2kAhoQ+NiN03TM4mL9Gsd2OkYa0kuPiIKfbu1Cy J2MxyQd2YudzAXStRG4aaoDf+/ysQsB+JVQLvn2gDPobWkPdoWLX1QDw9uIHqoiACVCe dt0A== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=fXYl2Kd9Z6DQd+07hwt5I3DejWQEV84aSXZywdSKmBg=; b=GmTGzA5DcVnCFvg0/oZcvOB8k/40r8ISgrGrIDnembPckQU0fsgagUESl+3NBcLltB KVs5AQKw32OTSz3YGQ4SbosqSHzHh/iTikcMVyJtIwde+bLIUyvZCLj/UVZbfsSKPTGR aDTBWXrrhtkmTUzjr/La/lproXe4L0IUfktZvSLEIXRsbGXN4kThSfRv29HoloNLLLdK de8je2/vb+bOP1Och9fiBMrwyB0eNYdC1+XSQFHc8MBDrc+Rp/lyESbAtQp9Ubzby9c8 FxK09lCmdIWNjnPBjkjsJ+zpV1GXGWUtpSWituBEL2IWhxFswPc93GKDW552B8oeKQUL HgEA== X-Gm-Message-State: AOAM530yPa2U8/v3JitFGfhnBnxYqLZ+XSwIgQuvgLlaV32+NVnpFxVF KwkYg8bfWkitg7d993BgDrFn1g== X-Google-Smtp-Source: ABdhPJxYOjVF2q+jc2hsn/yko6RJPWYwLB+DbB/5M0S2mjv83OOsGwHbZ3doiTE9fozjnpqAepUPMA== X-Received: by 2002:a7b:c303:: with SMTP id k3mr558273wmj.100.1620246392503; Wed, 05 May 2021 13:26:32 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a15sm497245wrr.53.2021.05.05.13.26.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 13:26:32 -0700 (PDT) From: Corentin Labbe To: chohnstaedt@innominate.com, davem@davemloft.net, herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH 09/11] crypto: ixp4xx: Correct functions alignment Date: Wed, 5 May 2021 20:26:16 +0000 Message-Id: <20210505202618.2663889-10-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210505202618.2663889-1-clabbe@baylibre.com> References: <20210505202618.2663889-1-clabbe@baylibre.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org This patch fixes all alignment issues reported by checkpatch. Signed-off-by: Corentin Labbe --- drivers/crypto/ixp4xx_crypto.c | 65 ++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index 03ae9c3a8d97..b38650b0fea1 100644 --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/crypto/ixp4xx_crypto.c @@ -354,8 +354,8 @@ static void finish_scattered_hmac(struct crypt_ctl *crypt) int decryptlen = req->assoclen + req->cryptlen - authsize; if (req_ctx->encrypt) { - scatterwalk_map_and_copy(req_ctx->hmac_virt, - req->dst, decryptlen, authsize, 1); + scatterwalk_map_and_copy(req_ctx->hmac_virt, req->dst, + decryptlen, authsize, 1); } dma_pool_free(buffer_pool, req_ctx->hmac_virt, crypt->icv_rev_aes); } @@ -412,7 +412,7 @@ static void one_packet(dma_addr_t phys) case CTL_FLAG_GEN_ICV: ctx = crypto_tfm_ctx(crypt->data.tfm); dma_pool_free(ctx_pool, crypt->regist_ptr, - crypt->regist_buf->phys_addr); + crypt->regist_buf->phys_addr); dma_pool_free(buffer_pool, crypt->regist_buf, crypt->src_buf); if (atomic_dec_and_test(&ctx->configuring)) complete(&ctx->completion); @@ -494,14 +494,13 @@ static int init_ixp_crypto(struct device *dev) * so assure it is large enough */ BUILD_BUG_ON(SHA1_DIGEST_SIZE > sizeof(struct buffer_desc)); - buffer_pool = dma_pool_create("buffer", dev, - sizeof(struct buffer_desc), 32, 0); + buffer_pool = dma_pool_create("buffer", dev, sizeof(struct buffer_desc), + 32, 0); ret = -ENOMEM; if (!buffer_pool) goto err; - ctx_pool = dma_pool_create("context", dev, - NPE_CTX_LEN, 16, 0); + ctx_pool = dma_pool_create("context", dev, NPE_CTX_LEN, 16, 0); if (!ctx_pool) goto err; @@ -546,9 +545,8 @@ static void release_ixp_crypto(struct device *dev) npe_release(npe_c); if (crypt_virt) - dma_free_coherent(dev, - NPE_QLEN * sizeof(struct crypt_ctl), - crypt_virt, crypt_phys); + dma_free_coherent(dev, NPE_QLEN * sizeof(struct crypt_ctl), + crypt_virt, crypt_phys); } static void reset_sa_dir(struct ix_sa_dir *dir) @@ -641,7 +639,8 @@ static void exit_tfm_aead(struct crypto_aead *tfm) } static int register_chain_var(struct crypto_tfm *tfm, u8 xpad, u32 target, - int init_len, u32 ctx_addr, const u8 *key, int key_len) + int init_len, u32 ctx_addr, const u8 *key, + int key_len) { struct ixp_ctx *ctx = crypto_tfm_ctx(tfm); struct crypt_ctl *crypt; @@ -735,11 +734,11 @@ static int setup_auth(struct crypto_tfm *tfm, int encrypt, unsigned int authsize dir->npe_mode |= NPE_OP_HASH_VERIFY; ret = register_chain_var(tfm, HMAC_OPAD_VALUE, otarget, - init_len, npe_ctx_addr, key, key_len); + init_len, npe_ctx_addr, key, key_len); if (ret) return ret; return register_chain_var(tfm, HMAC_IPAD_VALUE, itarget, - init_len, npe_ctx_addr, key, key_len); + init_len, npe_ctx_addr, key, key_len); } static int gen_rev_aes_key(struct crypto_tfm *tfm) @@ -770,8 +769,8 @@ static int gen_rev_aes_key(struct crypto_tfm *tfm) return 0; } -static int setup_cipher(struct crypto_tfm *tfm, int encrypt, - const u8 *key, int key_len) +static int setup_cipher(struct crypto_tfm *tfm, int encrypt, const u8 *key, + int key_len) { u8 *cinfo; u32 cipher_cfg; @@ -791,9 +790,15 @@ static int setup_cipher(struct crypto_tfm *tfm, int encrypt, } if (cipher_cfg & MOD_AES) { switch (key_len) { - case 16: keylen_cfg = MOD_AES128; break; - case 24: keylen_cfg = MOD_AES192; break; - case 32: keylen_cfg = MOD_AES256; break; + case 16: + keylen_cfg = MOD_AES128; + break; + case 24: + keylen_cfg = MOD_AES192; + break; + case 32: + keylen_cfg = MOD_AES256; + break; default: return -EINVAL; } @@ -855,7 +860,7 @@ static struct buffer_desc *chainup_buffers(struct device *dev, } static int ablk_setkey(struct crypto_skcipher *tfm, const u8 *key, - unsigned int key_len) + unsigned int key_len) { struct ixp_ctx *ctx = crypto_skcipher_ctx(tfm); int ret; @@ -892,7 +897,7 @@ static int ablk_des3_setkey(struct crypto_skcipher *tfm, const u8 *key, } static int ablk_rfc3686_setkey(struct crypto_skcipher *tfm, const u8 *key, - unsigned int key_len) + unsigned int key_len) { struct ixp_ctx *ctx = crypto_skcipher_ctx(tfm); @@ -901,7 +906,7 @@ static int ablk_rfc3686_setkey(struct crypto_skcipher *tfm, const u8 *key, return -EINVAL; memcpy(ctx->nonce, key + (key_len - CTR_RFC3686_NONCE_SIZE), - CTR_RFC3686_NONCE_SIZE); + CTR_RFC3686_NONCE_SIZE); key_len -= CTR_RFC3686_NONCE_SIZE; return ablk_setkey(tfm, key, key_len); @@ -979,7 +984,7 @@ static int ablk_perform(struct skcipher_request *req, int encrypt) * for more than one dst buffer, I think. */ req_ctx->dst = NULL; if (!chainup_buffers(dev, req->dst, nbytes, &dst_hook, - flags, DMA_FROM_DEVICE)) + flags, DMA_FROM_DEVICE)) goto free_buf_dest; src_direction = DMA_TO_DEVICE; req_ctx->dst = dst_hook.next; @@ -988,8 +993,8 @@ static int ablk_perform(struct skcipher_request *req, int encrypt) req_ctx->dst = NULL; } req_ctx->src = NULL; - if (!chainup_buffers(dev, req->src, nbytes, &src_hook, - flags, src_direction)) + if (!chainup_buffers(dev, req->src, nbytes, &src_hook, flags, + src_direction)) goto free_buf_src; req_ctx->src = src_hook.next; @@ -1042,7 +1047,7 @@ static int ablk_rfc3686_crypt(struct skcipher_request *req) } static int aead_perform(struct aead_request *req, int encrypt, - int cryptoffset, int eff_cryptlen, u8 *iv) + int cryptoffset, int eff_cryptlen, u8 *iv) { struct crypto_aead *tfm = crypto_aead_reqtfm(req); struct ixp_ctx *ctx = crypto_aead_ctx(tfm); @@ -1130,12 +1135,12 @@ static int aead_perform(struct aead_request *req, int encrypt, /* The 12 hmac bytes are scattered, * we need to copy them into a safe buffer */ req_ctx->hmac_virt = dma_pool_alloc(buffer_pool, flags, - &crypt->icv_rev_aes); + &crypt->icv_rev_aes); if (unlikely(!req_ctx->hmac_virt)) goto free_buf_dst; if (!encrypt) { scatterwalk_map_and_copy(req_ctx->hmac_virt, - req->src, cryptlen, authsize, 0); + req->src, cryptlen, authsize, 0); } req_ctx->encrypt = encrypt; } else { @@ -1176,11 +1181,11 @@ static int aead_setup(struct crypto_aead *tfm, unsigned int authsize) if (ret) goto out; ret = setup_auth(&tfm->base, 0, authsize, ctx->authkey, - ctx->authkey_len, digest_len); + ctx->authkey_len, digest_len); if (ret) goto out; ret = setup_auth(&tfm->base, 1, authsize, ctx->authkey, - ctx->authkey_len, digest_len); + ctx->authkey_len, digest_len); out: if (!atomic_dec_and_test(&ctx->configuring)) wait_for_completion(&ctx->completion); @@ -1197,7 +1202,7 @@ static int aead_setauthsize(struct crypto_aead *tfm, unsigned int authsize) } static int aead_setkey(struct crypto_aead *tfm, const u8 *key, - unsigned int keylen) + unsigned int keylen) { struct ixp_ctx *ctx = crypto_aead_ctx(tfm); struct crypto_authenc_keys keys; From patchwork Wed May 5 20:26:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 12240985 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44637C433ED for ; Wed, 5 May 2021 20:26:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 28808613D6 for ; Wed, 5 May 2021 20:26:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234986AbhEEU1p (ORCPT ); Wed, 5 May 2021 16:27:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235254AbhEEU1d (ORCPT ); Wed, 5 May 2021 16:27:33 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 862C6C061346 for ; Wed, 5 May 2021 13:26:34 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id s8so3208538wrw.10 for ; Wed, 05 May 2021 13:26:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vYMZs827CCgGeByzUj4j7pW9fP2E9jrzGT2N7JqFOmo=; b=aH9B3BMda3KPWti9Uu3E+DFfMK8Ml+sFvIdbE9z2GmHM6CfWdLsV2svGgW8yptBhwT NkNziXFpqeB01HGlJys6F3mzCIRd9b9UtKIwO7vmBT3SzU698aHvvv4BlkiND3RFOTdo haa8tkrt414eUT+W7v6H7L0UNnKaFrFkbVdKHOYmNoRagzoBU4hUqfYeLpMuNPwx3gZ1 H45lH23u26reF8EjyRwpuUfiTpPkRRXIQT+68QkpZn3BKX4IH1hvN0bbHf2esWIeC11U KiXQxDxAlD1DOz/s4qvvHja4r0Gh/OvGepk0xmDNX9xQrG0+QML9J4TiBJTcPrtz6JPs vWDw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=vYMZs827CCgGeByzUj4j7pW9fP2E9jrzGT2N7JqFOmo=; b=cEMLbhdnsL5swlqfEtG8LSGbl2E7SPvp5123DnGd6DResTz2PqU0lv1gm1urUCKeUi tAiqxWyZeVu1bM9rMm48V8FULCwIg7wFpvJvAB4dfqeISnHjOSmWH4q44KGQzj6n68U1 AMD5rfwtheC0+hsET75CsFpljhg9GXWL92AUU7ws2RKQCDK9kHRQ2NjvBwyiV3aI6ij+ kMggGdX2RKzILNev/IrjVdv6y+Dgm+bfBrLzpeJs/IRLGpik6GIebK53MtMK1ePBFsHV SYyd1CZCrv7jm3WOQPHPF5FsUR2go28VQlDM+ncgCz9RgCwnsd7S8qS6V5EyIt4EiiIE qPnw== X-Gm-Message-State: AOAM533fpFTnp0JAs/o2GwRvO6FMc7ZdOQaqkz/UVlIQArBzY8kqFz8g P0vN7BDAsoJPN7fVJONn4IMCUAbNsMmX2tWA X-Google-Smtp-Source: ABdhPJz8cK9jkEScVMSlG14YK2z2FbESXG3ybOXPeTvttlkfdC9shPN0TKFfu9Enj8x69G+Jmbdi3A== X-Received: by 2002:a5d:6302:: with SMTP id i2mr871368wru.237.1620246393285; Wed, 05 May 2021 13:26:33 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a15sm497245wrr.53.2021.05.05.13.26.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 13:26:32 -0700 (PDT) From: Corentin Labbe To: chohnstaedt@innominate.com, davem@davemloft.net, herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH 10/11] MAINTAINERS: add ixp4xx_crypto to the right arch list Date: Wed, 5 May 2021 20:26:17 +0000 Message-Id: <20210505202618.2663889-11-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210505202618.2663889-1-clabbe@baylibre.com> References: <20210505202618.2663889-1-clabbe@baylibre.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org drivers/crypto/ixp4xx_crypto.c is missing in the IXP4XX arch file list. Signed-off-by: Corentin Labbe --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index c7ffe0028387..351617dd019e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1974,6 +1974,7 @@ F: Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt F: Documentation/devicetree/bindings/timer/intel,ixp4xx-timer.yaml F: arch/arm/mach-ixp4xx/ F: drivers/clocksource/timer-ixp4xx.c +F: drivers/crypto/ixp4xx_crypto.c F: drivers/gpio/gpio-ixp4xx.c F: drivers/irqchip/irq-ixp4xx.c F: include/linux/irqchip/irq-ixp4xx.h From patchwork Wed May 5 20:26:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin LABBE X-Patchwork-Id: 12240987 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D620C433B4 for ; Wed, 5 May 2021 20:27:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7DFA1613C7 for ; Wed, 5 May 2021 20:27:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235676AbhEEU17 (ORCPT ); Wed, 5 May 2021 16:27:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235489AbhEEU1j (ORCPT ); Wed, 5 May 2021 16:27:39 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 612DEC061761 for ; Wed, 5 May 2021 13:26:35 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id 4-20020a05600c26c4b0290146e1feccd8so1848540wmv.1 for ; Wed, 05 May 2021 13:26:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jqRopQ6j7EZnfvlaFLYECgDSQLjyHwxQifGupas3xpc=; b=IBzjfiGOwr7Vh+9cvh0LuRB/HoU+/qiYi+BJe/wg4GgeuPXzdJoBXQ9ZdU+VM+6tsS m07ZhkvuSB/sYXBiGPbS9uiAz+21sog+VlBNX0pPQf3+b7U1iEVBKGM0FHPxdgwjI6oT HOsoj6aTaHdObd/TQELspiShcFTC6uuStMg2yjcXzdu6jnYtR4cKzssOxrXpJgoRHa8T dAqI2YampChMPN3sqaZ3osAL94v9YgZ1jFE7XAYySfnH+MYzxyxZ+7AOJWA/Lw23Nu9o nrgPMx5Kpc+OpgOd9+qN2YzGYYEphZHpXVaVW6jZaQGsoqVgscgDKJf1IedgviTysoAs Oteg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=jqRopQ6j7EZnfvlaFLYECgDSQLjyHwxQifGupas3xpc=; b=Xo+QY3LmJYA/dZ4kuajkFfRcQ47mGI4mQ5oIwOYb6MxGdbG8nSHfZ3E+WoWcwjfIMa xf4mC/2I6l6oUWL0EcKYMz9PLqz4WxnLF1z4HZ5a4hef1mBzhNiEvMsBKpIHPD9Gy+Nm y9ZCLxU3inzGBqL8aLzDY5yVn5u2W78xLCstYkgZ57vqgGVFaxJvOV7b9EnOhj2XZcaL W+8I8FLwnMJJalgVRDng7SKRXGYNwzKJqyhIKawp6IfP6/d8HgifCzn5vn1HekElewbk xXbIP+zula9CkKYCZ8itxIpIoh02YMwW4ZP7oqkKV8XLoxTGrrzHLRwH4+ReyD2r/u6Z yyOA== X-Gm-Message-State: AOAM530ivxHNCB0ZUaJkMBMD+PxVgayA911QCaE7hTkK/8+gqaa5fE0K xi9BjLn8ZcoRlRPl/s1jMfeSqQ== X-Google-Smtp-Source: ABdhPJxHe5r2fcydaLYlL9LtVPJpAD710+mO6YJtzdc3PMfnyVf43O+5uE0C+fz1Z7JzTrmgPYxArg== X-Received: by 2002:a1c:7c15:: with SMTP id x21mr534437wmc.186.1620246394181; Wed, 05 May 2021 13:26:34 -0700 (PDT) Received: from localhost.localdomain (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a15sm497245wrr.53.2021.05.05.13.26.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 13:26:33 -0700 (PDT) From: Corentin Labbe To: chohnstaedt@innominate.com, davem@davemloft.net, herbert@gondor.apana.org.au Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Corentin Labbe Subject: [PATCH 11/11] MAINTAINERS: add myself as maintainer of ixp4xx_crypto Date: Wed, 5 May 2021 20:26:18 +0000 Message-Id: <20210505202618.2663889-12-clabbe@baylibre.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210505202618.2663889-1-clabbe@baylibre.com> References: <20210505202618.2663889-1-clabbe@baylibre.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org No maintainer exists for ixp4xx_crypto, since I have access to a board with it, I propose to maintain it. Signed-off-by: Corentin Labbe --- MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 351617dd019e..b8b8618ecb41 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9254,6 +9254,12 @@ F: Documentation/admin-guide/media/ipu3_rcb.svg F: Documentation/userspace-api/media/v4l/pixfmt-meta-intel-ipu3.rst F: drivers/staging/media/ipu3/ +INTEL IXP4XX CRYPTO SUPPORT +M: Corentin Labbe +L: linux-crypto@vger.kernel.org +S: Maintained +F: drivers/crypto/ixp4xx_crypto.c + INTEL IXP4XX QMGR, NPE, ETHERNET and HSS SUPPORT M: Krzysztof Halasa S: Maintained