qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 9732ba: vhost-user-test: fix chardriver race


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 9732ba: vhost-user-test: fix chardriver race
Date: Thu, 03 Dec 2015 03:00:06 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 9732baf67850dac57dfc7dc8980bf408889a8973
      
https://github.com/qemu/qemu/commit/9732baf67850dac57dfc7dc8980bf408889a8973
  Author: Marc-André Lureau <address@hidden>
  Date:   2015-12-02 (Wed, 02 Dec 2015)

  Changed paths:
    M tests/vhost-user-test.c

  Log Message:
  -----------
  vhost-user-test: fix chardriver race

vhost-user-tests uses a helper thread to dispatch the vhost-user servers
sources. However the CharDriverState is not thread-safe. Therefore, when
it's given to the thread, it shouldn't be manipulated concurrently.

We dispatch cleaning the server in an idle source. By the end of the
test, we ensure not to leave anything behind by joining the thread and
finishing the sources dispatch.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: a899b1ea2a6d6baa18f1c12da566aad35cb0d807
      
https://github.com/qemu/qemu/commit/a899b1ea2a6d6baa18f1c12da566aad35cb0d807
  Author: Marc-André Lureau <address@hidden>
  Date:   2015-12-02 (Wed, 02 Dec 2015)

  Changed paths:
    M tests/vhost-user-test.c

  Log Message:
  -----------
  vhost-user-test: use unix port for migration

TCP port 1234 may be used by another process concurrently. Instead use a
temporary unix socket.

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 45ce512670f34d10be34448e621fd1484bea0ec6
      
https://github.com/qemu/qemu/commit/45ce512670f34d10be34448e621fd1484bea0ec6
  Author: Marc-André Lureau <address@hidden>
  Date:   2015-12-02 (Wed, 02 Dec 2015)

  Changed paths:
    M tests/vhost-user-test.c

  Log Message:
  -----------
  vhost-user-test: fix crash with glib < 2.36

The prepare callback needs to be implemented with glib < 2.36,
quoting glib documentation:
"Since 2.36 this may be NULL, in which case the effect is as if the
function always returns FALSE with a timeout of -1."

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 6f6f9512ea915009abeb6a4c5f204d4c25f090e0
      
https://github.com/qemu/qemu/commit/6f6f9512ea915009abeb6a4c5f204d4c25f090e0
  Author: Victor Kaplansky <address@hidden>
  Date:   2015-12-02 (Wed, 02 Dec 2015)

  Changed paths:
    M net/vhost-user.c

  Log Message:
  -----------
  vhost-user: verify that number of queues is non-zero

Fix QEMU crash when -netdev type=vhost-user,queues=n is passed
with zero number of queues.

Signed-off-by: Victor Kaplansky <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Acked-by: Jason Wang <address@hidden>


  Commit: b0ae1536c5248bc5f0f4472b8020a7a9d2ef9293
      
https://github.com/qemu/qemu/commit/b0ae1536c5248bc5f0f4472b8020a7a9d2ef9293
  Author: Michael S. Tsirkin <address@hidden>
  Date:   2015-12-02 (Wed, 02 Dec 2015)

  Changed paths:
    M include/hw/virtio/vhost.h

  Log Message:
  -----------
  vhost: drop dead code

commit 1e7398a1 ("vhost: enable vhost without without MSI-X"_
dropped the implementation of vhost_dev_query,
drop it from the header file as well.

Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Yuanhan Liu <address@hidden>


  Commit: 6d0b908a628a7086fa855c68b217cc1e2a5c4c19
      
https://github.com/qemu/qemu/commit/6d0b908a628a7086fa855c68b217cc1e2a5c4c19
  Author: Victor Kaplansky <address@hidden>
  Date:   2015-12-02 (Wed, 02 Dec 2015)

  Changed paths:
    M tests/vhost-user-bridge.c

  Log Message:
  -----------
  tests/vhost-user-bridge.c: fix fd leakage

This fixes file descriptor leakage in vhost-user-bridge
application. Whenever a new callfd or kickfd is set, the previous
one should be explicitly closed. File descriptors used to map
guest's memory are closed immediately after mmap call.

Signed-off-by: Victor Kaplansky <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 11380b36196c483ff5c7f800b0f7af6aa53b5657
      
https://github.com/qemu/qemu/commit/11380b36196c483ff5c7f800b0f7af6aa53b5657
  Author: Cornelia Huck <address@hidden>
  Date:   2015-12-02 (Wed, 02 Dec 2015)

  Changed paths:
    M hw/s390x/virtio-ccw.c
    M hw/virtio/virtio-bus.c
    M include/hw/virtio/virtio-bus.h

  Log Message:
  -----------
  virtio: handle non-virtio-1-capable backend for ccw

If you run a qemu advertising VERSION_1 with an old kernel where
vhost did not yet support VERSION_1, you'll end up with a device
that is {modern pci|ccw revision 1} but does not advertise VERSION_1.
This is not a sensible configuration and is rejected by the Linux
guest drivers.

To fix this, add a ->post_plugged() callback invoked after features
have been queried that can handle the VERSION_1 bit being withdrawn
and change ccw to fall back to revision 0 if VERSION_1 is gone.

Note that pci is _not_ fixed; we'll need to rethink the approach
for the next release but at least for pci it's not a regression.

Signed-off-by: Cornelia Huck <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: 0560b0e97df3da43651158c799c6d889f27529c3
      
https://github.com/qemu/qemu/commit/0560b0e97df3da43651158c799c6d889f27529c3
  Author: Shmulik Ladkani <address@hidden>
  Date:   2015-12-02 (Wed, 02 Dec 2015)

  Changed paths:
    M hw/virtio/virtio-pci.c
    M hw/virtio/virtio-pci.h

  Log Message:
  -----------
  virtio-pci: Set the QEMU_PCI_CAP_EXPRESS capability early in its DeviceClass 
realize method

In 1811e64 'hw/virtio: Add PCIe capability to virtio devices', the
QEMU_PCI_CAP_EXPRESS capability was added to virtio's pci_dev, within
'virtio_pci_realize' - the pci device object realization method.

This occurs to late, as 'pci_qdev_realize' (DeviceClass.realize of
TYPE_PCI_DEVICE) has already been called, without knowing that the
device instance is indeed an "express" instance, thus allocating
insufficient pci config space.

As a result, device may crash upon attempt to write to the PCIE config
space.

Fix, by arming the QEMU_PCI_CAP_EXPRESS capability early in virtio-pci's
own DeviceClass realize method.

This also makes code cleaner, as 'virtio_pci_realize' may now access the
'pci_is_express' predicate when needed.

Signed-off-by: Shmulik Ladkani <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
Tested-by: Marcel Apfelbaum <address@hidden>


  Commit: 7197fb4058bcb68986bae2bb2c04d6370f3e7218
      
https://github.com/qemu/qemu/commit/7197fb4058bcb68986bae2bb2c04d6370f3e7218
  Author: Michael S. Tsirkin <address@hidden>
  Date:   2015-12-02 (Wed, 02 Dec 2015)

  Changed paths:
    M include/qemu/mmap-alloc.h
    M util/mmap-alloc.c
    M util/oslib-posix.c

  Log Message:
  -----------
  util/mmap-alloc: fix hugetlb support on ppc64

Since commit 8561c9244ddf1122d "exec: allocate PROT_NONE pages on top of
RAM", it is no longer possible to back guest RAM with hugepages on ppc64
hosts:

mmap(NULL, 285212672, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x3fff57000000
mmap(0x3fff57000000, 268435456, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED, 19, 0) = -1 EBUSY (Device or resource busy)

This is because on ppc64, Linux fixes a page size for a virtual address
at mmap time, so we can't switch a range of memory from anonymous
small pages to hugetlbs with MAP_FIXED.

See commit d0f13e3c20b6fb73ccb467bdca97fa7cf5a574cd
("[POWERPC] Introduce address space "slices"") in Linux
history for the details.

Detect this and create the PROT_NONE mapping using the same fd.

Naturally, this makes the guard page bigger with hugetlbfs.

Based on patch by Greg Kurz.

Acked-by: Rik van Riel <address@hidden>
Reviewed-by: Greg Kurz <address@hidden>
Tested-by: Greg Kurz <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>


  Commit: ec1b9aa89d7970c7edc9594c33206690f5ba3c87
      
https://github.com/qemu/qemu/commit/ec1b9aa89d7970c7edc9594c33206690f5ba3c87
  Author: Peter Maydell <address@hidden>
  Date:   2015-12-02 (Wed, 02 Dec 2015)

  Changed paths:
    M hw/s390x/virtio-ccw.c
    M hw/virtio/virtio-bus.c
    M hw/virtio/virtio-pci.c
    M hw/virtio/virtio-pci.h
    M include/hw/virtio/vhost.h
    M include/hw/virtio/virtio-bus.h
    M include/qemu/mmap-alloc.h
    M net/vhost-user.c
    M tests/vhost-user-bridge.c
    M tests/vhost-user-test.c
    M util/mmap-alloc.c
    M util/oslib-posix.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

virtio,vhost,mmap fixes for 2.5

vhost test patches to fix the travis build
virtio ccw patch to fix virtio 1
virtio pci patch to fix pci express
vhost user bridge patch to fix fd leaks
mmap-alloc patch to fix hugetlbfs on ppc64
remove dead code for vhost (trivial)

Signed-off-by: Michael S. Tsirkin <address@hidden>

# gpg: Signature made Wed 02 Dec 2015 20:38:41 GMT using RSA key ID D28D5469
# gpg: Good signature from "Michael S. Tsirkin <address@hidden>"
# gpg:                 aka "Michael S. Tsirkin <address@hidden>"

* remotes/mst/tags/for_upstream:
  util/mmap-alloc: fix hugetlb support on ppc64
  virtio-pci: Set the QEMU_PCI_CAP_EXPRESS capability early in its DeviceClass 
realize method
  virtio: handle non-virtio-1-capable backend for ccw
  tests/vhost-user-bridge.c: fix fd leakage
  vhost: drop dead code
  vhost-user: verify that number of queues is non-zero
  vhost-user-test: fix crash with glib < 2.36
  vhost-user-test: use unix port for migration
  vhost-user-test: fix chardriver race

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/cf22132367a1...ec1b9aa89d79

reply via email to

[Prev in Thread] Current Thread [Next in Thread]