Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1053608imm; Wed, 1 Aug 2018 09:25:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdQNCHHdWQbasxbiwrCHHN4QgVW9rUL0lBYccqxqhXHq8kUFohvmgXcqBz9dYfGLoocVUOX X-Received: by 2002:a17:902:a50a:: with SMTP id s10-v6mr15994039plq.147.1533140753520; Wed, 01 Aug 2018 09:25:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533140753; cv=none; d=google.com; s=arc-20160816; b=mulE8P7HgrQnyKI9C2NOmWZ0Cyv9yBP2LxGyTI+xpG4+KgpE6PxSUCV4WOKwCXODV4 qNmvULyT2VO8bHt8xOKP91drmUvIiFZUHFgvO7LVEbZUDSTmbWGeX5wxG1NTLwCXXGoH DRcp94k5+KX5genmqBgOwoAT9Z1SrTOLYoXrApBv6thQtTGhOQLGBgCGa/XIyQMNM9or A5jIFfNimlDj/Xd+y7t4CDtYASQ60mTPhwWtg/HQs0M6p7bz9EgHTYtOuRPlJQZXtwbM QdabBX/a5TLRn8ORHjeT/yKiGMCImLNDPZz1tzTnIXYD2jZvbgEl4WAQObrU74usEOWo GP9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=wdkQz0ZkLYt54fvU11F3mRcDZOTKFRUiJbAH3YozcIE=; b=XEN3VoS9fP6uF+XOtcqY4QsLkPkTXr7IciUjqoQ4/DjPT5Z3f2TSwTjW8bdTDS0Xua BhrDv8cn7SiAYtF3w/8uqCOM2AGakXTtGGn1rZcLIwdVytvPQLaBFAREv314/tYrGVPW PL6r8uBhV6A4K38HxFGS7kw4KfdGMsu9yk3NybDEn3J0UanhoPdvIzr3MbFJPNN5nmzw Qd6o0uUaUyHHpiqCadZz/LPqyHp6N5Yh7IHlHtanH1mUcLBPqMK2JoMS8ktUUCD5wZvs HIRWkOymdVH+Fpi/8yQPXvdKnoMamUpVnPQCsY9N1WH2PXTClHvxUzbWx7GsKxCmmqGI EsmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Mmp+dtBU; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3-v6si15822443pgo.542.2018.08.01.09.25.38; Wed, 01 Aug 2018 09:25:53 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=Mmp+dtBU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390143AbeHASKo (ORCPT + 99 others); Wed, 1 Aug 2018 14:10:44 -0400 Received: from merlin.infradead.org ([205.233.59.134]:46738 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389942AbeHASKo (ORCPT ); Wed, 1 Aug 2018 14:10:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=wdkQz0ZkLYt54fvU11F3mRcDZOTKFRUiJbAH3YozcIE=; b=Mmp+dtBUwwBuq6nh5PflLu/sXD z+Wj5nSJovvLODUwOc3iSCkj25BzI/px2vfSkU2f5WMFfnFwkX+CQ6jJ9Zfe5MPiepfbEdOnuWq/0 F0frS1V8Wmwdw5ByVoLX3XfzRKs7onQPTASkIa1TfRrFpw8R17V/5DrhssHrotlpK1fVPGD34x21p Z4u4RkhAojvszzAZMpATklIxrOHqmNFg7w8LC83phCbS+u+JfD+8NJqfIUhCmY5LZPdRqlYUTNjoS 9bwFN2D3oTPrAY/wGozZ4RXXzyJAazW2bf9KzlIxb+fYvZ2P4BmxEBSWE9g1WIXEyIzyIn+S5RqGy Ndd4Oj4w==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fktun-0007JX-0n; Wed, 01 Aug 2018 16:23:57 +0000 Subject: Re: [RFC PATCH 3/7] vfio: add spimdev support To: Kenneth Lee , Jonathan Corbet , Herbert Xu , "David S . Miller" , Joerg Roedel , Alex Williamson , Kenneth Lee , Hao Fang , Zhou Wang , Zaibo Xu , Philippe Ombredanne , Greg Kroah-Hartman , Thomas Gleixner , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, iommu@lists.linux-foundation.org, kvm@vger.kernel.org, linux-accelerators@lists.ozlabs.org, Lu Baolu , Sanjay Kumar Cc: linuxarm@huawei.com References: <20180801102221.5308-1-nek.in.cn@gmail.com> <20180801102221.5308-4-nek.in.cn@gmail.com> From: Randy Dunlap Message-ID: Date: Wed, 1 Aug 2018 09:23:52 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180801102221.5308-4-nek.in.cn@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/01/2018 03:22 AM, Kenneth Lee wrote: > From: Kenneth Lee > > SPIMDEV is "Share Parent IOMMU Mdev". It is a vfio-mdev. But differ from > the general vfio-mdev: > > 1. It shares its parent's IOMMU. > 2. There is no hardware resource attached to the mdev is created. The > hardware resource (A `queue') is allocated only when the mdev is > opened. > > Currently only the vfio type-1 driver is updated to make it to be aware > of. > > Signed-off-by: Kenneth Lee > Signed-off-by: Zaibo Xu > Signed-off-by: Zhou Wang > --- > drivers/vfio/Kconfig | 1 + > drivers/vfio/Makefile | 1 + > drivers/vfio/spimdev/Kconfig | 10 + > drivers/vfio/spimdev/Makefile | 3 + > drivers/vfio/spimdev/vfio_spimdev.c | 421 ++++++++++++++++++++++++++++ > drivers/vfio/vfio_iommu_type1.c | 136 ++++++++- > include/linux/vfio_spimdev.h | 95 +++++++ > include/uapi/linux/vfio_spimdev.h | 28 ++ > 8 files changed, 689 insertions(+), 6 deletions(-) > create mode 100644 drivers/vfio/spimdev/Kconfig > create mode 100644 drivers/vfio/spimdev/Makefile > create mode 100644 drivers/vfio/spimdev/vfio_spimdev.c > create mode 100644 include/linux/vfio_spimdev.h > create mode 100644 include/uapi/linux/vfio_spimdev.h > > diff --git a/drivers/vfio/spimdev/Kconfig b/drivers/vfio/spimdev/Kconfig > new file mode 100644 > index 000000000000..1226301f9d0e > --- /dev/null > +++ b/drivers/vfio/spimdev/Kconfig > @@ -0,0 +1,10 @@ > +# SPDX-License-Identifier: GPL-2.0 > +config VFIO_SPIMDEV > + tristate "Support for Share Parent IOMMU MDEV" > + depends on VFIO_MDEV_DEVICE > + help > + Support for VFIO Share Parent IOMMU MDEV, which enable the kernel to enables > + support for the light weight hardware accelerator framework, WrapDrive. support the lightweight hardware accelerator framework, WrapDrive. > + > + To compile this as a module, choose M here: the module will be called > + spimdev. -- ~Randy