Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: kvm@vger.kernel.org, Stefan Hajnoczi <stefanha@gmail.com>,
	Zach Reizner <zachr@google.com>,
	Helen Mae Koike Fornazier <helen.koike@collabora.co.uk>
Subject: Re: passing FDs across domains
Date: Tue, 14 Nov 2017 09:08:54 +0100	[thread overview]
Message-ID: <afcabd2b-b16a-340c-d8d5-e69df923bb9e@collabora.com> (raw)
In-Reply-To: <20171114080257.p7fcafmfva64aeua@sirius.home.kraxel.org>

On 11/14/2017 09:02 AM, Gerd Hoffmann wrote:
> On Mon, Nov 13, 2017 at 03:18:46PM +0100, Tomeu Vizoso wrote:
>> Hi,
>>
>> I'm looking at what would be the best way for Wayland clients running in a
>> VM to communicate with a Wayland compositor in the host.
>>
>> The base Wayland protocol is fairly self-contained, with little or no
>> references to objects outside the client and the server, so it lends itself
>> very well to virtualization.
>>
>> But there's a problem when passing references to pixel buffers around with
>> FD passing, as SCM_RIGHTS isn't currently implemented in AF_VSOCK.
>>
>> The Wayland project is willing to consider adding AF_VSOCK support to the
>> libwayland libraries alongside existing support for AF_UNIX, both on client
>> and server.
>>
>> Any opinions on whether adding SCM_RIGHTS support to AF_VSOCK is a good
>> idea?
> 
> Not going to work.  A file handle is a reference to a kernel object
> which can be pretty much anything (file, socket, timer, memory, ...) and
> you can't pass that across machine borders.  It's not working for
> AF_INET for the same reason.

The idea was to only allow passing FDs that point that objects that can 
be shared across domains. So shared memory buffers in this case.

>> Or other options for letting processes in the host to access shmem
>> buffers allocated within the guest?
>>
>> Regarding the mechanics of mapping guest buffers in the host, I was hoping
>> the approach described below would work:
>>
>> http://www.fp7-save.eu/papers/SCALCOM2016.pdf
> 
> Doesn't look that useful to me on a quick glance.
> 
> Lets step back and look at the problem you are trying to solve.
> 
> It seems you want guest wayland applications appear seamless on the host
> wayland server, correct?

Correct.

> How does the wayland rendering workflow look like?  As far I know the
> wayland protocol doesn't include any rendering.  Rendering happens
> client side, into some buffer (one per window), which is then passed to
> the server for display compositing.  Correct?  So you basically want
> pass that buffer from guest to host?

Correct.

> What kind of shared memory is used by wayland?
> sysv shm?  gbm buffers / dmabufs?

Typically, shared memory for CPU-rendered content, and dmabufs for 
GPU-rendered content.

Thanks,

Tomeu

  reply	other threads:[~2017-11-14  8:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13 14:18 passing FDs across domains Tomeu Vizoso
2017-11-14  8:02 ` Gerd Hoffmann
2017-11-14  8:08   ` Tomeu Vizoso [this message]
2017-11-14  9:33     ` Gerd Hoffmann
2017-11-14 14:01       ` Tomeu Vizoso
2017-11-14 14:19         ` Gerd Hoffmann
2017-11-15  8:21           ` Tomeu Vizoso
2017-11-15  9:47             ` Tomeu Vizoso
2017-11-16  9:57           ` Tomeu Vizoso
2017-11-16 10:49             ` Gerd Hoffmann
2017-11-16 14:36               ` Tomeu Vizoso
2017-11-16 15:51                 ` Gerd Hoffmann
2017-11-22 10:54                   ` Stefan Hajnoczi
2017-11-22 15:47                     ` Stefan Hajnoczi
2017-11-23  8:17                       ` Tomeu Vizoso
2017-11-27 10:59                         ` Stefan Hajnoczi
2017-11-27 11:59                           ` cross-domain Wayland (Re: passing FDs across domains) Tomeu Vizoso
     [not found]                     ` <bf6ce187-46b6-f01d-4eba-79b035c94426@collabora.com>
     [not found]                       ` <CAAFQd5AJFtK524sh1RStOeE8yagknW_hoJVr6mzMXb=+eL03Bg@mail.gmail.com>
     [not found]                         ` <20190320121132.ysny44krkgw6jlje@sirius.home.kraxel.org>
     [not found]                           ` <CAAFQd5BmAfYzF0JprqWjpkmk-_PGAGXzy7HOa-QJJBxfqigVkg@mail.gmail.com>
     [not found]                             ` <20190401161940.c32mxs7locfzlp6z@sirius.home.kraxel.org>
2019-04-16  5:29                               ` passing FDs across domains Tomasz Figa
2019-04-17  9:30                                 ` Gerd Hoffmann
2019-04-17 10:12                                   ` Tomasz Figa
2019-04-18  6:56                                     ` Tomasz Figa
2019-04-18  7:07                                       ` Lepton Wu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=afcabd2b-b16a-340c-d8d5-e69df923bb9e@collabora.com \
    --to=tomeu.vizoso@collabora.com \
    --cc=helen.koike@collabora.co.uk \
    --cc=kraxel@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=stefanha@gmail.com \
    --cc=zachr@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox