qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC 00/14] vhost-user backends for gpu & input virtio devices
@ 2016-06-04 21:33 marcandre.lureau
  2016-06-04 21:33 ` [Qemu-devel] [RFC 01/14] Add qemu_chr_open_socket() marcandre.lureau
                   ` (14 more replies)
  0 siblings, 15 replies; 26+ messages in thread
From: marcandre.lureau @ 2016-06-04 21:33 UTC (permalink / raw)
  To: qemu-devel; +Cc: kraxel, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Hi,

vhost-user allows to drive a virtio device in a seperate process. So
far, it has been mainly used with virtio-net. It can work with other
devices such as input and gpu, as shown in this series.

Some of the benefits of using vhost-user are:
- parallelism, since the backend is running in a different process
- flexibility, since backends may be implemented by various parties
- some process isolation (virgl is fairly recent project and a lot of
security issues have been found, opengl isn't super safe either and it
may run on closed-source and large gl libraries), although having a
limited access to guest memory could be safer.

You can run the vhost-user-gpu backend with spice only (since
importing dmabuf requires an egl context, it's not easy to do it with
sdl/gtk ui), it provides the basic cursor/2d/3d rendering, but lacks
some features (such as resize):
-object vhost-user-backend,id=vug,cmd="./vhost-user-gpu"
-device virtio-vga,virgl=true,vhost-user=vug
-spice disable-ticketing,gl=on,unix,addr=/tmp/spice.soc

As for vhost-user-input, it takes an input device path:
-object vhost-user-backend,id=vuid,cmd="vhost-user-input /dev/input/event0"
-device virtio-input-host-pci,vhost-user=vuid

This is based on top of libvhost-user series sent earlier on ML. For
convenience, the branch is also available on github:
https://github.com/elmarco/qemu/ vhost-user-gpu

Comments welcome!

Marc-André Lureau (14):
  Add qemu_chr_open_socket()
  Add vhost-user-backend
  vhost-user: split vhost_user_read()
  vhost-user: add vhost_user_input_get_config()
  Add vhost-user backend to virtio-input-host
  contrib: add vhost-user-input
  misc: rename virtio-gpu.h header guard
  vhost: make sure call fd has been received
  qemu-char: use READ_RETRIES
  qemu-char: block during sync read
  console: add dpy_gl_scanout2()
  contrib: add vhost-user-gpu
  vhost-user: add vhost_user_gpu_set_socket()
  Add virtio-gpu vhost-user backend

 Makefile                               |    6 +
 Makefile.objs                          |    2 +
 backends/Makefile.objs                 |    2 +
 backends/vhost-user.c                  |  262 +++++++++
 configure                              |    5 +
 contrib/libvhost-user/libvhost-user.h  |    1 +
 contrib/vhost-user-gpu/Makefile.objs   |    7 +
 contrib/vhost-user-gpu/main.c          | 1012 ++++++++++++++++++++++++++++++++
 contrib/vhost-user-gpu/virgl.c         |  545 +++++++++++++++++
 contrib/vhost-user-gpu/virgl.h         |   24 +
 contrib/vhost-user-gpu/vugpu.h         |  155 +++++
 contrib/vhost-user-input/Makefile.objs |    1 +
 contrib/vhost-user-input/main.c        |  369 ++++++++++++
 docs/specs/vhost-user.txt              |    9 +
 hw/display/Makefile.objs               |    2 +-
 hw/display/vhost-gpu.c                 |  264 +++++++++
 hw/display/virtio-gpu-pci.c            |    6 +
 hw/display/virtio-gpu.c                |   75 ++-
 hw/display/virtio-vga.c                |    5 +
 hw/input/virtio-input-host.c           |   67 ++-
 hw/input/virtio-input.c                |    4 +
 hw/virtio/vhost-user.c                 |   97 ++-
 hw/virtio/vhost.c                      |    5 +
 hw/virtio/virtio-pci.c                 |    5 +
 include/hw/virtio/vhost-backend.h      |    5 +
 include/hw/virtio/virtio-gpu.h         |   11 +-
 include/hw/virtio/virtio-input.h       |    2 +
 include/sysemu/char.h                  |    2 +
 include/sysemu/vhost-user-backend.h    |   65 ++
 include/ui/console.h                   |   10 +
 qemu-char.c                            |   43 +-
 ui/console.c                           |   12 +
 ui/spice-display.c                     |   19 +
 33 files changed, 3073 insertions(+), 26 deletions(-)
 create mode 100644 backends/vhost-user.c
 create mode 100644 contrib/vhost-user-gpu/Makefile.objs
 create mode 100644 contrib/vhost-user-gpu/main.c
 create mode 100644 contrib/vhost-user-gpu/virgl.c
 create mode 100644 contrib/vhost-user-gpu/virgl.h
 create mode 100644 contrib/vhost-user-gpu/vugpu.h
 create mode 100644 contrib/vhost-user-input/Makefile.objs
 create mode 100644 contrib/vhost-user-input/main.c
 create mode 100644 hw/display/vhost-gpu.c
 create mode 100644 include/sysemu/vhost-user-backend.h

-- 
2.7.4

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2016-06-08 12:53 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-04 21:33 [Qemu-devel] [RFC 00/14] vhost-user backends for gpu & input virtio devices marcandre.lureau
2016-06-04 21:33 ` [Qemu-devel] [RFC 01/14] Add qemu_chr_open_socket() marcandre.lureau
2016-06-04 21:33 ` [Qemu-devel] [RFC 02/14] Add vhost-user-backend marcandre.lureau
2016-06-04 21:33 ` [Qemu-devel] [RFC 03/14] vhost-user: split vhost_user_read() marcandre.lureau
2016-06-04 21:33 ` [Qemu-devel] [RFC 04/14] vhost-user: add vhost_user_input_get_config() marcandre.lureau
2016-06-04 21:33 ` [Qemu-devel] [RFC 05/14] Add vhost-user backend to virtio-input-host marcandre.lureau
2016-06-06  6:22   ` Gerd Hoffmann
2016-06-04 21:33 ` [Qemu-devel] [RFC 06/14] contrib: add vhost-user-input marcandre.lureau
2016-06-04 21:33 ` [Qemu-devel] [RFC 07/14] misc: rename virtio-gpu.h header guard marcandre.lureau
2016-06-04 21:33 ` [Qemu-devel] [RFC 08/14] vhost: make sure call fd has been received marcandre.lureau
2016-06-04 21:33 ` [Qemu-devel] [RFC 09/14] qemu-char: use READ_RETRIES marcandre.lureau
2016-06-04 21:33 ` [Qemu-devel] [RFC 10/14] qemu-char: block during sync read marcandre.lureau
2016-06-04 21:33 ` [Qemu-devel] [RFC 11/14] console: add dpy_gl_scanout2() marcandre.lureau
2016-06-06  6:35   ` Gerd Hoffmann
2016-06-06 13:18     ` Marc-André Lureau
2016-06-06 14:04       ` Gerd Hoffmann
2016-06-04 21:33 ` [Qemu-devel] [RFC 12/14] contrib: add vhost-user-gpu marcandre.lureau
2016-06-04 21:33 ` [Qemu-devel] [RFC 13/14] vhost-user: add vhost_user_gpu_set_socket() marcandre.lureau
2016-06-06  6:36   ` Gerd Hoffmann
2016-06-04 21:33 ` [Qemu-devel] [RFC 14/14] Add virtio-gpu vhost-user backend marcandre.lureau
2016-06-06  6:54   ` Gerd Hoffmann
2016-06-06 13:54 ` [Qemu-devel] [RFC 00/14] vhost-user backends for gpu & input virtio devices Marc-André Lureau
2016-06-07 14:47   ` Gerd Hoffmann
2016-06-07 15:01     ` Marc-André Lureau
2016-06-08  6:11       ` Gerd Hoffmann
2016-06-08 12:53         ` Marc-André Lureau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).