[PATCH v2 03/40] iommu/sva: Manage process address spaces
From: Kenneth Lee <hidden>
Date: 2018-06-11 16:10:55
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 <redacted> To: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>, Jean-Philippe Brucker [off-list ref], "xieyisheng1 at huawei.com" [off-list ref], "kvm at vger.kernel.org" [off-list ref], "linux-pci at vger.kernel.org" [off-list ref], "xuzaibo at huawei.com" [off-list ref], Will Deacon [off-list ref], "okaya at codeaurora.org" [off-list ref], "linux-mm at kvack.org" [off-list ref], "yi.l.liu at intel.com" [off-list ref], "ashok.raj at intel.com" [off-list ref], "tn at semihalf.com" [off-list ref], "joro at 8bytes.org" [off-list ref], "robdclark at gmail.com" [off-list ref], "bharatku at xilinx.com" [off-list ref], "linux-acpi at vger.kernel.org" [off-list ref], "liudongdong3 at huawei.com" [off-list ref], "rfranz at cavium.com" [off-list ref], "devicetree at vger.kernel.org" [off-list ref], "kevin.tian at intel.com" [off-list ref], Jacob Pan [off-list ref], "alex.williamson at redhat.com" [off-list ref], "rgummal at xilinx.com" [off-list ref], "thunder.leizhen at huawei.com" [off-list ref], "linux-arm-kernel at lists.infradead.org" [off-list ref], "shunyong.yang at hxt-semitech.com" [off-list ref], "dwmw2 at infradead.org" [off-list ref], "liubo95 at huawei.com" [off-list ref], "jcrouse at codeaurora.org" [off-list ref], "iommu at lists.linux-foundation.org" [off-list ref], Robin Murphy [off-list ref], "christian.koenig at amd.com" [off-list ref], "nwatters at codeaurora.org" [off-list ref], "baolu.lu at linux.intel.com" [off-list ref], liguozhu at 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:quoted
Date: Fri, 25 May 2018 09:39:59 +0100 From: Jonathan Cameron <Jonathan.Cameron@huawei.com> To: Ilias Apalodimas <ilias.apalodimas@linaro.org> CC: Jean-Philippe Brucker <redacted>, "xieyisheng1 at huawei.com" [off-list ref], "kvm at vger.kernel.org" [off-list ref], "linux-pci at vger.kernel.org" [off-list ref], "xuzaibo at huawei.com" [off-list ref], Will Deacon [off-list ref], "okaya at codeaurora.org" [off-list ref], "linux-mm at kvack.org" [off-list ref], "yi.l.liu at intel.com" [off-list ref], "ashok.raj at intel.com" [off-list ref], "tn at semihalf.com" [off-list ref], "joro at 8bytes.org" [off-list ref], "robdclark at gmail.com" [off-list ref], "bharatku at xilinx.com" [off-list ref], "linux-acpi at vger.kernel.org" [off-list ref], "liudongdong3 at huawei.com" [off-list ref], "rfranz at cavium.com" [off-list ref], "devicetree at vger.kernel.org" [off-list ref], "kevin.tian at intel.com" [off-list ref], Jacob Pan [off-list ref], "alex.williamson at redhat.com" [off-list ref], "rgummal at xilinx.com" [off-list ref], "thunder.leizhen at huawei.com" [off-list ref], "linux-arm-kernel at lists.infradead.org" [off-list ref], "shunyong.yang at hxt-semitech.com" [off-list ref], "dwmw2 at infradead.org" [off-list ref], "liubo95 at huawei.com" [off-list ref], "jcrouse at codeaurora.org" [off-list ref], "iommu at lists.linux-foundation.org" [off-list ref], Robin Murphy [off-list ref], "christian.koenig at amd.com" [off-list ref], "nwatters at codeaurora.org" [off-list ref], "baolu.lu at linux.intel.com" [off-list ref], liguozhu at hisilicon.com, kenneth-lee-2012 at foxmail.com Subject: Re: [PATCH v2 03/40] iommu/sva: Manage process address spaces Message-ID: [ref] +CC Kenneth Lee On Fri, 25 May 2018 09:33:11 +0300 Ilias Apalodimas [off-list ref] wrote:quoted
On Thu, May 24, 2018 at 04:04:39PM +0100, Jean-Philippe Brucker wrote:quoted
On 24/05/18 12:50, Ilias Apalodimas wrote:quoted
quoted
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.quoted
quoted
quoted
Thanks, Jean-- -Kenneth Lee (Hisilicon)
I just found this mail was missed in the mailing list. I tried it once again. -- -Kenneth Lee (Hisilicon)