From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: virtio-dev-return-5474-cohuck=redhat.com@lists.oasis-open.org Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Received: from lists.oasis-open.org (oasis.ws5.connectedcommunity.org [10.110.1.242]) by lists.oasis-open.org (Postfix) with ESMTP id 192B7985D74 for ; Wed, 20 Feb 2019 15:32:14 +0000 (UTC) MIME-Version: 1.0 References: <20190204054053.GE29758@stefanha-x1.localdomain> <20190204101316.4e3e6rj32suwdmur@sirius.home.kraxel.org> <20190211092943-mutt-send-email-mst@kernel.org> <20190219071222.jjebzcbh55kwlspn@sirius.home.kraxel.org> <20190220070213.3uetjgzzlf5qojan@sirius.home.kraxel.org> In-Reply-To: <20190220070213.3uetjgzzlf5qojan@sirius.home.kraxel.org> From: Frank Yang Date: Wed, 20 Feb 2019 07:32:01 -0800 Message-ID: Content-Type: multipart/alternative; boundary="000000000000d56df40582550f8b" Subject: Re: [virtio-dev] Memory sharing device To: Gerd Hoffmann Cc: "Michael S. Tsirkin" , Roman Kiryanov , Stefan Hajnoczi , virtio-dev@lists.oasis-open.org, "Dr. David Alan Gilbert" List-ID: --000000000000d56df40582550f8b Content-Type: text/plain; charset="UTF-8" On Tue, Feb 19, 2019 at 11:02 PM Gerd Hoffmann wrote: > > > > In general though, this means that the ideal usage of host pointers > would > > > > be to set a few regions up front for certain purposes, then share > that > > > out > > > > amongst other device contexts. This also facilitates sharing the > memory > > > > between guest processes, which is useful for implementing things like > > > > compositors. > > > > > > Guest processes in the same VM or in different VMs? > > > > > > > > > The guest processes are in the same VM. > > Are you also considering the usage in different VMs? > > No, I'm just asking whenever that is important to you. > > For communication between guest processes within the same VM I don't > really see a need to involve the hypervisor ... > > Right, once the host memory is set up we can rely on purely guest side stuff map sub-regions of it. > > > This also features heavily for our "virtio userspace" thing. > > > > Since this is a common pattern, should this sharing concept be > > > standardized > > > > somehow? I.e., should there be a standard way to send > Shmid/offset/size > > > to > > > > other devices, or have that be a standard struct in the hypervisor? > > > > > > Same question: other devices of the same VM? > > > > > > > Yes, also, other devices of the same VM. > > So why involve the hypervisor here? The guest can handle that on its > own. Passing an image data buffer from the usb webcam to the intel gpu > for display (on bare metal) isn't fundamentally different from passing a > buffer from virtio-camera to virtio-gpu (in a VM). Linux guests will > use dma-bufs for that, other OSes probably something else. > That's true that it can be handled purely in the guest layers, if there is an existing interface in the guest to pass the proposed host memory id's / offsets / sizes between them. However, for the proposed host memory sharing spec, would there be a standard way to share the host memory across different virtio devices without relying on Linux dmabufs? > cheers, > Gerd > > --000000000000d56df40582550f8b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Feb 19, 2019 at 11:02 PM Gerd= Hoffmann <kraxel@redhat.com>= ; wrote:
> &g= t; > In general though, this means that the ideal usage of host pointers= would
> > > be to set a few regions up front for certain purposes, then = share that
> > out
> > > amongst other device contexts. This also facilitates sharing= the memory
> > > between guest processes, which is useful for implementing th= ings like
> > > compositors.
> >
> > Guest processes in the same VM or in different VMs?
> >
>
>
> The guest processes are in the same VM.
> Are you also considering the usage in different VMs?

No, I'm just asking whenever that is important to you.

For communication between guest processes within the same VM I don't really see a need to involve the hypervisor ...

=C2=A0
Right, once the host memory is set u= p we can rely on purely guest side stuff
map sub-regions of it.
=C2=A0=C2=A0

cheers,
=C2=A0 Gerd

--000000000000d56df40582550f8b--