[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [RFC v2 00/16] Add vhost-user-gpu support



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

Hi,

This series of patches add support for running a virtio GPU in a
seperate process, using vhost-user.

The QEMU series "[PATCH v4 00/29] vhost-user for input & GPU" is still
under review, and will hopefully land in 3.1. There are several
benefits of running the GPU process in an external process, since Mesa
is rather heavy on the qemu main loop, and may block for a while or
crash. I observe x5 performance improvements with Unigine Heaven 4
benchmark.

The external GPU process is started with one end of the vhost-user
socket pair, the other end is given to a QEMU chardev. It is also
added to the emulator cgroup to restrict its CPU usage.

vhost-user requires shared VM memory. The first patches ease and
improve shared memory setup, by using memfd. They could be considered
seperatly, but that's the setup I'd recommend with vhost-user-gpu.

Review welcome!

RFCv2:
- add new memfd memroyBacking source type
- drop the implicit shared memory NUMA setup approach, explicit now
  required
- rebased

Marc-André Lureau (16):
  qemu: add memory-backend-memfd capability check
  qemu: add memfd memory backing
  qemu: add vhost-user-gpu capabilities checks
  domain: add "vhost-user" video type
  qemu: fill the vhost-user video type capability
  qemu: check that qemu is vhost-user-vga capable
  qemu: vhost-user is valid as non-primary video device
  qemu: validate vhost-user video model
  qemu: add qemuSecurityStartVhostUserGPU helper
  qemu: add vhost-user-gpu helper unit
  qemu: restrict 'virgl=' option to 'virtio' video type
  qemu: set default address type on vhost-user video model
  qemu: start/stop the vhost-user-gpu external device
  qemu: build vhost-user-backend for vhost-user-gpu
  qemu: build vhost-user-gpu video device arguments
  tests: add vhost-user-gpu xml2argv tests

 docs/formatdomain.html.in                     |  11 +-
 docs/schemas/domaincommon.rng                 |   2 +
 src/conf/device_conf.h                        |   1 +
 src/conf/domain_conf.c                        |   7 +-
 src/conf/domain_conf.h                        |   2 +
 src/qemu/Makefile.inc.am                      |   2 +
 src/qemu/qemu_capabilities.c                  |   8 +
 src/qemu/qemu_capabilities.h                  |   3 +
 src/qemu/qemu_command.c                       | 135 ++++++--
 src/qemu/qemu_domain.c                        |   8 +-
 src/qemu/qemu_domain_address.c                |   4 +-
 src/qemu/qemu_extdevice.c                     |  47 ++-
 src/qemu/qemu_process.c                       |   6 +-
 src/qemu/qemu_security.c                      |  48 +++
 src/qemu/qemu_security.h                      |   6 +
 src/qemu/qemu_vhost_user_gpu.c                | 318 ++++++++++++++++++
 src/qemu/qemu_vhost_user_gpu.h                |  48 +++
 tests/domaincapsschemadata/full.xml           |   1 +
 .../caps_2.12.0.aarch64.xml                   |   1 +
 .../caps_2.12.0.ppc64.xml                     |   1 +
 .../caps_2.12.0.s390x.xml                     |   1 +
 .../caps_2.12.0.x86_64.xml                    |   1 +
 .../qemucapabilitiesdata/caps_3.0.0.ppc64.xml |   1 +
 .../caps_3.0.0.riscv32.xml                    |   1 +
 .../caps_3.0.0.riscv64.xml                    |   1 +
 .../caps_3.0.0.x86_64.xml                     |   1 +
 tests/qemuxml2argvdata/memfd-memory-numa.args |  27 ++
 tests/qemuxml2argvdata/memfd-memory-numa.xml  |  33 ++
 .../vhost-user-gpu-secondary.args             |  33 ++
 .../vhost-user-gpu-secondary.xml              |  44 +++
 tests/qemuxml2argvdata/vhost-user-vga.args    |  30 ++
 tests/qemuxml2argvdata/vhost-user-vga.xml     |  41 +++
 tests/qemuxml2argvtest.c                      |  15 +
 33 files changed, 849 insertions(+), 39 deletions(-)
 create mode 100644 src/qemu/qemu_vhost_user_gpu.c
 create mode 100644 src/qemu/qemu_vhost_user_gpu.h
 create mode 100644 tests/qemuxml2argvdata/memfd-memory-numa.args
 create mode 100644 tests/qemuxml2argvdata/memfd-memory-numa.xml
 create mode 100644 tests/qemuxml2argvdata/vhost-user-gpu-secondary.args
 create mode 100644 tests/qemuxml2argvdata/vhost-user-gpu-secondary.xml
 create mode 100644 tests/qemuxml2argvdata/vhost-user-vga.args
 create mode 100644 tests/qemuxml2argvdata/vhost-user-vga.xml

-- 
2.19.0.rc0.48.gb9dfa238d5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]