Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4023637yba; Wed, 17 Apr 2019 02:59:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqztklS0FbRYz45R29DSCk+QIosT65JmjuGhv4bc+xMHVFOCaNru52mn4QOv2b8LFfXKWzWk X-Received: by 2002:aa7:8552:: with SMTP id y18mr87676848pfn.176.1555495144179; Wed, 17 Apr 2019 02:59:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555495144; cv=none; d=google.com; s=arc-20160816; b=Skmnf1tm2pXvUWsuuPdF42e4p0uDBeCNmAxXsoYXDs7eOXH/oq2EJR9kiXbmTuqY3e fZhb32m0PGQuE5sX0SfuaV2n82aff6rRza1OvMkBWw/RchPG1dvQlEB9raeg+MyuxFs2 tqzInd3qXiH3JLRrqUNWc0yf52TbCi0VLSAXYT83xOPauhankkFPkobLvfZ4+ot4Nw89 5DBCqQYHKeRyuyVPjWj4EHoy1jlN1kWU65Rzymr5PeZ6w48WiBDrnYW7uqtZylwrzMni Rx44OFxHIQwbKJihoYxxnDqVagj59AOu7gKUtn4lnryQYCpm6iiI44RgruFSMXEytQST uaVw== 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=Zn3Xr0LGqaFmsV2Sjp/x2vi6uPuUEAcqnFWgu2S9WPo=; b=hQ0BO5E8ZOohBbrv2eUnDDIZ4iLW04x1mA11IwA5ygBeNfvMKey/LxaavCqIoKEIIx 1iL2g+4yfmxZPtiABF0KzzMzJeW6xgGclcJLWWDCQp6H2T+pfBbfAUfwJ4vg7PXmv+wQ mG6uWFWbMfjnzqQHm92XTOiOED2BbGIfA4We2T8lmM0eoYKUthQuThcLMfqp+5c7vmx0 moVhzOYsDqOLsDQ2xj1dH/CEXgeZDy0+lGYWbFzTJVOYzS97v2O4YWCkRjVsmQZwmBy/ fJjomuxmN7rERPmvOVpA4gfCsPQTkvZwutcJ/7BkodVLIjxB9cPASoeArBGbcYfC2zaN e3sQ== 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 a11si36560207pgw.384.2019.04.17.02.58.49; Wed, 17 Apr 2019 02:59:04 -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 S1731595AbfDQJ54 (ORCPT + 99 others); Wed, 17 Apr 2019 05:57:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51902 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727013AbfDQJ5z (ORCPT ); Wed, 17 Apr 2019 05:57:55 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1BD613082A27; Wed, 17 Apr 2019 09:57:55 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-65.ams2.redhat.com [10.36.116.65]) by smtp.corp.redhat.com (Postfix) with ESMTP id 80B285D71E; Wed, 17 Apr 2019 09:57:51 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B636D1747B; Wed, 17 Apr 2019 11:57:50 +0200 (CEST) Date: Wed, 17 Apr 2019 11:57:50 +0200 From: Gerd Hoffmann To: Chia-I Wu Cc: Gurchetan Singh , Tomeu Vizoso , "Michael S. Tsirkin" , David Airlie , Jason Wang , open list , ML dri-devel , "open list:VIRTIO CORE, NET AND BLOCK DRIVERS" , David Airlie , virtio@lists.oasis-open.org Subject: Re: [PATCH 3/3] virtio-gpu api: VIRTIO_GPU_F_RESSOURCE_V2 Message-ID: <20190417095750.lre3xrg4dlgskfjg@sirius.home.kraxel.org> References: <20190410114227.25846-1-kraxel@redhat.com> <20190410114227.25846-4-kraxel@redhat.com> <20190411050322.mfxo5mrwwzajlz3h@sirius.home.kraxel.org> <20190412054924.dvh6bfxfrbgvezxr@sirius.home.kraxel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 17 Apr 2019 09:57:55 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 12, 2019 at 04:34:20PM -0700, Chia-I Wu wrote: > Hi, > > I am still new to virgl, and missed the last round of discussion about > resource_create_v2. > > From the discussion below, semantically resource_create_v2 creates a host > resource object _without_ any storage; memory_create creates a host memory > object which provides the storage. Is that correct? Right now all resource_create_* variants create a resource object with host storage. memory_create creates guest storage, and resource_attach_memory binds things together. Then you have to transfer the data. Hmm, maybe we need a flag indicating that host storage is not needed, for resources where we want establish some kind of shared mapping later on. > Do we expect these new commands to be supported by OpenGL, which does not > separate resources and memories? Well, for opengl you need a 1:1 relationship between memory region and resource. > > Yes, even though it is not clear yet how we are going to handle > > host-allocated buffers in the vhost-user case ... > > This might be another dumb question, but is this only an issue for > vhost-user(-gpu) case? What mechanisms are used to map host dma-buf into > the guest address space? qemu can change the address space, that includes mmap()ing stuff there. An external vhost-user process can't do this, it can only read the address space layout, and read/write from/to guest memory. > But one needs to create the resource first to know which memory types can > be attached to it. I think the metadata needs to be returned with > resource_create_v2. There is a resource_info reply for that. > That should be good enough. But by returning alignments, we can minimize > the gaps when attaching multiple resources, especially when the resources > are only used by GPU. We can add alignments to the resource_info reply. cheers, Gerd