|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 0/1] drm/xen-zcopy: Add Xen zero-copy helper DRM driver
On 04/18/2018 01:18 PM, Paul Durrant wrote: -----Original Message----- From: Xen-devel [mailto:xen-devel-bounces@xxxxxxxxxxxxxxxxxxxx] On Behalf Of Roger Pau Monné Sent: 18 April 2018 11:11 To: Oleksandr Andrushchenko <andr2000@xxxxxxxxx> Cc: jgross@xxxxxxxx; Artem Mygaiev <Artem_Mygaiev@xxxxxxxx>; Dongwon Kim <dongwon.kim@xxxxxxxxx>; airlied@xxxxxxxx; Oleksandr_Andrushchenko@xxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; dri- devel@xxxxxxxxxxxxxxxxxxxxx; Potrola, MateuszX <mateuszx.potrola@xxxxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx; daniel.vetter@xxxxxxxxx; boris.ostrovsky@xxxxxxxxxx; Matt Roper <matthew.d.roper@xxxxxxxxx> Subject: Re: [Xen-devel] [PATCH 0/1] drm/xen-zcopy: Add Xen zero-copy helper DRM driver On Wed, Apr 18, 2018 at 11:01:12AM +0300, Oleksandr Andrushchenko wrote:On 04/18/2018 10:35 AM, Roger Pau Monné wrote:On Wed, Apr 18, 2018 at 09:38:39AM +0300, Oleksandr Andrushchenkowrote:On 04/17/2018 11:57 PM, Dongwon Kim wrote:On Tue, Apr 17, 2018 at 09:59:28AM +0200, Daniel Vetter wrote:On Mon, Apr 16, 2018 at 12:29:05PM -0700, Dongwon Kim wrote:3.2 Backend exports dma-buf to xen-front In this case Dom0 pages are shared with DomU. As before, DomU canonly writeto these pages, not any other page from Dom0, so it can be stillconsideredsafe. But, the following must be considered (highlighted in xen-front's Kernel documentation): - If guest domain dies then pages/grants received from the backendcannotbe claimed back - think of it as memory lost to Dom0 (won't be usedforany other guest) - Misbehaving guest may send too many requests to the backendexhaustingits grant references and memory (consider this from security POV).As thebackend runs in the trusted domain we also assume that it is trustedaswell, e.g. must take measures to prevent DDoS attacks.I cannot parse the above sentence: "As the backend runs in the trusted domain we also assume that it is trusted as well, e.g. must take measures to prevent DDoS attacks." What's the relation between being trusted and protecting from DoS attacks?I mean that we trust the backend that it can prevent Dom0 from crashing in case DomU's frontend misbehaves, e.g. if the frontend sends too many memory requests etc.In any case, all? PV protocols are implemented with the frontend sharing pages to the backend, and I think there's a reason why this model is used, and it should continue to be used.This is the first use-case above. But there are real-world use-cases (embedded in my case) when physically contiguous memory needs to be shared, one of the possible ways to achieve this is to share contiguous memory from Dom0 to DomU (the second use-caseabove) Ok, so just to summarize, xen-zcopy/hyper-dmabuf as they are now, are no go from your POV? Instead, we have to make all that fancy stuff with VAs <-> device-X and have that device-X driver live out of drivers/xen as it is not a Xen specific driver? Finally, this is indeed some memory, but a bit more [1]Also, (with my FreeBSD maintainer hat) how is this going to translate to other OSes? So far the operations performed by the gntdev device are mostly OS-agnostic because this just map/unmap memory, and in fact they are implemented by Linux and FreeBSD.At the moment I can only see Linux implementation and it seems to be perfectly ok as we do not change Xen's APIs etc. and only use the existing ones (remember, we only extend gntdev/balloon drivers, all the changes in the Linux kernel) As the second note I can also think that we do not extend gntdev/balloon drivers and have re-worked xen-zcopy driver be a separate entity, say drivers/xen/dma-bufimplement "wait" ioctl (wait for dma-buf->release): currently these are DRM_XEN_ZCOPY_DUMB_FROM_REFS,DRM_XEN_ZCOPY_DUMB_TO_REFS andDRM_XEN_ZCOPY_DUMB_WAIT_FREE 1.2. Xen balloon driver [6] to allow allocating contiguous buffers (not needed by current hyper-dmabuf, but is a must for xen-zcopy use-cases)I think this needs clarifying. In which memory space do you need those regions to be contiguous?Use-case: Dom0 has a HW driver which only works with contig memory and I want DomU to be able to directly write into that memory, thus implementing zero copyingDo they need to be contiguous in host physical memory, or guest physical memory?HostIf it's in guest memory space, isn't there any generic interface that you can use? If it's in host physical memory space, why do you need this buffer to be contiguous in host physical memory space? The IOMMU should hideallthis.There are drivers/HW which can only work with contig memory and if it is backed by an IOMMU then still it has to be contig in IPA space (real device doesn't know that it is actually IPA contig, not PA)What's IPA contig?I assume 'IPA' means 'IOMMU Physical Address'. I wonder whether this means what I've termed 'Bus Address' elsewhere? PaulThanks, Roger. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |