[PATCH] drm/prime: Clarify DMA-BUF/GEM Object lifetime

2017-01-26 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> From the description of the "DMA-BUF/GEM Object references and lifetime overview" it is not clear when exactly dma_buf gets destroyed and memory freed: only driver .release function mentioned which makes confu

Re: [PATCH] drm/prime: Clarify DMA-BUF/GEM Object lifetime

2017-01-26 Thread Oleksandr Andrushchenko
On 01/26/2017 12:45 PM, Chris Wilson wrote: On Thu, Jan 26, 2017 at 11:36:05AM +0100, Daniel Vetter wrote: On Thu, Jan 26, 2017 at 09:22:46AM +0200, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> From the description of the "

Re: [PATCH] drm/prime: Clarify DMA-BUF/GEM Object lifetime

2017-01-26 Thread Oleksandr Andrushchenko
Thank you for comments, I will update the patch and send v1. On 01/26/2017 12:36 PM, Daniel Vetter wrote: On Thu, Jan 26, 2017 at 09:22:46AM +0200, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> From the description of the "DMA-BUF

[PATCH v1] drm/prime: Clarify DMA-BUF/GEM Object lifetime

2017-01-29 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> From the description of the "DMA-BUF/GEM Object references and lifetime overview" it is not clear when exactly dma_buf gets destroyed and memory freed: only driver .release function mentioned which makes confu

Re: [PATCH v1] drm/prime: Clarify DMA-BUF/GEM Object lifetime

2017-01-29 Thread Oleksandr Andrushchenko
On 01/27/2017 04:00 PM, Daniel Vetter wrote: On Fri, Jan 27, 2017 at 09:04:25AM +0200, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> From the description of the "DMA-BUF/GEM Object references and lifetime overview" it is not cl

Re: GEM allocation for para-virtualized DRM driver

2017-03-19 Thread Oleksandr Andrushchenko
On 03/18/2017 04:06 PM, Rob Clark wrote: On Sat, Mar 18, 2017 at 9:25 AM, Oleksandr Andrushchenko <andr2...@gmail.com> wrote: Hi, Rob On 03/18/2017 02:22 PM, Rob Clark wrote: On Fri, Mar 17, 2017 at 1:39 PM, Oleksandr Andrushchenko <andr2...@gmail.com> wrote: Hello, I am wr

Re: GEM allocation for para-virtualized DRM driver

2017-03-19 Thread Oleksandr Andrushchenko
Hi, Rob On 03/18/2017 02:22 PM, Rob Clark wrote: On Fri, Mar 17, 2017 at 1:39 PM, Oleksandr Andrushchenko <andr2...@gmail.com> wrote: Hello, I am writing a para-virtualized DRM driver for Xen hypervisor and it now works with DRM CMA helpers, but I would also like to make it work wi

Re: GEM allocation for para-virtualized DRM driver

2017-03-19 Thread Oleksandr Andrushchenko
On 03/18/2017 04:50 PM, Rob Clark wrote: On Sat, Mar 18, 2017 at 10:44 AM, Oleksandr Andrushchenko <andr2...@gmail.com> wrote: then TTM might be useful. I was looking into it, but it seems to be an overkill in my case And isn't it that GEM should be used for new drivers, n

GEM allocation for para-virtualized DRM driver

2017-03-17 Thread Oleksandr Andrushchenko
Hello, I am writing a para-virtualized DRM driver for Xen hypervisor and it now works with DRM CMA helpers, but I would also like to make it work with non-contigous memory: virtual machine that the driver runs in can't guarantee that CMA is actually physically contigous (that is not a problem

Re: GEM allocation for para-virtualized DRM driver

2017-03-20 Thread Oleksandr Andrushchenko
On 03/20/2017 08:52 PM, Rob Clark wrote: On Mon, Mar 20, 2017 at 2:25 PM, Oleksandr Andrushchenko <andr2...@gmail.com> wrote: On 03/20/2017 08:17 PM, Rob Clark wrote: On Mon, Mar 20, 2017 at 2:01 PM, Oleksandr Andrushchenko <andr2...@gmail.com> wrote: On 03/20/2017 07:38 PM, Rob

Re: GEM allocation for para-virtualized DRM driver

2017-03-20 Thread Oleksandr Andrushchenko
On 03/20/2017 07:38 PM, Rob Clark wrote: On Mon, Mar 20, 2017 at 1:18 PM, Oleksandr Andrushchenko <andr2...@gmail.com> wrote: On 03/18/2017 02:22 PM, Rob Clark wrote: On Fri, Mar 17, 2017 at 1:39 PM, Oleksandr Andrushchenko <andr2...@gmail.com> wrote: Hello, I am writing a para

Re: GEM allocation for para-virtualized DRM driver

2017-03-20 Thread Oleksandr Andrushchenko
On 03/20/2017 08:17 PM, Rob Clark wrote: On Mon, Mar 20, 2017 at 2:01 PM, Oleksandr Andrushchenko <andr2...@gmail.com> wrote: On 03/20/2017 07:38 PM, Rob Clark wrote: On Mon, Mar 20, 2017 at 1:18 PM, Oleksandr Andrushchenko <andr2...@gmail.com> wrote: On 03/18/2017 02:22 PM, Rob

Re: GEM allocation for para-virtualized DRM driver

2017-03-20 Thread Oleksandr Andrushchenko
On 03/18/2017 02:22 PM, Rob Clark wrote: On Fri, Mar 17, 2017 at 1:39 PM, Oleksandr Andrushchenko <andr2...@gmail.com> wrote: Hello, I am writing a para-virtualized DRM driver for Xen hypervisor and it now works with DRM CMA helpers, but I would also like to make it work with non-con

Re: GEM allocation for para-virtualized DRM driver

2017-03-21 Thread Oleksandr Andrushchenko
On 03/20/2017 08:52 PM, Rob Clark wrote: On Mon, Mar 20, 2017 at 2:25 PM, Oleksandr Andrushchenko <andr2...@gmail.com> wrote: On 03/20/2017 08:17 PM, Rob Clark wrote: On Mon, Mar 20, 2017 at 2:01 PM, Oleksandr Andrushchenko <andr2...@gmail.com> wrote: On 03/20/2017 07:38 PM, Rob

Re: [Xen-devel] [RFC PATCH 01/60] hyper_dmabuf: initial working version of hyper_dmabuf drv

2017-12-21 Thread Oleksandr Andrushchenko
On 12/20/2017 01:27 AM, Dongwon Kim wrote: This patch series contains the implementation of a new device driver, hyper_dmabuf, which provides a method for DMA-BUF sharing across different OSes running on the same virtual OS platform powered by a hypervisor. This is very interesting at least in

Re: linux-next: build failure after merge of the drm-intel tree

2018-05-08 Thread Oleksandr Andrushchenko
" Signed-off-by: Stephen Rothwell <s...@canb.auug.org.au> Thank you, Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> --- drivers/gpu/drm/xen/xen_drm_front.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xen/xen_drm_front.c b/

Re: [PATCH 1/3] drm/xen-front: checking for NULL instead of IS_ERR

2018-05-08 Thread Oleksandr Andrushchenko
On 05/08/2018 12:26 PM, Dan Carpenter wrote: drm_dev_alloc() returns error pointers, it never returns NULL. Fixes: c575b7eeb89f ("drm/xen-front: Add support for Xen PV display frontend") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> Thank you, Reviewed-by: Oleksan

Re: [PATCH 2/3] drm/xen-front: fix xen_drm_front_shbuf_alloc() error handling

2018-05-08 Thread Oleksandr Andrushchenko
pport for Xen PV display frontend") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> Thank you, Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> diff --git a/drivers/gpu/drm/xen/xen_drm_front_shbuf.c b/drivers/gpu/drm/xen/xen_drm_front_shbuf.c index d570

Re: [PATCH 3/3] drm/xen-front: Fix loop timeout

2018-05-08 Thread Oleksandr Andrushchenko
n...@oracle.com> Thank you, Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> diff --git a/drivers/gpu/drm/xen/xen_drm_front.c b/drivers/gpu/drm/xen/xen_drm_front.c index 378cb7ce0db5..3345ac71b391 100644 --- a/drivers/gpu/drm/xen/xen_drm_front.c +++ b/drivers/gpu/d

Re: [Xen-devel] [PATCH 0/1] drm/xen-zcopy: Add Xen zero-copy helper DRM driver

2018-04-27 Thread Oleksandr Andrushchenko
On 04/25/2018 08:16 PM, Dongwon Kim wrote: On Wed, Apr 25, 2018 at 08:34:55AM +0200, Daniel Vetter wrote: On Wed, Apr 25, 2018 at 09:07:07AM +0300, Oleksandr Andrushchenko wrote: On 04/24/2018 11:35 PM, Dongwon Kim wrote: Had a meeting with Daniel and talked about bringing out generic part

Re: [PATCH 3/3] drm/xen-front: Fix loop timeout

2018-05-08 Thread Oleksandr Andrushchenko
On 05/08/2018 12:37 PM, Oleksandr Andrushchenko wrote: On 05/08/2018 12:28 PM, Dan Carpenter wrote: If the loop times out then we want to exit with "to" set to zero, but in the current code it's set to -1. Fixes: c575b7eeb89f ("drm/xen-front: Add support for Xen PV display fro

Re: [PATCH 2/3] drm/xen-front: fix xen_drm_front_shbuf_alloc() error handling

2018-05-08 Thread Oleksandr Andrushchenko
On 05/08/2018 12:37 PM, Oleksandr Andrushchenko wrote: On 05/08/2018 12:27 PM, Dan Carpenter wrote: The xen_drm_front_shbuf_alloc() function was returning a mix of error pointers and NULL and the the caller wasn't checking correctly. I've changed it to always return error pointer consistently

Re: [PATCH 1/3] drm/xen-front: checking for NULL instead of IS_ERR

2018-05-08 Thread Oleksandr Andrushchenko
On 05/08/2018 12:34 PM, Oleksandr Andrushchenko wrote: On 05/08/2018 12:26 PM, Dan Carpenter wrote: drm_dev_alloc() returns error pointers, it never returns NULL. Fixes: c575b7eeb89f ("drm/xen-front: Add support for Xen PV display frontend") Signed-off-by: Dan Carpenter &

[Xen-devel][RFC 0/3] dma-buf support for gntdev

2018-05-17 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> 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]

[Xen-devel][RFC 3/3] xen/gntdev: Add support for Linux dma buffers

2018-05-17 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> --- drivers/xen/gntdev.c | 954 +- include/uapi/xen/gntdev.h | 101 include/xen/gntdev_exp.h | 2

[Xen-devel][RFC 1/3] xen/balloon: Allow allocating DMA buffers

2018-05-17 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> --- drivers/xen/balloon.c | 214 +++--- drivers/xen/xen-balloon.c | 2 + include/xen/balloon.h | 11

[Xen-devel][RFC 2/3] xen/grant-table: Extend API to work with DMA buffers

2018-05-17 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> --- drivers/xen/grant-table.c | 49 +++ include/xen/grant_table.h | 7 ++ 2 files changed, 56 inserti

Re: [PATCH][next] drm/xen-front: fix spelling mistake: "conector" -> "connector"

2018-05-15 Thread Oleksandr Andrushchenko
On 05/15/2018 11:54 AM, Colin King wrote: From: Colin Ian King <colin.k...@canonical.com> Trivial fix to spelling mistake in DRM_INFO message. Signed-off-by: Colin Ian King <colin.k...@canonical.com> Thank you, Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrush

Re: [Xen-devel] [RFC 1/3] xen/balloon: Allow allocating DMA buffers

2018-05-21 Thread Oleksandr Andrushchenko
On 05/21/2018 07:35 PM, Boris Ostrovsky wrote: On 05/21/2018 01:40 AM, Oleksandr Andrushchenko wrote: On 05/19/2018 01:04 AM, Boris Ostrovsky wrote: On 05/17/2018 04:26 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> A commit message

Re: [Xen-devel] [RFC 1/3] xen/balloon: Allow allocating DMA buffers

2018-05-22 Thread Oleksandr Andrushchenko
On 05/22/2018 05:33 PM, Boris Ostrovsky wrote: On 05/22/2018 01:55 AM, Oleksandr Andrushchenko wrote: On 05/21/2018 11:36 PM, Boris Ostrovsky wrote: On 05/21/2018 03:13 PM, Oleksandr Andrushchenko wrote: On 05/21/2018 09:53 PM, Boris Ostrovsky wrote: On 05/21/2018 01:32 PM, Oleksandr

[PATCH] drm: Fix possible race conditions while unplugging DRM device

2018-05-22 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> When unplugging a hotpluggable DRM device we first unregister it with drm_dev_unregister and then set drm_device.unplugged flag which is used to mark device critical sections with drm_dev_enter()/ drm_dev_exit() preventing

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

2018-05-23 Thread Oleksandr Andrushchenko
On 05/23/2018 12:19 PM, Juergen Gross wrote: On 21/05/18 09:39, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Building for a 32-bit target results in warnings from casting between a 32-bit pointer and a 64-bit integer. Fix the wa

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

2018-05-23 Thread Oleksandr Andrushchenko
On 05/23/2018 02:06 PM, Juergen Gross wrote: On 23/05/18 12:00, Oleksandr Andrushchenko wrote: On 05/23/2018 12:19 PM, Juergen Gross wrote: On 21/05/18 09:39, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Building for a 32-bit target r

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

2018-05-23 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Building for a 32-bit target results in warnings from casting between a 32-bit pointer and a 64-bit integer. Fix the warnings by casting those pointers to uintptr_t first. Signed-off-by: Oleksandr Andrush

[PATCH 8/8] xen/gntdev: Expose gntdev's dma-buf API for in-kernel use

2018-05-25 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Allow creating grant device context for use by kernel modules which require functionality, provided by gntdev. Export symbols for dma-buf API provided by the module. Signed-off-by: Oleksandr Andrushchenko <oleksandr_a

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

2018-05-25 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> 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]

[PATCH 6/8] xen/gntdev: Implement dma-buf export functionality

2018-05-25 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> 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-c

[PATCH 2/8] xen/balloon: Move common memory reservation routines to a module

2018-05-25 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> 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

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

2018-05-25 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> 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 <oleksandr_andrushche...@epam.com> --- drivers/xen/g

[PATCH 5/8] xen/gntdev: Add initial support for dma-buf UAPI

2018-05-25 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> 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 im

[PATCH 4/8] xen/gntdev: Allow mappings for DMA buffers

2018-05-25 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> 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: Ole

[PATCH 7/8] xen/gntdev: Implement dma-buf import functionality

2018-05-25 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> 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

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

2018-05-25 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> 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

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

2018-05-24 Thread Oleksandr Andrushchenko
On 05/23/2018 02:46 PM, Juergen Gross wrote: On 23/05/18 13:36, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Building for a 32-bit target results in warnings from casting between a 32-bit pointer and a 64-bit integer. Fix the wa

Re: [Xen-devel] [RFC 1/3] xen/balloon: Allow allocating DMA buffers

2018-05-22 Thread Oleksandr Andrushchenko
On 05/22/2018 09:02 PM, Boris Ostrovsky wrote: On 05/22/2018 11:00 AM, Oleksandr Andrushchenko wrote: On 05/22/2018 05:33 PM, Boris Ostrovsky wrote: On 05/22/2018 01:55 AM, Oleksandr Andrushchenko wrote: On 05/21/2018 11:36 PM, Boris Ostrovsky wrote: On 05/21/2018 03:13 PM, Oleksandr

[PATCH] drm/xen-front: fix pointer casts

2018-05-21 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Building for a 32-bit target results in warnings from casting between a 32-bit pointer and a 64-bit integer. Fix the warnings by casting those pointers to uintptr_t first. Signed-off-by: Oleksandr Andrush

Re: [Xen-devel][RFC 3/3] xen/gntdev: Add support for Linux dma buffers

2018-05-21 Thread Oleksandr Andrushchenko
you change it to something else like... "xen_"? Np, will rename On Thu, May 17, 2018 at 11:26:04AM +0300, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.co

Re: [Xen-devel] [RFC 1/3] xen/balloon: Allow allocating DMA buffers

2018-05-22 Thread Oleksandr Andrushchenko
On 05/21/2018 09:53 PM, Boris Ostrovsky wrote: On 05/21/2018 01:32 PM, Oleksandr Andrushchenko wrote: On 05/21/2018 07:35 PM, Boris Ostrovsky wrote: On 05/21/2018 01:40 AM, Oleksandr Andrushchenko wrote: On 05/19/2018 01:04 AM, Boris Ostrovsky wrote: On 05/17/2018 04:26 AM, Oleksandr

Re: [Xen-devel] [RFC 1/3] xen/balloon: Allow allocating DMA buffers

2018-05-21 Thread Oleksandr Andrushchenko
On 05/21/2018 11:36 PM, Boris Ostrovsky wrote: On 05/21/2018 03:13 PM, Oleksandr Andrushchenko wrote: On 05/21/2018 09:53 PM, Boris Ostrovsky wrote: On 05/21/2018 01:32 PM, Oleksandr Andrushchenko wrote: On 05/21/2018 07:35 PM, Boris Ostrovsky wrote: On 05/21/2018 01:40 AM, Oleksandr

Re: [Xen-devel] [RFC 1/3] xen/balloon: Allow allocating DMA buffers

2018-05-20 Thread Oleksandr Andrushchenko
On 05/19/2018 01:04 AM, Boris Ostrovsky wrote: On 05/17/2018 04:26 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> A commit message would be useful. Sure, v1 will have it Signed-off-by: Oleksandr Andrushchenko <oleksandr_a

Re: [Xen-devel][RFC 2/3] xen/grant-table: Extend API to work with DMA buffers

2018-05-20 Thread Oleksandr Andrushchenko
On 05/19/2018 01:19 AM, Boris Ostrovsky wrote: On 05/17/2018 04:26 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> --- drivers/xen/grant-

Re: [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: [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: [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 5/9] xen/gntdev: Allow mappings for DMA buffers

2018-06-12 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-12 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: [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

Re: [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: [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: [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: [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: [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: [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: [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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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: [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: [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: [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->

[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

Re: [bug report] drm/prime: replace NULL with error value in drm_prime_pages_to_sg

2018-06-14 Thread Oleksandr Andrushchenko
On 06/15/2018 06:22 AM, YoungJun Cho wrote: Dear Dan, Your mail flashes back to my memory 5 years ago. Back then, I had cleaned up the exynos driver. And the replacement IS_ERR was one of items. IMHO it is still better to modify those two functions, drm_gem_cma_prime_get_sg_table and

Re: [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: [PATCH v3 9/9] xen/gntdev: Implement dma-buf import functionality

2018-06-14 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: [PATCH v3 7/9] xen/gntdev: Add initial support for dma-buf UAPI

2018-06-14 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: [PATCH v3 8/9] xen/gntdev: Implement dma-buf export functionality

2018-06-14 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: [PATCH v3 8/9] xen/gntdev: Implement dma-buf export functionality

2018-06-14 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: [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: [PATCH v3 3/9] xen/balloon: Share common memory reservation routines

2018-06-14 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: [PATCH v3 3/9] xen/balloon: Share common memory reservation routines

2018-06-14 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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

  1   2   3   4   5   >