Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2511618ybe; Thu, 12 Sep 2019 10:28:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLoQUU6/XTyQ2KNFx8SwBsXKiWY2Bwzg0dZzwGw/yTIaIBu0ygl1VO6/WM8uOxsPj4rRxM X-Received: by 2002:a50:99da:: with SMTP id n26mr27201930edb.293.1568309322986; Thu, 12 Sep 2019 10:28:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568309322; cv=none; d=google.com; s=arc-20160816; b=UJEHVwrvLNupRk3Lh7jZ1TlpAQHJ+LbTZ5OoadbE7ILtIWOcjJ8TdO//XwBZJuaFvv aMmW28NsKJ9NW6dSzi3Fei/+/Ufu08Ky2ywcnV6PrJScktKAjpvA6TwkFCNj4wzOjtPR C69fVc6PIQDlY0fa3lgKc+LRd8iyNx4ZzyfwlRc1Ybqe1RdCQ59liXnZIUnVlKE9qS38 2Gs6wO/EY106nOEkhLWsPPwHdJSPOhrE6ex1DX9b9K65Q7YKtgVlqrLgmdcGn0McnJ/x f+AxfGt+tIPzL/mciZoW95TQyxAgOyC8vG3EgqTO4U7rTRYHV1LMEhhgJ7sxkPHGZFXu TLRg== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=AY18DB1U2Agpb0Vn6AonJ7qEzINgmq8hLpTComjOn9M=; b=f/mTh8wwqN3nt4oCOWaf+UNoWtts7klQRaCq/IzfQzTvQXtBNxUAh9o6Dizb03YyMp 4fGf1YwW5nUX301SRqiS1Md4tCj1ZMEjZ3nZ57EukFirA5gLeZIuw7Fa9QDZkVpl4VMz X1/QPcCuNrwDSAa+Axwhzfxhh/bBoumvnIMgxL7biAS0C4drY3rxPZVSqk89W/aom6e4 /OIKk/aJiSS7SE7uVoVDefDIsE6JluiCJDBtsuIn6kv+U+9w4fRUh1DfKnCGOhdTBwH4 I5JIOdytuZIhns5epdi1/sZKEn6zNcjYq+zL0iE2nP1pSTv5e5wYbcmvfnSInWmbIAcS Eadw== 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 f1si15269777edy.247.2019.09.12.10.28.19; Thu, 12 Sep 2019 10:28:42 -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 S1731665AbfILMiX (ORCPT + 99 others); Thu, 12 Sep 2019 08:38:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40874 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731283AbfILMiX (ORCPT ); Thu, 12 Sep 2019 08:38:23 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D4BD710C092C; Thu, 12 Sep 2019 12:38:22 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-47.ams2.redhat.com [10.36.116.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7EE9360872; Thu, 12 Sep 2019 12:38:22 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B502E16E05; Thu, 12 Sep 2019 14:38:21 +0200 (CEST) Date: Thu, 12 Sep 2019 14:38:21 +0200 From: Gerd Hoffmann To: Tomasz Figa Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, stevensd@chromium.org, marcheu@chromium.org, zachr@chromium.org, keiichiw@chromium.org, posciak@chromium.org Subject: Re: [RFC PATCH] drm/virtio: Export resource handles via DMA-buf API Message-ID: <20190912123821.rraib5entkcxt5p5@sirius.home.kraxel.org> References: <20190912094121.228435-1-tfiga@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190912094121.228435-1-tfiga@chromium.org> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.66]); Thu, 12 Sep 2019 12:38:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, > To seamlessly enable buffer sharing with drivers using such frameworks, > make the virtio-gpu driver expose the resource handle as the DMA address > of the buffer returned from the DMA-buf mapping operation. Arguably, the > resource handle is a kind of DMA address already, as it is the buffer > identifier that the device needs to access the backing memory, which is > exactly the same role a DMA address provides for native devices. No. A scatter list has guest dma addresses, period. Stuffing something else into a scatterlist is asking for trouble, things will go seriously wrong when someone tries to use such a fake scatterlist as real scatterlist. Also note that "the DMA address of the buffer" is bonkers in virtio-gpu context. virtio-gpu resources are not required to be physically contigous in memory, so typically you actually need a scatter list to describe them. cheers, Gerd