[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20191021133455.GC117664@lophozonia>
Date: Mon, 21 Oct 2019 15:34:55 +0200
From: Jean-Philippe Brucker <jean-philippe@...aro.org>
To: Kenneth Lee <Kenneth-Lee-2012@...mail.com>
Cc: Zhangfei Gao <zhangfei.gao@...aro.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Arnd Bergmann <arnd@...db.de>,
Herbert Xu <herbert@...dor.apana.org.au>,
jonathan.cameron@...wei.com, grant.likely@....com,
ilias.apalodimas@...aro.org, francois.ozog@...aro.org,
Wangzhou <wangzhou1@...ilicon.com>,
"haojian . zhuang" <haojian.zhuang@...aro.org>,
linux-accelerators@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
linux-crypto@...r.kernel.org, Kenneth Lee <liguozhu@...ilicon.com>,
Zaibo Xu <xuzaibo@...wei.com>
Subject: Re: [PATCH v6 1/3] uacce: Add documents for uacce
Hi Kenneth,
On Thu, Oct 17, 2019 at 03:49:07PM +0800, Kenneth Lee wrote:
> Dear Jean,
>
> Please let me answer your question about why we build another subsystem
> other than use vfio-mdev.
>
> I think you might remember that we did build WarpDrive on top of
> vfio-mdev from the very beginning.
Right thanks for reminding me, I had forgotten about the first RFCs.
> Both RFCv1, Share Parent IOMMU mdev, and the RFCv2, Share Domain mdev,
> are based on mdev. We got many comments and we finally felt we could not
> solve all of them if we continued the mdev directory.
>
> I think the key problem here is that mdev is a virtual *device*. So,
>
> 1. As you have said, this creates more logic which is useless for
> accelerator. For example, it gives the user the full control of DMA
> and irq, it replays the dma mapping for new attach device and it
> create VFIO IOMMU drivers... These are necessary to simulate a raw
> device to a virtual machine. But it is not necessary to an
> accelerator.
>
> 2. You are forced to separate the resource to a device before use it.
> And if the user process crash, we need extra facility to put it back
> to the resource pool.
I don't understand the difference between vfio-mdev and uacce in this
context. An example may help. If you want to give direct access of a bit
of hardware to userspace, you necessarily need to isolate any resource
associated to that partition from other processes and from the kernel.
Namely create a DMA address space (SVA or AUXD), allocate an MMIO frame
and an interrupt (although IRQs are still handled by the kernel and could
be shared). And then you need to release those resources back into the
pool when the process exits or crashes.
> 3. Though Alex Williamson argues that vfio is not just used for
> virtualisation. But it is indeed used only by virtualisation for the
> time being.
There is DPDK, that implements userspace drivers for net and crypto using
vfio-pci, and will likely gain support for vfio-mdev soon. However
similarly to Qemu they are self-contained and can easily deal with the
fork problem, unlike a decompression library for example, that could be
included by any application.
In any case I agree with your point 1. that a simpler user interface might
be beneficial. Perhaps DPDK could support uacce as well later.
Thanks,
Jean
> And Jerome Glisse (also from Redhat) said he could
> accept some problem from a virtual machine because we can constrain
> the behavior of virtual machine program (such as qemu) . But he could
> not accept that happened in an general application. For example, if
> you pin the memory in a process and then fork, you may lost the
> physical page due to COW. We can solve the problem in uacce by
> letting go the shared pages in the child.
>
> So we think we should not continue the mdev direction for uacce. Even we
> can merge the logic together. It we become a burden for both vfio and
> uacce. Both of them make use of IOMMU, so of course they will have some
> code similar. But they go to different direction. VFIO is trying to
> export virtual DMA and irq to the user space. While uacce is trying to
> let the accelerator share address with the process itself. Many tricks
> can be made between the final user interface and the address translation
> framework. Merge them together will not be good to both of them.
>
> Hope this answer some of your question.
>
> Cheers:)
Powered by blists - more mailing lists