Received: by 10.213.65.68 with SMTP id h4csp2358387imn; Thu, 5 Apr 2018 13:33:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx49B1HeM8AOAPxQ1EfdbExH1KtCO6KlwuaVasJlGiDOiHxjMWLIIDjIFDtKCDGx6l2pZM/FQ X-Received: by 2002:a17:902:2d01:: with SMTP id o1-v6mr23880900plb.309.1522960434116; Thu, 05 Apr 2018 13:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522960434; cv=none; d=google.com; s=arc-20160816; b=ABTCks3JAbg32y8SHccRp/WmJlTkuRXQcBNCPomWb+OEane5rSMBbk07Op0yw+WX2J d+mXiB71ai1VzrNwIZurS3AZNgnCJElsI2EwZjaZa+4qMcW/tICqympaW/jaGs54g3qY biIMLLVFbjAsWiIojTFdR31Hx4cCpk+Ge0FCeJnsol+j7o60qQWmKQ1yfzNFuIAWeaZZ PtBgu5qKf81xzIpW/Z1SzCDyfQuHxsew2yI0z8lHpXk1iJHg4JI2Vp1E0EH+X0Q2dAdQ zrIWkUd3YPDJy1BedpGNoGQHMF4BIDdeDWKTdUsbDs64RA4CgZmXtOAHfjduZuJ+Zk4n u/xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=gV4tzHMy1ts9Y+8FOEOKDQLyaTav6kiL2An6b8V4P8k=; b=KZt0Zm8CGOibb2d90C4RH9u+T2zMAqi/7qz1PifRrfc9rBWImwXwsTov/xoOq9dVJ3 sDVUu8nCpcI086G9uUCe2S/MFb4V+flCTsRwe7t+E7zlQRbrdz0Lv/CpvFUcngS/TJoP PD3KAOQuJYxbYWDeHwNeJjxds/I0RxOwNaCBLO7LhWOvQkzyCxscUizlhGX/IGXx4rUZ uLvpIIhIGPATvrM3I6AK4O2A/hTjzYQjBzUo2hli7i/Vu2vf2T9/bsNzml6ruZHQTWRO 1dSAUuSfL+uZcufn5P1xt54mtYU7eAwPKDFKZszDNha41xA+OKB7Y5WOetlkZsLDtsEj gcPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=ZY9P8wX7; 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 j61-v6si6703877plb.317.2018.04.05.13.33.40; Thu, 05 Apr 2018 13:33:54 -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; dkim=fail header.i=@ffwll.ch header.s=google header.b=ZY9P8wX7; 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 S1753543AbeDEUcH (ORCPT + 99 others); Thu, 5 Apr 2018 16:32:07 -0400 Received: from mail-it0-f49.google.com ([209.85.214.49]:35091 "EHLO mail-it0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751274AbeDEUcF (ORCPT ); Thu, 5 Apr 2018 16:32:05 -0400 Received: by mail-it0-f49.google.com with SMTP id v194-v6so5874084itb.0 for ; Thu, 05 Apr 2018 13:32:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=gV4tzHMy1ts9Y+8FOEOKDQLyaTav6kiL2An6b8V4P8k=; b=ZY9P8wX7iry8VKf8iidsuZAiGDZd/pEvSJqjMWFJuN3feMABv0MDvkzcqiaCU/freF ypirdOjGpqgRKbwLDHovDYroP3VX2nkgGhdjQg5mfhnlE9zZ7HvcxI3c2FxMbO4KdqiY 8KIttetDZf9oHIt230BqFBeZyGrNG4yFBC+oc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=gV4tzHMy1ts9Y+8FOEOKDQLyaTav6kiL2An6b8V4P8k=; b=Q5HCorJ118rxwm42RSWEvhwYQHhF/336FDhS7mbiy5raQ5SEUli4MdNIe9B1r5/zSE 4HfDBKsOYBPnH2iNHuW4bhKzw1qZr5FVWTAmhNYAr6yfNeUQweOI697Qbk7A78XspwMc mLm7KeJFKD3PgzkFT2hI7rGKJOkl9LYPZ0RxpG9zy+90J39gAP5VStaPk9USoVoezrNr mArjGtlHvs6IQ9rZULTs/ge5WumNYTaVEJGLi0t1Y9roPl9i2UxnwPk5WWsfFIrh9yBS FClNZK6v7kSIcMZN5Uxb8sZo75+layXrSeDfuBH+Au3oKdp0Tyqyejzjq/vnrGQkx0iV 5nYw== X-Gm-Message-State: ALQs6tAdA2RywdoAcNSEvvlUDsJjfCMpjOEr2Fxwr5HpGTHBmQn1PB8D QQgKsUNFjme8EvuCmwsjmkSS+eS4ZhLzeyNMtyNMTA== X-Received: by 2002:a24:e14e:: with SMTP id n75-v6mr15657839ith.58.1522960324696; Thu, 05 Apr 2018 13:32:04 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.40.129 with HTTP; Thu, 5 Apr 2018 13:32:04 -0700 (PDT) X-Originating-IP: [212.51.149.109] In-Reply-To: <20180314080301.366zycak3whqvvqx@sirius.home.kraxel.org> References: <20180313154826.20436-1-kraxel@redhat.com> <20180313161035.GL4788@phenom.ffwll.local> <20180314080301.366zycak3whqvvqx@sirius.home.kraxel.org> From: Daniel Vetter Date: Thu, 5 Apr 2018 22:32:04 +0200 X-Google-Sender-Auth: KOc-QizI1-rKip76IlB574HvsGw Message-ID: Subject: Re: [RfC PATCH] Add udmabuf misc device To: Gerd Hoffmann , Oleksandr Andrushchenko , Dongwon Kim , Matthew D Roper Cc: dri-devel , Tomeu Vizoso , David Airlie , open list , qemu-devel@nongnu.org, "moderated list:DMA BUFFER SHARING FRAMEWORK" , "open list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pulling this out of the shadows again. We now also have xen-zcopy from Oleksandr and the hyper dmabuf stuff from Matt and Dongwong. At least from the intel side there seems to be the idea to just have 1 special device that can handle cross-gues/host sharing for all kinds of hypervisors, so I guess you all need to work together :-) Or we throw out the idea that hyper dmabuf will be cross-hypervisor (not sure how useful/reasonable that is, someone please convince me one way or the other). Cheers, Daniel On Wed, Mar 14, 2018 at 9:03 AM, Gerd Hoffmann wrote: > 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_notifi= er >> support (see i915 or amdgpu), but that also requires Christian K=C3=B6ni= gs >> 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 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel --=20 Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch