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 <jonathan.came...@huawei.com>
> To: Ilias Apalodimas <ilias.apalodi...@linaro.org>
> CC: Jean-Philippe Brucker <jean-philippe.bruc...@arm.com>,
>  "xieyishe...@huawei.com" <xieyishe...@huawei.com>, "k...@vger.kernel.org"
>  <k...@vger.kernel.org>, "linux-...@vger.kernel.org"
>  <linux-...@vger.kernel.org>, "xuza...@huawei.com" <xuza...@huawei.com>,
>  Will Deacon <will.dea...@arm.com>, "ok...@codeaurora.org"
>  <ok...@codeaurora.org>, "linux...@kvack.org" <linux...@kvack.org>,
>  "yi.l....@intel.com" <yi.l....@intel.com>, "ashok....@intel.com"
>  <ashok....@intel.com>, "t...@semihalf.com" <t...@semihalf.com>,
>  "j...@8bytes.org" <j...@8bytes.org>, "robdcl...@gmail.com"
>  <robdcl...@gmail.com>, "bhara...@xilinx.com" <bhara...@xilinx.com>,
>  "linux-a...@vger.kernel.org" <linux-a...@vger.kernel.org>,
>  "liudongdo...@huawei.com" <liudongdo...@huawei.com>, "rfr...@cavium.com"
>  <rfr...@cavium.com>, "devicet...@vger.kernel.org"
>  <devicet...@vger.kernel.org>, "kevin.t...@intel.com"
>  <kevin.t...@intel.com>, Jacob Pan <jacob.jun....@linux.intel.com>,
>  "alex.william...@redhat.com" <alex.william...@redhat.com>,
>  "rgum...@xilinx.com" <rgum...@xilinx.com>, "thunder.leiz...@huawei.com"
>  <thunder.leiz...@huawei.com>, "linux-arm-ker...@lists.infradead.org"
>  <linux-arm-ker...@lists.infradead.org>, "shunyong.y...@hxt-semitech.com"
>  <shunyong.y...@hxt-semitech.com>, "dw...@infradead.org"
>  <dw...@infradead.org>, "liub...@huawei.com" <liub...@huawei.com>,
>  "jcro...@codeaurora.org" <jcro...@codeaurora.org>,
>  "iommu@lists.linux-foundation.org" <iommu@lists.linux-foundation.org>,
>  Robin Murphy <robin.mur...@arm.com>, "christian.koe...@amd.com"
>  <christian.koe...@amd.com>, "nwatt...@codeaurora.org"
>  <nwatt...@codeaurora.org>, "baolu...@linux.intel.com"
>  <baolu...@linux.intel.com>, liguo...@hisilicon.com,
>  kenneth-lee-2...@foxmail.com
> Subject: Re: [PATCH v2 03/40] iommu/sva: Manage process address spaces
> Message-ID: <20180525093959.00004...@huawei.com>
> 
> +CC Kenneth Lee
> 
> On Fri, 25 May 2018 09:33:11 +0300
> Ilias Apalodimas <ilias.apalodi...@linaro.org> 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)


_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to