[libvirt] [RFC PATCH 00/17] Add vhost-user-gpu support

marcandre.lureau@redhat.com posted 17 patches 5 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20180713132824.8655-1-marcandre.lureau@redhat.com
Test syntax-check failed
There is a newer version of this series
docs/formatdomain.html.in                     |   5 +-
docs/schemas/domaincommon.rng                 |   1 +
src/conf/device_conf.h                        |   1 +
src/conf/domain_conf.c                        |   4 +-
src/conf/domain_conf.h                        |   1 +
src/qemu/Makefile.inc.am                      |   2 +
src/qemu/qemu_capabilities.c                  |  10 +
src/qemu/qemu_capabilities.h                  |   5 +
src/qemu/qemu_command.c                       | 191 ++++++++---
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.x86_64.xml                     |   1 +
.../fd-memory-no-numa-topology.args           |   4 +
tests/qemuxml2argvdata/memfd.args             |  28 ++
tests/qemuxml2argvdata/memfd.xml              |  32 ++
.../vhost-user-gpu-secondary.args             |  34 ++
.../vhost-user-gpu-secondary.xml              |  38 +++
tests/qemuxml2argvdata/vhost-user-vga.args    |  31 ++
tests/qemuxml2argvdata/vhost-user-vga.xml     |  35 ++
tests/qemuxml2argvtest.c                      |  14 +
32 files changed, 877 insertions(+), 51 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.args
create mode 100644 tests/qemuxml2argvdata/memfd.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
[libvirt] [RFC PATCH 00/17] Add vhost-user-gpu support
Posted by marcandre.lureau@redhat.com 5 years, 9 months ago
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. A few preliminary patches ease
and improve shared memory setup, when no explicit domain NUMA
configuration is given. Also, if there is no need for file-backed
memory, teach libvirt to make use of memfd memory backend, which has
better security guarantees and is easier to setup.

Review welcome!

Marc-André Lureau (17):
  qemu: setup shared memory without explicit numa configuration
  qemu: add memory-backend-memfd capability check
  qemu: use memory-backend-memfd if possible
  qemu: add vhost-user-gpu capabilities
  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                     |   5 +-
 docs/schemas/domaincommon.rng                 |   1 +
 src/conf/device_conf.h                        |   1 +
 src/conf/domain_conf.c                        |   4 +-
 src/conf/domain_conf.h                        |   1 +
 src/qemu/Makefile.inc.am                      |   2 +
 src/qemu/qemu_capabilities.c                  |  10 +
 src/qemu/qemu_capabilities.h                  |   5 +
 src/qemu/qemu_command.c                       | 191 ++++++++---
 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.x86_64.xml                     |   1 +
 .../fd-memory-no-numa-topology.args           |   4 +
 tests/qemuxml2argvdata/memfd.args             |  28 ++
 tests/qemuxml2argvdata/memfd.xml              |  32 ++
 .../vhost-user-gpu-secondary.args             |  34 ++
 .../vhost-user-gpu-secondary.xml              |  38 +++
 tests/qemuxml2argvdata/vhost-user-vga.args    |  31 ++
 tests/qemuxml2argvdata/vhost-user-vga.xml     |  35 ++
 tests/qemuxml2argvtest.c                      |  14 +
 32 files changed, 877 insertions(+), 51 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.args
 create mode 100644 tests/qemuxml2argvdata/memfd.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.18.0.129.ge3331758f1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [RFC PATCH 00/17] Add vhost-user-gpu support
Posted by Marc-André Lureau 5 years, 8 months ago
ping
On Fri, Jul 13, 2018 at 3:28 PM <marcandre.lureau@redhat.com> wrote:
>
> 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. A few preliminary patches ease
> and improve shared memory setup, when no explicit domain NUMA
> configuration is given. Also, if there is no need for file-backed
> memory, teach libvirt to make use of memfd memory backend, which has
> better security guarantees and is easier to setup.
>
> Review welcome!
>
> Marc-André Lureau (17):
>   qemu: setup shared memory without explicit numa configuration
>   qemu: add memory-backend-memfd capability check
>   qemu: use memory-backend-memfd if possible
>   qemu: add vhost-user-gpu capabilities
>   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                     |   5 +-
>  docs/schemas/domaincommon.rng                 |   1 +
>  src/conf/device_conf.h                        |   1 +
>  src/conf/domain_conf.c                        |   4 +-
>  src/conf/domain_conf.h                        |   1 +
>  src/qemu/Makefile.inc.am                      |   2 +
>  src/qemu/qemu_capabilities.c                  |  10 +
>  src/qemu/qemu_capabilities.h                  |   5 +
>  src/qemu/qemu_command.c                       | 191 ++++++++---
>  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.x86_64.xml                     |   1 +
>  .../fd-memory-no-numa-topology.args           |   4 +
>  tests/qemuxml2argvdata/memfd.args             |  28 ++
>  tests/qemuxml2argvdata/memfd.xml              |  32 ++
>  .../vhost-user-gpu-secondary.args             |  34 ++
>  .../vhost-user-gpu-secondary.xml              |  38 +++
>  tests/qemuxml2argvdata/vhost-user-vga.args    |  31 ++
>  tests/qemuxml2argvdata/vhost-user-vga.xml     |  35 ++
>  tests/qemuxml2argvtest.c                      |  14 +
>  32 files changed, 877 insertions(+), 51 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.args
>  create mode 100644 tests/qemuxml2argvdata/memfd.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.18.0.129.ge3331758f1
>
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list



-- 
Marc-André Lureau

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [RFC PATCH 00/17] Add vhost-user-gpu support
Posted by John Ferlan 5 years, 8 months ago

On 08/14/2018 07:25 PM, Marc-André Lureau wrote:
> ping
> On Fri, Jul 13, 2018 at 3:28 PM <marcandre.lureau@redhat.com> wrote:

Quite a bit has changed w/r/t qemu_capabilities.{c,h}.  Can you please
resync with the top of the tree and repost. Hopefully Pavel or Michal
will be able to take a look at the repost as well since they have more
recent NUMA and Hugepage experiences and that's where this series
starts...  Also I understand why things are combined, but the first 3
patches don't seem to be related to vhost-user-gpu, so they should be a
separate series. Although I do understand why they're included due to
qemu_capabilities conflicts for one series or the other.

Since, all I was able to "easily" git am was patch 1, I'll provide a
couple of comments there...

John

>>
>> 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. A few preliminary patches ease
>> and improve shared memory setup, when no explicit domain NUMA
>> configuration is given. Also, if there is no need for file-backed
>> memory, teach libvirt to make use of memfd memory backend, which has
>> better security guarantees and is easier to setup.
>>
>> Review welcome!
>>
>> Marc-André Lureau (17):
>>   qemu: setup shared memory without explicit numa configuration
>>   qemu: add memory-backend-memfd capability check
>>   qemu: use memory-backend-memfd if possible
>>   qemu: add vhost-user-gpu capabilities
>>   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                     |   5 +-
>>  docs/schemas/domaincommon.rng                 |   1 +
>>  src/conf/device_conf.h                        |   1 +
>>  src/conf/domain_conf.c                        |   4 +-
>>  src/conf/domain_conf.h                        |   1 +
>>  src/qemu/Makefile.inc.am                      |   2 +
>>  src/qemu/qemu_capabilities.c                  |  10 +
>>  src/qemu/qemu_capabilities.h                  |   5 +
>>  src/qemu/qemu_command.c                       | 191 ++++++++---
>>  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.x86_64.xml                     |   1 +
>>  .../fd-memory-no-numa-topology.args           |   4 +
>>  tests/qemuxml2argvdata/memfd.args             |  28 ++
>>  tests/qemuxml2argvdata/memfd.xml              |  32 ++
>>  .../vhost-user-gpu-secondary.args             |  34 ++
>>  .../vhost-user-gpu-secondary.xml              |  38 +++
>>  tests/qemuxml2argvdata/vhost-user-vga.args    |  31 ++
>>  tests/qemuxml2argvdata/vhost-user-vga.xml     |  35 ++
>>  tests/qemuxml2argvtest.c                      |  14 +
>>  32 files changed, 877 insertions(+), 51 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.args
>>  create mode 100644 tests/qemuxml2argvdata/memfd.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.18.0.129.ge3331758f1
>>
>> --
>> libvir-list mailing list
>> libvir-list@redhat.com
>> https://www.redhat.com/mailman/listinfo/libvir-list
> 
> 
> 

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list