From patchwork Wed Aug 14 09:34:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhangfei Gao X-Patchwork-Id: 171252 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp578133ily; Wed, 14 Aug 2019 02:34:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCJcdWZpIuFIn/yxVh9FhExxagQ9AgswV1wZZUSKS5mkTIS2OO545LES+pgm2S3Eh3kM65 X-Received: by 2002:a63:de4c:: with SMTP id y12mr4237219pgi.264.1565775279747; Wed, 14 Aug 2019 02:34:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565775279; cv=none; d=google.com; s=arc-20160816; b=P7vbnLmy1nfwWONTkpBpEPohzQm8ruBSI2ZsNFZ24JyAU21YDJzBCmarum8FmMV3xI 4QdqOD5Jeg47utGc4Vfb0q8V5pzqNl/2FEnuS7CQ1o4ASu1QT/AWboTiBzdbfswOri0C tDv4foVD3tXU2ltwDO//8hYpBgtJJNUzfq7Y47oEe0i0I1OCU4rWzZA7Xg9hbToh91Y9 OAlhxLqzoJp+XdGgQ+AMJAMugFmGQ16+yCdFZ9+/AN6kSemjZJhLvxyLid+Irw4+oJEZ mE5lIDxMGY8THgfkxdNI6KGKqcX9evzH51Avo2JMyk+BgIJ2CUa9ROhQK2hc45bpqrrx sEpg== 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=sBTOwsLej+6SFYj/3oga2SYDOf+AJErrS9OoJV4ZWCU=; b=iJh9xeIk2oQnEPdqz4xQShr8xnh75ZhKnevng3FdS6R8IxKSXlDoC/EKmFwSrSK+bw 44H+X2iWDDn0cIAwf19882E39mlceq/nvxJnHZCc/xSrZ9LKyChVy7jPLntnl6VCIOGj xXe4FlZjq0n74g75L0Ok+7JGXrXhru/VcYgyNOWEg0g8U32tu4cQvkwvI9lni7yhGIdh 64ACn1EQeWQKS6k89VnTkS14QyonPiGQhRQr81IOkItWFzTi+2AaMd6DFB5NVYzpALrk kJfQV6bZGn0vBLR6z6uS+Mf8fOETtatXDa+4enGvOkME+ihX/7QONVPNCLvYCAmgUsBZ SYgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TElvV3A0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t10si53648339pgu.549.2019.08.14.02.34.39; Wed, 14 Aug 2019 02:34:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TElvV3A0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726571AbfHNJei (ORCPT + 28 others); Wed, 14 Aug 2019 05:34:38 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:47016 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbfHNJeh (ORCPT ); Wed, 14 Aug 2019 05:34:37 -0400 Received: by mail-pg1-f193.google.com with SMTP id w3so15596843pgt.13 for ; Wed, 14 Aug 2019 02:34:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=sBTOwsLej+6SFYj/3oga2SYDOf+AJErrS9OoJV4ZWCU=; b=TElvV3A0gQCRT1a910QA7MFN/a1b31NtBoBXka4GAvmJ3MVna7Jt6D4nJzrRjgdEKw XRkVbqFo2fDsGYnUlXYggJAZU785xmfMO6PeC9mp5qJU/zGIodHmLX5KIWQRfQdEmEur rpppwemvPjaht8s0Xt6UEaL0NrD+8jkW33TEFS7g89UGbJD26mifLAV/tQM89xrw3LBa YNhwzwDNCAplVTx/csnMz6MT0jaunsd44v0nJdxWz4Ib3uqtN9YFf0BAqNe4vjokvNh0 4WA2/5vps95maWoq0Twr0nt1BSvmfO11vFEeaD9E/CBl2v6Pmc5IdDvZZfj80P88/hcQ vlRQ== 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=sBTOwsLej+6SFYj/3oga2SYDOf+AJErrS9OoJV4ZWCU=; b=Rh/KpV5+3sIeo7k476VOKoOM+Z+fCZci3E4dcP/Z2cnHdees6Txr1KdhSHsVWQx9U5 U5wPi5Z4Psg4SCuu0KtNH+oYUXIzsVkgovHhqq6C4jTEeiC2VANE35AAvnC2uYGmmBSR w7hojmtVjtS/LLmtFjlS81ryVYjYSeC+54Dv1bqq1SgnAFAG9Iz861FtPcbcq8LKSUH7 JBW0ChwoJU410HWssB02A/5zWcpB1Blu9xNOmG7BRi3BZvGfjWyignvNv3Zeg+aZP+d7 jVUbW9vgaDiXvBPBak4oYPxw0OlnC3tuVfm0p42R06k2/n5DastNnV6vdjD4/84HUz10 pCiQ== X-Gm-Message-State: APjAAAUJSHVFRsedP9BLb6xVnZoU8A0zY39W5wX+SofmLDMSL+jAHVcq D6Rj+8TgQFbrHXdRQR+Lc/Yu/w== X-Received: by 2002:a17:90a:4c:: with SMTP id 12mr6099188pjb.40.1565775276670; Wed, 14 Aug 2019 02:34:36 -0700 (PDT) Received: from localhost.localdomain ([193.187.117.228]) by smtp.gmail.com with ESMTPSA id v12sm3419815pjk.13.2019.08.14.02.34.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Aug 2019 02:34:35 -0700 (PDT) From: Zhangfei Gao To: Greg Kroah-Hartman , Arnd Bergmann Cc: linux-accelerators@lists.ozlabs.org, linux-kernel@vger.kernel.org, Zhangfei Gao Subject: [PATCH 0/2] A General Accelerator Framework, WarpDrive Date: Wed, 14 Aug 2019 17:34:23 +0800 Message-Id: <1565775265-21212-1-git-send-email-zhangfei.gao@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org *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. WarpDrive is intended to be used with Jean Philippe Brucker's SVA patchset[1], which enables IO side page fault and PASID support. We have keep verifying with Jean's sva/current [2] We also keep verifying with Eric's SMMUv3 Nested Stage patch [3] This series and related zip & qm driver as well as dummy driver for qemu test: https://github.com/Linaro/linux-kernel-warpdrive/tree/5.3-rc1-warpdrive-v1 zip driver already been upstreamed. zip supporting uacce will be the next step. The library and user application: https://github.com/Linaro/warpdrive/tree/wdprd-v1-current Change History: v4 changed from V3 1. Rebase to 5.3-rc1 2. Build on iommu interface 3. Verifying with Jean's sva and Eric's nested mode iommu. 4. User library has developed a lot: support zlib, openssl etc. 5. Move to misc first V3 changed from V2: https://lkml.org/lkml/2018/11/12/1951 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: https://lwn.net/Articles/763990/ 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) References: [1] http://jpbrucker.net/sva/ [2] http://www.linux-arm.org/git?p=linux-jpb.git;a=shortlog;h=refs/heads/sva/current [3] https://github.com/eauger/linux/tree/v5.3.0-rc0-2stage-v9 Kenneth Lee (2): uacce: Add documents for WarpDrive/uacce uacce: add uacce module Documentation/misc-devices/warpdrive.rst | 351 +++++++++ drivers/misc/Kconfig | 1 + drivers/misc/Makefile | 1 + drivers/misc/uacce/Kconfig | 13 + drivers/misc/uacce/Makefile | 2 + drivers/misc/uacce/uacce.c | 1186 ++++++++++++++++++++++++++++++ include/linux/uacce.h | 109 +++ include/uapi/misc/uacce.h | 44 ++ 8 files changed, 1707 insertions(+) create mode 100644 Documentation/misc-devices/warpdrive.rst create mode 100644 drivers/misc/uacce/Kconfig create mode 100644 drivers/misc/uacce/Makefile create mode 100644 drivers/misc/uacce/uacce.c create mode 100644 include/linux/uacce.h create mode 100644 include/uapi/misc/uacce.h -- 2.7.4