Re: [Xen-devel] [PATCH v5 0/8] xen: dma-buf support for grant device

2018-07-23 Thread Oleksandr Andrushchenko
On 07/23/2018 06:22 PM, Boris Ostrovsky wrote: On 07/23/2018 09:26 AM, Oleksandr Andrushchenko wrote: On 07/23/2018 11:38 AM, Oleksandr Andrushchenko wrote: data/upstream/linux-xen/drivers/xen/gntdev-dmabuf.c: In function ‘gntdev_ioctl_dmabuf_exp_from_refs’: /data/upstream/linux-xen/drivers

Re: [Xen-devel] [PATCH v5 0/8] xen: dma-buf support for grant device

2018-07-23 Thread Oleksandr Andrushchenko
On 07/23/2018 11:38 AM, Oleksandr Andrushchenko wrote: On 07/20/2018 05:08 PM, Boris Ostrovsky wrote: On 07/20/2018 05:01 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko This work is in response to my previous attempt to introduce Xen/DRM zero-copy driver [1] to enable Linux

[Xen-devel] [PATCH] libgnttab: Add support for Linux dma-buf

2018-07-23 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Add support for Linux grant device driver extension which allows converting existing dma-buf's into an array of grant references and vise versa. This is only implemented for Linux as other OSes have no Linux dma-buf support. Bump gnttab library minor version to 3

Re: [Xen-devel] [PATCH v3] drm: Replace NULL with error value in drm_prime_pages_to_sg

2018-07-23 Thread Oleksandr Andrushchenko
On 07/19/2018 01:24 PM, Dan Carpenter wrote: Reviewed-by: Dan Carpenter regards, dan carpenter Applied to drm-misc-next ___ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] [PATCH v5 0/8] xen: dma-buf support for grant device

2018-07-23 Thread Oleksandr Andrushchenko
On 07/20/2018 05:08 PM, Boris Ostrovsky wrote: On 07/20/2018 05:01 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko This work is in response to my previous attempt to introduce Xen/DRM zero-copy driver [1] to enable Linux dma-buf API [2] for Xen based frontends/backends

[Xen-devel] [PATCH v5 5/8] xen/gntdev: Make private routines/structures accessible

2018-07-20 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko This is in preparation for adding support of DMA buffer functionality: make map/unmap related code and structures, used privately by gntdev, ready for dma-buf extension, which will re-use these. Rename corresponding structures as those become non-private to gntdev

[Xen-devel] [PATCH v5 3/8] xen/grant-table: Allow allocating buffers suitable for DMA

2018-07-20 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Extend grant table module API to allow allocating buffers that can be used for DMA operations and mapping foreign grant references on top of those. The resulting buffer is similar to the one allocated by the balloon driver in that proper memory reservation is made

[Xen-devel] [PATCH v5 1/8] xen/grant-table: Make set/clear page private code shared

2018-07-20 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Make set/clear page private code shared and accessible to other kernel modules which can re-use these instead of open-coding. Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Boris Ostrovsky --- drivers/xen/grant-table.c | 54

[Xen-devel] [PATCH v5 8/8] xen/gntdev: Implement dma-buf import functionality

2018-07-20 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko 1. Import a dma-buf with the file descriptor provided and export granted references to the pages of that dma-buf into the array of grant references. 2. Add API to close all references to an imported buffer, so it can be released by the owner. This is only

[Xen-devel] [PATCH v5 0/8] xen: dma-buf support for grant device

2018-07-20 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko This work is in response to my previous attempt to introduce Xen/DRM zero-copy driver [1] to enable Linux dma-buf API [2] for Xen based frontends/backends. There is also an existing hyper_dmabuf approach available [3] which, if reworked to utilize the proposed

[Xen-devel] [PATCH v5 7/8] xen/gntdev: Implement dma-buf export functionality

2018-07-20 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko 1. Create a dma-buf from grant references provided by the foreign domain. By default dma-buf is backed by system memory pages, but by providing GNTDEV_DMA_FLAG_XXX flags it can also be created as a DMA write-combine/coherent buffer, e.g. allocated

[Xen-devel] [PATCH v5 6/8] xen/gntdev: Add initial support for dma-buf UAPI

2018-07-20 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Add UAPI and IOCTLs for dma-buf grant device driver extension: the extension allows userspace processes and kernel modules to use Xen backed dma-buf implementation. With this extension grant references to the pages of an imported dma-buf can be exported for other

[Xen-devel] [PATCH v5 2/8] xen/balloon: Share common memory reservation routines

2018-07-20 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Memory {increase|decrease}_reservation and VA mappings update/reset code used in balloon driver can be made common, so other drivers can also re-use the same functionality without open-coding. Create a dedicated file for the shared code and export corresponding

Re: [Xen-devel] [PATCH v3] drm: Replace NULL with error value in drm_prime_pages_to_sg

2018-07-19 Thread Oleksandr Andrushchenko
On 07/19/2018 01:24 PM, Dan Carpenter wrote: Reviewed-by: Dan Carpenter Thank you, if nobody objects I'll push it to drm-misc-next next Monday regards, dan carpenter ___ Xen-devel mailing list Xen-devel@lists.xenproject.org

[Xen-devel] [PATCH v3] drm: Replace NULL with error value in drm_prime_pages_to_sg

2018-07-19 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Dan Carpenter has reported that there is the following static checker warning: drivers/gpu/drm/drm_prime.c:317 drm_gem_map_dma_buf() warn: 'sgt' can also be NULL 314 sgt = obj->dev->driver->gem_prime_get_sg_table(obj); 315 316 if

Re: [Xen-devel] [PATCH] drm/xen-front: Fix error code in xen_drm_front_gem_get_sg_table()

2018-07-19 Thread Oleksandr Andrushchenko
On 07/19/2018 12:20 PM, Dan Carpenter wrote: On Thu, Jul 19, 2018 at 12:06:38PM +0300, Oleksandr Andrushchenko wrote: Hi, Dan! Thank you for the patch and sorry I was clumsy sending v3. Do you want me to send v3 now with the fixes for both Xen and CMA? Thank you, Sorry, I forgot that you

Re: [Xen-devel] [PATCH] drm/xen-front: Fix error code in xen_drm_front_gem_get_sg_table()

2018-07-19 Thread Oleksandr Andrushchenko
Hi, Dan! Thank you for the patch and sorry I was clumsy sending v3. Do you want me to send v3 now with the fixes for both Xen and CMA? Thank you, Oleksandr On 07/19/2018 11:11 AM, Dan Carpenter wrote: The xen_drm_front_gem_get_sg_table() function is supposed to return error pointer. The

Re: [Xen-devel] [PATCH v2] drm: Replace NULL with error value in drm_prime_pages_to_sg

2018-07-12 Thread Oleksandr Andrushchenko
On 06/18/2018 03:32 PM, Oleksandr Andrushchenko wrote: On 06/18/2018 03:29 PM, Dan Carpenter wrote: On Mon, Jun 18, 2018 at 09:07:09AM +0300, Oleksandr Andrushchenko wrote: drivers/gpu/drm/drm_gem_cma_helper.c    | 2 +-   drivers/gpu/drm/xen/xen_drm_front_gem.c | 2 +-   2 files changed, 2

Re: [Xen-devel] [PATCH v4 0/9] xen: dma-buf support for grant device

2018-07-02 Thread Oleksandr Andrushchenko
On 07/02/2018 11:20 AM, Juergen Gross wrote: On 02/07/18 09:10, Oleksandr Andrushchenko wrote: Hello, Boris, Juergen! Do you think I can re-base the series (which already has all required R-b's from Xen community) onto the latest kernel with API changes to patches 5 (of_dma_configure) and 8

Re: [Xen-devel] [PATCH v4 8/9] xen/gntdev: Implement dma-buf export functionality

2018-07-02 Thread Oleksandr Andrushchenko
+ +static const struct dma_buf_ops dmabuf_exp_ops = { + .attach = dmabuf_exp_ops_attach, + .detach = dmabuf_exp_ops_detach, + .map_dma_buf = dmabuf_exp_ops_map_dma_buf, + .unmap_dma_buf = dmabuf_exp_ops_unmap_dma_buf, + .release = dmabuf_exp_ops_release, +

Re: [Xen-devel] [PATCH v2] drm: Replace NULL with error value in drm_prime_pages_to_sg

2018-06-18 Thread Oleksandr Andrushchenko
On 06/18/2018 03:29 PM, Dan Carpenter wrote: On Mon, Jun 18, 2018 at 09:07:09AM +0300, Oleksandr Andrushchenko wrote: drivers/gpu/drm/drm_gem_cma_helper.c| 2 +- drivers/gpu/drm/xen/xen_drm_front_gem.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu

Re: [Xen-devel] [PATCH v2] drm/xen-front: fix pointer casts

2018-06-18 Thread Oleksandr Andrushchenko
On 06/18/2018 01:06 PM, Andre Przywara wrote: Hi, On 25/05/18 06:32, Oleksandr Andrushchenko wrote: On 05/23/2018 02:46 PM, Juergen Gross wrote: On 23/05/18 13:36, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko Building for a 32-bit target results in warnings from casting

Re: [Xen-devel] [PATCH v4 5/9] xen/gntdev: Allow mappings for DMA buffers

2018-06-18 Thread Oleksandr Andrushchenko
On 06/16/2018 12:07 AM, Boris Ostrovsky wrote: On 06/15/2018 02:50 AM, Oleksandr Andrushchenko wrote: On 06/15/2018 09:46 AM, Juergen Gross wrote: On 15/06/18 08:32, Oleksandr Andrushchenko wrote: Please note, that this will need a change (attached) while applying to the mainline kernel

Re: [Xen-devel] [PATCH v4 0/9] xen: dma-buf support for grant device

2018-06-18 Thread Oleksandr Andrushchenko
Boris, Juergen! Thank you so much for your comments and time spent on this series. Appreciate that very much! Thank you, Oleksandr On 06/15/2018 09:27 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko This work is in response to my previous attempt to introduce Xen/DRM zero

Re: [Xen-devel] [PATCH v2] drm: Replace NULL with error value in drm_prime_pages_to_sg

2018-06-18 Thread Oleksandr Andrushchenko
On 06/18/2018 09:07 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko Dan Carpenter has reported that there is the following static checker warning: drivers/gpu/drm/drm_prime.c:317 drm_gem_map_dma_buf() warn: 'sgt' can also be NULL 314 sgt = obj->dev->

[Xen-devel] [PATCH v2] drm: Replace NULL with error value in drm_prime_pages_to_sg

2018-06-18 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Dan Carpenter has reported that there is the following static checker warning: drivers/gpu/drm/drm_prime.c:317 drm_gem_map_dma_buf() warn: 'sgt' can also be NULL 314 sgt = obj->dev->driver->gem_prime_get_sg_table(obj); 315 316 if

[Xen-devel] [PATCH] drm/xen-front: Replace NULL with error value in xen_drm_front_gem_get_sg_table

2018-06-15 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Dan Carpenter has reported that there is the following static checker warning: drivers/gpu/drm/drm_prime.c:317 drm_gem_map_dma_buf() warn: 'sgt' can also be NULL 314 sgt = obj->dev->driver->gem_prime_get_sg_table(obj); 315 316 if

Re: [Xen-devel] [PATCH v4 5/9] xen/gntdev: Allow mappings for DMA buffers

2018-06-15 Thread Oleksandr Andrushchenko
On 06/15/2018 09:46 AM, Juergen Gross wrote: On 15/06/18 08:32, Oleksandr Andrushchenko wrote: Please note, that this will need a change (attached) while applying to the mainline kernel because of API changes [1]. Unfortunately, current Xen tip kernel tree is v4.17-rc5 based, so I cannot make

Re: [Xen-devel] [PATCH v4 5/9] xen/gntdev: Allow mappings for DMA buffers

2018-06-15 Thread Oleksandr Andrushchenko
/linux.git/commit/?id=3d6ce86ee79465e1b1b6e287f8ea26b553fc768e On 06/15/2018 09:27 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko Allow mappings for DMA backed buffers if grant table module supports such: this extends grant device to not only map buffers made of balloon pages

[Xen-devel] [PATCH v4 5/9] xen/gntdev: Allow mappings for DMA buffers

2018-06-15 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Allow mappings for DMA backed buffers if grant table module supports such: this extends grant device to not only map buffers made of balloon pages, but also from buffers allocated with dma_alloc_xxx. Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Boris

[Xen-devel] [PATCH v4 4/9] xen/grant-table: Allow allocating buffers suitable for DMA

2018-06-15 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Extend grant table module API to allow allocating buffers that can be used for DMA operations and mapping foreign grant references on top of those. The resulting buffer is similar to the one allocated by the balloon driver in that proper memory reservation is made

[Xen-devel] [PATCH v4 6/9] xen/gntdev: Make private routines/structures accessible

2018-06-15 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko This is in preparation for adding support of DMA buffer functionality: make map/unmap related code and structures, used privately by gntdev, ready for dma-buf extension, which will re-use these. Rename corresponding structures as those become non-private to gntdev

[Xen-devel] [PATCH v4 8/9] xen/gntdev: Implement dma-buf export functionality

2018-06-15 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko 1. Create a dma-buf from grant references provided by the foreign domain. By default dma-buf is backed by system memory pages, but by providing GNTDEV_DMA_FLAG_XXX flags it can also be created as a DMA write-combine/coherent buffer, e.g. allocated

[Xen-devel] [PATCH v4 3/9] xen/balloon: Share common memory reservation routines

2018-06-15 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Memory {increase|decrease}_reservation and VA mappings update/reset code used in balloon driver can be made common, so other drivers can also re-use the same functionality without open-coding. Create a dedicated file for the shared code and export corresponding

[Xen-devel] [PATCH v4 9/9] xen/gntdev: Implement dma-buf import functionality

2018-06-15 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko 1. Import a dma-buf with the file descriptor provided and export granted references to the pages of that dma-buf into the array of grant references. 2. Add API to close all references to an imported buffer, so it can be released by the owner. This is only

[Xen-devel] [PATCH v4 1/9] xen/grant-table: Export gnttab_{alloc|free}_pages as GPL

2018-06-15 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Only gnttab_{alloc|free}_pages are exported as EXPORT_SYMBOL while all the rest are exported as EXPORT_SYMBOL_GPL, thus effectively making it not possible for non-GPL driver modules to use grant table module. Export gnttab_{alloc|free}_pages as EXPORT_SYMBOL_GPL so

[Xen-devel] [PATCH v4 0/9] xen: dma-buf support for grant device

2018-06-15 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko This work is in response to my previous attempt to introduce Xen/DRM zero-copy driver [1] to enable Linux dma-buf API [2] for Xen based frontends/backends. There is also an existing hyper_dmabuf approach available [3] which, if reworked to utilize the proposed

[Xen-devel] [PATCH v4 7/9] xen/gntdev: Add initial support for dma-buf UAPI

2018-06-15 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Add UAPI and IOCTLs for dma-buf grant device driver extension: the extension allows userspace processes and kernel modules to use Xen backed dma-buf implementation. With this extension grant references to the pages of an imported dma-buf can be exported for other

[Xen-devel] [PATCH v4 2/9] xen/grant-table: Make set/clear page private code shared

2018-06-15 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Make set/clear page private code shared and accessible to other kernel modules which can re-use these instead of open-coding. Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Boris Ostrovsky --- drivers/xen/grant-table.c | 54

Re: [Xen-devel] [PATCH v3 0/9] xen: dma-buf support for grant device

2018-06-14 Thread Oleksandr Andrushchenko
Hi, Boris! It seems that I have resolved all the issues now which were mainly cleanup and code movement and 5 of 9 patches already have r-b's. Do you, as the primary reviewer of the series, think I can push (hopefully) the final version of the patches? Just in case you want to look at v4 it is

Re: [Xen-devel] [PATCH v3 9/9] xen/gntdev: Implement dma-buf import functionality

2018-06-14 Thread Oleksandr Andrushchenko
On 06/14/2018 01:03 AM, Boris Ostrovsky wrote: On 06/13/2018 05:04 AM, Oleksandr Andrushchenko wrote: On 06/13/2018 06:14 AM, Boris Ostrovsky wrote: On 06/12/2018 09:42 AM, Oleksandr Andrushchenko wrote:   int gntdev_dmabuf_imp_release(struct gntdev_dmabuf_priv *priv, u32 fd

Re: [Xen-devel] [PATCH v3 8/9] xen/gntdev: Implement dma-buf export functionality

2018-06-13 Thread Oleksandr Andrushchenko
On 06/14/2018 01:19 AM, Boris Ostrovsky wrote: On 06/13/2018 07:57 AM, Oleksandr Andrushchenko wrote: On 06/13/2018 05:58 AM, Boris Ostrovsky wrote: On 06/12/2018 09:41 AM, Oleksandr Andrushchenko wrote: + +static struct gntdev_dmabuf * +dmabuf_exp_wait_obj_get_by_fd(struct

Re: [Xen-devel] [PATCH v3 3/9] xen/balloon: Share common memory reservation routines

2018-06-13 Thread Oleksandr Andrushchenko
On 06/13/2018 03:03 PM, Oleksandr Andrushchenko wrote: On 06/13/2018 03:02 PM, Boris Ostrovsky wrote: On 06/13/2018 02:26 AM, Oleksandr Andrushchenko wrote: On 06/13/2018 03:47 AM, Boris Ostrovsky wrote: On 06/12/2018 09:41 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko

Re: [Xen-devel] [PATCH v3 3/9] xen/balloon: Share common memory reservation routines

2018-06-13 Thread Oleksandr Andrushchenko
On 06/13/2018 03:02 PM, Boris Ostrovsky wrote: On 06/13/2018 02:26 AM, Oleksandr Andrushchenko wrote: On 06/13/2018 03:47 AM, Boris Ostrovsky wrote: On 06/12/2018 09:41 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko diff --git a/include/xen/mem-reservation.h b

Re: [Xen-devel] [PATCH v3 8/9] xen/gntdev: Implement dma-buf export functionality

2018-06-13 Thread Oleksandr Andrushchenko
On 06/13/2018 05:58 AM, Boris Ostrovsky wrote: On 06/12/2018 09:41 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko 1. Create a dma-buf from grant references provided by the foreign     domain. By default dma-buf is backed by system memory pages, but     by providing

Re: [Xen-devel] [PATCH v3 9/9] xen/gntdev: Implement dma-buf import functionality

2018-06-13 Thread Oleksandr Andrushchenko
On 06/13/2018 06:14 AM, Boris Ostrovsky wrote: On 06/12/2018 09:42 AM, Oleksandr Andrushchenko wrote:   int gntdev_dmabuf_imp_release(struct gntdev_dmabuf_priv *priv, u32 fd)   { -    return -EINVAL; +    struct gntdev_dmabuf *gntdev_dmabuf; +    struct dma_buf_attachment *attach

Re: [Xen-devel] [PATCH v3 7/9] xen/gntdev: Add initial support for dma-buf UAPI

2018-06-13 Thread Oleksandr Andrushchenko
On 06/13/2018 04:49 AM, Boris Ostrovsky wrote: On 06/12/2018 09:41 AM, Oleksandr Andrushchenko wrote: diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c index a09db23e9663..e82660d81d7e 100644 --- a/drivers/xen/gntdev.c +++ b/drivers/xen/gntdev.c @@ -48,6 +48,9 @@   #include

Re: [Xen-devel] [PATCH v3 6/9] xen/gntdev: Make private routines/structures accessible

2018-06-13 Thread Oleksandr Andrushchenko
On 06/13/2018 04:38 AM, Boris Ostrovsky wrote: On 06/12/2018 09:41 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko This is in preparation for adding support of DMA buffer functionality: make map/unmap related code and structures, used privately by gntdev, ready for dma-buf

Re: [Xen-devel] [PATCH v3 5/9] xen/gntdev: Allow mappings for DMA buffers

2018-06-13 Thread Oleksandr Andrushchenko
On 06/13/2018 04:26 AM, Boris Ostrovsky wrote: On 06/12/2018 09:41 AM, Oleksandr Andrushchenko wrote:     static void gntdev_print_maps(struct gntdev_priv *priv, @@ -121,8 +146,27 @@ static void gntdev_free_map(struct grant_map *map)   if (map == NULL)   return;   +#ifdef

Re: [Xen-devel] [PATCH v3 4/9] xen/grant-table: Allow allocating buffers suitable for DMA

2018-06-13 Thread Oleksandr Andrushchenko
On 06/13/2018 04:12 AM, Boris Ostrovsky wrote: On 06/12/2018 09:41 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko Extend grant table module API to allow allocating buffers that can be used for DMA operations and mapping foreign grant references on top of those

Re: [Xen-devel] [PATCH v3 3/9] xen/balloon: Share common memory reservation routines

2018-06-13 Thread Oleksandr Andrushchenko
On 06/13/2018 04:07 AM, Boris Ostrovsky wrote: On 06/12/2018 09:41 AM, Oleksandr Andrushchenko wrote: One more thing: please add a comment here saying that frames array is array of PFNs (in Xen granularity), which is what XENMEM_populate_physmap requires. And remove (or update to name

Re: [Xen-devel] [PATCH v5 1/3] xen: Sync up with the canonical protocol definitions in Xen

2018-06-13 Thread Oleksandr Andrushchenko
On 06/13/2018 09:40 AM, Juergen Gross wrote: On 13/06/18 08:13, Oleksandr Andrushchenko wrote: On 06/13/2018 09:11 AM, Dmitry Torokhov wrote: On June 12, 2018 10:49:31 PM PDT, Oleksandr Andrushchenko wrote: On 06/13/2018 02:40 AM, Dmitry Torokhov wrote: On Tue, Jun 12, 2018 at 03:46:10PM

Re: [Xen-devel] [PATCH v5 1/3] xen: Sync up with the canonical protocol definitions in Xen

2018-06-13 Thread Oleksandr Andrushchenko
On 06/13/2018 09:25 AM, Dmitry Torokhov wrote: On June 12, 2018 11:13:40 PM PDT, Oleksandr Andrushchenko wrote: On 06/13/2018 09:11 AM, Dmitry Torokhov wrote: On June 12, 2018 10:49:31 PM PDT, Oleksandr Andrushchenko wrote: On 06/13/2018 02:40 AM, Dmitry Torokhov wrote: On Tue, Jun 12

Re: [Xen-devel] [PATCH v3 3/9] xen/balloon: Share common memory reservation routines

2018-06-13 Thread Oleksandr Andrushchenko
On 06/13/2018 03:47 AM, Boris Ostrovsky wrote: On 06/12/2018 09:41 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko diff --git a/include/xen/mem-reservation.h b/include/xen/mem-reservation.h new file mode 100644 index ..e0939387278d --- /dev/null +++ b/include

Re: [Xen-devel] [PATCH v5 1/3] xen: Sync up with the canonical protocol definitions in Xen

2018-06-13 Thread Oleksandr Andrushchenko
On 06/13/2018 09:11 AM, Dmitry Torokhov wrote: On June 12, 2018 10:49:31 PM PDT, Oleksandr Andrushchenko wrote: On 06/13/2018 02:40 AM, Dmitry Torokhov wrote: On Tue, Jun 12, 2018 at 03:46:10PM +0200, Juergen Gross wrote: On 12/06/18 09:48, Oleksandr Andrushchenko wrote: From: Oleksandr

Re: [Xen-devel] [PATCH v5 1/3] xen: Sync up with the canonical protocol definitions in Xen

2018-06-12 Thread Oleksandr Andrushchenko
On 06/13/2018 02:40 AM, Dmitry Torokhov wrote: On Tue, Jun 12, 2018 at 03:46:10PM +0200, Juergen Gross wrote: On 12/06/18 09:48, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko This is the sync up with the canonical definitions of the input, sound and display protocols in Xen

Re: [Xen-devel] [PATCH v5 3/3] Input: xen-kbdfront - allow better run-time configuration

2018-06-12 Thread Oleksandr Andrushchenko
On 06/13/2018 01:07 AM, Dmitry Torokhov wrote: On Tue, Jun 12, 2018 at 10:48:56AM +0300, Oleksandr Andrushchenko wrote: + if (!(with_kbd | with_ptr | with_mtouch)) { I changed this to logical "OR" and applied, thank you. Yes, that's better, thank you + re

Re: [Xen-devel] [PATCH v5 1/3] xen: Sync up with the canonical protocol definitions in Xen

2018-06-12 Thread Oleksandr Andrushchenko
On 06/12/2018 04:46 PM, Juergen Gross wrote: On 12/06/18 09:48, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko This is the sync up with the canonical definitions of the input, sound and display protocols in Xen. Changes to kbdif: 1. Add missing string constants for {feature

[Xen-devel] [PATCH v3 2/9] xen/grant-table: Make set/clear page private code shared

2018-06-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Make set/clear page private code shared and accessible to other kernel modules which can re-use these instead of open-coding. Signed-off-by: Oleksandr Andrushchenko Reviewed-by: Boris Ostrovsky --- drivers/xen/grant-table.c | 54

[Xen-devel] [PATCH v3 1/9] xen/grant-table: Export gnttab_{alloc|free}_pages as GPL

2018-06-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Only gnttab_{alloc|free}_pages are exported as EXPORT_SYMBOL while all the rest are exported as EXPORT_SYMBOL_GPL, thus effectively making it not possible for non-GPL driver modules to use grant table module. Export gnttab_{alloc|free}_pages as EXPORT_SYMBOL_GPL so

[Xen-devel] [PATCH v3 8/9] xen/gntdev: Implement dma-buf export functionality

2018-06-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko 1. Create a dma-buf from grant references provided by the foreign domain. By default dma-buf is backed by system memory pages, but by providing GNTDEV_DMA_FLAG_XXX flags it can also be created as a DMA write-combine/coherent buffer, e.g. allocated

[Xen-devel] [PATCH v3 0/9] xen: dma-buf support for grant device

2018-06-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko This work is in response to my previous attempt to introduce Xen/DRM zero-copy driver [1] to enable Linux dma-buf API [2] for Xen based frontends/backends. There is also an existing hyper_dmabuf approach available [3] which, if reworked to utilize the proposed

[Xen-devel] [PATCH v3 6/9] xen/gntdev: Make private routines/structures accessible

2018-06-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko This is in preparation for adding support of DMA buffer functionality: make map/unmap related code and structures, used privately by gntdev, ready for dma-buf extension, which will re-use these. Rename corresponding structures as those become non-private to gntdev

[Xen-devel] [PATCH v3 5/9] xen/gntdev: Allow mappings for DMA buffers

2018-06-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Allow mappings for DMA backed buffers if grant table module supports such: this extends grant device to not only map buffers made of balloon pages, but also from buffers allocated with dma_alloc_xxx. Signed-off-by: Oleksandr Andrushchenko --- drivers/xen

[Xen-devel] [PATCH v3 9/9] xen/gntdev: Implement dma-buf import functionality

2018-06-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko 1. Import a dma-buf with the file descriptor provided and export granted references to the pages of that dma-buf into the array of grant references. 2. Add API to close all references to an imported buffer, so it can be released by the owner. This is only

[Xen-devel] [PATCH v3 4/9] xen/grant-table: Allow allocating buffers suitable for DMA

2018-06-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Extend grant table module API to allow allocating buffers that can be used for DMA operations and mapping foreign grant references on top of those. The resulting buffer is similar to the one allocated by the balloon driver in terms that proper memory reservation

[Xen-devel] [PATCH v3 7/9] xen/gntdev: Add initial support for dma-buf UAPI

2018-06-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Add UAPI and IOCTLs for dma-buf grant device driver extension: the extension allows userspace processes and kernel modules to use Xen backed dma-buf implementation. With this extension grant references to the pages of an imported dma-buf can be exported for other

[Xen-devel] [PATCH v3 3/9] xen/balloon: Share common memory reservation routines

2018-06-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Memory {increase|decrease}_reservation and VA mappings update/reset code used in balloon driver can be made common, so other drivers can also re-use the same functionality without open-coding. Create a dedicated file for the shared code and export corresponding

[Xen-devel] [PATCH v5 3/3] Input: xen-kbdfront - allow better run-time configuration

2018-06-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko It is now only possible to control if multi-touch virtual device is created or not (via the corresponding XenStore entries), but keyboard and pointer devices are always created. In some cases this is not desirable. For example, if virtual keyboard device is exposed

[Xen-devel] [PATCH v5 2/3] Input: xen-kbdfront - fix multi-touch XenStore node's locations

2018-06-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko kbdif protocol describes multi-touch device parameters as a part of frontend's XenBus configuration nodes while they belong to backend's configuration. Fix this by reading the parameters as defined by the protocol. Fixes: 49aac8204da5 ("Input: xen-kbdfront

[Xen-devel] [PATCH v5 0/3] Input: xen-kbdfront - allow better run-time configuration

2018-06-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Hi, all! This patch series synchronizes Xen canonical protocol definitions which allow the last two patches in the series to update Xen kbdfront driver with a fix and v5 of the patch to allow better run-time configuration for xen-kbdfront. As xen-kbdfront patches

[Xen-devel] [PATCH v5 1/3] xen: Sync up with the canonical protocol definitions in Xen

2018-06-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko This is the sync up with the canonical definitions of the input, sound and display protocols in Xen. Changes to kbdif: 1. Add missing string constants for {feature|request}-raw-pointer to align with the rest of the interface file. 2. Add new XenStore feature

Re: [Xen-devel] [PATCH v2 5/9] xen/gntdev: Allow mappings for DMA buffers

2018-06-11 Thread Oleksandr Andrushchenko
On 06/11/2018 08:46 PM, Julien Grall wrote: Hi, On 06/11/2018 06:16 PM, Oleksandr Andrushchenko wrote: On 06/11/2018 07:51 PM, Stefano Stabellini wrote: On Mon, 11 Jun 2018, Oleksandr Andrushchenko wrote: On 06/08/2018 10:21 PM, Boris Ostrovsky wrote: On 06/08/2018 01:59 PM, Stefano

Re: [Xen-devel] [PATCH v2 5/9] xen/gntdev: Allow mappings for DMA buffers

2018-06-11 Thread Oleksandr Andrushchenko
On 06/11/2018 07:51 PM, Stefano Stabellini wrote: On Mon, 11 Jun 2018, Oleksandr Andrushchenko wrote: On 06/08/2018 10:21 PM, Boris Ostrovsky wrote: On 06/08/2018 01:59 PM, Stefano Stabellini wrote:    @@ -325,6 +401,14 @@ static int map_grant_pages(struct grant_map *map)    map

Re: [Xen-devel] [PATCH v2 5/9] xen/gntdev: Allow mappings for DMA buffers

2018-06-11 Thread Oleksandr Andrushchenko
On 06/08/2018 10:21 PM, Boris Ostrovsky wrote: On 06/08/2018 01:59 PM, Stefano Stabellini wrote:    @@ -325,6 +401,14 @@ static int map_grant_pages(struct grant_map *map)    map->unmap_ops[i].handle = map->map_ops[i].handle;    if (use_ptemod)   

Re: [Xen-devel] [PATCH v2 0/4] Unique-id and fixes to some protocols

2018-06-08 Thread Oleksandr Andrushchenko
On 06/08/2018 09:08 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko Hi, all! This series fixes inconsistency in section used while defining kbdif XenBus entries and adds string "unique-id" XenBus entry missing in displif and kbdif. It also changes sndif's "u

Re: [Xen-devel] [PATCH v2 6/9] xen/gntdev: Add initial support for dma-buf UAPI

2018-06-08 Thread Oleksandr Andrushchenko
On 06/08/2018 01:26 AM, Boris Ostrovsky wrote: On 06/07/2018 03:17 AM, Oleksandr Andrushchenko wrote: On 06/07/2018 12:32 AM, Boris Ostrovsky wrote: On 06/06/2018 05:06 AM, Oleksandr Andrushchenko wrote: On 06/04/2018 11:49 PM, Boris Ostrovsky wrote: diff --git a/drivers/xen/gntdev.c b

Re: [Xen-devel] [PATCH v2 7/9] xen/gntdev: Implement dma-buf export functionality

2018-06-08 Thread Oleksandr Andrushchenko
On 06/08/2018 01:30 AM, Boris Ostrovsky wrote: On 06/07/2018 04:44 AM, Oleksandr Andrushchenko wrote: On 06/07/2018 12:48 AM, Boris Ostrovsky wrote: On 06/06/2018 08:10 AM, Oleksandr Andrushchenko wrote: On 06/05/2018 01:07 AM, Boris Ostrovsky wrote: On 06/01/2018 07:41 AM, Oleksandr

Re: [Xen-devel] [PATCH v2 5/9] xen/gntdev: Allow mappings for DMA buffers

2018-06-08 Thread Oleksandr Andrushchenko
On 06/08/2018 12:46 AM, Boris Ostrovsky wrote: (Stefano, question for you at the end) On 06/07/2018 02:39 AM, Oleksandr Andrushchenko wrote: On 06/07/2018 12:19 AM, Boris Ostrovsky wrote: On 06/06/2018 04:14 AM, Oleksandr Andrushchenko wrote: On 06/04/2018 11:12 PM, Boris Ostrovsky wrote

[Xen-devel] [PATCH v2 3/4] xen/displif: Add unique display connector identifier

2018-06-08 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko If frontend is configured to expose multiple connectors then backend may require a way to uniquely identify concrete virtual connector within the frontend. This is useful for use-cases where connector needs to be matched to physical display connector. Add XenBus

[Xen-devel] [PATCH v2 2/4] xen/kbdif: Add unique input device identifier

2018-06-08 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko If frontend is configured to expose multiple input device instances then backend may require a way to uniquely identify concrete input device within the frontend. This is useful for use-cases where virtual input device needs to be matched to physical input device

[Xen-devel] [PATCH v2 4/4] xen/sndif: Change stream's unique-id to string

2018-06-08 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Display and input protocols define "unique-id" XenBus field as string which is much more flexible in defining unique identifiers comparing to integer used by sound protocol. For example, this allows to provide UUIDs as unique ID's. Align sound protocol wi

[Xen-devel] [PATCH v2 1/4] xen/kbdif: Move multi-touch device parameters to backend nodes

2018-06-08 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko In current kbdif protocol definition multi-touch device parameters are described as a part of frontend's XenBus configuration nodes while they belong to backend's configuration. Fix this by moving the parameters to the proper section. Fixes: b7a3ce49d528 (&quo

[Xen-devel] [PATCH v2 0/4] Unique-id and fixes to some protocols

2018-06-08 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Hi, all! This series fixes inconsistency in section used while defining kbdif XenBus entries and adds string "unique-id" XenBus entry missing in displif and kbdif. It also changes sndif's "unique-id" field from integer to string to be aligne

Re: [Xen-devel] [PATCH 2/3] xen/kbdif: Add unique input device identifier

2018-06-07 Thread Oleksandr Andrushchenko
On 06/07/2018 06:47 PM, Konrad Rzeszutek Wilk wrote: On Thu, Jun 07, 2018 at 04:40:48PM +0300, Oleksandr Andrushchenko wrote: On 06/07/2018 04:28 PM, Konrad Rzeszutek Wilk wrote: On Wed, May 23, 2018 at 09:19:22AM +0300, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko

Re: [Xen-devel] [PATCH 3/3] xen/displif: Add unique display connector identifier

2018-06-07 Thread Oleksandr Andrushchenko
On 06/07/2018 04:29 PM, Konrad Rzeszutek Wilk wrote: On Wed, May 23, 2018 at 09:19:23AM +0300, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko If frontend is configured to expose multiple connectors then backend may require a way to uniquely identify concrete virtual connector

Re: [Xen-devel] [PATCH 2/3] xen/kbdif: Add unique input device identifier

2018-06-07 Thread Oleksandr Andrushchenko
On 06/07/2018 04:28 PM, Konrad Rzeszutek Wilk wrote: On Wed, May 23, 2018 at 09:19:22AM +0300, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko If frontend is configured to expose multiple input device instances then backend may require a way to uniquely identify concrete input

Re: [Xen-devel] [PATCH v2 7/9] xen/gntdev: Implement dma-buf export functionality

2018-06-07 Thread Oleksandr Andrushchenko
On 06/07/2018 12:48 AM, Boris Ostrovsky wrote: On 06/06/2018 08:10 AM, Oleksandr Andrushchenko wrote: On 06/05/2018 01:07 AM, Boris Ostrovsky wrote: On 06/01/2018 07:41 AM, Oleksandr Andrushchenko wrote: + +static struct sg_table * +dmabuf_exp_ops_map_dma_buf(struct dma_buf_attachment

Re: [Xen-devel] [PATCH v2 9/9] xen/gntdev: Expose gntdev's dma-buf API for in-kernel use

2018-06-07 Thread Oleksandr Andrushchenko
On 06/07/2018 01:05 AM, Dongwon Kim wrote: On Wed, Jun 06, 2018 at 05:51:38PM -0400, Boris Ostrovsky wrote: On 06/06/2018 08:46 AM, Oleksandr Andrushchenko wrote: On 06/05/2018 01:36 AM, Boris Ostrovsky wrote: On 06/01/2018 07:41 AM, Oleksandr Andrushchenko wrote: From: Oleksandr

Re: [Xen-devel] [PATCH v2 6/9] xen/gntdev: Add initial support for dma-buf UAPI

2018-06-07 Thread Oleksandr Andrushchenko
On 06/07/2018 12:32 AM, Boris Ostrovsky wrote: On 06/06/2018 05:06 AM, Oleksandr Andrushchenko wrote: On 06/04/2018 11:49 PM, Boris Ostrovsky wrote: On 06/01/2018 07:41 AM, Oleksandr Andrushchenko wrote: +struct gntdev_dmabuf_export_args { +    int dummy; +}; Please define the full structure

Re: [Xen-devel] [PATCH v2 9/9] xen/gntdev: Expose gntdev's dma-buf API for in-kernel use

2018-06-06 Thread Oleksandr Andrushchenko
On 06/05/2018 01:36 AM, Boris Ostrovsky wrote: On 06/01/2018 07:41 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko Allow creating grant device context for use by kernel modules which require functionality, provided by gntdev. Export symbols for dma-buf API provided

Re: [Xen-devel] [PATCH v2 8/9] xen/gntdev: Implement dma-buf import functionality

2018-06-06 Thread Oleksandr Andrushchenko
On 06/05/2018 01:28 AM, Boris Ostrovsky wrote: On 06/01/2018 07:41 AM, Oleksandr Andrushchenko wrote: /* -- */ +static int +dmabuf_imp_grant_foreign_access(struct page **pages, u32 *refs, + int

Re: [Xen-devel] [PATCH v2 7/9] xen/gntdev: Implement dma-buf export functionality

2018-06-06 Thread Oleksandr Andrushchenko
On 06/05/2018 01:07 AM, Boris Ostrovsky wrote: On 06/01/2018 07:41 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko 1. Create a dma-buf from grant references provided by the foreign domain. By default dma-buf is backed by system memory pages, but by providing

Re: [Xen-devel] [PATCH v2 6/9] xen/gntdev: Add initial support for dma-buf UAPI

2018-06-06 Thread Oleksandr Andrushchenko
On 06/04/2018 11:49 PM, Boris Ostrovsky wrote: On 06/01/2018 07:41 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko Add UAPI and IOCTLs for dma-buf grant device driver extension: the extension allows userspace processes and kernel modules to use Xen backed dma-buf

Re: [Xen-devel] [PATCH v2 5/9] xen/gntdev: Allow mappings for DMA buffers

2018-06-06 Thread Oleksandr Andrushchenko
On 06/04/2018 11:12 PM, Boris Ostrovsky wrote: On 06/01/2018 07:41 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko Allow mappings for DMA backed buffers if grant table module supports such: this extends grant device to not only map buffers made of balloon pages, but also

Re: [Xen-devel] [PATCH v2 4/9] xen/grant-table: Allow allocating buffers suitable for DMA

2018-06-06 Thread Oleksandr Andrushchenko
On 06/04/2018 09:46 PM, Boris Ostrovsky wrote: On 06/01/2018 07:41 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko Extend grant table module API to allow allocating buffers that can be used for DMA operations and mapping foreign grant references on top of those. The resulting

Re: [Xen-devel] [PATCH v2 3/9] xen/balloon: Share common memory reservation routines

2018-06-06 Thread Oleksandr Andrushchenko
On 06/04/2018 07:37 PM, Boris Ostrovsky wrote: On 06/01/2018 07:41 AM, Oleksandr Andrushchenko wrote: diff --git a/include/xen/mem-reservation.h b/include/xen/mem-reservation.h new file mode 100644 index ..a727d65a1e61 --- /dev/null +++ b/include/xen/mem-reservation.h @@ -0,0 +1,65

Re: [Xen-devel] [PATCH v2 3/9] xen/balloon: Share common memory reservation routines

2018-06-04 Thread Oleksandr Andrushchenko
On 06/04/2018 07:37 PM, Boris Ostrovsky wrote: On 06/01/2018 07:41 AM, Oleksandr Andrushchenko wrote: diff --git a/include/xen/mem-reservation.h b/include/xen/mem-reservation.h new file mode 100644 index ..a727d65a1e61 --- /dev/null +++ b/include/xen/mem-reservation.h @@ -0,0 +1,65

Re: [Xen-devel] [PATCH v2 2/9] xen/grant-table: Make set/clear page private code shared

2018-06-01 Thread Oleksandr Andrushchenko
Boris, I dropped your r-b for this patch as I changed EXPORT_SYMBOL to EXPORT_SYMBOL_GPL as Juergen requested On 06/01/2018 02:41 PM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko Make set/clear page private code shared and accessible to other kernel modules which can re-use

[Xen-devel] [PATCH v2 7/9] xen/gntdev: Implement dma-buf export functionality

2018-06-01 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko 1. Create a dma-buf from grant references provided by the foreign domain. By default dma-buf is backed by system memory pages, but by providing GNTDEV_DMA_FLAG_XXX flags it can also be created as a DMA write-combine/coherent buffer, e.g. allocated

<    6   7   8   9   10   11   12   13   14   15   >