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

2018-06-06 Thread Dongwon Kim
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 Andrushchenko > >>> > >>> Allow creating

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

2018-05-30 Thread Dongwon Kim
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, but >by providing GNTDEV_DMA_FLAG_XXX flags it can

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

2018-05-30 Thread Dongwon Kim
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-by: Oleksandr Andrushchenko > --- >

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

2018-05-21 Thread Dongwon Kim
Still need more time to review the whole code changes but I noticed one thing. We've been using the term "hyper_dmabuf" for hypervisor-agnostic linux dmabuf solution and we are planning to call any of our future solution for other hypervisors the same name. So having same name for this

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

2018-04-30 Thread Dongwon Kim
On Wed, Apr 25, 2018 at 08:12:08AM +0200, Juergen Gross wrote: > On 24/04/18 22:35, Dongwon Kim wrote: > > Had a meeting with Daniel and talked about bringing out generic > > part of hyper-dmabuf to the userspace, which means we most likely > > reuse IOCTLs defined in xen-z

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

2018-04-25 Thread Dongwon Kim
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 of hy

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

2018-04-24 Thread Dongwon Kim
Had a meeting with Daniel and talked about bringing out generic part of hyper-dmabuf to the userspace, which means we most likely reuse IOCTLs defined in xen-zcopy for our use-case if we follow his suggestion. So assuming we use these IOCTLs as they are, Several things I would like you to

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

2018-04-19 Thread Dongwon Kim
On Thu, Apr 19, 2018 at 11:14:02AM +0300, Oleksandr Andrushchenko wrote: > On 04/18/2018 08:01 PM, Dongwon Kim wrote: > >On Wed, Apr 18, 2018 at 09:38:39AM +0300, Oleksandr Andrushchenko wrote: > >>On 04/17/2018 11:57 PM, Dongwon Kim wrote: > >>>On Tue, Apr 17, 20

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

2018-04-18 Thread Dongwon Kim
On Wed, Apr 18, 2018 at 09:38:39AM +0300, Oleksandr Andrushchenko wrote: > On 04/17/2018 11:57 PM, Dongwon Kim wrote: > >On Tue, Apr 17, 2018 at 09:59:28AM +0200, Daniel Vetter wrote: > >>On Mon, Apr 16, 2018 at 12:29:05PM -0700, Dongwon Kim wrote: > >>>Yeah,

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

2018-04-17 Thread Dongwon Kim
On Tue, Apr 17, 2018 at 09:59:28AM +0200, Daniel Vetter wrote: > On Mon, Apr 16, 2018 at 12:29:05PM -0700, Dongwon Kim wrote: > > Yeah, I definitely agree on the idea of expanding the use case to the > > general domain where dmabuf sharing is used. However, what you are

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

2018-04-16 Thread Dongwon Kim
Yeah, I definitely agree on the idea of expanding the use case to the general domain where dmabuf sharing is used. However, what you are targetting with proposed changes is identical to the core design of hyper_dmabuf. On top of this basic functionalities, hyper_dmabuf has driver level

Re: [Xen-devel] [RFC PATCH v2 2/9] hyper_dmabuf: architecture specification and reference guide

2018-02-23 Thread Dongwon Kim
Thanks for your comment, Roger I will try to polish this doc and resubmit. (I put some comments below as well.) On Fri, Feb 23, 2018 at 04:15:00PM +, Roger Pau Monné wrote: > On Tue, Feb 13, 2018 at 05:50:01PM -0800, Dongwon Kim wrote: > > Reference document for hyper_DMAB

Re: [Xen-devel] [RFC PATCH v2 0/9] hyper_dmabuf: Hyper_DMABUF driver

2018-02-21 Thread Dongwon Kim
On Mon, Feb 19, 2018 at 06:01:29PM +0100, Daniel Vetter wrote: > On Tue, Feb 13, 2018 at 05:49:59PM -0800, Dongwon Kim wrote: > > This patch series contains the implementation of a new device driver, > > hyper_DMABUF driver, which provides a way to expand the boundary of > >

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

2018-02-14 Thread Dongwon Kim
: comm ch management and ISRs for incoming messages. > > hyper_dmabuf/xen/hyper_dmabuf_xen_comm_list.c > : Database (linked-list) for keeping information about > existing comm channels among VMs > > Signed-off-by: Dongwon Kim <dongwon@intel.com> > Signed-off-by: Mat

[Xen-devel] [RFC PATCH v2 8/9] hyper_dmabuf: event-polling mechanism for detecting a new hyper_DMABUF

2018-02-13 Thread Dongwon Kim
N". Signed-off-by: Dongwon Kim <dongwon@intel.com> Signed-off-by: Mateusz Polrola <mateuszx.potr...@intel.com> --- drivers/dma-buf/hyper_dmabuf/Kconfig | 20 +++ drivers/dma-buf/hyper_dmabuf/Makefile | 1 + drivers/dma-buf/hyper_d

[Xen-devel] [RFC PATCH v2 1/9] hyper_dmabuf: initial upload of hyper_dmabuf drv core framework

2018-02-13 Thread Dongwon Kim
r exporter hyper_DMABUF include/uapi/linux/hyper_dmabuf.h - Contains definition of data types and structures referenced by user application to interact with driver Signed-off-by: Dongwon Kim <dongwon@intel.com> Signed-off-by: Mateusz Polrola <mateuszx.potr...@intel.com> --- dr

[Xen-devel] [RFC PATCH v2 2/9] hyper_dmabuf: architecture specification and reference guide

2018-02-13 Thread Dongwon Kim
Reference document for hyper_DMABUF driver Documentation/hyper-dmabuf-sharing.txt Signed-off-by: Dongwon Kim <dongwon@intel.com> --- Documentation/hyper-dmabuf-sharing.txt | 734 + 1 file changed, 734 insertions(+) create mode 100644 Documentation

[Xen-devel] [RFC PATCH v2 5/9] hyper_dmabuf: default backend for XEN hypervisor

2018-02-13 Thread Dongwon Kim
_rbuf, .init_tx_ch = xen_be_init_tx_rbuf, .send_req = xen_be_send_req, }; A section for Hypervisor Backend has been added to "Documentation/hyper-dmabuf-sharing.txt" accordingly Signed-off-by: Dongwon Kim <dongwon@intel.com> Signed-off-by: Mateusz Polrola <mateuszx.potr...

[Xen-devel] [RFC PATCH v2 9/9] hyper_dmabuf: threaded interrupt in Xen-backend

2018-02-13 Thread Dongwon Kim
Use threaded interrupt intead of regular one because most part of ISR is time-critical and possibly sleeps Signed-off-by: Dongwon Kim <dongwon@intel.com> --- .../hyper_dmabuf/backends/xen/hyper_dmabuf_xen_comm.c | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-)

[Xen-devel] [RFC PATCH v2 7/9] hyper_dmabuf: query ioctl for retreiving various hyper_DMABUF info

2018-02-13 Thread Dongwon Kim
till valid but will be unexported soon) HYPER_DMABUF_QUERY_PRIV_INFO_SIZE - size of private information (given by user application on exporter's side) attached to hyper_DMABUF HYPER_DMABUF_QUERY_PRIV_INFO - private information attached to hyper_DMABUF Signed-off-by: Dongwon Kim <dongwon@intel.co

[Xen-devel] [RFC PATCH v2 6/9] hyper_dmabuf: hyper_DMABUF synchronization across VM

2018-02-13 Thread Dongwon Kim
and so on) will be mimicked on this shadowed DMA-BUF for tracking and synchronization purpose (e.g. +-reference count to check the status). Signed-off-by: Dongwon Kim <dongwon@intel.com> Signed-off-by: Mateusz Polrola <mateuszx.potr...@intel.com> --- drivers/dma-buf/hyper_dma

[Xen-devel] [RFC PATCH v2 0/9] hyper_dmabuf: Hyper_DMABUF driver

2018-02-13 Thread Dongwon Kim
15-rc2 https://github.com/downor/linux_hyper_dmabuf.git hyper_dmabuf_integration_v4 Dongwon Kim, Mateusz Polrola (9): hyper_dmabuf: initial upload of hyper_dmabuf drv core framework hyper_dmabuf: architecture specification and reference guide MAINTAINERS: adding Hyper_DMABUF dri

[Xen-devel] [RFC PATCH v2 3/9] MAINTAINERS: adding Hyper_DMABUF driver section in MAINTAINERS

2018-02-13 Thread Dongwon Kim
Hyper_DMABUF DRIVER M: Dongwon Kim <dongwon@intel.com> M: Mateusz Polrola <mateuszx.potr...@intel.com> L: linux-ker...@vger.kernel.org L: xen-devel@lists.xenproject.org S: Maintained F: drivers/dma-buf/hyper_dmabuf* F: include/uapi/linux/hype

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

2018-01-10 Thread Dongwon Kim
On Wed, Dec 20, 2017 at 09:17:07AM +0100, Juergen Gross wrote: > On 20/12/17 00:27, Dongwon Kim wrote: > > I forgot to include this brief information about this patch series. > > > > This patch series contains the implementation of a new device driver, > > hyper_dmab

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

2018-01-10 Thread Dongwon Kim
Yes, I will post a test application. Thanks On Wed, Dec 20, 2017 at 10:38:08AM +0200, Oleksandr Andrushchenko wrote: > > 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

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

2018-01-10 Thread Dongwon Kim
On Wed, Dec 20, 2017 at 10:59:57AM +0100, Daniel Vetter wrote: > On Tue, Dec 19, 2017 at 03:27:31PM -0800, Dongwon Kim wrote: > > I forgot to include this brief information about this patch series. > > > > This patch series contains the implementation of a new device dri

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

2017-12-19 Thread Dongwon Kim
I forgot to include this brief information about this patch series. 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. Detailed

[Xen-devel] [RFC PATCH 50/60] hyper_dmabuf: fix styling err and warns caught by checkpatch.pl

2017-12-19 Thread Dongwon Kim
Fixing all styling problems caught by checkpatch.pl Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.c| 53 ++-- drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.h| 6 +- drivers/xen/hyper_dmabuf/hyper_dmabuf_event.c

[Xen-devel] [RFC PATCH 38/60] hyper_dmabuf: preventing self exporting of dma_buf

2017-12-19 Thread Dongwon Kim
Adding ID check to make sure a dma-buf is exported externally since hyper_dmabuf only allows to export a dmabuf to a different VM. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_ioctl.c | 6 ++ 1 file changed, 6 insertions(+) diff

[Xen-devel] [RFC PATCH 08/60] hyper_dmabuf: automatic comm channel initialization using xenstore

2017-12-19 Thread Dongwon Kim
le between two VMs. When upstream channel is removed (e.g. unloading driver), VM on the other side is notified and "xenstore watch" callback is invoked. Via this callback, VM can remove corresponding downstream channel. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hy

[Xen-devel] [RFC PATCH 37/60] hyper_dmabuf: implementation of query ioctl

2017-12-19 Thread Dongwon Kim
, DMABUF_QUERY_UNEXPORTED, DMABUF_QUERY_DELAYED_UNEXPORTED, }; Also, actual querying part of the function is moved to hyper_dmabuf_query.c Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/Makefile | 1 + drive

[Xen-devel] [RFC PATCH 15/60] hyper_dmabuf: reusing previously released hyper_dmabuf_id

2017-12-19 Thread Dongwon Kim
Now, released hyper_dmabuf_ids are stored in a stack - (hyper_dmabuf_private.id_queue) for reuse. This is to prevent overflow of ids for buffers. We also limit maximum number for the id to 1000 for the stability and optimal performance. Signed-off-by: Dongwon Kim <dongwon@intel.

[Xen-devel] [RFC PATCH 58/60] hyper_dmabuf: move device node out of /dev/xen/

2017-12-19 Thread Dongwon Kim
; Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.c b/drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.c index f2731bf..bbb3414 100644

[Xen-devel] [RFC PATCH 23/60] hyper_dmabuf: use CONFIG_HYPER_DMABUF_XEN instead of CONFIG_XEN

2017-12-19 Thread Dongwon Kim
Now, use CONFIG_HYPER_DMABUF_XEN as a configuration option for building hyper_dmabuf for Xen hypervisor. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drive

[Xen-devel] [RFC PATCH 07/60] hyper_dmabuf: message parsing done via workqueue

2017-12-19 Thread Dongwon Kim
Use workqueue mechanism to delay message parsing done after exiting from ISR to reduce ISR execution time. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.c| 13 ++ drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.h| 5 + drive

[Xen-devel] [RFC PATCH 55/60] hyper_dmabuf: fixed wrong send_req call

2017-12-19 Thread Dongwon Kim
From: Mateusz Polrola <mateuszx.potr...@intel.com> Wrong vmid is used in case of sending HYPER_DMABUF_EXPORT_FD_FAILED message. Instead of vmid, hypder dmabuf id is being used. Signed-off-by: Mateusz Polrola <mateuszx.potr...@intel.com> Signed-off-by: Dongwon Kim <dongwo

[Xen-devel] [RFC PATCH 39/60] hyper_dmabuf: correcting DMA-BUF clean-up order

2017-12-19 Thread Dongwon Kim
Reordering clean-up procedure Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_ioctl.c | 37 +-- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/drivers/xen/hyper_dmabuf/hyper_dmabuf_ioctl.c b/drive

[Xen-devel] [RFC PATCH 06/60] hyper_dmabuf: map shared pages only once when importing.

2017-12-19 Thread Dongwon Kim
From: Mateusz Polrola <mateuszx.potr...@intel.com> If shared pages of buffer were already mapped on importer side, do not map them again on next request to export fd. Signed-off-by: Mateusz Polrola <mateuszx.potr...@intel.com> Signed-off-by: Dongwon Kim <dongwon@intel.com>

[Xen-devel] [RFC PATCH 35/60] hyper_dmabuf: 128bit hyper_dmabuf_id with random keys

2017-12-19 Thread Dongwon Kim
rng_key[3]; } hyper_dmabuf_id_t; Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.c| 2 +- drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.h| 3 +- drivers/xen/hyper_dmabuf/hyper_dmabuf_id.c | 57 -- drive

[Xen-devel] [RFC PATCH 54/60] hyper_dmabuf: 'backend_ops' reduced to 'bknd_ops' and 'ops' to 'bknd_ops'

2017-12-19 Thread Dongwon Kim
To make type's name compact, *_backend_ops is changed to '*_bknd_ops'. Also 'ops' is now changed to 'bknd_ops' to clarify it is a data structure with entry points of 'backend' operations. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf

[Xen-devel] [RFC PATCH 47/60] hyper_dmabuf: fix issues with event-polling

2017-12-19 Thread Dongwon Kim
-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.c | 23 ++--- drivers/xen/hyper_dmabuf/hyper_dmabuf_event.c| 8 +-- drivers/xen/hyper_dmabuf/hyper_dmabuf_event.h| 2 +- drivers/xen/hyper_dmabuf/hyper_dmabuf_ioctl.c

[Xen-devel] [RFC PATCH 53/60] hyper_dmabuf: define fastpath_export for exporting existing buffer

2017-12-19 Thread Dongwon Kim
To make hyper_dmabuf_export_remote_ioctl more compact and readable, a new function call, 'fastpath_export' is created to replace a routine in hyper_dmabuf_export_remote_ioctl for the case requested buffer for exporting is already in the LIST (exported previously). Signed-off-by: Dongwon Kim

[Xen-devel] [RFC PATCH 17/60] hyper_dmabuf: use dynamic debug macros for logging

2017-12-19 Thread Dongwon Kim
From: Mateusz Polrola <mateuszx.potr...@intel.com> Replaces printk to debug macros Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.c| 4 +- drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.h| 4 ++ drivers/xen/

[Xen-devel] [RFC PATCH 44/60] hyper_dmabuf: proper handling of sgt_info->priv

2017-12-19 Thread Dongwon Kim
s some of export_remote_ioctl to make it more readable and compact. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_ioctl.c | 110 ++--- drivers/xen/hyper_dmabuf/hyper_dmabuf_struct.h | 6 +- 2 files changed, 65 insertions(+),

[Xen-devel] [RFC PATCH 46/60] hyper_dmabuf: delay auto initialization of comm_env

2017-12-19 Thread Dongwon Kim
). Only limitation is it currently checks domain ID 0 to 10. We could increase this range if needed. With this patch, we don't have to call comm channel setup IOCTL on importer side anymore. For example, we can remove ioctl call in init_hyper_dmabuf from vmdisplay. Signed-off-by: Dongwon Kim <dong

[Xen-devel] [RFC PATCH 45/60] hyper_dmabuf: adding poll/read for event generation

2017-12-19 Thread Dongwon Kim
hyper_dmabuf driver on importing domain now generates event every time new hyper_dmabuf is available (visible) to the importer. Each event comes with 128 byte private data, which can contain any meta data or user data specific to the originator of DMA BUF. Signed-off-by: Dongwon Kim <dong

[Xen-devel] [RFC PATCH 24/60] hyper_dmabuf: waits for resp only if WAIT_AFTER_SYNC_REQ == 1

2017-12-19 Thread Dongwon Kim
in func names in the backend. 3. some minor clean-ups Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_conf.h | 2 - drivers/xen/hyper_dmabuf/hyper_dmabuf_imp.c| 91 +++--- drivers/xen/hyper_dmabuf/hyper_dmabuf

[Xen-devel] [RFC PATCH 51/60] hyper_dmabuf: missing mutex_unlock and move spinlock

2017-12-19 Thread Dongwon Kim
modifications, changing type of function calls to static and correcting some of error code. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.c | 38 +-- drivers/xen/hyper_dmabuf/hyper_dmabuf_event.c | 15 +-- d

[Xen-devel] [RFC PATCH 48/60] hyper_dmabuf: add query items for buffer private info.

2017-12-19 Thread Dongwon Kim
,where private data will be copied in case query item is 'HYPER_DMABUF_QUERY_PRIV_INFO'. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.c | 7 +- drivers/xen/hyper_dmabuf/hyper_dmabuf_event.c | 6 ++ drivers/xen/hyper_dmabuf/hyper_dmabuf_

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

2017-12-19 Thread Dongwon Kim
isting comm channels among VMs Signed-off-by: Dongwon Kim <dongwon@intel.com> Signed-off-by: Mateusz Polrola <mateuszx.potr...@intel.com> --- drivers/xen/Kconfig| 2 + drivers/xen/Makefile | 1 + drivers/xen/hy

[Xen-devel] [RFC PATCH 36/60] hyper_dmabuf: error handling when share_pages fails

2017-12-19 Thread Dongwon Kim
From: Mateusz Polrola <mateuszx.potr...@intel.com> When error occurs while sharing pages, all pages already shared needs to be un-shared and proper error code has to be returned. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_ioctl

[Xen-devel] [RFC PATCH 34/60] hyper_dmabuf: extend DMA bitmask to 64-bits.

2017-12-19 Thread Dongwon Kim
From: Mateusz Polrola <mateuszx.potr...@intel.com> Extending DMA bitmask of hyper_dmabuf device to cover whole address space driver may access. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_ioctl.c | 2 +- 1 file changed, 1 insertion(+)

[Xen-devel] [RFC PATCH 41/60] hyper_dmabuf: re-organize driver source

2017-12-19 Thread Dongwon Kim
) is also put in the a new file, 'hyper_dmabuf_sgt_proc.c'. hyper_dmabuf_imp.c and hyper_dmabuf_imp.h are removed as a result. 3. Header files and Makefile are also updated accordingly. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/Makefile

[Xen-devel] [RFC PATCH 18/60] hyper_dmabuf: reset comm channel when one end has disconnected.

2017-12-19 Thread Dongwon Kim
blocks back ring irq until communication channel is initialized and fully active to prevent a race condition. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- .../xen/hyper_dmabuf/xen/hyper_dmabuf_xen_comm.c | 24 +++--- 1 file changed, 21 insertions(+), 3 deleti

[Xen-devel] [RFC PATCH 14/60] hyper_dmabuf: clean-up process based on file->f_count

2017-12-19 Thread Dongwon Kim
n sgt_info as an indicator for usage of buffer on the importer. 3. num of pages is added (nents) to hyper_dmabuf_sgt_info to keep the size info in EXPORT list. 3. more minor changes and clean-ups. Signed-off-by: Dongwon Kim <dongwon@intel.com> Signed-off-by: Mateusz Polrola <mateusz

[Xen-devel] [RFC PATCH 40/60] hyper_dmabuf: do not use 'private' as field name

2017-12-19 Thread Dongwon Kim
From: Mateusz Polrola <mateuszx.potr...@intel.com> Using a word, 'private' is not recommended because of conflict with language keyword when compiling with C++. So changing those to 'priv'. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf

[Xen-devel] [RFC PATCH 28/60] hyper_dmabuf: address several synchronization issues

2017-12-19 Thread Dongwon Kim
erface under include/uapi/xen/ Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_imp.c| 21 ++--- drivers/xen/hyper_dmabuf/hyper_dmabuf_ioctl.c | 17 +++- drivers/xen/hyper_dmabuf/hyper_dmabuf_ioctl.h | 74 +

[Xen-devel] [RFC PATCH 20/60] hyper_dmabuf: optimized loop with less condition check

2017-12-19 Thread Dongwon Kim
Redefined nents_last, which means # of gref in the last page of lvl2 table in any situation even if it is same as REFS_PER_PAGE. With this, loop can be simplified with less condition check. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/xen/hyper_dmabuf_xen

[Xen-devel] [RFC PATCH 25/60] hyper_dmabuf: introduced delayed unexport

2017-12-19 Thread Dongwon Kim
r is still valid (not unexported) on expoter VM's side before importer VM starts to use it. "delayed_ms" attribute is added to unexport ioctl, used for hardcoding delay from userspace. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_imp.c|

[Xen-devel] [RFC PATCH 27/60] hyper_dmabuf: use proper error codes

2017-12-19 Thread Dongwon Kim
Cleaned up and corrected error codes and condition in various error check routines. Also added proper err messages when func returns error. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.c| 14 +++-- drivers/xen/hyper_

[Xen-devel] [RFC PATCH 09/60] hyper_dmabuf: indirect DMA_BUF synchronization via shadowing

2017-12-19 Thread Dongwon Kim
of this is to get DMA_BUF synchronized eventually between the original creator of DMA_BUF and the end consumer of it running on the importer VM. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/Makefile | 1 + drivers/xen/hyper_dmabuf/hyper_dmabuf

[Xen-devel] [RFC PATCH 33/60] hyper_dmabuf: error checking on the result of dma_buf_map_attachment

2017-12-19 Thread Dongwon Kim
From: Mateusz Polrola <mateuszx.potr...@intel.com> Added error checking on the result of function call, dma_buf_map_attachment Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_ioctl.c | 5 + 1 file changed, 5 insertions(+) diff --g

[Xen-devel] [RFC PATCH 22/60] hyper_dmabuf: configure license

2017-12-19 Thread Dongwon Kim
Set the license of the driver to "GPL and MIT-X dual" and owner to "Intel". Also attached license term to all source and header files Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_conf.h | 26 ++

[Xen-devel] [RFC PATCH 31/60] hyper_dmabuf: built-in compilation option

2017-12-19 Thread Dongwon Kim
Kernel. This patch also addresses possible memory leaks in various places. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/Kconfig | 1 + drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.c| 17 ++-- drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.h

[Xen-devel] [RFC PATCH 29/60] hyper_dmabuf: make sure to release allocated buffers when exiting

2017-12-19 Thread Dongwon Kim
rt" routine, that is executed automatically when all of file pointers opened for accessing hyper_dmabuf driver are closed. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.c| 6 ++- drivers/xen/hyper_dmabuf/hype

[Xen-devel] [RFC PATCH 30/60] hyper_dmabuf: free already mapped pages when error happens

2017-12-19 Thread Dongwon Kim
From: Mateusz Polrola <mateuszx.potr...@intel.com> It is needed to freeing already-mapped pages if it gets error before finishing mapping all pages. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- .../xen/hyper_dmabuf/xen/hyper_dmabuf_xen_shm.c| 43 ++

[Xen-devel] [RFC PATCH 03/60] hyper_dmabuf: re-use dma_buf previously exported if exist

2017-12-19 Thread Dongwon Kim
n exported to the target domain. This patch also Includes changes in printk calles for debugging. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_imp.c | 28 +-- drivers/xen/hyper_dmabuf/hyper_dmabuf_ioctl.c | 17 -

[Xen-devel] [RFC PATCH 21/60] hyper_dmabuf: exposing drv information using sysfs

2017-12-19 Thread Dongwon Kim
uf can be enabled by setting a new config option, "CONFIG_HYPER_DMABUF_SYSFS" to 'yes'. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/Kconfig | 7 +++ drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.c | 12 - drivers/xen/hyper_dmabuf/hy

[Xen-devel] [RFC PATCH 05/60] hyper_dmabuf: skip creating a comm ch if exist for the VM

2017-12-19 Thread Dongwon Kim
hyper_dmabuf_importer_ring_setup creates new channel only if there is no existing downstream communication channel previously created for the exporter VM. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_imp.c | 13 +++-- drive

[Xen-devel] [RFC PATCH 26/60] hyper_dmabuf: add mutexes to prevent several race conditions

2017-12-19 Thread Dongwon Kim
cation channel to prevent req_pending override by another caller. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.c | 2 ++ drivers/xen/hyper_dmabuf/hyper_dmabuf_drv.h | 1 + drivers/xen/hyper_dmabuf/hyper_dmabuf_ioctl.c

[Xen-devel] [RFC PATCH 11/60] hyper_dmabuf: check stack before unmapping/detaching shadow DMA_BUF

2017-12-19 Thread Dongwon Kim
Make sure list of mapping/attaching activities on impoter VM is not empty before doing unmapping/detaching shadow DMA BUF for indirect synchronization. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- .../xen/hyper_dmabuf/hyper_dmabuf_remote_sync.c| 68 +-

[Xen-devel] [RFC PATCH 12/60] hyper_dmabuf: two different unexporting mechanisms

2017-12-19 Thread Dongwon Kim
ned by how "FORCED_UNEXPORING" is defined. Also, the word "destroy" in IOCTL commands and several functions have been modified to "unexport", which sounds more reasonable. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dma

[Xen-devel] [RFC PATCH 19/60] hyper_dmabuf: fix the case with sharing a buffer with 2 pages

2017-12-19 Thread Dongwon Kim
From: Mateusz Polrola <mateuszx.potr...@intel.com> Checking whether buffer has more than two pages should be done by evaluating nents > 1 instead of i > 1 to properly cover the case when nents == 2. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- driver

[Xen-devel] [RFC PATCH 04/60] hyper_dmabuf: new index, k for pointing a right n-th page

2017-12-19 Thread Dongwon Kim
Need a new index, k in hyper_dmabuf_extract_pgs function for picking up a correct n-th page in contigous memory space. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_imp.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff

[Xen-devel] [RFC PATCH 10/60] hyper_dmabuf: make sure to free memory to prevent leak

2017-12-19 Thread Dongwon Kim
an entry. Signed-off-by: Dongwon Kim <dongwon@intel.com> --- drivers/xen/hyper_dmabuf/hyper_dmabuf_ioctl.c | 1 + drivers/xen/hyper_dmabuf/hyper_dmabuf_list.c | 2 ++ drivers/xen/hyper_dmabuf/xen/hyper_dmabuf_xen_comm.c | 2 ++ drivers/xen/h