From patchwork Tue Oct 25 09:53:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: guanjun X-Patchwork-Id: 649 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp913073wru; Tue, 25 Oct 2022 03:04:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Y4AfRmWXhOUrL3L0Lb191rVFDklG8D1XlLt1mD/Q6pUWGTjGHVtd00HK1W+g/Un4H17lx X-Received: by 2002:a17:907:d0f:b0:78d:a335:8368 with SMTP id gn15-20020a1709070d0f00b0078da3358368mr32436959ejc.260.1666692281238; Tue, 25 Oct 2022 03:04:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666692281; cv=none; d=google.com; s=arc-20160816; b=Y18QOECN3GKg+lrsycZ3Q4VE8PrHOJe2wjiqa4t29E6f16XIQ+j8Hd0x4vTyyBUgv+ aoY9Euhz1ctYVaT8NZcDYaMILN0eREEAu8n2vI1VnG75H8BzErR/X6HEOXvZjWpvxUq9 LMbQ5eWdC0Px9Q457P8ezsAJidrlRKKlQiexYDlSffQPJ544iacAr90kmOtjTLL99aom RjI0mMKKSPrWTVc/0kOpXGgbcPpknz2EFUXFb5SZP9PAIokJfQaAR1gtNjbDskERtsEK 7TD5Mn8hmSOAR8xog+yhE5mPTIMq0C6ELplacva/zrldpQ2493uIQA1uCjdH2CfN+jxk xy/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=t23LQKNXp9S/zGDaJk4pOyxjs3cAhW7jMSpg+0mdvrc=; b=GCPGNBM0gzZouP9bFoVNBDCwQiQkd1jc62Mpe48O3gupfBoYbhCO9FUiA9RWeQLHvV nRYPfPSVJxDE7bBfbM3ccEaQcAc4ALp7kfHI1Oi6K/EWpesTVX0tRIkWr7gjGqjl4Nit LEk2K6yOuprU19JPMNWfhxXNTVSIvDt7lMvi5T/hdkmRM4d5AOa/jfE/boDrgyUSeOE4 OmFWNmpDEEit0lklsD3GV6/kWWZcsD5nNTBhVj9h1j9WM1fA2MCtrxMZK4H/JMUCKLZn zBIUI6hJZBMPk8gL8LQUjWY3mVyF/XegSnXJm5fy7+jB34AY3BqwBE3u8ZODm9LGh/x9 4+WQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u18-20020a1709064ad200b0078c9dd279b6si2000628ejt.345.2022.10.25.03.04.16; Tue, 25 Oct 2022 03:04:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229877AbiJYKAG (ORCPT + 99 others); Tue, 25 Oct 2022 06:00:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232005AbiJYJ6i (ORCPT ); Tue, 25 Oct 2022 05:58:38 -0400 Received: from out30-43.freemail.mail.aliyun.com (out30-43.freemail.mail.aliyun.com [115.124.30.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83FF918B771; Tue, 25 Oct 2022 02:53:39 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=guanjun@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0VT2gD3N_1666691616; Received: from localhost(mailfrom:guanjun@linux.alibaba.com fp:SMTPD_---0VT2gD3N_1666691616) by smtp.aliyun-inc.com; Tue, 25 Oct 2022 17:53:37 +0800 From: 'Guanjun' To: herbert@gondor.apana.org.au, elliott@hpe.com Cc: zelin.deng@linux.alibaba.com, artie.ding@linux.alibaba.com, guanjun@linux.alibaba.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, xuchun.shang@linux.alibaba.com Subject: [PATCH v3 0/9] Drivers for Alibaba YCC (Yitian Cryptography Complex) cryptographic accelerator Date: Tue, 25 Oct 2022 17:53:27 +0800 Message-Id: <1666691616-69983-1-git-send-email-guanjun@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747653525146305080?= X-GMAIL-MSGID: =?utf-8?q?1747653525146305080?= From: Guanjun Hi, This patch series aims to add drivers for Alibaba YCC (Yitian Cryptography Complex) cryptographic accelerator. Enables the on-chip cryptographic accelerator of Alibaba Yitian SoCs which is based on ARMv9 architecture. It includes PCIe enabling, skcipher, aead, rsa, sm2 support. Additionally, this patchset has rebase Linux upstream tree and ensure no compile warnings. -- As Herbert's comments said in v2. Please help to review. Thanks, Guanjun. Change log: v2 -> v3: - [01/09] Fix the lost "$" in Makefile - [08/09] Fix compile warnings when both CONFIG_CRYPTO_SM2 and CONFIG_CRYPTO_DEV_YCC are enabled v1 RESEND -> v2: - [01/09] Remove char device that is not used now. v1 -> v1 RESEND: - [01/09] Adjust the Kconfig entry in alphabetical order - [05/09][07/09][08/09] Adjust the format of algorithm names v2: https://lore.kernel.org/all/1664350687-47330-1-git-send-email-guanjun@linux.alibaba.com/ v1: https://lore.kernel.org/all/1661334621-44413-1-git-send-email-guanjun@linux.alibaba.com/ v1 RESEND: https://lore.kernel.org/all/1662435353-114812-1-git-send-email-guanjun@linux.alibaba.com/ Guanjun (3): crypto/ycc: Add skcipher algorithm support crypto/ycc: Add aead algorithm support crypto/ycc: Add rsa algorithm support Xuchun Shang (1): crypto/ycc: Add sm2 algorithm support Zelin Deng (5): crypto/ycc: Add YCC (Yitian Cryptography Complex) accelerator driver crypto/ycc: Add ycc ring configuration crypto/ycc: Add irq support for ycc kernel rings crypto/ycc: Add device error handling support for ycc hw errors MAINTAINERS: Add Yitian Cryptography Complex (YCC) driver maintainer entry MAINTAINERS | 8 + drivers/crypto/Kconfig | 2 + drivers/crypto/Makefile | 1 + drivers/crypto/ycc/Kconfig | 18 + drivers/crypto/ycc/Makefile | 7 + drivers/crypto/ycc/sm2signature_asn1.c | 38 ++ drivers/crypto/ycc/sm2signature_asn1.h | 13 + drivers/crypto/ycc/ycc_aead.c | 646 ++++++++++++++++++++++ drivers/crypto/ycc/ycc_algs.h | 176 ++++++ drivers/crypto/ycc/ycc_dev.h | 157 ++++++ drivers/crypto/ycc/ycc_drv.c | 567 ++++++++++++++++++++ drivers/crypto/ycc/ycc_isr.c | 279 ++++++++++ drivers/crypto/ycc/ycc_isr.h | 12 + drivers/crypto/ycc/ycc_pke.c | 946 +++++++++++++++++++++++++++++++++ drivers/crypto/ycc/ycc_ring.c | 652 +++++++++++++++++++++++ drivers/crypto/ycc/ycc_ring.h | 168 ++++++ drivers/crypto/ycc/ycc_ske.c | 925 ++++++++++++++++++++++++++++++++ 17 files changed, 4615 insertions(+) create mode 100644 drivers/crypto/ycc/Kconfig create mode 100644 drivers/crypto/ycc/Makefile create mode 100644 drivers/crypto/ycc/sm2signature_asn1.c create mode 100644 drivers/crypto/ycc/sm2signature_asn1.h create mode 100644 drivers/crypto/ycc/ycc_aead.c create mode 100644 drivers/crypto/ycc/ycc_algs.h create mode 100644 drivers/crypto/ycc/ycc_dev.h create mode 100644 drivers/crypto/ycc/ycc_drv.c create mode 100644 drivers/crypto/ycc/ycc_isr.c create mode 100644 drivers/crypto/ycc/ycc_isr.h create mode 100644 drivers/crypto/ycc/ycc_pke.c create mode 100644 drivers/crypto/ycc/ycc_ring.c create mode 100644 drivers/crypto/ycc/ycc_ring.h create mode 100644 drivers/crypto/ycc/ycc_ske.c