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

2018-06-15 Thread Oleksandr Andrushchenko
@@ -548,6 +632,17 @@ static int gntdev_open(struct inode *inode, struct file *flip) } flip->private_data = priv; +#ifdef CONFIG_XEN_GRANT_DMA_ALLOC + priv->dma_dev = gntdev_miscdev.this_device; + + /* +* The device is not spawn from a device tree, so

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

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

2018-06-15 Thread Oleksandr Andrushchenko
On 06/15/2018 12:08 PM, Dan Carpenter wrote: On Fri, Jun 15, 2018 at 08:39:17AM +0300, Oleksandr Andrushchenko wrote: 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

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 3/8] drm/xen-front: fix 32-bit build warning

2018-05-28 Thread Oleksandr Andrushchenko
Hi, On 05/25/2018 06:50 PM, Arnd Bergmann wrote: In 32-bit kernel builds, we cannot cast between a pointer and a 64-bit type: In file included from drivers/gpu/drm/xen/xen_drm_front_cfg.c:18: drivers/gpu/drm/xen/xen_drm_front.h: In function 'xen_drm_front_fb_to_cookie':

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

2018-05-29 Thread Oleksandr Andrushchenko
ping On 05/22/2018 05:13 PM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko 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

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

2018-05-29 Thread Oleksandr Andrushchenko
On 05/29/2018 09:04 PM, Boris Ostrovsky wrote: On 05/25/2018 11:33 AM, Oleksandr Andrushchenko wrote: 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

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

2018-05-29 Thread Oleksandr Andrushchenko
On 05/29/2018 09:24 PM, Boris Ostrovsky wrote: On 05/25/2018 11:33 AM, Oleksandr Andrushchenko wrote: + +void xenmem_reservation_va_mapping_update(unsigned long count, + struct page **pages, + xen_pfn_t *frames

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

2018-05-30 Thread Oleksandr Andrushchenko
On 05/30/2018 06:54 PM, Boris Ostrovsky wrote: On 05/30/2018 04:29 AM, Oleksandr Andrushchenko wrote: On 05/29/2018 11:03 PM, Boris Ostrovsky wrote: On 05/29/2018 02:22 PM, Oleksandr Andrushchenko wrote: On 05/29/2018 09:04 PM, Boris Ostrovsky wrote: On 05/25/2018 11:33 AM, Oleksandr

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

2018-05-30 Thread Oleksandr Andrushchenko
On 05/30/2018 06:20 PM, Boris Ostrovsky wrote: On 05/30/2018 02:34 AM, Oleksandr Andrushchenko wrote: On 05/29/2018 10:10 PM, Boris Ostrovsky wrote: On 05/25/2018 11:33 AM, Oleksandr Andrushchenko wrote: +/** + * gnttab_dma_free_pages - free DMAable pages + * @args: arguments to the function

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

2018-05-30 Thread Oleksandr Andrushchenko
On 05/31/2018 04:46 AM, Boris Ostrovsky wrote: On 05/25/2018 11:33 AM, Oleksandr Andrushchenko wrote: Oleksandr Andrushchenko (8):    xen/grant-table: Make set/clear page private code shared    xen/balloon: Move common memory reservation routines to a module    xen/grant-table: Allow

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

2018-05-30 Thread Oleksandr Andrushchenko
On 05/31/2018 12:34 AM, Dongwon Kim wrote: On Fri, May 25, 2018 at 06:33:24PM +0300, Oleksandr Andrushchenko wrote: 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

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

2018-05-30 Thread Oleksandr Andrushchenko
On 05/31/2018 02:10 AM, Dongwon Kim wrote: On Fri, May 25, 2018 at 06:33:29PM +0300, 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

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

2018-05-31 Thread Oleksandr Andrushchenko
On 05/30/2018 10:24 PM, Boris Ostrovsky wrote: On 05/30/2018 01:46 PM, Oleksandr Andrushchenko wrote: On 05/30/2018 06:54 PM, Boris Ostrovsky wrote: BTW, I also think you can further simplify xenmem_reservation_va_mapping_* routines by bailing out right away if xen_feature

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

2018-05-31 Thread Oleksandr Andrushchenko
On 05/29/2018 10:49 AM, Daniel Vetter wrote: On Tue, May 29, 2018 at 10:09:57AM +0300, Oleksandr Andrushchenko wrote: On 05/29/2018 10:02 AM, Daniel Vetter wrote: On Tue, May 22, 2018 at 05:13:04PM +0300, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko When unplugging

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

2018-05-29 Thread Oleksandr Andrushchenko
On 05/29/2018 10:02 AM, Daniel Vetter wrote: On Tue, May 22, 2018 at 05:13:04PM +0300, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko When unplugging a hotpluggable DRM device we first unregister it with drm_dev_unregister and then set drm_device.unplugged flag which is used

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

2018-05-29 Thread Oleksandr Andrushchenko
On 05/30/2018 07:24 AM, Juergen Gross wrote: On 25/05/18 17:33, Oleksandr Andrushchenko wrote: 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

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

2018-05-30 Thread Oleksandr Andrushchenko
On 05/30/2018 07:32 AM, Juergen Gross wrote: On 25/05/18 17:33, Oleksandr Andrushchenko wrote: 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

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

2018-05-30 Thread Oleksandr Andrushchenko
On 05/30/2018 01:34 AM, Boris Ostrovsky wrote: On 05/25/2018 11:33 AM, Oleksandr Andrushchenko wrote: +/* + * Create a dma-buf [1] from grant references @refs of count @count provided + * by the foreign domain @domid with flags @flags. + * + * By default dma-buf is backed by system memory

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

2018-05-30 Thread Oleksandr Andrushchenko
On 05/29/2018 10:10 PM, Boris Ostrovsky wrote: On 05/25/2018 11:33 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: [PATCH 4/8] xen/gntdev: Allow mappings for DMA buffers

2018-05-30 Thread Oleksandr Andrushchenko
On 05/30/2018 12:52 AM, Boris Ostrovsky wrote: On 05/25/2018 11:33 AM, Oleksandr Andrushchenko wrote: struct unmap_notify { @@ -96,10 +104,28 @@ struct grant_map { struct gnttab_unmap_grant_ref *kunmap_ops; struct page **pages; unsigned long pages_vm_start

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

2018-05-30 Thread Oleksandr Andrushchenko
On 05/25/2018 06:33 PM, Oleksandr Andrushchenko wrote: diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig index 3431fe210624..eaf63a2c7ae6 100644 --- a/drivers/xen/Kconfig +++ b/drivers/xen/Kconfig @@ -152,6 +152,16 @@ config XEN_GNTDEV help Allows userspace processes

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

2018-05-30 Thread Oleksandr Andrushchenko
On 05/29/2018 11:03 PM, Boris Ostrovsky wrote: On 05/29/2018 02:22 PM, Oleksandr Andrushchenko wrote: On 05/29/2018 09:04 PM, Boris Ostrovsky wrote: On 05/25/2018 11:33 AM, Oleksandr Andrushchenko wrote: @@ -463,11 +457,6 @@ static enum bp_state increase_reservation(unsigned long nr_pages

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

2018-05-30 Thread Oleksandr Andrushchenko
On 05/25/2018 06:33 PM, 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 by the module. Signed-off-by: Oleksandr Andrushchenko

Re: [PATCH v3] Add udmabuf misc device

2018-05-29 Thread Oleksandr Andrushchenko
On 05/25/2018 05:08 PM, Gerd Hoffmann wrote: A driver to let userspace turn memfd regions into dma-bufs. Use case: Allows qemu create dmabufs for the vga framebuffer or virtio-gpu ressources. Then they can be passed around to display those guest things on the host. To spice client for

Re: [PATCH v3] Add udmabuf misc device

2018-05-29 Thread Oleksandr Andrushchenko
On 05/29/2018 01:50 PM, Gerd Hoffmann wrote: Hi, +config UDMABUF + bool "userspace dmabuf misc driver" + default n + depends on DMA_SHARED_BUFFER Don't you want "select DMA_SHARED_BUFFER" here instead? Why do you think so? After thinking a bit more your code looks ok,

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

2018-05-31 Thread Oleksandr Andrushchenko
On 05/31/2018 11:25 PM, Boris Ostrovsky wrote: On 05/31/2018 10:41 AM, Oleksandr Andrushchenko wrote: On 05/31/2018 08:51 AM, Oleksandr Andrushchenko wrote: On 05/31/2018 04:46 AM, Boris Ostrovsky wrote: On 05/25/2018 11:33 AM, Oleksandr Andrushchenko wrote: Oleksandr Andrushchenko (8

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

[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

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

2018-06-01 Thread Oleksandr Andrushchenko
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 by the module. Signed-off-by: Oleksandr Andrushchenko --- drivers/xen/gntdev-dmabuf.c | 6 +++ drivers/xen

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

2018-06-01 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 v2 3/9] xen/balloon: Share common memory reservation routines

2018-06-01 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 v2 1/9] xen/grant-table: Export gnttab_{alloc|free}_pages as GPL

2018-06-01 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 v2 0/9] xen: dma-buf support for grant device

2018-06-01 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 v2 5/9] xen/gntdev: Allow mappings for DMA buffers

2018-06-01 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 v2 4/9] xen/grant-table: Allow allocating buffers suitable for DMA

2018-06-01 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 v2 6/9] xen/gntdev: Add initial support for dma-buf UAPI

2018-06-01 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 v2 2/9] xen/grant-table: Make set/clear page private code shared

2018-06-01 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 --- drivers/xen/grant-table.c | 54 +-- include/xen

Re: [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: [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 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: [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-07 Thread Oleksandr Andrushchenko
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: On 06/01/2018 07:41 AM, Oleksandr Andrushchenko wrote: @@ -121,8 +146,27 @@ static void gntdev_free_map(struct grant_map *map)   if (map

Re: [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-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: [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: [PATCH v2 3/9] xen/balloon: Share common memory reservation routines

2018-06-06 Thread Oleksandr Andrushchenko
On 06/07/2018 12:09 AM, Boris Ostrovsky wrote: On 06/06/2018 03:24 AM, Oleksandr Andrushchenko wrote: 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

Re: [PATCH] dma-buf: make map_atomic and map function pointers optional

2018-05-30 Thread Oleksandr Andrushchenko
09,8 @@ void *dma_buf_kmap(struct dma_buf *dmabuf, unsigned long page_num) { WARN_ON(!dmabuf); + if (!dmabuf->ops->map) + return NULL; return dmabuf->ops->map(dmabuf, page_num); } EXPORT_SYMBOL_GPL(dma_buf_kmap); Reviewed-by:

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

2018-05-31 Thread Oleksandr Andrushchenko
On 05/31/2018 10:51 AM, Oleksandr Andrushchenko wrote: On 05/30/2018 10:24 PM, Boris Ostrovsky wrote: On 05/30/2018 01:46 PM, Oleksandr Andrushchenko wrote: On 05/30/2018 06:54 PM, Boris Ostrovsky wrote: BTW, I also think you can further simplify xenmem_reservation_va_mapping_* routines

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

2018-05-31 Thread Oleksandr Andrushchenko
On 05/31/2018 08:55 AM, Oleksandr Andrushchenko wrote: On 05/31/2018 02:10 AM, Dongwon Kim wrote: On Fri, May 25, 2018 at 06:33:29PM +0300, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko 1. Create a dma-buf from grant references provided by the foreign     domain. By default

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

2018-05-31 Thread Oleksandr Andrushchenko
On 05/31/2018 08:51 AM, Oleksandr Andrushchenko wrote: On 05/31/2018 04:46 AM, Boris Ostrovsky wrote: On 05/25/2018 11:33 AM, Oleksandr Andrushchenko wrote: Oleksandr Andrushchenko (8):    xen/grant-table: Make set/clear page private code shared    xen/balloon: Move common memory

Re: [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: [PATCH v4 0/9] xen: dma-buf support for grant device

2018-07-02 Thread Oleksandr Andrushchenko
or objections are there so this seems reasonable to me now. 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-copy driver [1] to enable Linux dma-buf API [2] for Xen

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

Questions on page flips and atomic modeset

2018-02-05 Thread Oleksandr Andrushchenko
n on broken connection, for example. 4. As per my understanding I cannot put XENDISPL_OP_PG_FLIP request into .atomic_check as the check doesn't guarantee that .atomic_flush will follow. Is this correct or there is a more neat solution exists? Thank you very much for you time, Oleksandr Andrushchenko [

Atomic driver and old remove FB behavior

2018-01-31 Thread Oleksandr Andrushchenko
Hi, all! I am working on a para-virtualized frontend DRM driver for Xen [1] which implements display device I/O interface for Xen guest OSes [2]. At the moment I am rebasing the existing implementation from 4.9 kernel to recent and found that when user-space DRM application exits then CRTC's

Re: Atomic driver and old remove FB behavior

2018-02-01 Thread Oleksandr Andrushchenko
On 02/01/2018 12:04 PM, Maarten Lankhorst wrote: Op 01-02-18 om 08:08 schreef Oleksandr Andrushchenko: Hi, all! I am working on a para-virtualized frontend DRM driver for Xen [1] which implements display device I/O interface for Xen guest OSes [2]. At the moment I am rebasing the existing

Re: Atomic driver and old remove FB behavior

2018-02-08 Thread Oleksandr Andrushchenko
Hi, Maarten! On 02/06/2018 05:37 PM, Maarten Lankhorst wrote: Op 06-02-18 om 15:43 schreef Oleksandr Andrushchenko: Hello, Maarten! On 02/01/2018 12:13 PM, Oleksandr Andrushchenko wrote: On 02/01/2018 12:04 PM, Maarten Lankhorst wrote: Op 01-02-18 om 08:08 schreef Oleksandr Andrushchenko

Re: Questions on page flips and atomic modeset

2018-02-08 Thread Oleksandr Andrushchenko
Hello, Ville! On 02/06/2018 06:04 PM, Ville Syrjälä wrote: On Tue, Feb 06, 2018 at 11:59:37AM +0200, Oleksandr Andrushchenko wrote: Hello, Ville! Thank you very much for such a comprehensive answer. Please see inline On 02/05/2018 06:47 PM, Ville Syrjälä wrote: On Mon, Feb 05, 2018 at 06

Re: Questions on page flips and atomic modeset

2018-02-06 Thread Oleksandr Andrushchenko
Hello, Ville! Thank you very much for such a comprehensive answer. Please see inline On 02/05/2018 06:47 PM, Ville Syrjälä wrote: On Mon, Feb 05, 2018 at 06:03:25PM +0200, Oleksandr Andrushchenko wrote: Hello, I have a DRM driver which implements display protocol for Xen [1

Re: Atomic driver and old remove FB behavior

2018-02-06 Thread Oleksandr Andrushchenko
Hello, Maarten! On 02/01/2018 12:13 PM, Oleksandr Andrushchenko wrote: On 02/01/2018 12:04 PM, Maarten Lankhorst wrote: Op 01-02-18 om 08:08 schreef Oleksandr Andrushchenko: Hi, all! I am working on a para-virtualized frontend DRM driver for Xen [1] which implements display device I/O

[PATCH 2/4] drm/mxsfb: Do not use deprecated drm_driver.{enable|disable)_vblank

2018-02-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Do not use deprecated drm_driver.{enable|disable)_vblank callbacks, but use drm_simple_kms_helpe's pipe callbacks instead. Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Cc: Marek Vasut &l

[PATCH 3/4] drm/tve200: Do not use deprecated drm_driver.{enable|disable)_vblank

2018-02-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Do not use deprecated drm_driver.{enable|disable)_vblank callbacks, but use drm_simple_kms_helpe's pipe callbacks instead. Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Cc: Linus Walleij

[PATCH 0/4] drm/simple_kms_helper: Add {enable|disable}_vblank callback support

2018-02-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> If simple_kms_helper based driver needs to work with vblanks, then it has to provide drm_driver.{enable|disable}_vblank callbacks, because drm_simple_kms_helper.drm_crtc_funcs does not provide any. At the same time drm_

[PATCH 1/4] drm/simple_kms_helper: Add {enable|disable}_vblank callback support

2018-02-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> If simple_kms_helper based driver needs to work with vblanks, then it has to provide drm_driver.{enable|disable}_vblank callbacks, because drm_simple_kms_helper.drm_crtc_funcs does not provide any. At the same time drm_

[PATCH 4/4] drm/pl111: Do not use deprecated drm_driver.{enable|disable)_vblank

2018-02-12 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Do not use deprecated drm_driver.{enable|disable)_vblank callbacks, but use drm_simple_kms_helpe's pipe callbacks instead. Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Cc: Eric Anholt <

Re: Questions on page flips and atomic modeset

2018-02-09 Thread Oleksandr Andrushchenko
On 02/09/2018 06:24 PM, Ville Syrjälä wrote: On Fri, Feb 09, 2018 at 06:09:09PM +0200, Oleksandr Andrushchenko wrote: On 02/09/2018 05:53 PM, Ville Syrjälä wrote: On Thu, Feb 08, 2018 at 11:53:30AM +0200, Oleksandr Andrushchenko wrote: Hello, Ville! On 02/06/2018 06:04 PM, Ville Syrjälä

Re: Questions on page flips and atomic modeset

2018-02-09 Thread Oleksandr Andrushchenko
On 02/09/2018 05:53 PM, Ville Syrjälä wrote: On Thu, Feb 08, 2018 at 11:53:30AM +0200, Oleksandr Andrushchenko wrote: Hello, Ville! On 02/06/2018 06:04 PM, Ville Syrjälä wrote: On Tue, Feb 06, 2018 at 11:59:37AM +0200, Oleksandr Andrushchenko wrote: Hello, Ville! Thank you very much

Re: [PATCH 3/4] drm/tve200: Do not use deprecated drm_driver.{enable|disable)_vblank

2018-02-13 Thread Oleksandr Andrushchenko
On 02/13/2018 03:51 PM, Linus Walleij wrote: On Mon, Feb 12, 2018 at 9:52 AM, Oleksandr Andrushchenko <andr2...@gmail.com> wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Do not use deprecated drm_driver.{enable|disable)_vblank callbacks, but use drm_simple

[PATCH] drm/simple_kms_helper: Fix NULL pointer dereference with no active CRTC

2018-02-13 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> It is possible that drm_simple_kms_plane_atomic_check called with no CRTC set, e.g. when user-space application sets CRTC_ID/FB_ID to 0 before doing any actual drawing. This leads to NULL pointer dereference because in this ca

Re: Questions on page flips and atomic modeset

2018-02-10 Thread Oleksandr Andrushchenko
On 02/09/2018 07:09 PM, Ville Syrjälä wrote: On Fri, Feb 09, 2018 at 06:30:08PM +0200, Oleksandr Andrushchenko wrote: -- OFFTOP -- BTW, what is the right branch should I use for a new DRM driver and the patch like the above? I am lost a bit :) Usual recommendation is to use: git

Re: [PATCH] drm/simple_kms_helper: Fix NULL pointer dereference with no active CRTC

2018-02-19 Thread Oleksandr Andrushchenko
On 02/19/2018 04:30 PM, Daniel Vetter wrote: On Tue, Feb 13, 2018 at 10:44:16AM +0200, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> It is possible that drm_simple_kms_plane_atomic_check called with no CRTC set, e.g. when user-space appli

Re: [Xen-devel] [PATCH 1/9] drm/xen-front: Introduce Xen para-virtualized frontend driver

2018-02-21 Thread Oleksandr Andrushchenko
On 02/21/2018 11:17 AM, Roger Pau Monné wrote: On Wed, Feb 21, 2018 at 10:03:34AM +0200, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Introduce skeleton of the para-virtualized Xen display frontend driver. This patch only adds re

Re: [PATCH 1/9] drm/xen-front: Introduce Xen para-virtualized frontend driver

2018-02-21 Thread Oleksandr Andrushchenko
On 02/21/2018 10:19 AM, Juergen Gross wrote: On 21/02/18 09:03, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Introduce skeleton of the para-virtualized Xen display frontend driver. This patch only adds required essential stubs. Sign

[PATCH 9/9] drm/xen-front: Implement communication with backend

2018-02-21 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Handle communication with the backend: - send requests and wait for the responses according to the displif protocol - serialize access to the communication channel - time-out used for backend communication is set to 3

[PATCH 5/9] drm/xen-front: Implement handling of shared display buffers

2018-02-21 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Implement shared buffer handling according to the para-virtualized display device protocol at xen/interface/io/displif.h: - handle page directories according to displif protocol: - allocate and share page direc

[PATCH 0/9] drm/xen-front: Add support for Xen PV display frontend

2018-02-21 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Hello! This patch series adds support for Xen [1] para-virtualized frontend display driver. It implements the protocol from include/xen/interface/io/displif.h [2]. Accompanying backend [3] is implemented as a user-space appli

[PATCH 6/9] drm/xen-front: Introduce DRM/KMS virtual display driver

2018-02-21 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Implement essential initialization of the display driver: - introduce required data structures - handle DRM/KMS driver registration - perform basic DRM driver initialization - register driver on backend connection -

[PATCH 2/9] drm/xen-front: Implement Xen bus state handling

2018-02-21 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Initial handling for Xen bus states: implement Xen bus state machine for the frontend driver according to the state diagram and recovery flow from display para-virtualized protocol: xen/interface/io/displif.h. Sign

[PATCH 1/9] drm/xen-front: Introduce Xen para-virtualized frontend driver

2018-02-21 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Introduce skeleton of the para-virtualized Xen display frontend driver. This patch only adds required essential stubs. Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> --- drivers/gpu

[PATCH 8/9] drm/xen-front: Implement GEM operations

2018-02-21 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Implement GEM handling depending on driver mode of operation: depending on the requirements for the para-virtualized environment, namely requirements dictated by the accompanying DRM/(v)GPU drivers running in both host and

[PATCH 4/9] drm/xen-front: Implement Xen event channel handling

2018-02-21 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Handle Xen event channels: - create for all configured connectors and publish corresponding ring references and event channels in Xen store, so backend can connect - implement event channels interrupt handlers -

Re: [PATCH 1/9] drm/xen-front: Introduce Xen para-virtualized frontend driver

2018-02-21 Thread Oleksandr Andrushchenko
On 02/21/2018 11:09 AM, Juergen Gross wrote: On 21/02/18 09:47, Oleksandr Andrushchenko wrote: On 02/21/2018 10:19 AM, Juergen Gross wrote: On 21/02/18 09:03, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Introduce skeleton of th

[PATCH 3/9] drm/xen-front: Read driver configuration from Xen store

2018-02-21 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Read configuration values from Xen store according to xen/interface/io/displif.h protocol: - read connector(s) configuration - read buffer allocation mode (backend/frontend) Signed-off-by: Oleksandr Andrush

[PATCH 7/9] drm/xen-front: Implement KMS/connector handling

2018-02-21 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Implement kernel modesetiing/connector handling using DRM simple KMS helper pipeline: - implement KMS part of the driver with the help of DRM simple pipepline helper which is possible due to the fact that the para-virtu

[PATCH v1] drm/simple_kms_helper: Fix NULL pointer dereference with no active CRTC

2018-02-21 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> It is possible that drm_simple_kms_plane_atomic_check called with no CRTC set, e.g. when user-space application sets CRTC_ID/FB_ID to 0 before doing any actual drawing. This leads to NULL pointer dereference because in this ca

Re: [PATCH 2/9] drm/xen-front: Implement Xen bus state handling

2018-02-22 Thread Oleksandr Andrushchenko
On 02/21/2018 10:23 AM, Juergen Gross wrote: On 21/02/18 09:03, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> Initial handling for Xen bus states: implement Xen bus state machine for the frontend driver according to the state d

Re: [PATCH v1] drm/simple_kms_helper: Fix NULL pointer dereference with no active CRTC

2018-02-22 Thread Oleksandr Andrushchenko
On 02/22/2018 08:09 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> It is possible that drm_simple_kms_plane_atomic_check called with no CRTC set, e.g. when user-space application sets CRTC_ID/FB_ID to 0 before doing any actual d

Re: [PATCH 1/4] drm/simple_kms_helper: Add {enable|disable}_vblank callback support

2018-02-19 Thread Oleksandr Andrushchenko
ping On 02/12/2018 10:52 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> If simple_kms_helper based driver needs to work with vblanks, then it has to provide drm_driver.{enable|disable}_vblank callbacks, b

Re: Questions on page flips and atomic modeset

2018-02-19 Thread Oleksandr Andrushchenko
On 02/19/2018 11:36 AM, Daniel Vetter wrote: On Tue, Feb 06, 2018 at 11:59:37AM +0200, Oleksandr Andrushchenko wrote: Hello, Ville! Thank you very much for such a comprehensive answer. Just noticed a few of your questions threads. We'd very much appreciate (for the next person creating

Re: [PATCH] drm/simple_kms_helper: Fix NULL pointer dereference with no active CRTC

2018-02-20 Thread Oleksandr Andrushchenko
On 02/20/2018 02:49 PM, Daniel Vetter wrote: On Tue, Feb 20, 2018 at 02:36:05PM +0200, Oleksandr Andrushchenko wrote: On 02/20/2018 01:17 PM, Daniel Vetter wrote: On Mon, Feb 19, 2018 at 04:58:43PM +0200, Oleksandr Andrushchenko wrote: On 02/19/2018 04:30 PM, Daniel Vetter wrote: On Tue, Feb

Re: [PATCH] drm/simple_kms_helper: Fix NULL pointer dereference with no active CRTC

2018-02-20 Thread Oleksandr Andrushchenko
On 02/20/2018 02:53 PM, Oleksandr Andrushchenko wrote: On 02/20/2018 02:49 PM, Daniel Vetter wrote: On Tue, Feb 20, 2018 at 02:36:05PM +0200, Oleksandr Andrushchenko wrote: On 02/20/2018 01:17 PM, Daniel Vetter wrote: On Mon, Feb 19, 2018 at 04:58:43PM +0200, Oleksandr Andrushchenko wrote

Re: [PATCH] drm/simple_kms_helper: Fix NULL pointer dereference with no active CRTC

2018-02-20 Thread Oleksandr Andrushchenko
On 02/20/2018 01:17 PM, Daniel Vetter wrote: On Mon, Feb 19, 2018 at 04:58:43PM +0200, Oleksandr Andrushchenko wrote: On 02/19/2018 04:30 PM, Daniel Vetter wrote: On Tue, Feb 13, 2018 at 10:44:16AM +0200, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrush

Re: [PATCH 1/4] drm/simple_kms_helper: Add {enable|disable}_vblank callback support

2018-02-22 Thread Oleksandr Andrushchenko
On 02/22/2018 06:59 PM, Daniel Vetter wrote: On Mon, Feb 19, 2018 at 11:11:23AM +0200, Oleksandr Andrushchenko wrote: ping On 02/12/2018 10:52 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> If simple_kms_helper based driver needs t

Re: [PATCH v1] drm/simple_kms_helper: Fix NULL pointer dereference with no active CRTC

2018-02-22 Thread Oleksandr Andrushchenko
On 02/22/2018 06:11 PM, Daniel Vetter wrote: On Thu, Feb 22, 2018 at 08:12:48AM +0200, Oleksandr Andrushchenko wrote: On 02/22/2018 08:09 AM, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko <oleksandr_andrushche...@epam.com> It is possible that drm_simple_kms_plane_atomic

Re: [PATCH 4/9] drm/xen-front: Implement Xen event channel handling

2018-02-22 Thread Oleksandr Andrushchenko
On 02/23/2018 01:50 AM, Boris Ostrovsky wrote: On 02/21/2018 03:03 AM, Oleksandr Andrushchenko wrote: + +static irqreturn_t evtchnl_interrupt_ctrl(int irq, void *dev_id) +{ + struct xen_drm_front_evtchnl *evtchnl = dev_id; + struct xen_drm_front_info *front_info = evtchnl

Re: [PATCH 5/9] drm/xen-front: Implement handling of shared display buffers

2018-02-22 Thread Oleksandr Andrushchenko
On 02/23/2018 02:25 AM, Boris Ostrovsky wrote: On 02/21/2018 03:03 AM, Oleksandr Andrushchenko wrote: static int __init xen_drv_init(void) { + /* At the moment we only support case with XEN_PAGE_SIZE == PAGE_SIZE */ + BUILD_BUG_ON(XEN_PAGE_SIZE != PAGE_SIZE); Why

Re: [PATCH 1/9] drm/xen-front: Introduce Xen para-virtualized frontend driver

2018-02-22 Thread Oleksandr Andrushchenko
On 02/23/2018 12:23 AM, Boris Ostrovsky wrote: On 02/21/2018 03:03 AM, Oleksandr Andrushchenko wrote: +static struct xenbus_driver xen_driver = { + .ids = xen_drv_ids, + .probe = xen_drv_probe, + .remove = xen_drv_remove, + .otherend_changed = backend_on_changed, What

<    1   2   3   4   5   >