Received: by 10.223.185.116 with SMTP id b49csp3981243wrg; Mon, 19 Feb 2018 09:02:30 -0800 (PST) X-Google-Smtp-Source: AH8x227uodHY+TfonUU+hcUz1t78Zwi4mrNi2YKE/P0OFLcrvYqMTkjpyU/Lnw04i72ZHJUwbUdi X-Received: by 10.98.204.132 with SMTP id j4mr14169497pfk.35.1519059750029; Mon, 19 Feb 2018 09:02:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519059749; cv=none; d=google.com; s=arc-20160816; b=kqrGIz5osKUMGOTU4RsiD8yDovx5/zqDDc0yu9lWsQ8s7e4hNYzBoquH4ufHz4xbHw 1wnnlwjwQmXviTU8S7dtRiwnlO7upqT0VLdK4CKbMWTchIb/hgvSsBEeEWwR5FaWtxu6 mz5vfmeF1JMVM2Ky8KcPUP8bXWNvstD+pCYLeHu4vLOX3AmUFTI6WO1+pzRQ+lpatL03 QrsLhZr7c0CFoP0ThP/XKSjnALEk8S122VfXgIXye5HLBpXiknJ21EADkvPK1Hxo6XdA /cTJhopnGUWFzZw6Y4VPyPPIP90VGa5BSOBJSZGf+gQmAP1azQJ8jYzei3+3XLWH74Cn Ot5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=1JqCUZvAgVnDKzQ7myKAnRfs7EP9Uv5vhkx3nH2MhO0=; b=N4uTtGo1IdjRXg8yg7NuRo9wnP+ZgKdZ8oYQ5Bs/9TVhxhEM0l4ZmsXMopZhYHZNnH nHYwaYvJK2TqwyMdlQ3lklfWHiEtheabZX9sx3pcgmRF8Dmv6B6B7j8j3Q+2OI3G3bkN kOcHOz60uC3V5enzhr7cwH9ehDu0KxITmv63FO+rIcMVVdBRI28eoLYrTMqcymA2AECj UXAX1M6/vXH6/9DSyIFak5P78pMO4f84HDjQ4BuD5/UBYpu4a4XF4/TIS6O/j3w0PXwe 951KJl7Hwhh6aMGHF3oyKV2Vk1RdN9if3r6ey0Bl/d7fu6IWUIRD74nC/NKyZgQ1SMDR I1Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=UM8hd+FS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m37-v6si6321955plg.372.2018.02.19.09.02.15; Mon, 19 Feb 2018 09:02:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=UM8hd+FS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753187AbeBSRBf (ORCPT + 99 others); Mon, 19 Feb 2018 12:01:35 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:52197 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753108AbeBSRBd (ORCPT ); Mon, 19 Feb 2018 12:01:33 -0500 Received: by mail-wm0-f44.google.com with SMTP id h21so9077745wmd.1 for ; Mon, 19 Feb 2018 09:01:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=1JqCUZvAgVnDKzQ7myKAnRfs7EP9Uv5vhkx3nH2MhO0=; b=UM8hd+FScWpZn2m9pKYL2Pk0RnnMYEWw/UtlTpVCnvrApqMb+x7AUrXpFg8PiRn4vO Ay0TtS/XZ2OdqCUOQdft5vgsg6K6VVp1KQwH7Zn3u9ilZsHJGpdZsZHX5CpTi1p9OJ7M OsLFQUq4kkbp0lbevhh7GX3F9g+OcXvpe0eik= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=1JqCUZvAgVnDKzQ7myKAnRfs7EP9Uv5vhkx3nH2MhO0=; b=ncVjxdp1b4AApwGwTik8IVRQzeS2BZVCmJDmCMIcLCzcm8e4u902JoGoM8v4NmP4tq SQbBAcSkp2ScyT0qCZj6we2AMeHSFC1f7g2Lwae9/pm/3HeRlCoK9+D6bytNB6XXkdmu sxIXlVsdFA9gJaKbJQgORnLm97ov1CDjqEpDJ/o4TAT3yFHFNQN3cjEmoQYhgPtr3FEM 9xWWiz0+Z9Ur40I+62pOKKSEcuLrQ2WLItUb+Rhd3LRfCSGALLeqTUndOazoKdf/fyKY vD59qJ0CT3jTTVrDbAzehpVxdJVaF68+wDVBA6pPDeG21CfDvWsG8yV5l6AbED245DlU EHeQ== X-Gm-Message-State: APf1xPCqzRINo+FCyRrDDea8WTl1UEBjQjww+Qk6L2nd/QgGJZm3JSsz SsE0jVjz5gQFYdp5aarVa1YtLQ== X-Received: by 10.80.214.202 with SMTP id l10mr4589549edj.44.1519059692214; Mon, 19 Feb 2018 09:01:32 -0800 (PST) Received: from phenom.ffwll.local (212-51-149-109.fiber7.init7.net. [212.51.149.109]) by smtp.gmail.com with ESMTPSA id t23sm398367edb.54.2018.02.19.09.01.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Feb 2018 09:01:31 -0800 (PST) Date: Mon, 19 Feb 2018 18:01:29 +0100 From: Daniel Vetter To: Dongwon Kim Cc: linux-kernel@vger.kernel.org, linaro-mm-sig@lists.linaro.org, xen-devel@lists.xenproject.org, dri-devel@lists.freedesktop.org, mateuszx.potrola@intel.com Subject: Re: [RFC PATCH v2 0/9] hyper_dmabuf: Hyper_DMABUF driver Message-ID: <20180219170129.GC22199@phenom.ffwll.local> Mail-Followup-To: Dongwon Kim , linux-kernel@vger.kernel.org, linaro-mm-sig@lists.linaro.org, xen-devel@lists.xenproject.org, dri-devel@lists.freedesktop.org, mateuszx.potrola@intel.com References: <20180214015008.9513-1-dongwon.kim@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180214015008.9513-1-dongwon.kim@intel.com> X-Operating-System: Linux phenom 4.14.0-3-amd64 User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Linux DMA-BUF sharing to across different VM instances in Multi-OS platform > enabled by a Hypervisor (e.g. XEN) > > This version 2 series is basically refactored version of old series starting > with "[RFC PATCH 01/60] hyper_dmabuf: initial working version of hyper_dmabuf > drv" > > Implementation details of this driver are described in the reference guide > added by the second patch, "[RFC PATCH v2 2/5] hyper_dmabuf: architecture > specification and reference guide". > > Attaching 'Overview' section here as a quick summary. > > ------------------------------------------------------------------------------ > Section 1. Overview > ------------------------------------------------------------------------------ > > Hyper_DMABUF driver is a Linux device driver running on multiple Virtual > achines (VMs), which expands DMA-BUF sharing capability to the VM environment > where multiple different OS instances need to share same physical data without > data-copy across VMs. > > To share a DMA_BUF across VMs, an instance of the Hyper_DMABUF drv on the > exporting VM (so called, “exporter”) imports a local DMA_BUF from the original > producer of the buffer, then re-exports it with an unique ID, hyper_dmabuf_id > for the buffer to the importing VM (so called, “importer”). > > Another instance of the Hyper_DMABUF driver on importer registers > a hyper_dmabuf_id together with reference information for the shared physical > pages associated with the DMA_BUF to its database when the export happens. > > The actual mapping of the DMA_BUF on the importer’s side is done by > the Hyper_DMABUF driver when user space issues the IOCTL command to access > the shared DMA_BUF. The Hyper_DMABUF driver works as both an importing and > exporting driver as is, that is, no special configuration is required. > Consequently, only a single module per VM is needed to enable cross-VM DMA_BUF > exchange. > > ------------------------------------------------------------------------------ > > There is a git repository at github.com where this series of patches are all > integrated in Linux kernel tree based on the commit: > > commit ae64f9bd1d3621b5e60d7363bc20afb46aede215 > Author: Linus Torvalds > Date: Sun Dec 3 11:01:47 2018 -0500 > > Linux 4.15-rc2 > > https://github.com/downor/linux_hyper_dmabuf.git hyper_dmabuf_integration_v4 Since you place this under drivers/dma-buf I'm assuming you want to maintain this as part of the core dma-buf support, and not as some Xen-specific thing. Given that, usual graphics folks rules apply: Where's the userspace for this (must be open source)? What exactly is the use-case you're trying to solve by sharing dma-bufs in this fashion? Iirc my feedback on v1 was why exactly you really need to be able to import a normal dma-buf into a hyper-dmabuf, instead of allocating them directly in the hyper-dmabuf driver. Which would _massively_ simplify your design, since you don't need to marshall all the attach and map business around (since the hypervisor would be in control of the dma-buf, not a guest OS). Also, all this marshalling leaves me with the impression that the guest that exports the dma-buf could take down the importer. That kinda nukes all the separation guarantees that vms provide. Or you just stuff this somewhere deeply hidden within Xen where gpu folks can't find it :-) -Daniel > > 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 driver section in MAINTAINERS > hyper_dmabuf: user private data attached to hyper_DMABUF > hyper_dmabuf: hyper_DMABUF synchronization across VM > hyper_dmabuf: query ioctl for retreiving various hyper_DMABUF info > hyper_dmabuf: event-polling mechanism for detecting a new hyper_DMABUF > hyper_dmabuf: threaded interrupt in Xen-backend > hyper_dmabuf: default backend for XEN hypervisor > > Documentation/hyper-dmabuf-sharing.txt | 734 ++++++++++++++++ > MAINTAINERS | 11 + > drivers/dma-buf/Kconfig | 2 + > drivers/dma-buf/Makefile | 1 + > drivers/dma-buf/hyper_dmabuf/Kconfig | 50 ++ > drivers/dma-buf/hyper_dmabuf/Makefile | 44 + > .../backends/xen/hyper_dmabuf_xen_comm.c | 944 +++++++++++++++++++++ > .../backends/xen/hyper_dmabuf_xen_comm.h | 78 ++ > .../backends/xen/hyper_dmabuf_xen_comm_list.c | 158 ++++ > .../backends/xen/hyper_dmabuf_xen_comm_list.h | 67 ++ > .../backends/xen/hyper_dmabuf_xen_drv.c | 46 + > .../backends/xen/hyper_dmabuf_xen_drv.h | 53 ++ > .../backends/xen/hyper_dmabuf_xen_shm.c | 525 ++++++++++++ > .../backends/xen/hyper_dmabuf_xen_shm.h | 46 + > drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_drv.c | 410 +++++++++ > drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_drv.h | 122 +++ > drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_event.c | 122 +++ > drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_event.h | 38 + > drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_id.c | 135 +++ > drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_id.h | 53 ++ > drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_ioctl.c | 794 +++++++++++++++++ > drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_ioctl.h | 52 ++ > drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_list.c | 295 +++++++ > drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_list.h | 73 ++ > drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_msg.c | 416 +++++++++ > drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_msg.h | 89 ++ > drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_ops.c | 415 +++++++++ > drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_ops.h | 34 + > drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_query.c | 174 ++++ > drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_query.h | 36 + > .../hyper_dmabuf/hyper_dmabuf_remote_sync.c | 324 +++++++ > .../hyper_dmabuf/hyper_dmabuf_remote_sync.h | 32 + > .../dma-buf/hyper_dmabuf/hyper_dmabuf_sgl_proc.c | 257 ++++++ > .../dma-buf/hyper_dmabuf/hyper_dmabuf_sgl_proc.h | 43 + > drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_struct.h | 143 ++++ > include/uapi/linux/hyper_dmabuf.h | 134 +++ > 36 files changed, 6950 insertions(+) > create mode 100644 Documentation/hyper-dmabuf-sharing.txt > create mode 100644 drivers/dma-buf/hyper_dmabuf/Kconfig > create mode 100644 drivers/dma-buf/hyper_dmabuf/Makefile > create mode 100644 drivers/dma-buf/hyper_dmabuf/backends/xen/hyper_dmabuf_xen_comm.c > create mode 100644 drivers/dma-buf/hyper_dmabuf/backends/xen/hyper_dmabuf_xen_comm.h > create mode 100644 drivers/dma-buf/hyper_dmabuf/backends/xen/hyper_dmabuf_xen_comm_list.c > create mode 100644 drivers/dma-buf/hyper_dmabuf/backends/xen/hyper_dmabuf_xen_comm_list.h > create mode 100644 drivers/dma-buf/hyper_dmabuf/backends/xen/hyper_dmabuf_xen_drv.c > create mode 100644 drivers/dma-buf/hyper_dmabuf/backends/xen/hyper_dmabuf_xen_drv.h > create mode 100644 drivers/dma-buf/hyper_dmabuf/backends/xen/hyper_dmabuf_xen_shm.c > create mode 100644 drivers/dma-buf/hyper_dmabuf/backends/xen/hyper_dmabuf_xen_shm.h > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_drv.c > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_drv.h > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_event.c > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_event.h > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_id.c > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_id.h > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_ioctl.c > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_ioctl.h > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_list.c > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_list.h > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_msg.c > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_msg.h > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_ops.c > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_ops.h > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_query.c > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_query.h > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_remote_sync.c > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_remote_sync.h > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_sgl_proc.c > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_sgl_proc.h > create mode 100644 drivers/dma-buf/hyper_dmabuf/hyper_dmabuf_struct.h > create mode 100644 include/uapi/linux/hyper_dmabuf.h > > -- > 2.16.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch