Received: by 10.213.65.68 with SMTP id h4csp832141imn; Wed, 14 Mar 2018 01:04:30 -0700 (PDT) X-Google-Smtp-Source: AG47ELuZngTo4big+4ugii+Hy23jt3fUwtYE+l4/mjZpRzH9+c/PHNJPQ36pEb5bBjr7SHiWk9MO X-Received: by 2002:a17:902:7d17:: with SMTP id z23-v6mr3259236pll.237.1521014670435; Wed, 14 Mar 2018 01:04:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521014670; cv=none; d=google.com; s=arc-20160816; b=yq4894bJ4h3R6ZWwZBg3HqeYMb9vhxoO7KwizDE9bkeMSSv/2+ctYqIBr0iz0Lg0xY cyWzYKsEPuE//0LP1fi148hpmcHmqmkzipmRxNxWii8+1rpZZwZHugeRcxpCR4cIuXGl YMnR2egKrFXvQJ5NHtdSgyLh96b4EzkBTjQ3mLfw7hdJKF4zNLQp1/rAnRT83/lBLTaH PYIlkGDoQdi71WJABXrr4WrdSVJvYVZJy1AqSXDVpf9+fmUPZ/Q4GdauIWAjLIOHtSAe tVB6eyqeozshAgSzGegHWa/Eo6YED5jgNEOwXL6hdyvis2kxZBT8K/numFw1cj0cS5Ve CEgA== 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:message-id:subject:to:from:date :arc-authentication-results; bh=ukOR24EMALq08e+vq7V55x1WbvTzF2bkTeg8s9MNwyI=; b=MmkuJHNxkX5VHz2EW0s5YgEa9CTi0kRAYlfkuBUSeaaWLntbpUxVx07XlmI2h5Mg+1 +TUms1shT9wW//T+qnl1q1TY3OIbrQnk8q84jUeHlxKsx6TQwLJFe5tRxyZDiSwyS5O6 OJn2ybdUGvRZQCvHFhqTY+q8O8eReZW7i8nazoTvKOapLI6ruFtyLV/+/uMluSEcBQCl ypgDKG/qLzukeJitJSGHRfYFsapGqpS6zCBlcivPl0XlfrTjjVmM93kgnDiLQFyOZQKz Hv8JqpIxweGJsXGdMVxTq7HzjiiAlmJkAAi/XMJNmxIG3ObjPUY/wfDASxJrlML8peug pA9g== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t3-v6si1597540plm.240.2018.03.14.01.04.16; Wed, 14 Mar 2018 01:04:30 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753057AbeCNIDL (ORCPT + 99 others); Wed, 14 Mar 2018 04:03:11 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:47028 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751317AbeCNIDH (ORCPT ); Wed, 14 Mar 2018 04:03:07 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ECF2680AD211; Wed, 14 Mar 2018 08:03:06 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5D3416353D; Wed, 14 Mar 2018 08:03:02 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7C1ACECE; Wed, 14 Mar 2018 09:03:01 +0100 (CET) Date: Wed, 14 Mar 2018 09:03:01 +0100 From: Gerd Hoffmann To: dri-devel@lists.freedesktop.org, Tomeu Vizoso , David Airlie , open list , qemu-devel@nongnu.org, "moderated list:DMA BUFFER SHARING FRAMEWORK" , "open list:DMA BUFFER SHARING FRAMEWORK" Subject: Re: [RfC PATCH] Add udmabuf misc device Message-ID: <20180314080301.366zycak3whqvvqx@sirius.home.kraxel.org> References: <20180313154826.20436-1-kraxel@redhat.com> <20180313161035.GL4788@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180313161035.GL4788@phenom.ffwll.local> User-Agent: NeoMutt/20180223 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 14 Mar 2018 08:03:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 14 Mar 2018 08:03:07 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kraxel@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > Either mlock account (because it's mlocked defacto), and get_user_pages > won't do that for you. > > Or you write the full-blown userptr implementation, including mmu_notifier > support (see i915 or amdgpu), but that also requires Christian K?nigs > latest ->invalidate_mapping RFC for dma-buf (since atm exporting userptr > buffers is a no-go). I guess I'll look at mlock accounting for starters then. Easier for now, and leaves the door open to switch to userptr later as this should be transparent to userspace. > > Known issue: Driver API isn't complete yet. Need add some flags, for > > example to support read-only buffers. > > dma-buf has no concept of read-only. I don't think we can even enforce > that (not many iommus can enforce this iirc), so pretty much need to > require r/w memory. Ah, ok. Just saw the 'write' arg for get_user_pages_fast and figured we might support that, but if iommus can't handle that anyway it's pointless indeed. > > Cc: David Airlie > > Cc: Tomeu Vizoso > > Signed-off-by: Gerd Hoffmann > > btw there's also the hyperdmabuf stuff from the xen folks, but imo their > solution of forwarding the entire dma-buf api is over the top. This here > looks _much_ better, pls cc all the hyperdmabuf people on your next > version. Fun fact: googling for "hyperdmabuf" found me your mail and nothing else :-o (Trying "hyper dmabuf" instead worked better then). Yes, will cc them on the next version. Not sure it'll help much on xen though due to the memory management being very different. Basically xen owns the memory, not the kernel of the control domain (dom0), so creating dmabufs for guest memory chunks isn't that simple ... Also it's not clear whenever they really need guest -> guest exports or guest -> dom0 exports. > Overall I like the idea, but too lazy to review. Cool. General comments on the idea was all I was looking for for the moment. Spare yor review cycles for the next version ;) > Oh, some kselftests for this stuff would be lovely. I'll look into it. thanks, Gerd