All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v4 00/29] vhost-user for input & GPU
@ 2018-07-13 13:08 Marc-André Lureau
  2018-07-13 13:08 ` [Qemu-devel] [PATCH v4 01/29] chardev: avoid crash if no associated address Marc-André Lureau
                   ` (31 more replies)
  0 siblings, 32 replies; 58+ messages in thread
From: Marc-André Lureau @ 2018-07-13 13:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: airlied, kraxel, Marc-André Lureau

Hi,

vhost-user allows to drive a virtio device in a seperate
process. After vhost-user-net, we have seen
vhost-user-{scsi,blk,crypto} added more recently.

This series, initially proposed 2 years ago
(https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg01905.html)
contributes with vhost-user-input and vhost-user-gpu.

Additionally, to factor out common code and ease the usage, a
vhost-user-backend is introduced as an intermediary object between the
backend and the qemu device.

You may start a vhost-user-gpu with virgl rendering in a separate
process like this:

$ ./vhost-user-gpu --virgl -s vgpu.sock &
$ qemu...
  -chardev socket,id=chr,path=vgpu.sock
  -object vhost-user-backend,id=vug,chardev=chr
  -device vhost-user-vga,vhost-user=vug

You may also specify the backend command and the arguments as part of
vhost-user-backend qemu arguments. For example, to start a
vhost-user-input backend on input device /dev/input/event19:

-object vhost-user-backend,id=vuid,cmd="vhost-user-input /dev/input/event19"
-device virtio-input-host-pci,vhost-user=vuid

The vhost-user-gpu backend requires virgl from git.

The libvirt support is on-going work:
https://github.com/elmarco/libvirt/commits/vhost-user-gpu

The GPU benchmarks are encouraging, giving up to x5 performance on
Unigine Heaven 4.0.

Feedback welcome,

v4:
 - move qemu_write_pidfile() in util, improve it a bit
 - add --pid and --fd arguments to vhost-user to help with libvirt support
 - various bug fixes for synchronization, and tearing down

v3: deal with most comments from rfcv2 and various improvements
 - "vhost-user-backend: allow to specify binary to execute" as seperate
  patch, not for inclusion since Daniel as concerned about parsing
  shell strings with glib
 - use dmabuf to share 2d rendering result (with intel gem only atm)
 - document the vhost-user-gpu protocol
 - make vhost-user-gpu-pci and vhost-user-vga seperate devices (instead
   of adding vhost-user support to existing devices)
 - allow to specify virgl rendering, and rendernode
 - let's promote out of RFC status :)

RFCv2: (addressing some of Gerd comments digged in the archives)
 - rebased, clean ups, various small fixes, update commit messages
 - teach the vhost-user-backend to take a chardev
 - add vhost-user-input-pci, instead of adding vhost code to virtio-input-host-pci

Marc-André Lureau (29):
  chardev: avoid crash if no associated address
  chardev: remove qemu_chr_fe_read_all() counter
  chardev: unref if underlying chardev has no parent
  dmabuf: add y0_top, pass it to spice
  vhost-user: simplify vhost_user_init/vhost_user_cleanup
  libvhost-user: exit by default on VHOST_USER_NONE
  vhost-user: wrap some read/write with retry handling
  Add vhost-user-backend
  qio: add qio_channel_command_new_spawn_with_pre_exec()
  HACK: vhost-user-backend: allow to specify binary to execute
  vhost-user: split vhost_user_read()
  vhost-user: add vhost_user_input_get_config()
  libvhost-user: export vug_source_new()
  contrib: add vhost-user-input
  Add vhost-user-input-pci
  vhost-user: add vhost_user_gpu_set_socket()
  vhost-user: add vhost_user_gpu_get_num_capsets()
  virtio: add virtio-gpu bswap helpers header
  util: promote qemu_egl_rendernode_open() to libqemuutil
  util: add qemu_write_pidfile()
  util: use fcntl() for qemu_write_pidfile() locking
  contrib: add vhost-user-gpu
  virtio-gpu: remove unused qdev
  virtio-gpu: remove unused config_size
  virtio-gpu: block both 2d and 3d rendering
  virtio-gpu: remove useless 'waiting' field
  virtio-gpu: split virtio-gpu, introduce virtio-gpu-base
  virtio-gpu: split virtio-gpu-pci & virtio-vga
  hw/display: add vhost-user-vga & gpu-pci

 contrib/libvhost-user/libvhost-user-glib.h |    3 +
 contrib/libvhost-user/libvhost-user.h      |    3 +
 contrib/vhost-user-gpu/drm.h               |   63 ++
 contrib/vhost-user-gpu/virgl.h             |   25 +
 contrib/vhost-user-gpu/vugpu.h             |  168 +++
 hw/display/virtio-vga.h                    |   22 +
 hw/virtio/virtio-pci.h                     |   27 +-
 include/hw/virtio/vhost-backend.h          |    6 +
 include/hw/virtio/vhost-user-blk.h         |    2 +-
 include/hw/virtio/vhost-user-scsi.h        |    2 +-
 include/hw/virtio/vhost-user.h             |    2 +-
 include/hw/virtio/virtio-gpu-bswap.h       |   61 +
 include/hw/virtio/virtio-gpu.h             |   90 +-
 include/hw/virtio/virtio-input.h           |   14 +
 include/io/channel-command.h               |   18 +
 include/qemu/drm.h                         |    6 +
 include/qemu/osdep.h                       |    3 +-
 include/sysemu/vhost-user-backend.h        |   60 +
 include/ui/console.h                       |    1 +
 backends/cryptodev-vhost-user.c            |   18 +-
 backends/vhost-user.c                      |  320 ++++++
 chardev/char-fe.c                          |   13 +-
 chardev/char-socket.c                      |    8 +-
 contrib/libvhost-user/libvhost-user-glib.c |   15 +-
 contrib/libvhost-user/libvhost-user.c      |    3 +-
 contrib/vhost-user-gpu/drm.c               |  190 ++++
 contrib/vhost-user-gpu/main.c              | 1164 ++++++++++++++++++++
 contrib/vhost-user-gpu/virgl.c             |  579 ++++++++++
 contrib/vhost-user-input/main.c            |  379 +++++++
 hw/block/vhost-user-blk.c                  |   22 +-
 hw/display/vhost-user-gpu-pci.c            |   51 +
 hw/display/vhost-user-gpu.c                |  524 +++++++++
 hw/display/vhost-user-vga.c                |   52 +
 hw/display/virtio-gpu-3d.c                 |   70 +-
 hw/display/virtio-gpu-base.c               |  292 +++++
 hw/display/virtio-gpu-pci.c                |   39 +-
 hw/display/virtio-gpu.c                    |  368 ++-----
 hw/display/virtio-vga.c                    |  127 ++-
 hw/input/vhost-user-input.c                |  110 ++
 hw/scsi/vhost-user-scsi.c                  |   20 +-
 hw/virtio/vhost-stub.c                     |    4 +-
 hw/virtio/vhost-user.c                     |  143 ++-
 hw/virtio/virtio-pci.c                     |   20 +
 io/channel-command.c                       |   33 +-
 net/vhost-user.c                           |   13 +-
 os-posix.c                                 |   24 -
 os-win32.c                                 |   25 -
 qga/main.c                                 |   54 +-
 scsi/qemu-pr-helper.c                      |   40 +-
 ui/egl-helpers.c                           |   51 +-
 ui/spice-display.c                         |    3 +-
 util/drm.c                                 |   66 ++
 util/oslib-posix.c                         |   39 +
 util/oslib-win32.c                         |   27 +
 vl.c                                       |    8 +-
 MAINTAINERS                                |   15 +-
 Makefile                                   |    6 +
 Makefile.objs                              |    2 +
 backends/Makefile.objs                     |    3 +-
 configure                                  |   35 +
 contrib/vhost-user-gpu/Makefile.objs       |   10 +
 contrib/vhost-user-input/Makefile.objs     |    1 +
 docs/interop/vhost-user-gpu.rst            |  236 ++++
 docs/interop/vhost-user.txt                |   24 +
 hw/display/Makefile.objs                   |    5 +-
 hw/input/Makefile.objs                     |    1 +
 qemu-options.hx                            |   24 +
 util/Makefile.objs                         |    1 +
 68 files changed, 5130 insertions(+), 723 deletions(-)
 create mode 100644 contrib/vhost-user-gpu/drm.h
 create mode 100644 contrib/vhost-user-gpu/virgl.h
 create mode 100644 contrib/vhost-user-gpu/vugpu.h
 create mode 100644 hw/display/virtio-vga.h
 create mode 100644 include/hw/virtio/virtio-gpu-bswap.h
 create mode 100644 include/qemu/drm.h
 create mode 100644 include/sysemu/vhost-user-backend.h
 create mode 100644 backends/vhost-user.c
 create mode 100644 contrib/vhost-user-gpu/drm.c
 create mode 100644 contrib/vhost-user-gpu/main.c
 create mode 100644 contrib/vhost-user-gpu/virgl.c
 create mode 100644 contrib/vhost-user-input/main.c
 create mode 100644 hw/display/vhost-user-gpu-pci.c
 create mode 100644 hw/display/vhost-user-gpu.c
 create mode 100644 hw/display/vhost-user-vga.c
 create mode 100644 hw/display/virtio-gpu-base.c
 create mode 100644 hw/input/vhost-user-input.c
 create mode 100644 util/drm.c
 create mode 100644 contrib/vhost-user-gpu/Makefile.objs
 create mode 100644 contrib/vhost-user-input/Makefile.objs
 create mode 100644 docs/interop/vhost-user-gpu.rst

-- 
2.18.0.129.ge3331758f1

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

end of thread, other threads:[~2018-09-11 10:57 UTC | newest]

Thread overview: 58+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-13 13:08 [Qemu-devel] [PATCH v4 00/29] vhost-user for input & GPU Marc-André Lureau
2018-07-13 13:08 ` [Qemu-devel] [PATCH v4 01/29] chardev: avoid crash if no associated address Marc-André Lureau
2018-07-13 13:08 ` [Qemu-devel] [PATCH v4 02/29] chardev: remove qemu_chr_fe_read_all() counter Marc-André Lureau
2018-08-28 15:05   ` Daniel P. Berrangé
2018-07-13 13:08 ` [Qemu-devel] [PATCH v4 03/29] chardev: unref if underlying chardev has no parent Marc-André Lureau
2018-08-28 15:06   ` Daniel P. Berrangé
2018-07-13 13:08 ` [Qemu-devel] [PATCH v4 04/29] dmabuf: add y0_top, pass it to spice Marc-André Lureau
2018-08-21  6:25   ` Gerd Hoffmann
2018-07-13 13:08 ` [Qemu-devel] [PATCH v4 05/29] vhost-user: simplify vhost_user_init/vhost_user_cleanup Marc-André Lureau
2018-07-13 13:08 ` [Qemu-devel] [PATCH v4 06/29] libvhost-user: exit by default on VHOST_USER_NONE Marc-André Lureau
2018-08-28 13:12   ` Jens Freimann
2018-07-13 13:08 ` [Qemu-devel] [PATCH v4 07/29] vhost-user: wrap some read/write with retry handling Marc-André Lureau
2018-07-13 13:08 ` [Qemu-devel] [PATCH v4 08/29] Add vhost-user-backend Marc-André Lureau
2018-07-13 13:08 ` [Qemu-devel] [PATCH v4 09/29] qio: add qio_channel_command_new_spawn_with_pre_exec() Marc-André Lureau
2018-08-28 15:09   ` Daniel P. Berrangé
2018-07-13 13:08 ` [Qemu-devel] [PATCH v4 10/29] HACK: vhost-user-backend: allow to specify binary to execute Marc-André Lureau
2018-08-28 15:44   ` Daniel P. Berrangé
2018-07-13 13:08 ` [Qemu-devel] [PATCH v4 11/29] vhost-user: split vhost_user_read() Marc-André Lureau
2018-08-28 15:46   ` Daniel P. Berrangé
2018-07-13 13:08 ` [Qemu-devel] [PATCH v4 12/29] vhost-user: add vhost_user_input_get_config() Marc-André Lureau
2018-07-13 13:09 ` [Qemu-devel] [PATCH v4 13/29] libvhost-user: export vug_source_new() Marc-André Lureau
2018-07-13 13:09 ` [Qemu-devel] [PATCH v4 14/29] contrib: add vhost-user-input Marc-André Lureau
2018-07-13 13:09 ` [Qemu-devel] [PATCH v4 15/29] Add vhost-user-input-pci Marc-André Lureau
2018-07-13 13:09 ` [Qemu-devel] [PATCH v4 16/29] vhost-user: add vhost_user_gpu_set_socket() Marc-André Lureau
2018-07-13 13:09 ` [Qemu-devel] [PATCH v4 17/29] vhost-user: add vhost_user_gpu_get_num_capsets() Marc-André Lureau
2018-07-13 13:09 ` [Qemu-devel] [PATCH v4 18/29] virtio: add virtio-gpu bswap helpers header Marc-André Lureau
2018-07-13 13:09 ` [Qemu-devel] [PATCH v4 19/29] util: promote qemu_egl_rendernode_open() to libqemuutil Marc-André Lureau
2018-07-13 13:09 ` [Qemu-devel] [PATCH v4 20/29] util: add qemu_write_pidfile() Marc-André Lureau
2018-08-28 15:52   ` Daniel P. Berrangé
2018-08-28 16:04     ` Marc-André Lureau
2018-08-31 10:42   ` Daniel P. Berrangé
2018-07-13 13:09 ` [Qemu-devel] [PATCH v4 21/29] util: use fcntl() for qemu_write_pidfile() locking Marc-André Lureau
2018-08-28 15:59   ` Daniel P. Berrangé
2018-08-28 16:07     ` Marc-André Lureau
2018-08-28 23:41     ` Marc-André Lureau
2018-08-29  8:12       ` Daniel P. Berrangé
2018-07-13 13:09 ` [Qemu-devel] [PATCH v4 22/29] contrib: add vhost-user-gpu Marc-André Lureau
2018-07-13 13:09 ` [Qemu-devel] [PATCH v4 23/29] virtio-gpu: remove unused qdev Marc-André Lureau
2018-07-13 13:09 ` [Qemu-devel] [PATCH v4 24/29] virtio-gpu: remove unused config_size Marc-André Lureau
2018-07-13 13:09 ` [Qemu-devel] [PATCH v4 25/29] virtio-gpu: block both 2d and 3d rendering Marc-André Lureau
2018-07-13 13:09 ` [Qemu-devel] [PATCH v4 26/29] virtio-gpu: remove useless 'waiting' field Marc-André Lureau
2018-07-13 13:09 ` [Qemu-devel] [PATCH v4 27/29] virtio-gpu: split virtio-gpu, introduce virtio-gpu-base Marc-André Lureau
2018-07-13 13:09 ` [Qemu-devel] [PATCH v4 28/29] virtio-gpu: split virtio-gpu-pci & virtio-vga Marc-André Lureau
2018-07-13 13:09 ` [Qemu-devel] [PATCH v4 29/29] hw/display: add vhost-user-vga & gpu-pci Marc-André Lureau
2018-08-29  9:13   ` Daniel P. Berrangé
2018-08-14 23:26 ` [Qemu-devel] [PATCH v4 00/29] vhost-user for input & GPU Marc-André Lureau
2018-08-21  7:51   ` Gerd Hoffmann
2018-08-21 10:10     ` Marc-André Lureau
2018-08-21 10:13       ` Daniel P. Berrangé
2018-08-28 10:49 ` Marc-André Lureau
2018-08-29  9:50 ` Daniel P. Berrangé
2018-08-29 10:22   ` Dr. David Alan Gilbert
2018-08-29 10:37     ` Daniel P. Berrangé
2018-08-29 11:34   ` Marc-André Lureau
2018-09-07 13:11     ` Marc-André Lureau
2018-09-11  8:59       ` Gerd Hoffmann
2018-09-11  9:16         ` Marc-André Lureau
2018-09-11 10:44           ` Gerd Hoffmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.