Message ID | 20181112075807.9291-1-nek.in.cn@gmail.com |
---|---|
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2855795ljp; Sun, 11 Nov 2018 23:58:31 -0800 (PST) X-Google-Smtp-Source: AJdET5f+dXcSMtVAw+zGoyeCcSQQ+D5krIWFD/1xdvXawkESg0AMINpx+8JHwF+pDKSIqc/l8dfD X-Received: by 2002:a62:7893:: with SMTP id t141-v6mr19084009pfc.259.1542009511305; Sun, 11 Nov 2018 23:58:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542009511; cv=none; d=google.com; s=arc-20160816; b=0nw1VKCzt/g1nbEWfxAfb9pdhMHGFutf6iDw5F2qxVPv3A8V8pw67UdZ96jsu4WhMg kIq0IdaFo6esjBIhblZzM6WfozoEd9SJ5Eqgu9hjxf4DcO9BTsAL4nCOeOivZJ6Ye09F 7JU14IyAq3t67WFD4ULwgbTmnL24Gr/iCnHnVo1LQforki2hog8CV/kPkVRTcdRf/shs 2V+7/7wTh8Ol7Gdb41Y9jhXogUtCiDq7BQAKlEsPjuXI4gCGpd9rVemcOjo0grZSvzq3 LKxPcULL0NCOTt/dapM5j5v0QbTA/DezXXNMOeerlCoZieKO6nln7iAgK4g7HAlU/47t HFtQ== 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; bh=uvusb/Bv/pkIFB9xelCNhqJh6PsfA7bLbgBEcVCgKFk=; b=enz2/iK7ms6Qp1yY/zrT4AR//v+f1HcgfRLfNhT/PT+xArhLCnw8nzUmB9JhrUr499 if349PF0Ar/hTO8JxtPvo+Ya3DwwPzo1oV4k8uhUIEiFsjSL4ZULuCPi0r0CGZc118B7 dAFJTmrz/ppCWk38hUZ+9fc5hdqhXZwJ9uGRsIlxo0rS/2dxI2nXReaSFov/LGhQX95G HkbkXO5nJAgsBgsMCwRItrrWuyLnt1n9iV5N58driB721EIMIRujMjT1+lurbcTgAwFM wB8eTw0+43DOb+/yIUqC+vH9fPw2E2XlVvn7ZcQZ9cHK3BhRSmSf95/zjZpPPKzvbB/L zm5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t7U0zM3V; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: <linux-crypto-owner@vger.kernel.org> Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d9si13698405pgb.105.2018.11.11.23.58.31; Sun, 11 Nov 2018 23:58:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-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=t7U0zM3V; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728154AbeKLRuc (ORCPT <rfc822;ard.biesheuvel@linaro.org> + 2 others); Mon, 12 Nov 2018 12:50:32 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:42144 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727357AbeKLRuc (ORCPT <rfc822;linux-crypto@vger.kernel.org>); Mon, 12 Nov 2018 12:50:32 -0500 Received: by mail-pg1-f195.google.com with SMTP id d72so250793pga.9; Sun, 11 Nov 2018 23:58:29 -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=uvusb/Bv/pkIFB9xelCNhqJh6PsfA7bLbgBEcVCgKFk=; b=t7U0zM3V/CF4YhLMkrEV4zQ+A+B64shVTXiNRF7FqfnxOvrstZzlD60KOEA6ZSLA4s mhDVDE6cx24+BW1lQbDasfe1CTLNeIi1Bd6isag3izAi+NAlHFw9Wjso49AfPVpiWdjE dFHnX/f4EhCWfRC/VMTyqv9uzF4WTkrj5JrkcvgTqSWvnMydZU5nzGSACDS+FYKt3JWH CFLoEu4i2Y/A/dVVKzoxGy3hzxKxKvRtRQZreGteNwQIBld08mSfRr1EsgUncyNnrwBe aPTpVR1nz+wZ93FEMmyrEcaVE/VpdMl4+qEOzbzDViXIAnT0JaB9wxEX96ur3Am076l3 yDhw== 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=uvusb/Bv/pkIFB9xelCNhqJh6PsfA7bLbgBEcVCgKFk=; b=DoLNPIu2maExnO+3tsbGz0rZeLaTbLzvQy77p1CGd9I2ZevicKQEiW0Cek1Hks9rJq CPtp+cKXH9XOPZCuTxIdaIEePIzzqRh4lEggvcYc1FAjpYTbKualimDRuUM3sWHpNkB8 +PDSNuFfj8nGD3hpJIbUsfVCgsC+i1KSBBSX8UHiG2CvHWs7FuHjJwKR1On6BC8axp2t 1+KkuZXaQ5GeJaJGCv3GQTGo7Jbhf+snkgfdAaD0Jim9lSRd33XSND+Hsvqer2Y0AtmX z3ZoMo7Rs2wIqRfIRF1m1Awu/KSM+Qxnbh2vFTMVktdX5hVGoqEkpKzIZQQzNhqEDyqb 7VdQ== X-Gm-Message-State: AGRZ1gJAbUIRC/8vjhWYMAw16JrTM4XMadlTdLOsB+cZS+UzOGxZzgvB qkrZXY6/6GCqVVsz/g+7EZI= X-Received: by 2002:a63:ee0e:: with SMTP id e14mr16127022pgi.8.1542009508751; Sun, 11 Nov 2018 23:58:28 -0800 (PST) Received: from localhost.localdomain ([45.41.180.77]) by smtp.gmail.com with ESMTPSA id u2-v6sm17050816pfn.50.2018.11.11.23.58.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 23:58:27 -0800 (PST) From: Kenneth Lee <nek.in.cn@gmail.com> To: Alexander Shishkin <alexander.shishkin@linux.intel.com>, Tim Sell <timothy.sell@unisys.com>, Sanyog Kale <sanyog.r.kale@intel.com>, Randy Dunlap <rdunlap@infradead.org>, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>, Vinod Koul <vkoul@kernel.org>, David Kershner <david.kershner@unisys.com>, Sagar Dharia <sdharia@codeaurora.org>, Gavin Schenk <g.schenk@eckelmann.de>, Jens Axboe <axboe@kernel.dk>, Philippe Ombredanne <pombredanne@nexb.com>, Cyrille Pitchen <cyrille.pitchen@free-electrons.com>, Johan Hovold <johan@kernel.org>, Zhou Wang <wangzhou1@hisilicon.com>, Hao Fang <fanghao11@huawei.com>, Jonathan Cameron <Jonathan.Cameron@huawei.com>, Zaibo Xu <xuzaibo@huawei.com>, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-accelerators@lists.ozlabs.org Cc: linuxarm@huawei.com, guodong.xu@linaro.org, zhangfei.gao@foxmail.com, haojian.zhuang@linaro.org, Kenneth Lee <liguozhu@hisilicon.com> Subject: [RFCv3 PATCH 0/6] A General Accelerator Framework, WarpDrive Date: Mon, 12 Nov 2018 15:58:01 +0800 Message-Id: <20181112075807.9291-1-nek.in.cn@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: <linux-crypto.vger.kernel.org> X-Mailing-List: linux-crypto@vger.kernel.org |
Series |
A General Accelerator Framework, WarpDrive
|
expand
|
From: Kenneth Lee <liguozhu@hisilicon.com> *WarpDrive* is a general accelerator framework for the user application to access the hardware without going through the kernel in data path. WarpDrive is the name for the whole framework. The component in kernel is called uacce, meaning "Unified/User-space-access-intended Accelerator Framework". It makes use of the capability of IOMMU to maintain a unified virtual address space between the hardware and the process. The first patch in this patchset contains document of the framework. Please refer to it for more information. WarpDrive is intended to be used with Jean Philippe Brucker's SVA patchset[1], which enables IO side page fault and PASID support. But this patchset itself is simply the first step to support the no-PASID version. The patch 1 is document of the framework. The patch 2 add uacce support. The patch 3 and 4 are drivers for Hisilicon's ZIP Accelerator. It is registered to crypto subsystem. The patch 5 adds uacce support to the accelerator driver. It then can work in either crypto or uacce mode. It can support both mode at the same time when PASID mode is added in the future. The patch 6 is is a user space sample demonstrating how WarpDrive is used. The intension of this RFC is to know if the idea is acceptable. So the focus is the uacce itself. The patch 3 and 4 will be sent to mainline by another topic. We assume they will be accepted first and we can upstream uacce. And if SVA is upstreamed, the new feature will be added accordingly. Change History: V3 changed from V2: 1. Build uacce from original IOMMU interface. V2 is built on VFIO. But the VFIO way locking the user memory in place will not work properly if the process fork a child. Because the copy-on-write strategy will make the parent process lost its page. This is not acceptable to accelerator user. 2. The kernel component is renamed to uacce from sdmdev accordingly 3. Document is updated for the new design. The Static Shared Virtual Memory concept is introduced to replace the User Memory Sharing concept. 4. Rebase to the lastest kernel (4.20.0-rc1) 5. As an RFC, this version is tested only with "test-to-pass" test case and not tested with Jean's SVA patch. V2 changed from V1: 1. Change kernel framework name from SPIMDEV (Share Parent IOMMU Mdev) to SDMDEV (Share Domain Mdev). 2. Allocate Hardware Resource when a new mdev is created (While it is allocated when the mdev is openned) 3. Unmap pages from the shared domain when the sdmdev iommu group is detached. (This procedure is necessary, but missed in V1) 4. Update document accordingly. 5. Rebase to the latest kernel (4.19.0-rc1) Refernces: [1] https://www.spinics.net/lists/kernel/msg2651481.html [2] https://github.com/Kenneth-Lee/linux-kernel-warpdrive/tree/warpdrive-sva-v0.5 [3] https://lkml.org/lkml/2018/7/22/34 Best Regards Kenneth Lee Kenneth Lee (6): uacce: Add documents for WarpDrive/uacce uacce: add uacce module crypto/hisilicon: add hisilicon Queue Manager driver crypto/hisilicon: add Hisilicon zip driver crypto: add uacce support to Hisilicon qm uacce: add user sample for uacce/warpdrive Documentation/warpdrive/warpdrive.rst | 260 ++++++ Documentation/warpdrive/wd-arch.svg | 764 ++++++++++++++++ Documentation/warpdrive/wd.svg | 526 +++++++++++ Documentation/warpdrive/wd_q_addr_space.svg | 359 ++++++++ drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/crypto/hisilicon/Kconfig | 19 +- drivers/crypto/hisilicon/Makefile | 2 + drivers/crypto/hisilicon/qm.c | 926 ++++++++++++++++++++ drivers/crypto/hisilicon/qm.h | 227 +++++ drivers/crypto/hisilicon/qm_usr_if.h | 32 + drivers/crypto/hisilicon/zip/Makefile | 2 + drivers/crypto/hisilicon/zip/zip.h | 57 ++ drivers/crypto/hisilicon/zip/zip_crypto.c | 362 ++++++++ drivers/crypto/hisilicon/zip/zip_crypto.h | 18 + drivers/crypto/hisilicon/zip/zip_main.c | 191 ++++ drivers/uacce/Kconfig | 11 + drivers/uacce/Makefile | 2 + drivers/uacce/uacce.c | 902 +++++++++++++++++++ include/linux/uacce.h | 117 +++ include/uapi/linux/uacce.h | 33 + samples/warpdrive/AUTHORS | 3 + samples/warpdrive/ChangeLog | 1 + samples/warpdrive/Makefile.am | 9 + samples/warpdrive/NEWS | 1 + samples/warpdrive/README | 32 + samples/warpdrive/autogen.sh | 3 + samples/warpdrive/cleanup.sh | 13 + samples/warpdrive/conf.sh | 4 + samples/warpdrive/configure.ac | 52 ++ samples/warpdrive/drv/hisi_qm_udrv.c | 228 +++++ samples/warpdrive/drv/hisi_qm_udrv.h | 57 ++ samples/warpdrive/drv/wd_drv.h | 19 + samples/warpdrive/test/Makefile.am | 7 + samples/warpdrive/test/test_hisi_zip.c | 150 ++++ samples/warpdrive/wd.c | 96 ++ samples/warpdrive/wd.h | 97 ++ samples/warpdrive/wd_adapter.c | 71 ++ samples/warpdrive/wd_adapter.h | 36 + 39 files changed, 5691 insertions(+), 1 deletion(-) create mode 100644 Documentation/warpdrive/warpdrive.rst create mode 100644 Documentation/warpdrive/wd-arch.svg create mode 100644 Documentation/warpdrive/wd.svg create mode 100644 Documentation/warpdrive/wd_q_addr_space.svg create mode 100644 drivers/crypto/hisilicon/qm.c create mode 100644 drivers/crypto/hisilicon/qm.h create mode 100644 drivers/crypto/hisilicon/qm_usr_if.h create mode 100644 drivers/crypto/hisilicon/zip/Makefile create mode 100644 drivers/crypto/hisilicon/zip/zip.h create mode 100644 drivers/crypto/hisilicon/zip/zip_crypto.c create mode 100644 drivers/crypto/hisilicon/zip/zip_crypto.h create mode 100644 drivers/crypto/hisilicon/zip/zip_main.c create mode 100644 drivers/uacce/Kconfig create mode 100644 drivers/uacce/Makefile create mode 100644 drivers/uacce/uacce.c create mode 100644 include/linux/uacce.h create mode 100644 include/uapi/linux/uacce.h create mode 100644 samples/warpdrive/AUTHORS create mode 100644 samples/warpdrive/ChangeLog create mode 100644 samples/warpdrive/Makefile.am create mode 100644 samples/warpdrive/NEWS create mode 100644 samples/warpdrive/README create mode 100755 samples/warpdrive/autogen.sh create mode 100755 samples/warpdrive/cleanup.sh create mode 100755 samples/warpdrive/conf.sh create mode 100644 samples/warpdrive/configure.ac create mode 100644 samples/warpdrive/drv/hisi_qm_udrv.c create mode 100644 samples/warpdrive/drv/hisi_qm_udrv.h create mode 100644 samples/warpdrive/drv/wd_drv.h create mode 100644 samples/warpdrive/test/Makefile.am create mode 100644 samples/warpdrive/test/test_hisi_zip.c create mode 100644 samples/warpdrive/wd.c create mode 100644 samples/warpdrive/wd.h create mode 100644 samples/warpdrive/wd_adapter.c create mode 100644 samples/warpdrive/wd_adapter.h -- 2.17.1