From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f69.google.com (mail-oi0-f69.google.com [209.85.218.69]) by kanga.kvack.org (Postfix) with ESMTP id B363F6B000A for ; Mon, 11 Jun 2018 12:11:18 -0400 (EDT) Received: by mail-oi0-f69.google.com with SMTP id j7-v6so13485296oib.19 for ; Mon, 11 Jun 2018 09:11:18 -0700 (PDT) Received: from smtpbg202.qq.com (smtpbg202.qq.com. [184.105.206.29]) by mx.google.com with ESMTPS id i12-v6si17149627otj.54.2018.06.11.09.11.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jun 2018 09:11:16 -0700 (PDT) Message-ID: <5b1e9f24.1c69fb81.b1095.7272SMTPIN_ADDED_BROKEN@mx.google.com> Date: Tue, 12 Jun 2018 00:10:55 +0800 From: Kenneth Lee Subject: Re: [PATCH v2 03/40] iommu/sva: Manage process address spaces References: <20180511190641.23008-4-jean-philippe.brucker@arm.com> <20180516163117.622693ea@jacob-builder> <20180522094334.71f0e36b@jacob-builder> <20180524115039.GA10260@apalos> <19e82a74-429a-3f86-119e-32b12082d0ff@arm.com> <20180525063311.GA11605@apalos> <20180525093959.000040a7@huawei.com> <20180526022445.GA6069@kllp05> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180526022445.GA6069@kllp05> Sender: owner-linux-mm@kvack.org List-ID: To: Jonathan Cameron Cc: Ilias Apalodimas , Jean-Philippe Brucker , "xieyisheng1@huawei.com" , "kvm@vger.kernel.org" , "linux-pci@vger.kernel.org" , "xuzaibo@huawei.com" , Will Deacon , "okaya@codeaurora.org" , "linux-mm@kvack.org" , "yi.l.liu@intel.com" , "ashok.raj@intel.com" , "tn@semihalf.com" , "joro@8bytes.org" , "robdclark@gmail.com" , "bharatku@xilinx.com" , "linux-acpi@vger.kernel.org" , "liudongdong3@huawei.com" , "rfranz@cavium.com" , "devicetree@vger.kernel.org" , "kevin.tian@intel.com" , Jacob Pan , "alex.williamson@redhat.com" , "rgummal@xilinx.com" , "thunder.leizhen@huawei.com" , "linux-arm-kernel@lists.infradead.org" , "shunyong.yang@hxt-semitech.com" , "dwmw2@infradead.org" , "liubo95@huawei.com" , "jcrouse@codeaurora.org" , "iommu@lists.linux-foundation.org" , Robin Murphy , "christian.koenig@amd.com" , "nwatters@codeaurora.org" , "baolu.lu@linux.intel.com" , liguozhu@hisilicon.com On Sat, May 26, 2018 at 10:24:45AM +0800, Kenneth Lee wrote: > Date: Sat, 26 May 2018 10:24:45 +0800 > From: Kenneth Lee > To: Jonathan Cameron > Cc: Ilias Apalodimas , Jean-Philippe Brucker > , "xieyisheng1@huawei.com" > , "kvm@vger.kernel.org" , > "linux-pci@vger.kernel.org" , > "xuzaibo@huawei.com" , Will Deacon > , "okaya@codeaurora.org" , > "linux-mm@kvack.org" , "yi.l.liu@intel.com" > , "ashok.raj@intel.com" , > "tn@semihalf.com" , "joro@8bytes.org" , > "robdclark@gmail.com" , "bharatku@xilinx.com" > , "linux-acpi@vger.kernel.org" > , "liudongdong3@huawei.com" > , "rfranz@cavium.com" , > "devicetree@vger.kernel.org" , > "kevin.tian@intel.com" , Jacob Pan > , "alex.williamson@redhat.com" > , "rgummal@xilinx.com" , > "thunder.leizhen@huawei.com" , > "linux-arm-kernel@lists.infradead.org" > , "shunyong.yang@hxt-semitech.com" > , "dwmw2@infradead.org" > , "liubo95@huawei.com" , > "jcrouse@codeaurora.org" , > "iommu@lists.linux-foundation.org" , > Robin Murphy , "christian.koenig@amd.com" > , "nwatters@codeaurora.org" > , "baolu.lu@linux.intel.com" > , liguozhu@hisilicon.com > Subject: Re: [PATCH v2 03/40] iommu/sva: Manage process address spaces > Message-ID: <20180526022445.GA6069@kllp05> > > On Fri, May 25, 2018 at 09:39:59AM +0100, Jonathan Cameron wrote: > > Date: Fri, 25 May 2018 09:39:59 +0100 > > From: Jonathan Cameron > > To: Ilias Apalodimas > > CC: Jean-Philippe Brucker , > > "xieyisheng1@huawei.com" , "kvm@vger.kernel.org" > > , "linux-pci@vger.kernel.org" > > , "xuzaibo@huawei.com" , > > Will Deacon , "okaya@codeaurora.org" > > , "linux-mm@kvack.org" , > > "yi.l.liu@intel.com" , "ashok.raj@intel.com" > > , "tn@semihalf.com" , > > "joro@8bytes.org" , "robdclark@gmail.com" > > , "bharatku@xilinx.com" , > > "linux-acpi@vger.kernel.org" , > > "liudongdong3@huawei.com" , "rfranz@cavium.com" > > , "devicetree@vger.kernel.org" > > , "kevin.tian@intel.com" > > , Jacob Pan , > > "alex.williamson@redhat.com" , > > "rgummal@xilinx.com" , "thunder.leizhen@huawei.com" > > , "linux-arm-kernel@lists.infradead.org" > > , "shunyong.yang@hxt-semitech.com" > > , "dwmw2@infradead.org" > > , "liubo95@huawei.com" , > > "jcrouse@codeaurora.org" , > > "iommu@lists.linux-foundation.org" , > > Robin Murphy , "christian.koenig@amd.com" > > , "nwatters@codeaurora.org" > > , "baolu.lu@linux.intel.com" > > , liguozhu@hisilicon.com, > > kenneth-lee-2012@foxmail.com > > Subject: Re: [PATCH v2 03/40] iommu/sva: Manage process address spaces > > Message-ID: <20180525093959.000040a7@huawei.com> > > > > +CC Kenneth Lee > > > > On Fri, 25 May 2018 09:33:11 +0300 > > Ilias Apalodimas wrote: > > > > > On Thu, May 24, 2018 at 04:04:39PM +0100, Jean-Philippe Brucker wrote: > > > > On 24/05/18 12:50, Ilias Apalodimas wrote: > > > > >> Interesting, I hadn't thought about this use-case before. At first I > > > > >> thought you were talking about mdev devices assigned to VMs, but I think > > > > >> you're referring to mdevs assigned to userspace drivers instead? Out of > > > > >> curiosity, is it only theoretical or does someone actually need this? > > > > > > > > > > There has been some non upstreamed efforts to have mdev and produce userspace > > > > > drivers. Huawei is using it on what they call "wrapdrive" for crypto devices and > > > > > we did a proof of concept for ethernet interfaces. At the time we choose not to > > > > > involve the IOMMU for the reason you mentioned, but having it there would be > > > > > good. > > > > > > > > I'm guessing there were good reasons to do it that way but I wonder, is > > > > it not simpler to just have the kernel driver create a /dev/foo, with a > > > > standard ioctl/mmap/poll interface? Here VFIO adds a layer of > > > > indirection, and since the mediating driver has to implement these > > > > operations already, what is gained? > > > The best reason i can come up with is "common code". You already have one API > > > doing that for you so we replicate it in a /dev file? > > > The mdev approach still needs extentions to support what we tried to do (i.e > > > mdev bus might need yo have access on iommu_ops), but as far as i undestand it's > > > a possible case. > > Hi, Jean, Please allow me to share my understanding here: > https://zhuanlan.zhihu.com/p/35489035 > > The reason we do not use the /dev/foo scheme is that the devices to be > shared are programmable accelerators. We cannot fix up the kernel driver for them. > > > > > > > > Thanks, > > > > Jean > > > > > > -- > -Kenneth Lee (Hisilicon) I just found this mail was missed in the mailing list. I tried it once again. -- -Kenneth Lee (Hisilicon)