[Qemu-devel] [PATCH v6 00/11] vhost-user for input & GPU

Marc-André Lureau posted 11 patches 5 years ago
Test checkpatch failed
Test asan failed
Test docker-clang@ubuntu passed
Test docker-mingw@fedora passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190423132004.13725-1-marcandre.lureau@redhat.com
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>
contrib/libvhost-user/libvhost-user.h      |    1 +
contrib/vhost-user-gpu/drm.h               |   72 ++
contrib/vhost-user-gpu/virgl.h             |   25 +
contrib/vhost-user-gpu/vugpu.h             |  170 +++
hw/display/virtio-vga.h                    |   32 +
include/hw/virtio/vhost-backend.h          |    2 +
include/hw/virtio/virtio-gpu-bswap.h       |   61 +
include/hw/virtio/virtio-gpu-pci.h         |   40 +
include/hw/virtio/virtio-gpu.h             |   92 +-
include/hw/virtio/virtio-input.h           |   14 +
include/sysemu/vhost-user-backend.h        |   57 +
backends/vhost-user.c                      |  209 ++++
contrib/libvhost-user/libvhost-user.c      |    5 +
contrib/vhost-user-gpu/drm.c               |  341 ++++++
contrib/vhost-user-gpu/main.c              | 1236 ++++++++++++++++++++
contrib/vhost-user-gpu/virgl.c             |  579 +++++++++
contrib/vhost-user-input/main.c            |  427 +++++++
hw/display/vhost-user-gpu-pci.c            |   51 +
hw/display/vhost-user-gpu.c                |  572 +++++++++
hw/display/vhost-user-vga.c                |   52 +
hw/display/virtio-gpu-3d.c                 |   49 +-
hw/display/virtio-gpu-base.c               |  268 +++++
hw/display/virtio-gpu-pci.c                |   55 +-
hw/display/virtio-gpu.c                    |  415 ++-----
hw/display/virtio-vga.c                    |  138 +--
hw/input/vhost-user-input.c                |  129 ++
hw/virtio/vhost-user-input-pci.c           |   53 +
hw/virtio/vhost-user.c                     |   11 +
vl.c                                       |    1 +
MAINTAINERS                                |   14 +-
Makefile                                   |   27 +-
Makefile.objs                              |    2 +
backends/Makefile.objs                     |    2 +
configure                                  |   29 +
contrib/vhost-user-gpu/50-qemu-gpu.json.in |    5 +
contrib/vhost-user-gpu/Makefile.objs       |   10 +
contrib/vhost-user-input/Makefile.objs     |    1 +
docs/interop/index.rst                     |    2 +-
docs/interop/vhost-user-gpu.rst            |  238 ++++
docs/interop/vhost-user.txt                |    9 +
hw/display/Kconfig                         |   10 +
hw/display/Makefile.objs                   |    5 +-
hw/input/Kconfig                           |    5 +
hw/input/Makefile.objs                     |    1 +
hw/virtio/Makefile.objs                    |    1 +
rules.mak                                  |    9 +-
util/Makefile.objs                         |    2 +-
47 files changed, 5070 insertions(+), 459 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/hw/virtio/virtio-gpu-pci.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 hw/virtio/vhost-user-input-pci.c
create mode 100644 contrib/vhost-user-gpu/50-qemu-gpu.json.in
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
[Qemu-devel] [PATCH v6 00/11] vhost-user for input & GPU
Posted by Marc-André Lureau 5 years ago
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 ~3 years ago, time flies
(https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg01905.html)
contributes with vhost-user-input and vhost-user-gpu.

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
  -device vhost-user-vga,chardev=chr

v6:
 - do not install vhost-user-input
 - install vhost-user-gpu and json file following the spec
 - fix the build when drm-intel-devel missing
 - rebase (& resend without already applied patches)

v5:
 - remove user-creatable version of vhost-user-backend
 - remove optinal management of sub-process in vhost-user-backend
 - removed daemonize/pid code
 - drop introduction of new input & gpu messages for PCI config space
   handling, instead use VHOST_USER_PROTOCOL_F_CONFIG
 - plain mem & udmabuf fallback for 2d rendering
 - rebased, kconfig-ify, rst-ify

Marc-André Lureau (11):
  Add vhost-user-backend
  Add vhost-user-input-pci
  libvhost-user: add PROTOCOL_F_CONFIG if {set,get}_config
  contrib: add vhost-user-input
  vhost-user: add vhost_user_gpu_set_socket()
  virtio: add virtio-gpu bswap helpers header
  util: compile drm.o on Linux
  contrib: add vhost-user-gpu
  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.h      |    1 +
 contrib/vhost-user-gpu/drm.h               |   72 ++
 contrib/vhost-user-gpu/virgl.h             |   25 +
 contrib/vhost-user-gpu/vugpu.h             |  170 +++
 hw/display/virtio-vga.h                    |   32 +
 include/hw/virtio/vhost-backend.h          |    2 +
 include/hw/virtio/virtio-gpu-bswap.h       |   61 +
 include/hw/virtio/virtio-gpu-pci.h         |   40 +
 include/hw/virtio/virtio-gpu.h             |   92 +-
 include/hw/virtio/virtio-input.h           |   14 +
 include/sysemu/vhost-user-backend.h        |   57 +
 backends/vhost-user.c                      |  209 ++++
 contrib/libvhost-user/libvhost-user.c      |    5 +
 contrib/vhost-user-gpu/drm.c               |  341 ++++++
 contrib/vhost-user-gpu/main.c              | 1236 ++++++++++++++++++++
 contrib/vhost-user-gpu/virgl.c             |  579 +++++++++
 contrib/vhost-user-input/main.c            |  427 +++++++
 hw/display/vhost-user-gpu-pci.c            |   51 +
 hw/display/vhost-user-gpu.c                |  572 +++++++++
 hw/display/vhost-user-vga.c                |   52 +
 hw/display/virtio-gpu-3d.c                 |   49 +-
 hw/display/virtio-gpu-base.c               |  268 +++++
 hw/display/virtio-gpu-pci.c                |   55 +-
 hw/display/virtio-gpu.c                    |  415 ++-----
 hw/display/virtio-vga.c                    |  138 +--
 hw/input/vhost-user-input.c                |  129 ++
 hw/virtio/vhost-user-input-pci.c           |   53 +
 hw/virtio/vhost-user.c                     |   11 +
 vl.c                                       |    1 +
 MAINTAINERS                                |   14 +-
 Makefile                                   |   27 +-
 Makefile.objs                              |    2 +
 backends/Makefile.objs                     |    2 +
 configure                                  |   29 +
 contrib/vhost-user-gpu/50-qemu-gpu.json.in |    5 +
 contrib/vhost-user-gpu/Makefile.objs       |   10 +
 contrib/vhost-user-input/Makefile.objs     |    1 +
 docs/interop/index.rst                     |    2 +-
 docs/interop/vhost-user-gpu.rst            |  238 ++++
 docs/interop/vhost-user.txt                |    9 +
 hw/display/Kconfig                         |   10 +
 hw/display/Makefile.objs                   |    5 +-
 hw/input/Kconfig                           |    5 +
 hw/input/Makefile.objs                     |    1 +
 hw/virtio/Makefile.objs                    |    1 +
 rules.mak                                  |    9 +-
 util/Makefile.objs                         |    2 +-
 47 files changed, 5070 insertions(+), 459 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/hw/virtio/virtio-gpu-pci.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 hw/virtio/vhost-user-input-pci.c
 create mode 100644 contrib/vhost-user-gpu/50-qemu-gpu.json.in
 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.21.0.313.ge35b8cb8e2


Re: [Qemu-devel] [PATCH v6 00/11] vhost-user for input & GPU
Posted by no-reply@patchew.org 5 years ago
Patchew URL: https://patchew.org/QEMU/20190423132004.13725-1-marcandre.lureau@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20190423132004.13725-1-marcandre.lureau@redhat.com
Subject: [Qemu-devel] [PATCH v6 00/11] vhost-user for input & GPU

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
dae2bdda06 hw/display: add vhost-user-vga & gpu-pci
5085d87320 virtio-gpu: split virtio-gpu-pci & virtio-vga
4b0acd3384 virtio-gpu: split virtio-gpu, introduce virtio-gpu-base
c1d833191f contrib: add vhost-user-gpu
cba97fa704 util: compile drm.o on Linux
b7f05f9505 virtio: add virtio-gpu bswap helpers header
567cb03399 vhost-user: add vhost_user_gpu_set_socket()
e42b84bcb3 contrib: add vhost-user-input
455270bf34 libvhost-user: add PROTOCOL_F_CONFIG if {set, get}_config
4cce0394b0 Add vhost-user-input-pci
34a8518660 Add vhost-user-backend

=== OUTPUT BEGIN ===
1/11 Checking commit 34a851866041 (Add vhost-user-backend)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#44: 
new file mode 100644

WARNING: Block comments use a leading /* on a separate line
#143: FILE: backends/vhost-user.c:95:
+    /* guest_notifier_mask/pending not used yet, so just unmask

total: 0 errors, 2 warnings, 280 lines checked

Patch 1/11 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
2/11 Checking commit 4cce0394b02c (Add vhost-user-input-pci)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#58: 
new file mode 100644

total: 0 errors, 1 warnings, 250 lines checked

Patch 2/11 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
3/11 Checking commit 455270bf3492 (libvhost-user: add PROTOCOL_F_CONFIG if {set, get}_config)
4/11 Checking commit e42b84bcb3fc (contrib: add vhost-user-input)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#69: 
new file mode 100644

total: 0 errors, 1 warnings, 458 lines checked

Patch 4/11 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
5/11 Checking commit 567cb0339958 (vhost-user: add vhost_user_gpu_set_socket())
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#74: 
new file mode 100644

total: 0 errors, 1 warnings, 313 lines checked

Patch 5/11 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
6/11 Checking commit b7f05f95058d (virtio: add virtio-gpu bswap helpers header)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#74: 
new file mode 100644

total: 0 errors, 1 warnings, 116 lines checked

Patch 6/11 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
7/11 Checking commit cba97fa704c1 (util: compile drm.o on Linux)
8/11 Checking commit c1d833191f34 (contrib: add vhost-user-gpu)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#164: 
new file mode 100644

total: 0 errors, 1 warnings, 2573 lines checked

Patch 8/11 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
9/11 Checking commit 4b0acd33848a (virtio-gpu: split virtio-gpu, introduce virtio-gpu-base)
WARNING: Block comments use a leading /* on a separate line
#100: FILE: hw/display/virtio-gpu-3d.c:181:
+            info.flags & 1 /* FIXME: Y_0_TOP */,

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#188: 
new file mode 100644

ERROR: Macros with complex values should be enclosed in parenthesis
#1253: FILE: include/hw/virtio/virtio-gpu.h:122:
+#define VIRTIO_GPU_BASE_PROPERTIES(_state, _conf)                       \
+    DEFINE_PROP_UINT32("max_outputs", _state, _conf.max_outputs, 1),    \
+    DEFINE_PROP_BIT("edid", _state, _conf.flags, \
+                    VIRTIO_GPU_FLAG_EDID_ENABLED, false), \
+    DEFINE_PROP_UINT32("xres", _state, _conf.xres, 1024), \
+    DEFINE_PROP_UINT32("yres", _state, _conf.yres, 768)

total: 1 errors, 2 warnings, 1184 lines checked

Patch 9/11 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

10/11 Checking commit 5085d87320e8 (virtio-gpu: split virtio-gpu-pci & virtio-vga)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#392: 
new file mode 100644

total: 0 errors, 1 warnings, 390 lines checked

Patch 10/11 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
11/11 Checking commit dae2bdda06e1 (hw/display: add vhost-user-vga & gpu-pci)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#56: 
new file mode 100644

ERROR: Macros with complex values should be enclosed in parenthesis
#829: FILE: include/hw/virtio/virtio-gpu-pci.h:35:
+#define DEFINE_VIRTIO_GPU_PCI_PROPERTIES(_state)                \
+    DEFINE_PROP_BIT("ioeventfd", _state, flags,                 \
+                    VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT, false),  \
+        DEFINE_PROP_UINT32("vectors", _state, nvectors, 3)

total: 1 errors, 1 warnings, 818 lines checked

Patch 11/11 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20190423132004.13725-1-marcandre.lureau@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [Qemu-devel] [PATCH v6 00/11] vhost-user for input & GPU
Posted by Michael S. Tsirkin 5 years ago
On Tue, Apr 23, 2019 at 03:19:53PM +0200, Marc-André Lureau wrote:
> 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 ~3 years ago, time flies
> (https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg01905.html)
> contributes with vhost-user-input and vhost-user-gpu.


Pls note asan errors reported by patchew.


> 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
>   -device vhost-user-vga,chardev=chr
> 
> v6:
>  - do not install vhost-user-input
>  - install vhost-user-gpu and json file following the spec
>  - fix the build when drm-intel-devel missing
>  - rebase (& resend without already applied patches)
> 
> v5:
>  - remove user-creatable version of vhost-user-backend
>  - remove optinal management of sub-process in vhost-user-backend
>  - removed daemonize/pid code
>  - drop introduction of new input & gpu messages for PCI config space
>    handling, instead use VHOST_USER_PROTOCOL_F_CONFIG
>  - plain mem & udmabuf fallback for 2d rendering
>  - rebased, kconfig-ify, rst-ify
> 
> Marc-André Lureau (11):
>   Add vhost-user-backend
>   Add vhost-user-input-pci
>   libvhost-user: add PROTOCOL_F_CONFIG if {set,get}_config
>   contrib: add vhost-user-input
>   vhost-user: add vhost_user_gpu_set_socket()
>   virtio: add virtio-gpu bswap helpers header
>   util: compile drm.o on Linux
>   contrib: add vhost-user-gpu
>   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.h      |    1 +
>  contrib/vhost-user-gpu/drm.h               |   72 ++
>  contrib/vhost-user-gpu/virgl.h             |   25 +
>  contrib/vhost-user-gpu/vugpu.h             |  170 +++
>  hw/display/virtio-vga.h                    |   32 +
>  include/hw/virtio/vhost-backend.h          |    2 +
>  include/hw/virtio/virtio-gpu-bswap.h       |   61 +
>  include/hw/virtio/virtio-gpu-pci.h         |   40 +
>  include/hw/virtio/virtio-gpu.h             |   92 +-
>  include/hw/virtio/virtio-input.h           |   14 +
>  include/sysemu/vhost-user-backend.h        |   57 +
>  backends/vhost-user.c                      |  209 ++++
>  contrib/libvhost-user/libvhost-user.c      |    5 +
>  contrib/vhost-user-gpu/drm.c               |  341 ++++++
>  contrib/vhost-user-gpu/main.c              | 1236 ++++++++++++++++++++
>  contrib/vhost-user-gpu/virgl.c             |  579 +++++++++
>  contrib/vhost-user-input/main.c            |  427 +++++++
>  hw/display/vhost-user-gpu-pci.c            |   51 +
>  hw/display/vhost-user-gpu.c                |  572 +++++++++
>  hw/display/vhost-user-vga.c                |   52 +
>  hw/display/virtio-gpu-3d.c                 |   49 +-
>  hw/display/virtio-gpu-base.c               |  268 +++++
>  hw/display/virtio-gpu-pci.c                |   55 +-
>  hw/display/virtio-gpu.c                    |  415 ++-----
>  hw/display/virtio-vga.c                    |  138 +--
>  hw/input/vhost-user-input.c                |  129 ++
>  hw/virtio/vhost-user-input-pci.c           |   53 +
>  hw/virtio/vhost-user.c                     |   11 +
>  vl.c                                       |    1 +
>  MAINTAINERS                                |   14 +-
>  Makefile                                   |   27 +-
>  Makefile.objs                              |    2 +
>  backends/Makefile.objs                     |    2 +
>  configure                                  |   29 +
>  contrib/vhost-user-gpu/50-qemu-gpu.json.in |    5 +
>  contrib/vhost-user-gpu/Makefile.objs       |   10 +
>  contrib/vhost-user-input/Makefile.objs     |    1 +
>  docs/interop/index.rst                     |    2 +-
>  docs/interop/vhost-user-gpu.rst            |  238 ++++
>  docs/interop/vhost-user.txt                |    9 +
>  hw/display/Kconfig                         |   10 +
>  hw/display/Makefile.objs                   |    5 +-
>  hw/input/Kconfig                           |    5 +
>  hw/input/Makefile.objs                     |    1 +
>  hw/virtio/Makefile.objs                    |    1 +
>  rules.mak                                  |    9 +-
>  util/Makefile.objs                         |    2 +-
>  47 files changed, 5070 insertions(+), 459 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/hw/virtio/virtio-gpu-pci.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 hw/virtio/vhost-user-input-pci.c
>  create mode 100644 contrib/vhost-user-gpu/50-qemu-gpu.json.in
>  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.21.0.313.ge35b8cb8e2

Re: [Qemu-devel] [PATCH v6 00/11] vhost-user for input & GPU
Posted by Marc-André Lureau 5 years ago
Hi

On Wed, Apr 24, 2019 at 3:29 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
> On Tue, Apr 23, 2019 at 03:19:53PM +0200, Marc-André Lureau wrote:
> > 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 ~3 years ago, time flies
> > (https://lists.gnu.org/archive/html/qemu-devel/2016-06/msg01905.html)
> > contributes with vhost-user-input and vhost-user-gpu.
>
>
> Pls note asan errors reported by patchew.

Those are pre-existing, and I thought we had patches on the list for
them, but I can't find them.

A quick fix could be:

diff --git a/contrib/libvhost-user/libvhost-user.c
b/contrib/libvhost-user/libvhost-user.c
index c9823a1354..944d5c9c4f 100644
--- a/contrib/libvhost-user/libvhost-user.c
+++ b/contrib/libvhost-user/libvhost-user.c
@@ -543,7 +543,7 @@ static bool
 vu_set_mem_table_exec_postcopy(VuDev *dev, VhostUserMsg *vmsg)
 {
     int i;
-    VhostUserMemory *memory = &vmsg->payload.memory;
+    VhostUserMemory m = vmsg->payload.memory, *memory = &m;
     dev->nregions = memory->nregions;

     DPRINT("Nregions: %d\n", memory->nregions);
@@ -685,7 +685,7 @@ static bool
 vu_set_mem_table_exec(VuDev *dev, VhostUserMsg *vmsg)
 {
     int i;
-    VhostUserMemory *memory = &vmsg->payload.memory;
+    VhostUserMemory m = vmsg->payload.memory, *memory = &m;

     for (i = 0; i < dev->nregions; i++) {
         VuDevRegion *r = &dev->regions[i];
@@ -814,7 +814,7 @@ vu_set_vring_num_exec(VuDev *dev, VhostUserMsg *vmsg)
 static bool
 vu_set_vring_addr_exec(VuDev *dev, VhostUserMsg *vmsg)
 {
-    struct vhost_vring_addr *vra = &vmsg->payload.addr;
+    struct vhost_vring_addr addr = vmsg->payload.addr, *vra = &addr;
     unsigned int index = vra->index;
     VuVirtq *vq = &dev->vq[index];


>
>
> > 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
> >   -device vhost-user-vga,chardev=chr
> >
> > v6:
> >  - do not install vhost-user-input
> >  - install vhost-user-gpu and json file following the spec
> >  - fix the build when drm-intel-devel missing
> >  - rebase (& resend without already applied patches)
> >
> > v5:
> >  - remove user-creatable version of vhost-user-backend
> >  - remove optinal management of sub-process in vhost-user-backend
> >  - removed daemonize/pid code
> >  - drop introduction of new input & gpu messages for PCI config space
> >    handling, instead use VHOST_USER_PROTOCOL_F_CONFIG
> >  - plain mem & udmabuf fallback for 2d rendering
> >  - rebased, kconfig-ify, rst-ify
> >
> > Marc-André Lureau (11):
> >   Add vhost-user-backend
> >   Add vhost-user-input-pci
> >   libvhost-user: add PROTOCOL_F_CONFIG if {set,get}_config
> >   contrib: add vhost-user-input
> >   vhost-user: add vhost_user_gpu_set_socket()
> >   virtio: add virtio-gpu bswap helpers header
> >   util: compile drm.o on Linux
> >   contrib: add vhost-user-gpu
> >   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.h      |    1 +
> >  contrib/vhost-user-gpu/drm.h               |   72 ++
> >  contrib/vhost-user-gpu/virgl.h             |   25 +
> >  contrib/vhost-user-gpu/vugpu.h             |  170 +++
> >  hw/display/virtio-vga.h                    |   32 +
> >  include/hw/virtio/vhost-backend.h          |    2 +
> >  include/hw/virtio/virtio-gpu-bswap.h       |   61 +
> >  include/hw/virtio/virtio-gpu-pci.h         |   40 +
> >  include/hw/virtio/virtio-gpu.h             |   92 +-
> >  include/hw/virtio/virtio-input.h           |   14 +
> >  include/sysemu/vhost-user-backend.h        |   57 +
> >  backends/vhost-user.c                      |  209 ++++
> >  contrib/libvhost-user/libvhost-user.c      |    5 +
> >  contrib/vhost-user-gpu/drm.c               |  341 ++++++
> >  contrib/vhost-user-gpu/main.c              | 1236 ++++++++++++++++++++
> >  contrib/vhost-user-gpu/virgl.c             |  579 +++++++++
> >  contrib/vhost-user-input/main.c            |  427 +++++++
> >  hw/display/vhost-user-gpu-pci.c            |   51 +
> >  hw/display/vhost-user-gpu.c                |  572 +++++++++
> >  hw/display/vhost-user-vga.c                |   52 +
> >  hw/display/virtio-gpu-3d.c                 |   49 +-
> >  hw/display/virtio-gpu-base.c               |  268 +++++
> >  hw/display/virtio-gpu-pci.c                |   55 +-
> >  hw/display/virtio-gpu.c                    |  415 ++-----
> >  hw/display/virtio-vga.c                    |  138 +--
> >  hw/input/vhost-user-input.c                |  129 ++
> >  hw/virtio/vhost-user-input-pci.c           |   53 +
> >  hw/virtio/vhost-user.c                     |   11 +
> >  vl.c                                       |    1 +
> >  MAINTAINERS                                |   14 +-
> >  Makefile                                   |   27 +-
> >  Makefile.objs                              |    2 +
> >  backends/Makefile.objs                     |    2 +
> >  configure                                  |   29 +
> >  contrib/vhost-user-gpu/50-qemu-gpu.json.in |    5 +
> >  contrib/vhost-user-gpu/Makefile.objs       |   10 +
> >  contrib/vhost-user-input/Makefile.objs     |    1 +
> >  docs/interop/index.rst                     |    2 +-
> >  docs/interop/vhost-user-gpu.rst            |  238 ++++
> >  docs/interop/vhost-user.txt                |    9 +
> >  hw/display/Kconfig                         |   10 +
> >  hw/display/Makefile.objs                   |    5 +-
> >  hw/input/Kconfig                           |    5 +
> >  hw/input/Makefile.objs                     |    1 +
> >  hw/virtio/Makefile.objs                    |    1 +
> >  rules.mak                                  |    9 +-
> >  util/Makefile.objs                         |    2 +-
> >  47 files changed, 5070 insertions(+), 459 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/hw/virtio/virtio-gpu-pci.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 hw/virtio/vhost-user-input-pci.c
> >  create mode 100644 contrib/vhost-user-gpu/50-qemu-gpu.json.in
> >  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.21.0.313.ge35b8cb8e2
>


-- 
Marc-André Lureau

Re: [Qemu-devel] [PATCH v6 00/11] vhost-user for input & GPU
Posted by no-reply@patchew.org 5 years ago
Patchew URL: https://patchew.org/QEMU/20190423132004.13725-1-marcandre.lureau@redhat.com/



Hi,

This series failed the asan build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
time make docker-test-debug@fedora TARGET_LIST=x86_64-softmmu J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      qmp.o
  CC      hmp.o
  CC      cpus-common.o
/tmp/qemu-test/src/contrib/libvhost-user/libvhost-user.c:546:32: error: taking address of packed member 'payload' of class or structure 'VhostUserMsg' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member]
    VhostUserMemory *memory = &vmsg->payload.memory;
                               ^~~~~~~~~~~~~~~~~~~~
/tmp/qemu-test/src/contrib/libvhost-user/libvhost-user.c:688:32: error: taking address of packed member 'payload' of class or structure 'VhostUserMsg' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member]
    VhostUserMemory *memory = &vmsg->payload.memory;
                               ^~~~~~~~~~~~~~~~~~~~
/tmp/qemu-test/src/contrib/libvhost-user/libvhost-user.c:817:37: error: taking address of packed member 'payload' of class or structure 'VhostUserMsg' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member]
    struct vhost_vring_addr *vra = &vmsg->payload.addr;
                                    ^~~~~~~~~~~~~~~~~~
3 errors generated.


The full log is available at
http://patchew.org/logs/20190423132004.13725-1-marcandre.lureau@redhat.com/testing.asan/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com