All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25
@ 2016-03-21 17:27 Michael Roth
  2016-03-21 17:27 ` [Qemu-devel] [PATCH 01/35] ehci: make idt processing more robust Michael Roth
                   ` (36 more replies)
  0 siblings, 37 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable

Hi everyone,

The following new patches are queued for QEMU stable v2.5.1:

  https://github.com/mdroth/qemu/commits/stable-2.5-staging

The release is planned for 2016-03-29:

  http://wiki.qemu.org/Planning/2.5

Please respond here or CC qemu-stable@nongnu.org on any patches you
think should be included in the release.

Testing/feedback is greatly appreciated.

Thanks!

----------------------------------------------------------------
Alberto Garcia (1):
      quorum: Fix crash in quorum_aio_cb()

Christian Borntraeger (1):
      block/raw-posix: avoid bogus fixup for cylinders on DASD disks

Dr. David Alan Gilbert (1):
      cpus: use broadcast on qemu_pause_cond

Eric Blake (1):
      qmp: Fix reference-counting of qnull on empty output visit

Gabriel L. Somlo (1):
      fw_cfg: avoid calculating invalid current entry pointer

Gerd Hoffmann (2):
      ehci: make idt processing more robust
      ehci: update irq on reset

Greg Kurz (3):
      target-ppc: kvm: fix floating point registers sync on little-endian hosts
      virtio-9p: use accessor to get thread_pool
      spapr: skip configuration section during migration of older machines

Halil Pasic (1):
      s390x/css: fix control flags during csch

Jeff Cody (2):
      block: set device_list.tqe_prev to NULL on BDS removal
      block: qemu-iotests - add test for snapshot, commit, snapshot bug

Laszlo Ersek (2):
      e1000: eliminate infinite loops on out-of-bounds transfer start
      fw_cfg: unbreak migration compatibility for 2.4 and earlier machines

Laurent Vivier (1):
      net: set endianness on all backend devices

Li Zhijian (2):
      net/dump: fix nfds->filename leak
      net/filter: fix nf->netdev_id leak

Marc-André Lureau (2):
      ivshmem: no need for opaque argument
      ivshmem: remove redundant assignment, fix crash with msi=off

Marcel Apfelbaum (3):
      hw/virtio: fix double use of a virtio flag
      hw/virtio: group virtio flags into an enum
      vl.c: Fix regression in machine error message

Max Reitz (2):
      block: Add blk_dev_has_tray()
      blockdev: Fix 'change' for slot devices

Michael S. Tsirkin (1):
      vhost-user: don't merge regions with different fds

P J P (2):
      net: vmxnet3: avoid memory leakage in activate_device
      scsi: initialise info object with appropriate size

Peter Maydell (2):
      configure: Fix shell syntax to placate OpenBSD's pdksh
      target-arm: Make reserved ranges in ID_AA64* spaces RAZ, not UNDEF

Pierre Morel (1):
      s390x/ioinst: set type and len for SEI response

Prasad J Pandit (2):
      net: rocker: fix an incorrect array bounds check
      net: ne2000: check ring buffer control registers

Stefano Stabellini (2):
      xen/blkif: Avoid double access to src->nr_segments
      xenfb: avoid reading twice the same fields from the shared page

 block.c                           |  24 ++++---
 block/block-backend.c             |  10 ++-
 block/quorum.c                    |  12 ++--
 block/raw-posix.c                 |   7 ---
 blockdev.c                        |  34 ++++++++--
 configure                         |   6 +-
 cpus.c                            |   4 +-
 hw/9pfs/virtio-9p-coth.c          |   2 +-
 hw/block/xen_blkif.h              |  12 ++--
 hw/display/xenfb.c                |  10 +--
 hw/misc/ivshmem.c                 |   7 +--
 hw/net/e1000.c                    |   6 +-
 hw/net/ne2000.c                   |   4 ++
 hw/net/rocker/rocker.c            |   8 +--
 hw/net/vhost_net.c                |  23 ++++---
 hw/net/vmxnet3.c                  |  24 ++++---
 hw/nvram/fw_cfg.c                 |  26 +++++---
 hw/ppc/spapr.c                    |   1 +
 hw/s390x/css.c                    |   2 +-
 hw/scsi/megasas.c                 |   2 +-
 hw/usb/hcd-ehci.c                 |   6 +-
 hw/virtio/vhost-user.c            |  20 ++++++
 hw/virtio/vhost.c                 |   7 +++
 hw/virtio/virtio-pci.h            |  17 ++---
 include/block/block.h             |   1 +
 include/block/block_int.h         |   1 +
 include/hw/compat.h               |   8 +++
 include/hw/virtio/vhost-backend.h |   4 ++
 net/dump.c                        |   8 +++
 net/filter.c                      |   1 +
 qapi/block-core.json              |   3 +-
 qapi/qmp-output-visitor.c         |  41 +++++++++---
 target-arm/cpu-qom.h              |   1 +
 target-arm/helper.c               | 128 +++++++++++++++++++++++++++++++++++---
 target-ppc/kvm.c                  |  12 ++++
 target-s390x/ioinst.c             |   3 +-
 tests/qemu-iotests/144            | 114 +++++++++++++++++++++++++++++++++
 tests/qemu-iotests/144.out        |  24 +++++++
 tests/qemu-iotests/group          |   1 +
 tests/test-qmp-output-visitor.c   |   2 +
 vl.c                              |  37 +++++++----
 41 files changed, 544 insertions(+), 119 deletions(-)
 create mode 100755 tests/qemu-iotests/144
 create mode 100644 tests/qemu-iotests/144.out

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

* [Qemu-devel] [PATCH 01/35] ehci: make idt processing more robust
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
@ 2016-03-21 17:27 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 02/35] net: vmxnet3: avoid memory leakage in activate_device Michael Roth
                   ` (35 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:27 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Roth, qemu-stable, Gerd Hoffmann

From: Gerd Hoffmann <kraxel@redhat.com>

Make ehci_process_itd return an error in case we didn't do any actual
iso transfer because we've found no active transaction.  That'll avoid
ehci happily run in circles forever if the guest builds a loop out of
idts.

This is CVE-2015-8558.

Cc: qemu-stable@nongnu.org
Reported-by: Qinghao Tang <luodalongde@gmail.com>
Tested-by: P J P <ppandit@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 156a2e4dbffa85997636a7a39ef12da6f1b40254)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/usb/hcd-ehci.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 4e2161b..d07f228 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -1389,7 +1389,7 @@ static int ehci_process_itd(EHCIState *ehci,
 {
     USBDevice *dev;
     USBEndpoint *ep;
-    uint32_t i, len, pid, dir, devaddr, endp;
+    uint32_t i, len, pid, dir, devaddr, endp, xfers = 0;
     uint32_t pg, off, ptr1, ptr2, max, mult;
 
     ehci->periodic_sched_active = PERIODIC_ACTIVE;
@@ -1479,9 +1479,10 @@ static int ehci_process_itd(EHCIState *ehci,
                 ehci_raise_irq(ehci, USBSTS_INT);
             }
             itd->transact[i] &= ~ITD_XACT_ACTIVE;
+            xfers++;
         }
     }
-    return 0;
+    return xfers ? 0 : -1;
 }
 
 
-- 
1.9.1

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

* [Qemu-devel] [PATCH 02/35] net: vmxnet3: avoid memory leakage in activate_device
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
  2016-03-21 17:27 ` [Qemu-devel] [PATCH 01/35] ehci: make idt processing more robust Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 03/35] target-ppc: kvm: fix floating point registers sync on little-endian hosts Michael Roth
                   ` (34 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jason Wang, Michael Roth, Prasad J Pandit, qemu-stable, P J P

From: P J P <ppandit@redhat.com>

Vmxnet3 device emulator does not check if the device is active
before activating it, also it did not free the transmit & receive
buffers while deactivating the device, thus resulting in memory
leakage on the host. This patch fixes both these issues to avoid
host memory leakage.

Reported-by: Qinghao Tang <luodalongde@gmail.com>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Cc: qemu-stable@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit aa4a3dce1c88ed51b616806b8214b7c8428b7470)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/net/vmxnet3.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index 37373e5..2b4aad7 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -1194,8 +1194,13 @@ static void vmxnet3_reset_mac(VMXNET3State *s)
 
 static void vmxnet3_deactivate_device(VMXNET3State *s)
 {
-    VMW_CBPRN("Deactivating vmxnet3...");
-    s->device_active = false;
+    if (s->device_active) {
+        VMW_CBPRN("Deactivating vmxnet3...");
+        vmxnet_tx_pkt_reset(s->tx_pkt);
+        vmxnet_tx_pkt_uninit(s->tx_pkt);
+        vmxnet_rx_pkt_uninit(s->rx_pkt);
+        s->device_active = false;
+    }
 }
 
 static void vmxnet3_reset(VMXNET3State *s)
@@ -1204,7 +1209,6 @@ static void vmxnet3_reset(VMXNET3State *s)
 
     vmxnet3_deactivate_device(s);
     vmxnet3_reset_interrupt_states(s);
-    vmxnet_tx_pkt_reset(s->tx_pkt);
     s->drv_shmem = 0;
     s->tx_sop = true;
     s->skip_current_tx_pkt = false;
@@ -1431,6 +1435,12 @@ static void vmxnet3_activate_device(VMXNET3State *s)
         return;
     }
 
+    /* Verify if device is active */
+    if (s->device_active) {
+        VMW_CFPRN("Vmxnet3 device is active");
+        return;
+    }
+
     vmxnet3_adjust_by_guest_type(s);
     vmxnet3_update_features(s);
     vmxnet3_update_pm_state(s);
@@ -1627,7 +1637,7 @@ static void vmxnet3_handle_command(VMXNET3State *s, uint64_t cmd)
         break;
 
     case VMXNET3_CMD_QUIESCE_DEV:
-        VMW_CBPRN("Set: VMXNET3_CMD_QUIESCE_DEV - pause the device");
+        VMW_CBPRN("Set: VMXNET3_CMD_QUIESCE_DEV - deactivate the device");
         vmxnet3_deactivate_device(s);
         break;
 
@@ -1741,7 +1751,7 @@ vmxnet3_io_bar1_write(void *opaque,
          * shared address only after we get the high part
          */
         if (val == 0) {
-            s->device_active = false;
+            vmxnet3_deactivate_device(s);
         }
         s->temp_shared_guest_driver_memory = val;
         s->drv_shmem = 0;
@@ -2021,9 +2031,7 @@ static bool vmxnet3_peer_has_vnet_hdr(VMXNET3State *s)
 static void vmxnet3_net_uninit(VMXNET3State *s)
 {
     g_free(s->mcast_list);
-    vmxnet_tx_pkt_reset(s->tx_pkt);
-    vmxnet_tx_pkt_uninit(s->tx_pkt);
-    vmxnet_rx_pkt_uninit(s->rx_pkt);
+    vmxnet3_deactivate_device(s);
     qemu_del_nic(s->nic);
 }
 
-- 
1.9.1

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

* [Qemu-devel] [PATCH 03/35] target-ppc: kvm: fix floating point registers sync on little-endian hosts
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
  2016-03-21 17:27 ` [Qemu-devel] [PATCH 01/35] ehci: make idt processing more robust Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 02/35] net: vmxnet3: avoid memory leakage in activate_device Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 04/35] configure: Fix shell syntax to placate OpenBSD's pdksh Michael Roth
                   ` (33 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Roth, David Gibson, qemu-stable, Greg Kurz

From: Greg Kurz <gkurz@linux.vnet.ibm.com>

On VSX capable CPUs, the 32 FP registers are mapped to the high-bits
of the 32 first VSX registers. So if you have:

VSR31 = (uint128) 0x0102030405060708090a0b0c0d0e0f00

then

FPR31 = (uint64) 0x0102030405060708

The kernel stores the VSX registers in the fp_state struct following the
host endian element ordering.

On big-endian:

fp_state.fpr[31][0] = 0x0102030405060708
fp_state.fpr[31][1] = 0x090a0b0c0d0e0f00

On little-endian:

fp_state.fpr[31][0] = 0x090a0b0c0d0e0f00
fp_state.fpr[31][1] = 0x0102030405060708

The KVM_GET_ONE_REG and KVM_SET_ONE_REG ioctls preserve this ordering, but
QEMU considers it as big-endian and always copies element [0] to the
fpr[] array and element [1] to the vsr[] array. This does not work with
little-endian hosts, and you will get:

(qemu) p $f31
0x90a0b0c0d0e0f00

instead of:

(qemu) p $f31
0x102030405060708

This patch fixes the element ordering for little-endian hosts.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit 3a4b791b4c13e02537a5cc572fa3de70bc5f68da)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 target-ppc/kvm.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index ac70f08..acd3275 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -650,8 +650,13 @@ static int kvm_put_fp(CPUState *cs)
         for (i = 0; i < 32; i++) {
             uint64_t vsr[2];
 
+#ifdef HOST_WORDS_BIGENDIAN
             vsr[0] = float64_val(env->fpr[i]);
             vsr[1] = env->vsr[i];
+#else
+            vsr[0] = env->vsr[i];
+            vsr[1] = float64_val(env->fpr[i]);
+#endif
             reg.addr = (uintptr_t) &vsr;
             reg.id = vsx ? KVM_REG_PPC_VSR(i) : KVM_REG_PPC_FPR(i);
 
@@ -721,10 +726,17 @@ static int kvm_get_fp(CPUState *cs)
                         vsx ? "VSR" : "FPR", i, strerror(errno));
                 return ret;
             } else {
+#ifdef HOST_WORDS_BIGENDIAN
                 env->fpr[i] = vsr[0];
                 if (vsx) {
                     env->vsr[i] = vsr[1];
                 }
+#else
+                env->fpr[i] = vsr[1];
+                if (vsx) {
+                    env->vsr[i] = vsr[0];
+                }
+#endif
             }
         }
     }
-- 
1.9.1

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

* [Qemu-devel] [PATCH 04/35] configure: Fix shell syntax to placate OpenBSD's pdksh
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (2 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 03/35] target-ppc: kvm: fix floating point registers sync on little-endian hosts Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 05/35] xen/blkif: Avoid double access to src->nr_segments Michael Roth
                   ` (32 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, qemu-stable, Michael Roth

From: Peter Maydell <peter.maydell@linaro.org>

Unfortunately the OpenBSD pdksh does not like brackets inside
the right part of a ${variable+word} parameter expansion:

  $ echo "${a+($b)}"
  ksh: ${a+($b)}": bad substitution

though both bash and dash accept them. In any case this line
was causing odd output in the case where nettle is not present:
  nettle    no ()

(because if nettle is not present then $nettle will be "no",
not a null string or unset).

Rewrite it to just use an if.

This bug was originally introduced in becaeb726 and was present
in the 2.4.0 release.

Fixes: https://bugs.launchpad.net/qemu/+bug/1525682
Reported-by: Dmitrij D. Czarkoff
Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1450105357-8516-1-git-send-email-peter.maydell@linaro.org
(cherry picked from commit 18f49881cf8359e89396aac12f5d3cf3f8a632ba)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 configure | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index b9552fd..6ca6c64 100755
--- a/configure
+++ b/configure
@@ -4758,7 +4758,11 @@ echo "GTK GL support    $gtk_gl"
 echo "GNUTLS support    $gnutls"
 echo "GNUTLS hash       $gnutls_hash"
 echo "libgcrypt         $gcrypt"
-echo "nettle            $nettle ${nettle+($nettle_version)}"
+if test "$nettle" = "yes"; then
+    echo "nettle            $nettle ($nettle_version)"
+else
+    echo "nettle            $nettle"
+fi
 echo "libtasn1          $tasn1"
 echo "VTE support       $vte"
 echo "curses support    $curses"
-- 
1.9.1

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

* [Qemu-devel] [PATCH 05/35] xen/blkif: Avoid double access to src->nr_segments
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (3 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 04/35] configure: Fix shell syntax to placate OpenBSD's pdksh Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 06/35] xenfb: avoid reading twice the same fields from the shared page Michael Roth
                   ` (31 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Roth, qemu-stable, Stefano Stabellini

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

src is stored in shared memory and src->nr_segments is dereferenced
twice at the end of the function.  If a compiler decides to compile this
into two separate memory accesses then the size limitation could be
bypassed.

Fix it by removing the double access to src->nr_segments.

This is part of XSA-155.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
(cherry picked from commit f9e98e5d7a67367b862941e339a98b8322fa0cea)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/block/xen_blkif.h | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/block/xen_blkif.h b/hw/block/xen_blkif.h
index 711b692..c68487cb 100644
--- a/hw/block/xen_blkif.h
+++ b/hw/block/xen_blkif.h
@@ -85,8 +85,10 @@ static inline void blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_reque
 		d->nr_sectors = s->nr_sectors;
 		return;
 	}
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
@@ -106,8 +108,10 @@ static inline void blkif_get_x86_64_req(blkif_request_t *dst, blkif_x86_64_reque
 		d->nr_sectors = s->nr_sectors;
 		return;
 	}
-	if (n > src->nr_segments)
-		n = src->nr_segments;
+	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
+	barrier();
+	if (n > dst->nr_segments)
+		n = dst->nr_segments;
 	for (i = 0; i < n; i++)
 		dst->seg[i] = src->seg[i];
 }
-- 
1.9.1

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

* [Qemu-devel] [PATCH 06/35] xenfb: avoid reading twice the same fields from the shared page
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (4 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 05/35] xen/blkif: Avoid double access to src->nr_segments Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 07/35] virtio-9p: use accessor to get thread_pool Michael Roth
                   ` (30 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Roth, qemu-stable, Stefano Stabellini

From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>

Reading twice the same field could give the guest an attack of
opportunity. In the case of event->type, gcc could compile the switch
statement into a jump table, effectively ending up reading the type
field multiple times.

This is part of XSA-155.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
(cherry picked from commit 7ea11bf376aea4bf8340eb363de9777c7f93e556)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/display/xenfb.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c
index 5e324ef..4e2a27a 100644
--- a/hw/display/xenfb.c
+++ b/hw/display/xenfb.c
@@ -784,18 +784,20 @@ static void xenfb_invalidate(void *opaque)
 
 static void xenfb_handle_events(struct XenFB *xenfb)
 {
-    uint32_t prod, cons;
+    uint32_t prod, cons, out_cons;
     struct xenfb_page *page = xenfb->c.page;
 
     prod = page->out_prod;
-    if (prod == page->out_cons)
+    out_cons = page->out_cons;
+    if (prod == out_cons)
 	return;
     xen_rmb();		/* ensure we see ring contents up to prod */
-    for (cons = page->out_cons; cons != prod; cons++) {
+    for (cons = out_cons; cons != prod; cons++) {
 	union xenfb_out_event *event = &XENFB_OUT_RING_REF(page, cons);
+        uint8_t type = event->type;
 	int x, y, w, h;
 
-	switch (event->type) {
+	switch (type) {
 	case XENFB_TYPE_UPDATE:
 	    if (xenfb->up_count == UP_QUEUE)
 		xenfb->up_fullscreen = 1;
-- 
1.9.1

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

* [Qemu-devel] [PATCH 07/35] virtio-9p: use accessor to get thread_pool
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (5 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 06/35] xenfb: avoid reading twice the same fields from the shared page Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 08/35] scsi: initialise info object with appropriate size Michael Roth
                   ` (29 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Roth, qemu-stable, Greg Kurz

From: Greg Kurz <gkurz@linux.vnet.ibm.com>

The aio_context_new() function does not allocate a thread pool. This is
deferred to the first call to the aio_get_thread_pool() accessor. It is
hence forbidden to access the thread_pool field directly, as it may be
NULL. The accessor *must* be used always.

Fixes: ebac1202c95a4f1b76b6ef3f0f63926fa76e753e
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Tested-by: Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-stable@nongnu.org
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
(cherry picked from commit 4b3a4f2d458ca5a7c6c16ac36a8d9ac22cc253d6)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/9pfs/virtio-9p-coth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/9pfs/virtio-9p-coth.c b/hw/9pfs/virtio-9p-coth.c
index fb6e8f8..ab9425c 100644
--- a/hw/9pfs/virtio-9p-coth.c
+++ b/hw/9pfs/virtio-9p-coth.c
@@ -36,6 +36,6 @@ static int coroutine_enter_func(void *arg)
 void co_run_in_worker_bh(void *opaque)
 {
     Coroutine *co = opaque;
-    thread_pool_submit_aio(qemu_get_aio_context()->thread_pool,
+    thread_pool_submit_aio(aio_get_thread_pool(qemu_get_aio_context()),
                            coroutine_enter_func, co, coroutine_enter_cb, co);
 }
-- 
1.9.1

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

* [Qemu-devel] [PATCH 08/35] scsi: initialise info object with appropriate size
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (6 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 07/35] virtio-9p: use accessor to get thread_pool Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 09/35] ivshmem: no need for opaque argument Michael Roth
                   ` (28 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael Roth, Paolo Bonzini, Prasad J Pandit, qemu-stable, P J P

From: P J P <ppandit@redhat.com>

While processing controller 'CTRL_GET_INFO' command, the routine
'megasas_ctrl_get_info' overflows the '&info' object size. Use its
appropriate size to null initialise it.

Reported-by: Qinghao Tang <luodalongde@gmail.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-Id: <alpine.LFD.2.20.1512211501420.22471@wniryva>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: P J P <ppandit@redhat.com>
(cherry picked from commit 36fef36b91f7ec0435215860f1458b5342ce2811)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/scsi/megasas.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index d7dc667..576f56c 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -718,7 +718,7 @@ static int megasas_ctrl_get_info(MegasasState *s, MegasasCmd *cmd)
     BusChild *kid;
     int num_pd_disks = 0;
 
-    memset(&info, 0x0, cmd->iov_size);
+    memset(&info, 0x0, dcmd_size);
     if (cmd->iov_size < dcmd_size) {
         trace_megasas_dcmd_invalid_xfer_len(cmd->index, cmd->iov_size,
                                             dcmd_size);
-- 
1.9.1

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

* [Qemu-devel] [PATCH 09/35] ivshmem: no need for opaque argument
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (7 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 08/35] scsi: initialise info object with appropriate size Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 10/35] ivshmem: remove redundant assignment, fix crash with msi=off Michael Roth
                   ` (27 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, qemu-stable, Michael Roth

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

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
(cherry picked from commit 2c64846972897fc3aec4072f849fae2b00322f8b)
*context dependency for 47213eb
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/misc/ivshmem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index f73f0c2..7d14222 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -350,11 +350,11 @@ static void ivshmem_vector_poll(PCIDevice *dev,
     }
 }
 
-static CharDriverState* create_eventfd_chr_device(void * opaque, EventNotifier *n,
+static CharDriverState* create_eventfd_chr_device(IVShmemState *s,
+                                                  EventNotifier *n,
                                                   int vector)
 {
     /* create a event character device based on the passed eventfd */
-    IVShmemState *s = opaque;
     PCIDevice *pdev = PCI_DEVICE(s);
     int eventfd = event_notifier_get_fd(n);
     CharDriverState *chr;
-- 
1.9.1

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

* [Qemu-devel] [PATCH 10/35] ivshmem: remove redundant assignment, fix crash with msi=off
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (8 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 09/35] ivshmem: no need for opaque argument Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 11/35] net: rocker: fix an incorrect array bounds check Michael Roth
                   ` (26 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Marc-André Lureau, qemu-stable, Michael Roth

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

Fix crash when msi=false introduced in 660c97ee (msi_vectors is NULL in
this case)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
(cherry picked from commit 47213eb1104709bf238c8d16db20aa47d37b1c59)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/misc/ivshmem.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index 7d14222..dcfc8cc 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -355,12 +355,9 @@ static CharDriverState* create_eventfd_chr_device(IVShmemState *s,
                                                   int vector)
 {
     /* create a event character device based on the passed eventfd */
-    PCIDevice *pdev = PCI_DEVICE(s);
     int eventfd = event_notifier_get_fd(n);
     CharDriverState *chr;
 
-    s->msi_vectors[vector].pdev = pdev;
-
     chr = qemu_chr_open_eventfd(eventfd);
 
     if (chr == NULL) {
-- 
1.9.1

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

* [Qemu-devel] [PATCH 11/35] net: rocker: fix an incorrect array bounds check
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (9 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 10/35] ivshmem: remove redundant assignment, fix crash with msi=off Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 12/35] block: Add blk_dev_has_tray() Michael Roth
                   ` (25 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Roth, Jason Wang, qemu-stable, Prasad J Pandit

From: Prasad J Pandit <pjp@fedoraproject.org>

While processing transmit(tx) descriptors in 'tx_consume' routine
the switch emulator suffers from an off-by-one error, if a
descriptor was to have more than allowed(ROCKER_TX_FRAGS_MAX=16)
fragments. Fix an incorrect bounds check to avoid it.

Reported-by: Qinghao Tang <luodalongde@gmail.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 007cd223de527b5f41278f2d886c1a4beb3e67aa)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/net/rocker/rocker.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c
index c57f1a6..2e77e50 100644
--- a/hw/net/rocker/rocker.c
+++ b/hw/net/rocker/rocker.c
@@ -232,6 +232,9 @@ static int tx_consume(Rocker *r, DescInfo *info)
         frag_addr = rocker_tlv_get_le64(tlvs[ROCKER_TLV_TX_FRAG_ATTR_ADDR]);
         frag_len = rocker_tlv_get_le16(tlvs[ROCKER_TLV_TX_FRAG_ATTR_LEN]);
 
+        if (iovcnt >= ROCKER_TX_FRAGS_MAX) {
+            goto err_too_many_frags;
+        }
         iov[iovcnt].iov_len = frag_len;
         iov[iovcnt].iov_base = g_malloc(frag_len);
         if (!iov[iovcnt].iov_base) {
@@ -244,10 +247,7 @@ static int tx_consume(Rocker *r, DescInfo *info)
             err = -ROCKER_ENXIO;
             goto err_bad_io;
         }
-
-        if (++iovcnt > ROCKER_TX_FRAGS_MAX) {
-            goto err_too_many_frags;
-        }
+        iovcnt++;
     }
 
     if (iovcnt) {
-- 
1.9.1

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

* [Qemu-devel] [PATCH 12/35] block: Add blk_dev_has_tray()
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (10 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 11/35] net: rocker: fix an incorrect array bounds check Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 13/35] blockdev: Fix 'change' for slot devices Michael Roth
                   ` (24 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Roth, qemu-stable, Max Reitz

From: Max Reitz <mreitz@redhat.com>

Pull out the check whether a block device has a tray from
blk_dev_is_tray_open() into its own function so both attributes (whether
there is a tray vs. whether that tray is open) can be queried
independently.

Cc: qemu-stable <qemu-stable@nongnu.org>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-id: 1454096953-31773-2-git-send-email-mreitz@redhat.com
(cherry picked from commit 8f3a73bc57ea83e5b3930d14fc596ea51859987a)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 block/block-backend.c     | 10 +++++++++-
 include/block/block_int.h |  1 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/block/block-backend.c b/block/block-backend.c
index 36ccc9e..419591f 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -458,6 +458,14 @@ bool blk_dev_has_removable_media(BlockBackend *blk)
 }
 
 /*
+ * Does @blk's attached device model have a tray?
+ */
+bool blk_dev_has_tray(BlockBackend *blk)
+{
+    return blk->dev_ops && blk->dev_ops->is_tray_open;
+}
+
+/*
  * Notify @blk's attached device model of a media eject request.
  * If @force is true, the medium is about to be yanked out forcefully.
  */
@@ -473,7 +481,7 @@ void blk_dev_eject_request(BlockBackend *blk, bool force)
  */
 bool blk_dev_is_tray_open(BlockBackend *blk)
 {
-    if (blk->dev_ops && blk->dev_ops->is_tray_open) {
+    if (blk_dev_has_tray(blk)) {
         return blk->dev_ops->is_tray_open(blk->dev_opaque);
     }
     return false;
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 4012e36..7029d41 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -686,6 +686,7 @@ void blk_set_bs(BlockBackend *blk, BlockDriverState *bs);
 
 void blk_dev_change_media_cb(BlockBackend *blk, bool load);
 bool blk_dev_has_removable_media(BlockBackend *blk);
+bool blk_dev_has_tray(BlockBackend *blk);
 void blk_dev_eject_request(BlockBackend *blk, bool force);
 bool blk_dev_is_tray_open(BlockBackend *blk);
 bool blk_dev_is_medium_locked(BlockBackend *blk);
-- 
1.9.1

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

* [Qemu-devel] [PATCH 13/35] blockdev: Fix 'change' for slot devices
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (11 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 12/35] block: Add blk_dev_has_tray() Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 14/35] net/dump: fix nfds->filename leak Michael Roth
                   ` (23 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Roth, qemu-stable, Max Reitz

From: Max Reitz <mreitz@redhat.com>

'change' and related operations did not work when used on guest devices
featuring removable media but no actual tray, because
blk_dev_is_tray_open() always returned false for them and the
blockdev-{insert,remove}-medium commands required it to return true.

Fix this by making blockdev-{insert,remove}-medium work on tray-less
devices. Also, blockdev-{open,close}-tray are now explicitly no-ops when
invoked on such devices, and blk_dev_change_media_cb() is instead
called by blockdev-{insert,remove}-medium (for tray-less devices only).

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-stable <qemu-stable@nongnu.org>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-id: 1454096953-31773-3-git-send-email-mreitz@redhat.com
Reviewed-by: Eric Blake <eblake@redhat.com>
(cherry picked from commit 12c7ec87a7d88919b23736176eba3118d1521372)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 blockdev.c           | 31 +++++++++++++++++++++++++++++--
 qapi/block-core.json |  3 +--
 2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index 80932e8..7c81f48 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2306,6 +2306,11 @@ void qmp_blockdev_open_tray(const char *device, bool has_force, bool force,
         return;
     }
 
+    if (!blk_dev_has_tray(blk)) {
+        /* Ignore this command on tray-less devices */
+        return;
+    }
+
     if (blk_dev_is_tray_open(blk)) {
         return;
     }
@@ -2336,6 +2341,11 @@ void qmp_blockdev_close_tray(const char *device, Error **errp)
         return;
     }
 
+    if (!blk_dev_has_tray(blk)) {
+        /* Ignore this command on tray-less devices */
+        return;
+    }
+
     if (!blk_dev_is_tray_open(blk)) {
         return;
     }
@@ -2365,7 +2375,7 @@ void qmp_x_blockdev_remove_medium(const char *device, Error **errp)
         return;
     }
 
-    if (has_device && !blk_dev_is_tray_open(blk)) {
+    if (has_device && blk_dev_has_tray(blk) && !blk_dev_is_tray_open(blk)) {
         error_setg(errp, "Tray of device '%s' is not open", device);
         return;
     }
@@ -2390,6 +2400,14 @@ void qmp_x_blockdev_remove_medium(const char *device, Error **errp)
 
     blk_remove_bs(blk);
 
+    if (!blk_dev_has_tray(blk)) {
+        /* For tray-less devices, blockdev-open-tray is a no-op (or may not be
+         * called at all); therefore, the medium needs to be ejected here.
+         * Do it after blk_remove_bs() so blk_is_inserted(blk) returns the @load
+         * value passed here (i.e. false). */
+        blk_dev_change_media_cb(blk, false);
+    }
+
 out:
     aio_context_release(aio_context);
 }
@@ -2415,7 +2433,7 @@ static void qmp_blockdev_insert_anon_medium(const char *device,
         return;
     }
 
-    if (has_device && !blk_dev_is_tray_open(blk)) {
+    if (has_device && blk_dev_has_tray(blk) && !blk_dev_is_tray_open(blk)) {
         error_setg(errp, "Tray of device '%s' is not open", device);
         return;
     }
@@ -2428,6 +2446,15 @@ static void qmp_blockdev_insert_anon_medium(const char *device,
     blk_insert_bs(blk, bs);
 
     QTAILQ_INSERT_TAIL(&bdrv_states, bs, device_list);
+
+    if (!blk_dev_has_tray(blk)) {
+        /* For tray-less devices, blockdev-close-tray is a no-op (or may not be
+         * called at all); therefore, the medium needs to be pushed into the
+         * slot here.
+         * Do it after blk_insert_bs() so blk_is_inserted(blk) returns the @load
+         * value passed here (i.e. true). */
+        blk_dev_change_media_cb(blk, true);
+    }
 }
 
 void qmp_x_blockdev_insert_medium(const char *device, const char *node_name,
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 5a23165..419f112 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -2048,8 +2048,7 @@
 #   respond to the eject request
 # - if the BlockBackend denoted by @device does not have a guest device attached
 #   to it
-# - if the guest device does not have an actual tray and is empty, for instance
-#   for floppy disk drives
+# - if the guest device does not have an actual tray
 #
 # @device: block device name
 #
-- 
1.9.1

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

* [Qemu-devel] [PATCH 14/35] net/dump: fix nfds->filename leak
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (12 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 13/35] blockdev: Fix 'change' for slot devices Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 15/35] net/filter: fix nf->netdev_id leak Michael Roth
                   ` (22 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jason Wang, qemu-stable, Li Zhijian, Michael Roth

From: Li Zhijian <lizhijian@cn.fujitsu.com>

Cc: Jason Wang <jasowang@redhat.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit b50c7d452f5aef52cc9e7461f215cab87c3f3b03)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 net/dump.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/dump.c b/net/dump.c
index ce16a4b..347b5ca 100644
--- a/net/dump.c
+++ b/net/dump.c
@@ -329,6 +329,13 @@ static void filter_dump_instance_init(Object *obj)
                             file_dump_set_filename, NULL);
 }
 
+static void filter_dump_instance_finalize(Object *obj)
+{
+    NetFilterDumpState *nfds = FILTER_DUMP(obj);
+
+    g_free(nfds->filename);
+}
+
 static void filter_dump_class_init(ObjectClass *oc, void *data)
 {
     NetFilterClass *nfc = NETFILTER_CLASS(oc);
@@ -343,6 +350,7 @@ static const TypeInfo filter_dump_info = {
     .parent = TYPE_NETFILTER,
     .class_init = filter_dump_class_init,
     .instance_init = filter_dump_instance_init,
+    .instance_finalize = filter_dump_instance_finalize,
     .instance_size = sizeof(NetFilterDumpState),
 };
 
-- 
1.9.1

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

* [Qemu-devel] [PATCH 15/35] net/filter: fix nf->netdev_id leak
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (13 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 14/35] net/dump: fix nfds->filename leak Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 16/35] net: ne2000: check ring buffer control registers Michael Roth
                   ` (21 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jason Wang, qemu-stable, Li Zhijian, Michael Roth

From: Li Zhijian <lizhijian@cn.fujitsu.com>

Cc: Jason Wang <jasowang@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 671f66f87fbf6cc6a3879f3055f16347b1db91e9)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 net/filter.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/filter.c b/net/filter.c
index 1365bad..f777ba2 100644
--- a/net/filter.c
+++ b/net/filter.c
@@ -204,6 +204,7 @@ static void netfilter_finalize(Object *obj)
     if (nf->netdev && !QTAILQ_EMPTY(&nf->netdev->filters)) {
         QTAILQ_REMOVE(&nf->netdev->filters, nf, next);
     }
+    g_free(nf->netdev_id);
 }
 
 static void netfilter_class_init(ObjectClass *oc, void *data)
-- 
1.9.1

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

* [Qemu-devel] [PATCH 16/35] net: ne2000: check ring buffer control registers
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (14 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 15/35] net/filter: fix nf->netdev_id leak Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 17/35] net: set endianness on all backend devices Michael Roth
                   ` (20 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Roth, Jason Wang, qemu-stable, Prasad J Pandit

From: Prasad J Pandit <pjp@fedoraproject.org>

Ne2000 NIC uses ring buffer of NE2000_MEM_SIZE(49152)
bytes to process network packets. Registers PSTART & PSTOP
define ring buffer size & location. Setting these registers
to invalid values could lead to infinite loop or OOB r/w
access issues. Add check to avoid it.

Reported-by: Yang Hongke <yanghongke@huawei.com>
Tested-by: Yang Hongke <yanghongke@huawei.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 415ab35a441eca767d033a2702223e785b9d5190)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/net/ne2000.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
index 010f9ef..84a7263 100644
--- a/hw/net/ne2000.c
+++ b/hw/net/ne2000.c
@@ -154,6 +154,10 @@ static int ne2000_buffer_full(NE2000State *s)
 {
     int avail, index, boundary;
 
+    if (s->stop <= s->start) {
+        return 1;
+    }
+
     index = s->curpag << 8;
     boundary = s->boundary << 8;
     if (index < boundary)
-- 
1.9.1

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

* [Qemu-devel] [PATCH 17/35] net: set endianness on all backend devices
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (15 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 16/35] net: ne2000: check ring buffer control registers Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 18/35] ehci: update irq on reset Michael Roth
                   ` (19 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Laurent Vivier, Michael Roth, qemu-stable, Michael S. Tsirkin

From: Laurent Vivier <lvivier@redhat.com>

commit 5be7d9f1b1452613b95c6ba70b8d7ad3d0797991
       vhost-net: tell tap backend about the vnet endianness

makes vhost net to set the endianness of the device, but only for
the first device.

In case of multiqueue, we have multiple devices... This patch sets the
endianness for all the devices of the interface.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit a407644079c8639002e7ea635d851953b10a38c3)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/net/vhost_net.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
index 318c3e6..10e233a 100644
--- a/hw/net/vhost_net.c
+++ b/hw/net/vhost_net.c
@@ -300,21 +300,19 @@ int vhost_net_start(VirtIODevice *dev, NetClientState *ncs,
     BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(dev)));
     VirtioBusState *vbus = VIRTIO_BUS(qbus);
     VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus);
-    int r, e, i;
+    int r, e, i, j;
 
     if (!k->set_guest_notifiers) {
         error_report("binding does not support guest notifiers");
-        r = -ENOSYS;
-        goto err;
+        return -ENOSYS;
     }
 
-    r = vhost_net_set_vnet_endian(dev, ncs[0].peer, true);
-    if (r < 0) {
-        goto err;
-    }
-
-    for (i = 0; i < total_queues; i++) {
-        vhost_net_set_vq_index(get_vhost_net(ncs[i].peer), i * 2);
+    for (j = 0; j < total_queues; j++) {
+        r = vhost_net_set_vnet_endian(dev, ncs[j].peer, true);
+        if (r < 0) {
+            goto err_endian;
+        }
+        vhost_net_set_vq_index(get_vhost_net(ncs[j].peer), j * 2);
     }
 
     r = k->set_guest_notifiers(qbus->parent, total_queues * 2, true);
@@ -343,8 +341,9 @@ err_start:
         fflush(stderr);
     }
 err_endian:
-    vhost_net_set_vnet_endian(dev, ncs[0].peer, false);
-err:
+    while (--j >= 0) {
+        vhost_net_set_vnet_endian(dev, ncs[j].peer, false);
+    }
     return r;
 }
 
-- 
1.9.1

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

* [Qemu-devel] [PATCH 18/35] ehci: update irq on reset
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (16 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 17/35] net: set endianness on all backend devices Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 19/35] block/raw-posix: avoid bogus fixup for cylinders on DASD disks Michael Roth
                   ` (18 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Roth, qemu-stable, Gerd Hoffmann

From: Gerd Hoffmann <kraxel@redhat.com>

After clearing the status register we also have to update the irq line
status.  Otherwise a irq which happends to be pending at reset time
causes a interrupt storm.  And the guest can't stop as the status
register doesn't indicate any pending interrupt.

Both NetBSD and FreeBSD hang on shutdown because of that.

Cc: qemu-stable@nongnu.org
Reported-by: Andrey Korolyov <andrey@xdel.ru>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 1453203884-4125-1-git-send-email-kraxel@redhat.com
(cherry picked from commit 5a8660741a8aa19fbf8a5e8a2b3aac88664f4e66)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/usb/hcd-ehci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index d07f228..d2b7fa2 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -865,6 +865,7 @@ void ehci_reset(void *opaque)
     s->usbsts = USBSTS_HALT;
     s->usbsts_pending = 0;
     s->usbsts_frindex = 0;
+    ehci_update_irq(s);
 
     s->astate = EST_INACTIVE;
     s->pstate = EST_INACTIVE;
-- 
1.9.1

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

* [Qemu-devel] [PATCH 19/35] block/raw-posix: avoid bogus fixup for cylinders on DASD disks
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (17 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 18/35] ehci: update irq on reset Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 20/35] s390x/ioinst: set type and len for SEI response Michael Roth
                   ` (17 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Christian Borntraeger, qemu-stable, Michael Roth

From: Christian Borntraeger <borntraeger@de.ibm.com>

large volume DASD that have > 64k cylinders do claim to have
0xFFFE cylinders as special value in the old 16 bit field. We
want to pass this "token" along to the guest, instead of
calculating the real number. Otherwise qemu might fail with
"cyls must be between 1 and 65535"

Cc: qemu-stable@nongnu.org
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 972b543c6b63579aee590b738d21af09f01569f7)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 block/raw-posix.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/block/raw-posix.c b/block/raw-posix.c
index d9162fd..2fff184 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -783,7 +783,6 @@ static int hdev_probe_geometry(BlockDriverState *bs, HDGeometry *geo)
 {
     BDRVRawState *s = bs->opaque;
     struct hd_geometry ioctl_geo = {0};
-    uint32_t blksize;
 
     /* If DASD, get its geometry */
     if (check_for_dasd(s->fd) < 0) {
@@ -803,12 +802,6 @@ static int hdev_probe_geometry(BlockDriverState *bs, HDGeometry *geo)
     }
     geo->heads = ioctl_geo.heads;
     geo->sectors = ioctl_geo.sectors;
-    if (!probe_physical_blocksize(s->fd, &blksize)) {
-        /* overwrite cyls: HDIO_GETGEO result is incorrect for big drives */
-        geo->cylinders = bdrv_nb_sectors(bs) / (blksize / BDRV_SECTOR_SIZE)
-                                             / (geo->heads * geo->sectors);
-        return 0;
-    }
     geo->cylinders = ioctl_geo.cylinders;
 
     return 0;
-- 
1.9.1

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

* [Qemu-devel] [PATCH 20/35] s390x/ioinst: set type and len for SEI response
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (18 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 19/35] block/raw-posix: avoid bogus fixup for cylinders on DASD disks Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 21/35] s390x/css: fix control flags during csch Michael Roth
                   ` (16 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Cornelia Huck, Pierre Morel, qemu-stable, Michael Roth

From: Pierre Morel <pmorel@linux.vnet.ibm.com>

If no event information is pending, the return code
is set to 0x0005 and the length of the response is
set to 8 bytes.

Signed-off-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Song Shan Gong <gongss@linux.vnet.ibm.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
(cherry picked from commit f70202be535b5601fd02c725dc1d74f3bfc5039c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 target-s390x/ioinst.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target-s390x/ioinst.c b/target-s390x/ioinst.c
index 77f2a1f..57c2d8b 100644
--- a/target-s390x/ioinst.c
+++ b/target-s390x/ioinst.c
@@ -616,7 +616,8 @@ static void ioinst_handle_chsc_sei(ChscReq *req, ChscResp *res)
             (*res_flags) &= ~0x80;
         }
     } else {
-        res->code = cpu_to_be16(0x0004);
+        res->code = cpu_to_be16(0x0005);
+        res->len = cpu_to_be16(CHSC_MIN_RESP_LEN);
     }
 }
 
-- 
1.9.1

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

* [Qemu-devel] [PATCH 21/35] s390x/css: fix control flags during csch
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (19 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 20/35] s390x/ioinst: set type and len for SEI response Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 22/35] fw_cfg: avoid calculating invalid current entry pointer Michael Roth
                   ` (15 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Cornelia Huck, Halil Pasic, qemu-stable, Michael Roth

From: Halil Pasic <pasic@linux.vnet.ibm.com>

>From the beginning, css support contained an error in csch handling:
instead of setting the clear bit in the function control bits twice, we
need to set the clear pending bit in the activity control bits. Let's
fix this.

Cc: qemu-stable@nongnu.org
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Halil Pasic <pasic@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
(cherry picked from commit 4c6bf79a222934ac9ff0e45fc98ea1c986ed5c67)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/s390x/css.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/s390x/css.c b/hw/s390x/css.c
index 19851ce..c6ca8be 100644
--- a/hw/s390x/css.c
+++ b/hw/s390x/css.c
@@ -701,7 +701,7 @@ int css_do_csch(SubchDev *sch)
 
     /* Trigger the clear function. */
     s->ctrl &= ~(SCSW_CTRL_MASK_FCTL | SCSW_CTRL_MASK_ACTL);
-    s->ctrl |= SCSW_FCTL_CLEAR_FUNC | SCSW_FCTL_CLEAR_FUNC;
+    s->ctrl |= SCSW_FCTL_CLEAR_FUNC | SCSW_ACTL_CLEAR_PEND;
 
     do_subchannel_work(sch, NULL);
     ret = 0;
-- 
1.9.1

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

* [Qemu-devel] [PATCH 22/35] fw_cfg: avoid calculating invalid current entry pointer
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (20 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 21/35] s390x/css: fix control flags during csch Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 23/35] cpus: use broadcast on qemu_pause_cond Michael Roth
                   ` (14 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael Roth, Gabriel L. Somlo, qemu-stable, Marc Marí,
	Gerd Hoffmann

From: "Gabriel L. Somlo" <somlo@cmu.edu>

When calculating a pointer to the currently selected fw_cfg item, the
following is used:

  FWCfgEntry *e = &s->entries[arch][s->cur_entry & FW_CFG_ENTRY_MASK];

When s->cur_entry is FW_CFG_INVALID, we are calculating the address of
a non-existent element in s->entries[arch][...], which is undefined.

This patch ensures the resulting entry pointer is set to NULL whenever
s->cur_entry is FW_CFG_INVALID.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
Message-id: 1446733972-1602-5-git-send-email-somlo@cmu.edu
Cc: Marc Marí <markmb@redhat.com>
Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 66f8fd9dda312191b78d2a2ba2848bcee76127a2)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/nvram/fw_cfg.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 73b0a81..117809b 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -270,7 +270,8 @@ static int fw_cfg_select(FWCfgState *s, uint16_t key)
 static uint8_t fw_cfg_read(FWCfgState *s)
 {
     int arch = !!(s->cur_entry & FW_CFG_ARCH_LOCAL);
-    FWCfgEntry *e = &s->entries[arch][s->cur_entry & FW_CFG_ENTRY_MASK];
+    FWCfgEntry *e = (s->cur_entry == FW_CFG_INVALID) ? NULL :
+                    &s->entries[arch][s->cur_entry & FW_CFG_ENTRY_MASK];
     uint8_t ret;
 
     if (s->cur_entry == FW_CFG_INVALID || !e->data || s->cur_offset >= e->len)
@@ -338,7 +339,8 @@ static void fw_cfg_dma_transfer(FWCfgState *s)
     }
 
     arch = !!(s->cur_entry & FW_CFG_ARCH_LOCAL);
-    e = &s->entries[arch][s->cur_entry & FW_CFG_ENTRY_MASK];
+    e = (s->cur_entry == FW_CFG_INVALID) ? NULL :
+        &s->entries[arch][s->cur_entry & FW_CFG_ENTRY_MASK];
 
     if (dma.control & FW_CFG_DMA_CTL_READ) {
         read = 1;
-- 
1.9.1

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

* [Qemu-devel] [PATCH 23/35] cpus: use broadcast on qemu_pause_cond
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (21 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 22/35] fw_cfg: avoid calculating invalid current entry pointer Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 24/35] qmp: Fix reference-counting of qnull on empty output visit Michael Roth
                   ` (13 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael Roth, Paolo Bonzini, qemu-stable, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

Jiri saw a hang on pause_all_vcpus called from postcopy_start,
where the cpus are all apparently stopped ('stopped' flag set)
but pause_all_vcpus is still stuck on a cond_wait on qemu_paused_cond.
We suspect this is happening if a qmp_stop is called at about the
same time as the postcopy code calls that pause_all_vcpus;
although they both should have the main lock held, Paolo spotted
the cond_wait unlocks the global lock so perhaps they both
could end up waiting at the same time?

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reported-by: Jiri Denemark <jdenemar@redhat.com>
Message-Id: <1453716498-27238-1-git-send-email-dgilbert@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 96bce6831bd19b61e965384427741d805c7234c3)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 cpus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cpus.c b/cpus.c
index 43676fa..747f14d 100644
--- a/cpus.c
+++ b/cpus.c
@@ -986,7 +986,7 @@ static void qemu_wait_io_event_common(CPUState *cpu)
     if (cpu->stop) {
         cpu->stop = false;
         cpu->stopped = true;
-        qemu_cond_signal(&qemu_pause_cond);
+        qemu_cond_broadcast(&qemu_pause_cond);
     }
     flush_queued_work(cpu);
     cpu->thread_kicked = false;
@@ -1387,7 +1387,7 @@ void cpu_stop_current(void)
         current_cpu->stop = false;
         current_cpu->stopped = true;
         cpu_exit(current_cpu);
-        qemu_cond_signal(&qemu_pause_cond);
+        qemu_cond_broadcast(&qemu_pause_cond);
     }
 }
 
-- 
1.9.1

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

* [Qemu-devel] [PATCH 24/35] qmp: Fix reference-counting of qnull on empty output visit
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (22 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 23/35] cpus: use broadcast on qemu_pause_cond Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 25/35] block: set device_list.tqe_prev to NULL on BDS removal Michael Roth
                   ` (12 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Roth, qemu-stable, Markus Armbruster

From: Eric Blake <eblake@redhat.com>

Commit 6c2f9a15 ensured that we would not return NULL when the
caller used an output visitor but had nothing to visit. But
in doing so, it added a FIXME about a reference count leak
that could abort qemu in the (unlikely) case of SIZE_MAX such
visits (more plausible on 32-bit).  (Although that commit
suggested we might fix it in time for 2.5, we ran out of time;
fortunately, it is unlikely enough to bite that it was not
worth worrying about during the 2.5 release.)

This fixes things by documenting the internal contracts, and
explaining why the internal function can return NULL and only
the public facing interface needs to worry about qnull(),
thus avoiding over-referencing the qnull_ global object.

It does not, however, fix the stupidity of the stack mixing
up two separate pieces of information; add a FIXME to explain
that issue, which will be fixed shortly in a future patch.

Signed-off-by: Eric Blake <eblake@redhat.com>
Cc: qemu-stable@nongnu.org
Message-Id: <1454075341-13658-25-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
(cherry picked from commit a86156401559cb4401cf9ecc704faeab6fc8bb19)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qapi/qmp-output-visitor.c       | 41 ++++++++++++++++++++++++++++++++++-------
 tests/test-qmp-output-visitor.c |  2 ++
 2 files changed, 36 insertions(+), 7 deletions(-)

diff --git a/qapi/qmp-output-visitor.c b/qapi/qmp-output-visitor.c
index 29899ac..43cfebf 100644
--- a/qapi/qmp-output-visitor.c
+++ b/qapi/qmp-output-visitor.c
@@ -29,6 +29,15 @@ typedef QTAILQ_HEAD(QStack, QStackEntry) QStack;
 struct QmpOutputVisitor
 {
     Visitor visitor;
+    /* FIXME: we are abusing stack to hold two separate pieces of
+     * information: the current root object in slot 0, and the stack
+     * of N objects still being built in slots 1 through N (for N+1
+     * slots in use).  Worse, our behavior is inconsistent:
+     * qmp_output_add_obj() visiting two top-level scalars in a row
+     * discards the first in favor of the second, but visiting two
+     * top-level objects in a row tries to append the second object
+     * into the first (since the first object was placed in the stack
+     * in both slot 0 and 1, but only popped from slot 1).  */
     QStack stack;
 };
 
@@ -41,10 +50,12 @@ static QmpOutputVisitor *to_qov(Visitor *v)
     return container_of(v, QmpOutputVisitor, visitor);
 }
 
+/* Push @value onto the stack of current QObjects being built */
 static void qmp_output_push_obj(QmpOutputVisitor *qov, QObject *value)
 {
     QStackEntry *e = g_malloc0(sizeof(*e));
 
+    assert(value);
     e->value = value;
     if (qobject_type(e->value) == QTYPE_QLIST) {
         e->is_list_head = true;
@@ -52,44 +63,53 @@ static void qmp_output_push_obj(QmpOutputVisitor *qov, QObject *value)
     QTAILQ_INSERT_HEAD(&qov->stack, e, node);
 }
 
+/* Pop a value off the stack of QObjects being built, and return it. */
 static QObject *qmp_output_pop(QmpOutputVisitor *qov)
 {
     QStackEntry *e = QTAILQ_FIRST(&qov->stack);
     QObject *value;
+
+    assert(e);
     QTAILQ_REMOVE(&qov->stack, e, node);
     value = e->value;
+    assert(value);
     g_free(e);
     return value;
 }
 
+/* Grab the root QObject, if any */
 static QObject *qmp_output_first(QmpOutputVisitor *qov)
 {
     QStackEntry *e = QTAILQ_LAST(&qov->stack, QStack);
 
-    /*
-     * FIXME Wrong, because qmp_output_get_qobject() will increment
-     * the refcnt *again*.  We need to think through how visitors
-     * handle null.
-     */
     if (!e) {
-        return qnull();
+        /* No root */
+        return NULL;
     }
-
+    assert(e->value);
     return e->value;
 }
 
+/* Peek at the top of the stack of QObjects being built.
+ * The stack must not be empty. */
 static QObject *qmp_output_last(QmpOutputVisitor *qov)
 {
     QStackEntry *e = QTAILQ_FIRST(&qov->stack);
+
+    assert(e && e->value);
     return e->value;
 }
 
+/* Add @value to the current QObject being built.
+ * If the stack is visiting a dictionary or list, @value is now owned
+ * by that container. Otherwise, @value is now the root.  */
 static void qmp_output_add_obj(QmpOutputVisitor *qov, const char *name,
                                QObject *value)
 {
     QObject *cur;
 
     if (QTAILQ_EMPTY(&qov->stack)) {
+        /* Stack was empty, track this object as root */
         qmp_output_push_obj(qov, value);
         return;
     }
@@ -98,13 +118,17 @@ static void qmp_output_add_obj(QmpOutputVisitor *qov, const char *name,
 
     switch (qobject_type(cur)) {
     case QTYPE_QDICT:
+        assert(name);
         qdict_put_obj(qobject_to_qdict(cur), name, value);
         break;
     case QTYPE_QLIST:
         qlist_append_obj(qobject_to_qlist(cur), value);
         break;
     default:
+        /* The previous root was a scalar, replace it with a new root */
+        /* FIXME this is abusing the stack; see comment above */
         qobject_decref(qmp_output_pop(qov));
+        assert(QTAILQ_EMPTY(&qov->stack));
         qmp_output_push_obj(qov, value);
         break;
     }
@@ -198,11 +222,14 @@ static void qmp_output_type_any(Visitor *v, QObject **obj, const char *name,
     qmp_output_add_obj(qov, name, *obj);
 }
 
+/* Finish building, and return the root object. Will not be NULL. */
 QObject *qmp_output_get_qobject(QmpOutputVisitor *qov)
 {
     QObject *obj = qmp_output_first(qov);
     if (obj) {
         qobject_incref(obj);
+    } else {
+        obj = qnull();
     }
     return obj;
 }
diff --git a/tests/test-qmp-output-visitor.c b/tests/test-qmp-output-visitor.c
index 0d0c859..5609bb8 100644
--- a/tests/test-qmp-output-visitor.c
+++ b/tests/test-qmp-output-visitor.c
@@ -461,6 +461,8 @@ static void test_visitor_out_empty(TestOutputVisitorData *data,
 
     arg = qmp_output_get_qobject(data->qov);
     g_assert(qobject_type(arg) == QTYPE_QNULL);
+    /* Check that qnull reference counting is sane */
+    g_assert(arg->refcnt == 2);
     qobject_decref(arg);
 }
 
-- 
1.9.1

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

* [Qemu-devel] [PATCH 25/35] block: set device_list.tqe_prev to NULL on BDS removal
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (23 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 24/35] qmp: Fix reference-counting of qnull on empty output visit Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 26/35] block: qemu-iotests - add test for snapshot, commit, snapshot bug Michael Roth
                   ` (11 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Roth, Jeff Cody, qemu-stable, Max Reitz

From: Jeff Cody <jcody@redhat.com>

This fixes a regression introduced with commit 3f09bfbc7.  Multiple
bugs arise in conjunction with live snapshots and mirroring operations
(which include active layer commit).

After a live snapshot occurs, the active layer and the base layer both
have a non-NULL tqe_prev field in the device_list, although the base
node's tqe_prev field points to a NULL entry.  This non-NULL tqe_prev
field occurs after the bdrv_append() in the external snapshot calls
change_parent_backing_link().

In change_parent_backing_link(), when the previous active layer is
removed from device_list, the device_list.tqe_prev pointer is not
set to NULL.

The operating scheme in the block layer is to indicate that a BDS belongs
in the bdrv_states device_list iff the device_list.tqe_prev pointer
is non-NULL.

This patch does two things:

1.) Introduces a new block layer helper bdrv_device_remove() to remove a
    BDS from the device_list, and
2.) uses that new API, which also fixes the regression once used in
    change_parent_backing_link().

Signed-off-by: Jeff Cody <jcody@redhat.com>
Message-id: 0cd51e11c0666c04ddb7c05293fe94afeb551e89.1454376655.git.jcody@redhat.com
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
(cherry picked from commit f8aa905a4fec89863c82de4186352447d851871e)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 block.c               | 24 ++++++++++++++----------
 blockdev.c            |  3 +--
 include/block/block.h |  1 +
 3 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/block.c b/block.c
index 3a7324b..3c172dd 100644
--- a/block.c
+++ b/block.c
@@ -1976,21 +1976,25 @@ void bdrv_close_all(void)
     }
 }
 
+/* Note that bs->device_list.tqe_prev is initially null,
+ * and gets set to non-null by QTAILQ_INSERT_TAIL().  Establish
+ * the useful invariant "bs in bdrv_states iff bs->tqe_prev" by
+ * resetting it to null on remove.  */
+void bdrv_device_remove(BlockDriverState *bs)
+{
+    QTAILQ_REMOVE(&bdrv_states, bs, device_list);
+    bs->device_list.tqe_prev = NULL;
+}
+
 /* make a BlockDriverState anonymous by removing from bdrv_state and
  * graph_bdrv_state list.
    Also, NULL terminate the device_name to prevent double remove */
 void bdrv_make_anon(BlockDriverState *bs)
 {
-    /*
-     * Take care to remove bs from bdrv_states only when it's actually
-     * in it.  Note that bs->device_list.tqe_prev is initially null,
-     * and gets set to non-null by QTAILQ_INSERT_TAIL().  Establish
-     * the useful invariant "bs in bdrv_states iff bs->tqe_prev" by
-     * resetting it to null on remove.
-     */
+    /* Take care to remove bs from bdrv_states only when it's actually
+     * in it. */
     if (bs->device_list.tqe_prev) {
-        QTAILQ_REMOVE(&bdrv_states, bs, device_list);
-        bs->device_list.tqe_prev = NULL;
+        bdrv_device_remove(bs);
     }
     if (bs->node_name[0] != '\0') {
         QTAILQ_REMOVE(&graph_bdrv_states, bs, node_list);
@@ -2031,7 +2035,7 @@ static void change_parent_backing_link(BlockDriverState *from,
         if (!to->device_list.tqe_prev) {
             QTAILQ_INSERT_BEFORE(from, to, device_list);
         }
-        QTAILQ_REMOVE(&bdrv_states, from, device_list);
+        bdrv_device_remove(from);
     }
 }
 
diff --git a/blockdev.c b/blockdev.c
index 7c81f48..e20e0c1 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2394,8 +2394,7 @@ void qmp_x_blockdev_remove_medium(const char *device, Error **errp)
 
     /* This follows the convention established by bdrv_make_anon() */
     if (bs->device_list.tqe_prev) {
-        QTAILQ_REMOVE(&bdrv_states, bs, device_list);
-        bs->device_list.tqe_prev = NULL;
+        bdrv_device_remove(bs);
     }
 
     blk_remove_bs(blk);
diff --git a/include/block/block.h b/include/block/block.h
index 3477328..d83d420 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -196,6 +196,7 @@ int bdrv_create(BlockDriver *drv, const char* filename,
 int bdrv_create_file(const char *filename, QemuOpts *opts, Error **errp);
 BlockDriverState *bdrv_new_root(void);
 BlockDriverState *bdrv_new(void);
+void bdrv_device_remove(BlockDriverState *bs);
 void bdrv_make_anon(BlockDriverState *bs);
 void bdrv_swap(BlockDriverState *bs_new, BlockDriverState *bs_old);
 void bdrv_append(BlockDriverState *bs_new, BlockDriverState *bs_top);
-- 
1.9.1

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

* [Qemu-devel] [PATCH 26/35] block: qemu-iotests - add test for snapshot, commit, snapshot bug
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (24 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 25/35] block: set device_list.tqe_prev to NULL on BDS removal Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 27/35] e1000: eliminate infinite loops on out-of-bounds transfer start Michael Roth
                   ` (10 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Roth, Jeff Cody, qemu-stable, Max Reitz

From: Jeff Cody <jcody@redhat.com>

Signed-off-by: Jeff Cody <jcody@redhat.com>
Message-id: 2dbc05efba2f683cb3aaf71aaa9b776ebf7ec57c.1454376655.git.jcody@redhat.com
Reviewed-by: Max Reitz <mreitz@redhat.com>
[Moved test number from 143 to 144]
Signed-off-by: Max Reitz <mreitz@redhat.com>

(cherry picked from commit 8983b670f62ab5e5e8dd2690bf8304123651bfe5)

Conflicts:
	tests/qemu-iotests/group

*removed context dependencies on newer test groups

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 tests/qemu-iotests/144     | 114 +++++++++++++++++++++++++++++++++++++++++++++
 tests/qemu-iotests/144.out |  24 ++++++++++
 tests/qemu-iotests/group   |   1 +
 3 files changed, 139 insertions(+)
 create mode 100755 tests/qemu-iotests/144
 create mode 100644 tests/qemu-iotests/144.out

diff --git a/tests/qemu-iotests/144 b/tests/qemu-iotests/144
new file mode 100755
index 0000000..00de3c3
--- /dev/null
+++ b/tests/qemu-iotests/144
@@ -0,0 +1,114 @@
+#!/bin/bash
+# Check live snapshot, followed by active commit, and another snapshot.
+#
+# This test is to catch the error case of BZ #1300209:
+# https://bugzilla.redhat.com/show_bug.cgi?id=1300209
+#
+# Copyright (C) 2016 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+# creator
+owner=jcody@redhat.com
+
+seq=`basename $0`
+echo "QA output created by $seq"
+
+here=`pwd`
+status=1	# failure is the default!
+
+TMP_SNAP1=${TEST_DIR}/tmp.qcow2
+TMP_SNAP2=${TEST_DIR}/tmp2.qcow2
+
+_cleanup()
+{
+    _cleanup_qemu
+    rm -f "${TEST_IMG}" "${TMP_SNAP1}" "${TMP_SNAP2}"
+}
+
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./common.filter
+. ./common.qemu
+
+_supported_fmt qcow2
+_supported_proto file
+_supported_os Linux
+
+size=512M
+
+_make_test_img $size
+
+echo
+echo === Launching QEMU ===
+echo
+
+qemu_comm_method="qmp"
+_launch_qemu -drive file="${TEST_IMG}",if=virtio
+h=$QEMU_HANDLE
+
+
+echo
+echo === Performing Live Snapshot 1 ===
+echo
+
+_send_qemu_cmd $h "{ 'execute': 'qmp_capabilities' }" "return"
+
+
+# First live snapshot, new overlay as active layer
+_send_qemu_cmd $h "{ 'execute': 'blockdev-snapshot-sync',
+                                'arguments': {
+                                             'device': 'virtio0',
+                                             'snapshot-file':'${TMP_SNAP1}',
+                                             'format': 'qcow2'
+                                             }
+                    }" "return"
+
+echo
+echo === Performing block-commit on active layer ===
+echo
+
+# Block commit on active layer, push the new overlay into base
+_send_qemu_cmd $h "{ 'execute': 'block-commit',
+                                'arguments': {
+                                                 'device': 'virtio0'
+                                              }
+                    }" "READY"
+
+_send_qemu_cmd $h "{ 'execute': 'block-job-complete',
+                                'arguments': {
+                                                'device': 'virtio0'
+                                              }
+                   }" "COMPLETED"
+
+echo
+echo === Performing Live Snapshot 2 ===
+echo
+
+# New live snapshot, new overlays as active layer
+_send_qemu_cmd $h "{ 'execute': 'blockdev-snapshot-sync',
+                                'arguments': {
+                                                'device': 'virtio0',
+                                                'snapshot-file':'${TMP_SNAP2}',
+                                                'format': 'qcow2'
+                                              }
+                   }" "return"
+
+# success, all done
+echo "*** done"
+rm -f $seq.full
+status=0
diff --git a/tests/qemu-iotests/144.out b/tests/qemu-iotests/144.out
new file mode 100644
index 0000000..410d741
--- /dev/null
+++ b/tests/qemu-iotests/144.out
@@ -0,0 +1,24 @@
+QA output created by 144
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=536870912
+
+=== Launching QEMU ===
+
+
+=== Performing Live Snapshot 1 ===
+
+{"return": {}}
+Formatting 'TEST_DIR/tmp.qcow2', fmt=qcow2 size=536870912 backing_file=TEST_DIR/t.qcow2 backing_fmt=qcow2 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
+{"return": {}}
+
+=== Performing block-commit on active layer ===
+
+{"return": {}}
+{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_READY", "data": {"device": "virtio0", "len": 0, "offset": 0, "speed": 0, "type": "commit"}}
+{"return": {}}
+{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "virtio0", "len": 0, "offset": 0, "speed": 0, "type": "commit"}}
+
+=== Performing Live Snapshot 2 ===
+
+Formatting 'TEST_DIR/tmp2.qcow2', fmt=qcow2 size=536870912 backing_file=TEST_DIR/t.qcow2 backing_fmt=qcow2 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
+{"return": {}}
+*** done
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index 5a08808..d90629f 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -140,3 +140,4 @@
 137 rw auto
 138 rw auto quick
 139 rw auto quick
+144 rw auto quick
-- 
1.9.1

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

* [Qemu-devel] [PATCH 27/35] e1000: eliminate infinite loops on out-of-bounds transfer start
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (25 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 26/35] block: qemu-iotests - add test for snapshot, commit, snapshot bug Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 28/35] spapr: skip configuration section during migration of older machines Michael Roth
                   ` (9 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Petr Matousek, Michael Roth, Stefano Stabellini, Jason Wang,
	Michael S. Tsirkin, qemu-stable, Prasad Pandit, Laszlo Ersek

From: Laszlo Ersek <lersek@redhat.com>

The start_xmit() and e1000_receive_iov() functions implement DMA transfers
iterating over a set of descriptors that the guest's e1000 driver
prepares:

- the TDLEN and RDLEN registers store the total size of the descriptor
  area,

- while the TDH and RDH registers store the offset (in whole tx / rx
  descriptors) into the area where the transfer is supposed to start.

Each time a descriptor is processed, the TDH and RDH register is bumped
(as appropriate for the transfer direction).

QEMU already contains logic to deal with bogus transfers submitted by the
guest:

- Normally, the transmit case wants to increase TDH from its initial value
  to TDT. (TDT is allowed to be numerically smaller than the initial TDH
  value; wrapping at or above TDLEN bytes to zero is normal.) The failsafe
  that QEMU currently has here is a check against reaching the original
  TDH value again -- a complete wraparound, which should never happen.

- In the receive case RDH is increased from its initial value until
  "total_size" bytes have been received; preferably in a single step, or
  in "s->rxbuf_size" byte steps, if the latter is smaller. However, null
  RX descriptors are skipped without receiving data, while RDH is
  incremented just the same. QEMU tries to prevent an infinite loop
  (processing only null RX descriptors) by detecting whether RDH assumes
  its original value during the loop. (Again, wrapping from RDLEN to 0 is
  normal.)

What both directions miss is that the guest could program TDLEN and RDLEN
so low, and the initial TDH and RDH so high, that these registers will
immediately be truncated to zero, and then never reassume their initial
values in the loop -- a full wraparound will never occur.

The condition that expresses this is:

  xdh_start >= s->mac_reg[XDLEN] / sizeof(desc)

i.e., TDH or RDH start out after the last whole rx or tx descriptor that
fits into the TDLEN or RDLEN sized area.

This condition could be checked before we enter the loops, but
pci_dma_read() / pci_dma_write() knows how to fill in buffers safely for
bogus DMA addresses, so we just extend the existing failsafes with the
above condition.

This is CVE-2016-1981.

Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Petr Matousek <pmatouse@redhat.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Prasad Pandit <ppandit@redhat.com>
Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: Jason Wang <jasowang@redhat.com>
Cc: qemu-stable@nongnu.org
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1296044
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit dd793a74882477ca38d49e191110c17dfee51dcc)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/net/e1000.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index bec06e9..34d0823 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -908,7 +908,8 @@ start_xmit(E1000State *s)
          * bogus values to TDT/TDLEN.
          * there's nothing too intelligent we could do about this.
          */
-        if (s->mac_reg[TDH] == tdh_start) {
+        if (s->mac_reg[TDH] == tdh_start ||
+            tdh_start >= s->mac_reg[TDLEN] / sizeof(desc)) {
             DBGOUT(TXERR, "TDH wraparound @%x, TDT %x, TDLEN %x\n",
                    tdh_start, s->mac_reg[TDT], s->mac_reg[TDLEN]);
             break;
@@ -1165,7 +1166,8 @@ e1000_receive_iov(NetClientState *nc, const struct iovec *iov, int iovcnt)
         if (++s->mac_reg[RDH] * sizeof(desc) >= s->mac_reg[RDLEN])
             s->mac_reg[RDH] = 0;
         /* see comment in start_xmit; same here */
-        if (s->mac_reg[RDH] == rdh_start) {
+        if (s->mac_reg[RDH] == rdh_start ||
+            rdh_start >= s->mac_reg[RDLEN] / sizeof(desc)) {
             DBGOUT(RXERR, "RDH wraparound @%x, RDT %x, RDLEN %x\n",
                    rdh_start, s->mac_reg[RDT], s->mac_reg[RDLEN]);
             set_ics(s, 0, E1000_ICS_RXO);
-- 
1.9.1

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

* [Qemu-devel] [PATCH 28/35] spapr: skip configuration section during migration of older machines
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (26 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 27/35] e1000: eliminate infinite loops on out-of-bounds transfer start Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-22  7:49   ` [Qemu-devel] [Qemu-stable] " Greg Kurz
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 29/35] hw/virtio: fix double use of a virtio flag Michael Roth
                   ` (8 subsequent siblings)
  36 siblings, 1 reply; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Roth, David Gibson, qemu-stable, Greg Kurz

From: Greg Kurz <gkurz@linux.vnet.ibm.com>

Since QEMU 2.4, we have a configuration section in the migration stream.
This must be skipped for older machines, like it is already done for x86.

This patch fixes the migration of pseries-2.3 from/to QEMU 2.3, but it
breaks migration of the same machine from/to QEMU 2.4/2.4.1/2.5. We do
that anyway because QEMU 2.3 is likely to be more widely deployed than
newer QEMU versions.

Fixes: 61964c23e5ddd5a33f15699e45ce126f879e3e33
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
(cherry picked from commit 09b5e30da5b19f44768a5429f603caaede216757)

Conflicts:
	hw/ppc/spapr.c

*remove dep on 5013c5474

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/ppc/spapr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 6bfb908..ff1537a 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2327,6 +2327,7 @@ static void spapr_compat_2_3(Object *obj)
 {
     savevm_skip_section_footers();
     global_state_set_optional();
+    savevm_skip_configuration();
 }
 
 static void spapr_compat_2_2(Object *obj)
-- 
1.9.1

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

* [Qemu-devel] [PATCH 29/35] hw/virtio: fix double use of a virtio flag
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (27 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 28/35] spapr: skip configuration section during migration of older machines Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 30/35] hw/virtio: group virtio flags into an enum Michael Roth
                   ` (7 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marcel Apfelbaum, Michael Roth, qemu-stable, Michael S. Tsirkin

From: Marcel Apfelbaum <marcel@redhat.com>

Commits 1811e64c and a6df8adf use the same virtio feature bit 4
for different features.

Fix it by using different bits.

Reported-by: Laurent Vivier <lvivier@redhat.com>
Tested-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 631a4387554d53a0d19dd7973851ed760a5bff97)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-pci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h
index a104ff2..8e69365 100644
--- a/hw/virtio/virtio-pci.h
+++ b/hw/virtio/virtio-pci.h
@@ -72,7 +72,7 @@ typedef struct VirtioBusClass VirtioPCIBusClass;
 /* virtio version flags */
 #define VIRTIO_PCI_FLAG_DISABLE_LEGACY_BIT 2
 #define VIRTIO_PCI_FLAG_DISABLE_MODERN_BIT 3
-#define VIRTIO_PCI_FLAG_DISABLE_PCIE_BIT 4
+#define VIRTIO_PCI_FLAG_DISABLE_PCIE_BIT 6
 #define VIRTIO_PCI_FLAG_DISABLE_LEGACY (1 << VIRTIO_PCI_FLAG_DISABLE_LEGACY_BIT)
 #define VIRTIO_PCI_FLAG_DISABLE_MODERN (1 << VIRTIO_PCI_FLAG_DISABLE_MODERN_BIT)
 #define VIRTIO_PCI_FLAG_DISABLE_PCIE (1 << VIRTIO_PCI_FLAG_DISABLE_PCIE_BIT)
-- 
1.9.1

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

* [Qemu-devel] [PATCH 30/35] hw/virtio: group virtio flags into an enum
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (28 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 29/35] hw/virtio: fix double use of a virtio flag Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 31/35] fw_cfg: unbreak migration compatibility for 2.4 and earlier machines Michael Roth
                   ` (6 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marcel Apfelbaum, Michael Roth, qemu-stable, Michael S. Tsirkin

From: Marcel Apfelbaum <marcel@redhat.com>

Minimizes the possibility to assign
the same bit to different features.

Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit fc1769b758a5b6167bb9cdb4e10369a49b4fa930)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/virtio-pci.h | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h
index 8e69365..c8f9cfd 100644
--- a/hw/virtio/virtio-pci.h
+++ b/hw/virtio/virtio-pci.h
@@ -59,30 +59,33 @@ typedef struct VirtioBusClass VirtioPCIBusClass;
 #define VIRTIO_PCI_BUS_CLASS(klass) \
         OBJECT_CLASS_CHECK(VirtioPCIBusClass, klass, TYPE_VIRTIO_PCI_BUS)
 
+enum {
+    VIRTIO_PCI_FLAG_BUS_MASTER_BUG_MIGRATION_BIT,
+    VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT,
+    VIRTIO_PCI_FLAG_DISABLE_LEGACY_BIT,
+    VIRTIO_PCI_FLAG_DISABLE_MODERN_BIT,
+    VIRTIO_PCI_FLAG_MIGRATE_EXTRA_BIT,
+    VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY_BIT,
+    VIRTIO_PCI_FLAG_DISABLE_PCIE_BIT,
+};
+
 /* Need to activate work-arounds for buggy guests at vmstate load. */
-#define VIRTIO_PCI_FLAG_BUS_MASTER_BUG_MIGRATION_BIT  0
 #define VIRTIO_PCI_FLAG_BUS_MASTER_BUG_MIGRATION \
     (1 << VIRTIO_PCI_FLAG_BUS_MASTER_BUG_MIGRATION_BIT)
 
 /* Performance improves when virtqueue kick processing is decoupled from the
  * vcpu thread using ioeventfd for some devices. */
-#define VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT 1
 #define VIRTIO_PCI_FLAG_USE_IOEVENTFD   (1 << VIRTIO_PCI_FLAG_USE_IOEVENTFD_BIT)
 
 /* virtio version flags */
-#define VIRTIO_PCI_FLAG_DISABLE_LEGACY_BIT 2
-#define VIRTIO_PCI_FLAG_DISABLE_MODERN_BIT 3
-#define VIRTIO_PCI_FLAG_DISABLE_PCIE_BIT 6
 #define VIRTIO_PCI_FLAG_DISABLE_LEGACY (1 << VIRTIO_PCI_FLAG_DISABLE_LEGACY_BIT)
 #define VIRTIO_PCI_FLAG_DISABLE_MODERN (1 << VIRTIO_PCI_FLAG_DISABLE_MODERN_BIT)
 #define VIRTIO_PCI_FLAG_DISABLE_PCIE (1 << VIRTIO_PCI_FLAG_DISABLE_PCIE_BIT)
 
 /* migrate extra state */
-#define VIRTIO_PCI_FLAG_MIGRATE_EXTRA_BIT 4
 #define VIRTIO_PCI_FLAG_MIGRATE_EXTRA (1 << VIRTIO_PCI_FLAG_MIGRATE_EXTRA_BIT)
 
 /* have pio notification for modern device ? */
-#define VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY_BIT 5
 #define VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY \
     (1 << VIRTIO_PCI_FLAG_MODERN_PIO_NOTIFY_BIT)
 
-- 
1.9.1

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

* [Qemu-devel] [PATCH 31/35] fw_cfg: unbreak migration compatibility for 2.4 and earlier machines
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (29 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 30/35] hw/virtio: group virtio flags into an enum Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 32/35] vhost-user: don't merge regions with different fds Michael Roth
                   ` (5 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael Roth, Alexandre DERUMIER, qemu-stable, Gerd Hoffmann,
	Marc Marí,
	Laszlo Ersek

From: Laszlo Ersek <lersek@redhat.com>

When I reviewed Marc's fw_cfg DMA patches, I completely missed that the
way we set dma_enabled would break migration.

Gerd explained the right way (see reference below): dma_enabled should be
set to true by default, and only true->false transitions should be
possible:

- when the user requests that with

    -global fw_cfg_mem.dma_enabled=off

  or

   -global fw_cfg_io.dma_enabled=off

  as appropriate for the platform,

- when HW_COMPAT_2_4 dictates it,

- when board code initializes fw_cfg without requesting DMA support.

Cc: Marc Marí <markmb@redhat.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Alexandre DERUMIER <aderumier@odiso.com>
Cc: qemu-stable@nongnu.org
Ref: http://thread.gmane.org/gmane.comp.emulators.qemu/390272/focus=391042
Ref: https://bugs.launchpad.net/qemu/+bug/1536487
Suggested-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1455823860-22268-1-git-send-email-lersek@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit e6915b5f3a874a467a9a65f7ec1d6ef8d251a51a)

Conflicts:
	include/hw/compat.h

* remove cosmetic dep on c9c0afbb

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/nvram/fw_cfg.c   | 20 ++++++++++++--------
 include/hw/compat.h |  8 ++++++++
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c
index 117809b..5a03b5d 100644
--- a/hw/nvram/fw_cfg.c
+++ b/hw/nvram/fw_cfg.c
@@ -782,17 +782,19 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase,
     DeviceState *dev;
     FWCfgState *s;
     uint32_t version = FW_CFG_VERSION;
-    bool dma_enabled = dma_iobase && dma_as;
+    bool dma_requested = dma_iobase && dma_as;
 
     dev = qdev_create(NULL, TYPE_FW_CFG_IO);
     qdev_prop_set_uint32(dev, "iobase", iobase);
     qdev_prop_set_uint32(dev, "dma_iobase", dma_iobase);
-    qdev_prop_set_bit(dev, "dma_enabled", dma_enabled);
+    if (!dma_requested) {
+        qdev_prop_set_bit(dev, "dma_enabled", false);
+    }
 
     fw_cfg_init1(dev);
     s = FW_CFG(dev);
 
-    if (dma_enabled) {
+    if (s->dma_enabled) {
         /* 64 bits for the address field */
         s->dma_as = dma_as;
         s->dma_addr = 0;
@@ -818,11 +820,13 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
     SysBusDevice *sbd;
     FWCfgState *s;
     uint32_t version = FW_CFG_VERSION;
-    bool dma_enabled = dma_addr && dma_as;
+    bool dma_requested = dma_addr && dma_as;
 
     dev = qdev_create(NULL, TYPE_FW_CFG_MEM);
     qdev_prop_set_uint32(dev, "data_width", data_width);
-    qdev_prop_set_bit(dev, "dma_enabled", dma_enabled);
+    if (!dma_requested) {
+        qdev_prop_set_bit(dev, "dma_enabled", false);
+    }
 
     fw_cfg_init1(dev);
 
@@ -832,7 +836,7 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr,
 
     s = FW_CFG(dev);
 
-    if (dma_enabled) {
+    if (s->dma_enabled) {
         s->dma_as = dma_as;
         s->dma_addr = 0;
         sysbus_mmio_map(sbd, 2, dma_addr);
@@ -877,7 +881,7 @@ static Property fw_cfg_io_properties[] = {
     DEFINE_PROP_UINT32("iobase", FWCfgIoState, iobase, -1),
     DEFINE_PROP_UINT32("dma_iobase", FWCfgIoState, dma_iobase, -1),
     DEFINE_PROP_BOOL("dma_enabled", FWCfgIoState, parent_obj.dma_enabled,
-                     false),
+                     true),
     DEFINE_PROP_END_OF_LIST(),
 };
 
@@ -917,7 +921,7 @@ static const TypeInfo fw_cfg_io_info = {
 static Property fw_cfg_mem_properties[] = {
     DEFINE_PROP_UINT32("data_width", FWCfgMemState, data_width, -1),
     DEFINE_PROP_BOOL("dma_enabled", FWCfgMemState, parent_obj.dma_enabled,
-                     false),
+                     true),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/include/hw/compat.h b/include/hw/compat.h
index d0b1c4f..b7973db 100644
--- a/include/hw/compat.h
+++ b/include/hw/compat.h
@@ -18,6 +18,14 @@
             .driver   = "virtio-pci",\
             .property = "migrate-extra",\
             .value    = "off",\
+        },{\
+            .driver   = "fw_cfg_mem",\
+            .property = "dma_enabled",\
+            .value    = "off",\
+        },{\
+            .driver   = "fw_cfg_io",\
+            .property = "dma_enabled",\
+            .value    = "off",\
         },
 
 #define HW_COMPAT_2_3 \
-- 
1.9.1

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

* [Qemu-devel] [PATCH 32/35] vhost-user: don't merge regions with different fds
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (30 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 31/35] fw_cfg: unbreak migration compatibility for 2.4 and earlier machines Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 33/35] target-arm: Make reserved ranges in ID_AA64* spaces RAZ, not UNDEF Michael Roth
                   ` (4 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael Roth, Victor Kaplansky, qemu-stable, Michael S. Tsirkin

From: "Michael S. Tsirkin" <mst@redhat.com>

vhost currently merges regions with contiguious virtual and physical
addresses.  This breaks for vhost-user since that also needs fds to
match.

Add a vhost_ops entry to compare the fds for vhost-user only.

Cc: qemu-stable@nongnu.org
Cc: Victor Kaplansky <victork@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit ffe42cc14c770549abc7995a90cf53bca3659b7f)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/virtio/vhost-user.c            | 20 ++++++++++++++++++++
 hw/virtio/vhost.c                 |  7 +++++++
 include/hw/virtio/vhost-backend.h |  4 ++++
 3 files changed, 31 insertions(+)

diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 1b6c5ac..577c95e 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -612,6 +612,25 @@ static int vhost_user_migration_done(struct vhost_dev *dev, char* mac_addr)
     return -1;
 }
 
+static bool vhost_user_can_merge(struct vhost_dev *dev,
+                                 uint64_t start1, uint64_t size1,
+                                 uint64_t start2, uint64_t size2)
+{
+    ram_addr_t ram_addr;
+    int mfd, rfd;
+    MemoryRegion *mr;
+
+    mr = qemu_ram_addr_from_host((void *)(uintptr_t)start1, &ram_addr);
+    assert(mr);
+    mfd = qemu_get_ram_fd(ram_addr);
+
+    mr = qemu_ram_addr_from_host((void *)(uintptr_t)start2, &ram_addr);
+    assert(mr);
+    rfd = qemu_get_ram_fd(ram_addr);
+
+    return mfd == rfd;
+}
+
 const VhostOps user_ops = {
         .backend_type = VHOST_BACKEND_TYPE_USER,
         .vhost_backend_init = vhost_user_init,
@@ -634,4 +653,5 @@ const VhostOps user_ops = {
         .vhost_set_vring_enable = vhost_user_set_vring_enable,
         .vhost_requires_shm_log = vhost_user_requires_shm_log,
         .vhost_migration_done = vhost_user_migration_done,
+        .vhost_backend_can_merge = vhost_user_can_merge,
 };
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index de29968..90c60a7 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -259,6 +259,13 @@ static void vhost_dev_assign_memory(struct vhost_dev *dev,
             continue;
         }
 
+        if (dev->vhost_ops->vhost_backend_can_merge &&
+            !dev->vhost_ops->vhost_backend_can_merge(dev, uaddr, size,
+                                                     reg->userspace_addr,
+                                                     reg->memory_size)) {
+            continue;
+        }
+
         if (merged) {
             --to;
             assert(to >= 0);
diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-backend.h
index c59cc81..a6e5c97 100644
--- a/include/hw/virtio/vhost-backend.h
+++ b/include/hw/virtio/vhost-backend.h
@@ -70,6 +70,9 @@ typedef int (*vhost_set_vring_enable_op)(struct vhost_dev *dev,
 typedef bool (*vhost_requires_shm_log_op)(struct vhost_dev *dev);
 typedef int (*vhost_migration_done_op)(struct vhost_dev *dev,
                                        char *mac_addr);
+typedef bool (*vhost_backend_can_merge_op)(struct vhost_dev *dev,
+                                           uint64_t start1, uint64_t size1,
+                                           uint64_t start2, uint64_t size2);
 
 typedef struct VhostOps {
     VhostBackendType backend_type;
@@ -97,6 +100,7 @@ typedef struct VhostOps {
     vhost_set_vring_enable_op vhost_set_vring_enable;
     vhost_requires_shm_log_op vhost_requires_shm_log;
     vhost_migration_done_op vhost_migration_done;
+    vhost_backend_can_merge_op vhost_backend_can_merge;
 } VhostOps;
 
 extern const VhostOps user_ops;
-- 
1.9.1

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

* [Qemu-devel] [PATCH 33/35] target-arm: Make reserved ranges in ID_AA64* spaces RAZ, not UNDEF
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (31 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 32/35] vhost-user: don't merge regions with different fds Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 34/35] quorum: Fix crash in quorum_aio_cb() Michael Roth
                   ` (3 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, qemu-stable, Michael Roth

From: Peter Maydell <peter.maydell@linaro.org>

The v8 ARM ARM defines that unused spaces in the ID_AA64* system
register ranges are Reserved and must RAZ, rather than being UNDEF.
Implement this.

In particular, ARM v8.2 adds a new feature register ID_AA64MMFR2,
and newer versions of the Linux kernel will attempt to read this,
which causes them not to boot up on versions of QEMU missing this fix.

Since the encoding .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 6
is actually defined in ARMv8 (as ID_MMFR4), we give it an entry in
the ARMCPU struct so CPUs can override it, though since none do
this too will just RAZ.

Cc: qemu-stable@nongnu.org
Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1455890863-11203-1-git-send-email-peter.maydell@linaro.org
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
(cherry picked from commit e20d84c1407d43d5a2e2ac95dbb46db3b0af8f9f)

Conflicts:
	target-arm/helper.c

* remove context dep on 4054bfa9

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 target-arm/cpu-qom.h |   1 +
 target-arm/helper.c  | 128 ++++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 122 insertions(+), 7 deletions(-)

diff --git a/target-arm/cpu-qom.h b/target-arm/cpu-qom.h
index 25fb1ce..9376eaf 100644
--- a/target-arm/cpu-qom.h
+++ b/target-arm/cpu-qom.h
@@ -150,6 +150,7 @@ typedef struct ARMCPU {
     uint32_t id_mmfr1;
     uint32_t id_mmfr2;
     uint32_t id_mmfr3;
+    uint32_t id_mmfr4;
     uint32_t id_isar0;
     uint32_t id_isar1;
     uint32_t id_isar2;
diff --git a/target-arm/helper.c b/target-arm/helper.c
index afc4163..1743e37 100644
--- a/target-arm/helper.c
+++ b/target-arm/helper.c
@@ -4092,12 +4092,14 @@ void register_cp_regs_for_features(ARMCPU *cpu)
               .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 5,
               .access = PL1_R, .type = ARM_CP_CONST,
               .resetvalue = cpu->id_isar5 },
-            /* 6..7 are as yet unallocated and must RAZ */
-            { .name = "ID_ISAR6", .cp = 15, .crn = 0, .crm = 2,
-              .opc1 = 0, .opc2 = 6, .access = PL1_R, .type = ARM_CP_CONST,
-              .resetvalue = 0 },
-            { .name = "ID_ISAR7", .cp = 15, .crn = 0, .crm = 2,
-              .opc1 = 0, .opc2 = 7, .access = PL1_R, .type = ARM_CP_CONST,
+            { .name = "ID_MMFR4", .state = ARM_CP_STATE_BOTH,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 6,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = cpu->id_mmfr4 },
+            /* 7 is as yet unallocated and must RAZ */
+            { .name = "ID_ISAR7_RESERVED", .state = ARM_CP_STATE_BOTH,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 2, .opc2 = 7,
+              .access = PL1_R, .type = ARM_CP_CONST,
               .resetvalue = 0 },
             REGINFO_SENTINEL
         };
@@ -4151,7 +4153,11 @@ void register_cp_regs_for_features(ARMCPU *cpu)
         define_arm_cp_regs(cpu, not_v7_cp_reginfo);
     }
     if (arm_feature(env, ARM_FEATURE_V8)) {
-        /* AArch64 ID registers, which all have impdef reset values */
+        /* AArch64 ID registers, which all have impdef reset values.
+         * Note that within the ID register ranges the unused slots
+         * must all RAZ, not UNDEF; future architecture versions may
+         * define new registers here.
+         */
         ARMCPRegInfo v8_idregs[] = {
             { .name = "ID_AA64PFR0_EL1", .state = ARM_CP_STATE_AA64,
               .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 0,
@@ -4161,6 +4167,30 @@ void register_cp_regs_for_features(ARMCPU *cpu)
               .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 1,
               .access = PL1_R, .type = ARM_CP_CONST,
               .resetvalue = cpu->id_aa64pfr1},
+            { .name = "ID_AA64PFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 2,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "ID_AA64PFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 3,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "ID_AA64PFR4_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 4,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "ID_AA64PFR5_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 5,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "ID_AA64PFR6_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 6,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "ID_AA64PFR7_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 4, .opc2 = 7,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
             { .name = "ID_AA64DFR0_EL1", .state = ARM_CP_STATE_AA64,
               .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 0,
               .access = PL1_R, .type = ARM_CP_CONST,
@@ -4174,6 +4204,14 @@ void register_cp_regs_for_features(ARMCPU *cpu)
               .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 1,
               .access = PL1_R, .type = ARM_CP_CONST,
               .resetvalue = cpu->id_aa64dfr1 },
+            { .name = "ID_AA64DFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 2,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "ID_AA64DFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 3,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
             { .name = "ID_AA64AFR0_EL1", .state = ARM_CP_STATE_AA64,
               .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 4,
               .access = PL1_R, .type = ARM_CP_CONST,
@@ -4182,6 +4220,14 @@ void register_cp_regs_for_features(ARMCPU *cpu)
               .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 5,
               .access = PL1_R, .type = ARM_CP_CONST,
               .resetvalue = cpu->id_aa64afr1 },
+            { .name = "ID_AA64AFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 6,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "ID_AA64AFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 5, .opc2 = 7,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
             { .name = "ID_AA64ISAR0_EL1", .state = ARM_CP_STATE_AA64,
               .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 0,
               .access = PL1_R, .type = ARM_CP_CONST,
@@ -4190,6 +4236,30 @@ void register_cp_regs_for_features(ARMCPU *cpu)
               .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 1,
               .access = PL1_R, .type = ARM_CP_CONST,
               .resetvalue = cpu->id_aa64isar1 },
+            { .name = "ID_AA64ISAR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 2,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "ID_AA64ISAR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 3,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "ID_AA64ISAR4_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 4,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "ID_AA64ISAR5_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 5,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "ID_AA64ISAR6_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 6,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "ID_AA64ISAR7_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 6, .opc2 = 7,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
             { .name = "ID_AA64MMFR0_EL1", .state = ARM_CP_STATE_AA64,
               .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 0,
               .access = PL1_R, .type = ARM_CP_CONST,
@@ -4198,6 +4268,30 @@ void register_cp_regs_for_features(ARMCPU *cpu)
               .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 1,
               .access = PL1_R, .type = ARM_CP_CONST,
               .resetvalue = cpu->id_aa64mmfr1 },
+            { .name = "ID_AA64MMFR2_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 2,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "ID_AA64MMFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 3,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "ID_AA64MMFR4_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 4,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "ID_AA64MMFR5_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 5,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "ID_AA64MMFR6_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 6,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "ID_AA64MMFR7_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 7, .opc2 = 7,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
             { .name = "MVFR0_EL1", .state = ARM_CP_STATE_AA64,
               .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 0,
               .access = PL1_R, .type = ARM_CP_CONST,
@@ -4210,6 +4304,26 @@ void register_cp_regs_for_features(ARMCPU *cpu)
               .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 2,
               .access = PL1_R, .type = ARM_CP_CONST,
               .resetvalue = cpu->mvfr2 },
+            { .name = "MVFR3_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 3,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "MVFR4_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 4,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "MVFR5_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 5,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "MVFR6_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 6,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
+            { .name = "MVFR7_EL1_RESERVED", .state = ARM_CP_STATE_AA64,
+              .opc0 = 3, .opc1 = 0, .crn = 0, .crm = 3, .opc2 = 7,
+              .access = PL1_R, .type = ARM_CP_CONST,
+              .resetvalue = 0 },
             REGINFO_SENTINEL
         };
         /* RVBAR_EL1 is only implemented if EL1 is the highest EL */
-- 
1.9.1

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

* [Qemu-devel] [PATCH 34/35] quorum: Fix crash in quorum_aio_cb()
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (32 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 33/35] target-arm: Make reserved ranges in ID_AA64* spaces RAZ, not UNDEF Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 35/35] vl.c: Fix regression in machine error message Michael Roth
                   ` (2 subsequent siblings)
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Roth, Alberto Garcia, qemu-stable, Max Reitz

From: Alberto Garcia <berto@igalia.com>

quorum_aio_cb() emits the QUORUM_REPORT_BAD event if there's
an I/O error in a Quorum child. However sacb->aiocb must be
correctly initialized for this to happen. read_quorum_children() and
read_fifo_child() are not doing this, which results in a QEMU crash.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 8138570d071ba7e25db3736979234a1fd71dbd05.1457610443.git.berto@igalia.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
(cherry picked from commit b9c600d20716b3d942cb07188ff998fb236a8365)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 block/quorum.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/block/quorum.c b/block/quorum.c
index b9ba028..e640688 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -646,8 +646,9 @@ static BlockAIOCB *read_quorum_children(QuorumAIOCB *acb)
     }
 
     for (i = 0; i < s->num_children; i++) {
-        bdrv_aio_readv(s->children[i]->bs, acb->sector_num, &acb->qcrs[i].qiov,
-                       acb->nb_sectors, quorum_aio_cb, &acb->qcrs[i]);
+        acb->qcrs[i].aiocb = bdrv_aio_readv(s->children[i]->bs, acb->sector_num,
+                                            &acb->qcrs[i].qiov, acb->nb_sectors,
+                                            quorum_aio_cb, &acb->qcrs[i]);
     }
 
     return &acb->common;
@@ -662,9 +663,10 @@ static BlockAIOCB *read_fifo_child(QuorumAIOCB *acb)
     qemu_iovec_init(&acb->qcrs[acb->child_iter].qiov, acb->qiov->niov);
     qemu_iovec_clone(&acb->qcrs[acb->child_iter].qiov, acb->qiov,
                      acb->qcrs[acb->child_iter].buf);
-    bdrv_aio_readv(s->children[acb->child_iter]->bs, acb->sector_num,
-                   &acb->qcrs[acb->child_iter].qiov, acb->nb_sectors,
-                   quorum_aio_cb, &acb->qcrs[acb->child_iter]);
+    acb->qcrs[acb->child_iter].aiocb =
+        bdrv_aio_readv(s->children[acb->child_iter]->bs, acb->sector_num,
+                       &acb->qcrs[acb->child_iter].qiov, acb->nb_sectors,
+                       quorum_aio_cb, &acb->qcrs[acb->child_iter]);
 
     return &acb->common;
 }
-- 
1.9.1

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

* [Qemu-devel] [PATCH 35/35] vl.c: Fix regression in machine error message
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (33 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 34/35] quorum: Fix crash in quorum_aio_cb() Michael Roth
@ 2016-03-21 17:28 ` Michael Roth
  2016-03-21 19:32 ` [Qemu-devel] [Qemu-stable] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Cole Robinson
  2016-03-22 10:00 ` Peter Lieven
  36 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-21 17:28 UTC (permalink / raw)
  To: qemu-devel
  Cc: Marcel Apfelbaum, Markus Armbruster, Michael Roth, qemu-stable,
	Eduardo Habkost

From: Marcel Apfelbaum <marcel@redhat.com>

Commit e1ce0c3cb (vl.c: fix regression when reading machine type
from config file) fixed the error message when the machine type
was supplied inside the config file. However now the option name
is not displayed correctly if the error happens when the machine
is specified at command line.

Running
    ./x86_64-softmmu/qemu-system-x86_64 -M q35-1.5 -redir tcp:8022::22
will result in the error message:
    qemu-system-x86_64: -redir tcp:8022::22: unsupported machine type
    Use -machine help to list supported machines

Fixed it by restoring the error location and also extracted the code
dealing with machine options into a separate function.

Reported-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <1455303747-19776-2-git-send-email-ehabkost@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
(cherry picked from commit 34f405ae6d5c4170b192a12b2e654a2aea0c3b50)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 vl.c | 37 ++++++++++++++++++++++++++-----------
 1 file changed, 26 insertions(+), 11 deletions(-)

diff --git a/vl.c b/vl.c
index 4211ff1..873d265 100644
--- a/vl.c
+++ b/vl.c
@@ -2757,6 +2757,31 @@ static const QEMUOption *lookup_opt(int argc, char **argv,
     return popt;
 }
 
+static void set_machine_options(MachineClass **machine_class)
+{
+    const char *optarg;
+    QemuOpts *opts;
+    Location loc;
+
+    loc_push_none(&loc);
+
+    opts = qemu_get_machine_opts();
+    qemu_opts_loc_restore(opts);
+
+    optarg = qemu_opt_get(opts, "type");
+    if (optarg) {
+        *machine_class = machine_parse(optarg);
+    }
+
+    if (*machine_class == NULL) {
+        error_report("No machine specified, and there is no default");
+        error_printf("Use -machine help to list supported machines\n");
+        exit(1);
+    }
+
+    loc_pop(&loc);
+}
+
 static int machine_set_property(void *opaque,
                                 const char *name, const char *value,
                                 Error **errp)
@@ -4025,17 +4050,7 @@ int main(int argc, char **argv, char **envp)
 
     replay_configure(icount_opts);
 
-    opts = qemu_get_machine_opts();
-    optarg = qemu_opt_get(opts, "type");
-    if (optarg) {
-        machine_class = machine_parse(optarg);
-    }
-
-    if (machine_class == NULL) {
-        error_report("No machine specified, and there is no default");
-        error_printf("Use -machine help to list supported machines\n");
-        exit(1);
-    }
+    set_machine_options(&machine_class);
 
     set_memory_options(&ram_slots, &maxram_size, machine_class);
 
-- 
1.9.1

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

* Re: [Qemu-devel] [Qemu-stable] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (34 preceding siblings ...)
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 35/35] vl.c: Fix regression in machine error message Michael Roth
@ 2016-03-21 19:32 ` Cole Robinson
  2016-03-22 22:47   ` Michael Roth
  2016-03-22 10:00 ` Peter Lieven
  36 siblings, 1 reply; 43+ messages in thread
From: Cole Robinson @ 2016-03-21 19:32 UTC (permalink / raw)
  To: Michael Roth, qemu-devel; +Cc: qemu-stable

On 03/21/2016 01:27 PM, Michael Roth wrote:
> Hi everyone,
> 
> The following new patches are queued for QEMU stable v2.5.1:
> 
>   https://github.com/mdroth/qemu/commits/stable-2.5-staging
> 
> The release is planned for 2016-03-29:
> 
>   http://wiki.qemu.org/Planning/2.5
> 
> Please respond here or CC qemu-stable@nongnu.org on any patches you
> think should be included in the release.
> 
> Testing/feedback is greatly appreciated.
> 

Here's some patches we have in Fedora that aren't in your tree that IMO are
stable candidates:

99b4cb7 ahci: Do not unmap NULL addresses
64ffbe0 hmp: fix sendkey out of bounds write (CVE-2015-8619)
4c1396c i386: avoid null pointer dereference
4ab0359 ide: ahci: reset ncq object to unused on error
362786f net: check packet payload length
aa7f996 net: ne2000: fix bounds check in ioport operations
49d925c usb: check page select value while processing iTD
fe3c546 usb: check RNDIS buffer offsets & length
64c9bc1 usb: check RNDIS message length
80eecda usb: check USB configuration descriptor object
d62d9dc vmdk: Create streamOptimized as version 3
3db1d98 vmdk: Fix converting to streamOptimized

vmdk patches are for https://bugzilla.redhat.com/show_bug.cgi?id=1299185
Rest are security issues

Thanks,
Cole

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

* Re: [Qemu-devel] [Qemu-stable] [PATCH 28/35] spapr: skip configuration section during migration of older machines
  2016-03-21 17:28 ` [Qemu-devel] [PATCH 28/35] spapr: skip configuration section during migration of older machines Michael Roth
@ 2016-03-22  7:49   ` Greg Kurz
  2016-03-22 22:35     ` Michael Roth
  0 siblings, 1 reply; 43+ messages in thread
From: Greg Kurz @ 2016-03-22  7:49 UTC (permalink / raw)
  To: Michael Roth; +Cc: qemu-stable, qemu-devel, David Gibson

On Mon, 21 Mar 2016 12:28:26 -0500
Michael Roth <mdroth@linux.vnet.ibm.com> wrote:

> From: Greg Kurz <gkurz@linux.vnet.ibm.com>
> 
> Since QEMU 2.4, we have a configuration section in the migration stream.
> This must be skipped for older machines, like it is already done for x86.
> 
> This patch fixes the migration of pseries-2.3 from/to QEMU 2.3, but it
> breaks migration of the same machine from/to QEMU 2.4/2.4.1/2.5. We do
> that anyway because QEMU 2.3 is likely to be more widely deployed than
> newer QEMU versions.
> 
> Fixes: 61964c23e5ddd5a33f15699e45ce126f879e3e33
> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> Reviewed-by: Laurent Vivier <lvivier@redhat.com>
> Reviewed-by: Juan Quintela <quintela@redhat.com>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> (cherry picked from commit 09b5e30da5b19f44768a5429f603caaede216757)
> 
> Conflicts:
> 	hw/ppc/spapr.c
> 
> *remove dep on 5013c5474
> 
> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
> ---

This will break migration of pseries-2.3 from QEMU 2.5 to QEMU 2.5.1. Maybe
this should be documented somewhere ?

Also, there's a companion patch to allow migration to succeed with manual
intervention on the destination:

commit 902c053d834e3b802ec736f170edf226d4a841ff
Author: Greg Kurz <gkurz@linux.vnet.ibm.com>
Date:   Thu Feb 18 12:32:25 2016 +0100

    migration: allow machine to enforce configuration section migration

Maybe worth to push to stable as well ?

>  hw/ppc/spapr.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 6bfb908..ff1537a 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -2327,6 +2327,7 @@ static void spapr_compat_2_3(Object *obj)
>  {
>      savevm_skip_section_footers();
>      global_state_set_optional();
> +    savevm_skip_configuration();
>  }
> 
>  static void spapr_compat_2_2(Object *obj)

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

* Re: [Qemu-devel] [Qemu-stable] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25
  2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
                   ` (35 preceding siblings ...)
  2016-03-21 19:32 ` [Qemu-devel] [Qemu-stable] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Cole Robinson
@ 2016-03-22 10:00 ` Peter Lieven
  2016-03-22 22:45   ` Michael Roth
  36 siblings, 1 reply; 43+ messages in thread
From: Peter Lieven @ 2016-03-22 10:00 UTC (permalink / raw)
  To: Michael Roth, qemu-devel; +Cc: qemu-stable

Am 21.03.2016 um 18:27 schrieb Michael Roth:
> Hi everyone,
>
> The following new patches are queued for QEMU stable v2.5.1:
>
>    https://github.com/mdroth/qemu/commits/stable-2.5-staging
>
> The release is planned for 2016-03-29:
>
>    http://wiki.qemu.org/Planning/2.5
>
> Please respond here or CC qemu-stable@nongnu.org on any patches you
> think should be included in the release.

Is this stable material?

4467c6c hyperv: cpu hotplug fix with HyperV enabled

Peter

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

* Re: [Qemu-devel] [Qemu-stable] [PATCH 28/35] spapr: skip configuration section during migration of older machines
  2016-03-22  7:49   ` [Qemu-devel] [Qemu-stable] " Greg Kurz
@ 2016-03-22 22:35     ` Michael Roth
  2016-03-23  7:59       ` Greg Kurz
  0 siblings, 1 reply; 43+ messages in thread
From: Michael Roth @ 2016-03-22 22:35 UTC (permalink / raw)
  To: Greg Kurz; +Cc: qemu-stable, qemu-devel, David Gibson

Quoting Greg Kurz (2016-03-22 02:49:35)
> On Mon, 21 Mar 2016 12:28:26 -0500
> Michael Roth <mdroth@linux.vnet.ibm.com> wrote:
> 
> > From: Greg Kurz <gkurz@linux.vnet.ibm.com>
> > 
> > Since QEMU 2.4, we have a configuration section in the migration stream.
> > This must be skipped for older machines, like it is already done for x86.
> > 
> > This patch fixes the migration of pseries-2.3 from/to QEMU 2.3, but it
> > breaks migration of the same machine from/to QEMU 2.4/2.4.1/2.5. We do
> > that anyway because QEMU 2.3 is likely to be more widely deployed than
> > newer QEMU versions.
> > 
> > Fixes: 61964c23e5ddd5a33f15699e45ce126f879e3e33
> > Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> > Reviewed-by: Laurent Vivier <lvivier@redhat.com>
> > Reviewed-by: Juan Quintela <quintela@redhat.com>
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> > (cherry picked from commit 09b5e30da5b19f44768a5429f603caaede216757)
> > 
> > Conflicts:
> >       hw/ppc/spapr.c
> > 
> > *remove dep on 5013c5474
> > 
> > Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
> > ---
> 
> This will break migration of pseries-2.3 from QEMU 2.5 to QEMU 2.5.1. Maybe
> this should be documented somewhere ?
> 
> Also, there's a companion patch to allow migration to succeed with manual
> intervention on the destination:
> 
> commit 902c053d834e3b802ec736f170edf226d4a841ff
> Author: Greg Kurz <gkurz@linux.vnet.ibm.com>
> Date:   Thu Feb 18 12:32:25 2016 +0100
> 
>     migration: allow machine to enforce configuration section migration
> 
> Maybe worth to push to stable as well ?

Yah, makes sense. I'll include this patch and document compatibility
changes in the release notes.

Is this wording correct?

"Fixes migration between QEMU 2.3 and QEMU 2.5.1 when running
pseries-2.3 machine model. Note that for migration of same
pseries-2.3 machine to/from QEMU versions 2.4.x and 2.5, 
the -machine enforce-config-section=on option now needs to be
used."

> 
> >  hw/ppc/spapr.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> > index 6bfb908..ff1537a 100644
> > --- a/hw/ppc/spapr.c
> > +++ b/hw/ppc/spapr.c
> > @@ -2327,6 +2327,7 @@ static void spapr_compat_2_3(Object *obj)
> >  {
> >      savevm_skip_section_footers();
> >      global_state_set_optional();
> > +    savevm_skip_configuration();
> >  }
> > 
> >  static void spapr_compat_2_2(Object *obj)
> 

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

* Re: [Qemu-devel] [Qemu-stable] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25
  2016-03-22 10:00 ` Peter Lieven
@ 2016-03-22 22:45   ` Michael Roth
  0 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-22 22:45 UTC (permalink / raw)
  To: Peter Lieven, qemu-devel; +Cc: qemu-stable

Quoting Peter Lieven (2016-03-22 05:00:28)
> Am 21.03.2016 um 18:27 schrieb Michael Roth:
> > Hi everyone,
> >
> > The following new patches are queued for QEMU stable v2.5.1:
> >
> >    https://github.com/mdroth/qemu/commits/stable-2.5-staging
> >
> > The release is planned for 2016-03-29:
> >
> >    http://wiki.qemu.org/Planning/2.5
> >
> > Please respond here or CC qemu-stable@nongnu.org on any patches you
> > think should be included in the release.
> 
> Is this stable material?
> 
> 4467c6c hyperv: cpu hotplug fix with HyperV enabled

Doesn't seem like it would cause any side-effects outside of the cpu
hotplug case it's fixing, so makes sense to me.

> 
> Peter
> 

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

* Re: [Qemu-devel] [Qemu-stable] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25
  2016-03-21 19:32 ` [Qemu-devel] [Qemu-stable] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Cole Robinson
@ 2016-03-22 22:47   ` Michael Roth
  0 siblings, 0 replies; 43+ messages in thread
From: Michael Roth @ 2016-03-22 22:47 UTC (permalink / raw)
  To: Cole Robinson, qemu-devel; +Cc: qemu-stable

Quoting Cole Robinson (2016-03-21 14:32:14)
> On 03/21/2016 01:27 PM, Michael Roth wrote:
> > Hi everyone,
> > 
> > The following new patches are queued for QEMU stable v2.5.1:
> > 
> >   https://github.com/mdroth/qemu/commits/stable-2.5-staging
> > 
> > The release is planned for 2016-03-29:
> > 
> >   http://wiki.qemu.org/Planning/2.5
> > 
> > Please respond here or CC qemu-stable@nongnu.org on any patches you
> > think should be included in the release.
> > 
> > Testing/feedback is greatly appreciated.
> > 
> 
> Here's some patches we have in Fedora that aren't in your tree that IMO are
> stable candidates:
> 
> 99b4cb7 ahci: Do not unmap NULL addresses
> 64ffbe0 hmp: fix sendkey out of bounds write (CVE-2015-8619)
> 4c1396c i386: avoid null pointer dereference
> 4ab0359 ide: ahci: reset ncq object to unused on error
> 362786f net: check packet payload length
> aa7f996 net: ne2000: fix bounds check in ioport operations
> 49d925c usb: check page select value while processing iTD
> fe3c546 usb: check RNDIS buffer offsets & length
> 64c9bc1 usb: check RNDIS message length
> 80eecda usb: check USB configuration descriptor object
> d62d9dc vmdk: Create streamOptimized as version 3
> 3db1d98 vmdk: Fix converting to streamOptimized
> 
> vmdk patches are for https://bugzilla.redhat.com/show_bug.cgi?id=1299185
> Rest are security issues

Thanks, definitely good to have. Have them all applied locally and will
push after another round of testing.

> 
> Thanks,
> Cole
> 

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

* Re: [Qemu-devel] [Qemu-stable] [PATCH 28/35] spapr: skip configuration section during migration of older machines
  2016-03-22 22:35     ` Michael Roth
@ 2016-03-23  7:59       ` Greg Kurz
  0 siblings, 0 replies; 43+ messages in thread
From: Greg Kurz @ 2016-03-23  7:59 UTC (permalink / raw)
  To: Michael Roth; +Cc: qemu-stable, qemu-devel, David Gibson

On Tue, 22 Mar 2016 17:35:18 -0500
Michael Roth <mdroth@linux.vnet.ibm.com> wrote:

> Quoting Greg Kurz (2016-03-22 02:49:35)
> > On Mon, 21 Mar 2016 12:28:26 -0500
> > Michael Roth <mdroth@linux.vnet.ibm.com> wrote:
> >   
> > > From: Greg Kurz <gkurz@linux.vnet.ibm.com>
> > > 
> > > Since QEMU 2.4, we have a configuration section in the migration stream.
> > > This must be skipped for older machines, like it is already done for x86.
> > > 
> > > This patch fixes the migration of pseries-2.3 from/to QEMU 2.3, but it
> > > breaks migration of the same machine from/to QEMU 2.4/2.4.1/2.5. We do
> > > that anyway because QEMU 2.3 is likely to be more widely deployed than
> > > newer QEMU versions.
> > > 
> > > Fixes: 61964c23e5ddd5a33f15699e45ce126f879e3e33
> > > Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
> > > Reviewed-by: Laurent Vivier <lvivier@redhat.com>
> > > Reviewed-by: Juan Quintela <quintela@redhat.com>
> > > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> > > (cherry picked from commit 09b5e30da5b19f44768a5429f603caaede216757)
> > > 
> > > Conflicts:
> > >       hw/ppc/spapr.c
> > > 
> > > *remove dep on 5013c5474
> > > 
> > > Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
> > > ---  
> > 
> > This will break migration of pseries-2.3 from QEMU 2.5 to QEMU 2.5.1. Maybe
> > this should be documented somewhere ?
> > 
> > Also, there's a companion patch to allow migration to succeed with manual
> > intervention on the destination:
> > 
> > commit 902c053d834e3b802ec736f170edf226d4a841ff
> > Author: Greg Kurz <gkurz@linux.vnet.ibm.com>
> > Date:   Thu Feb 18 12:32:25 2016 +0100
> > 
> >     migration: allow machine to enforce configuration section migration
> > 
> > Maybe worth to push to stable as well ?  
> 
> Yah, makes sense. I'll include this patch and document compatibility
> changes in the release notes.
> 
> Is this wording correct?
> 
> "Fixes migration between QEMU 2.3 and QEMU 2.5.1 when running
> pseries-2.3 machine model. Note that for migration of same
> pseries-2.3 machine to/from QEMU versions 2.4.x and 2.5, 
> the -machine enforce-config-section=on option now needs to be
> used."
> 

Of course this is also the case for older pseries (< 2.3) but the wording
is correct.

Thanks !

> >   
> > >  hw/ppc/spapr.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> > > index 6bfb908..ff1537a 100644
> > > --- a/hw/ppc/spapr.c
> > > +++ b/hw/ppc/spapr.c
> > > @@ -2327,6 +2327,7 @@ static void spapr_compat_2_3(Object *obj)
> > >  {
> > >      savevm_skip_section_footers();
> > >      global_state_set_optional();
> > > +    savevm_skip_configuration();
> > >  }
> > > 
> > >  static void spapr_compat_2_2(Object *obj)  
> >   

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

end of thread, other threads:[~2016-03-23  8:00 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-21 17:27 [Qemu-devel] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Michael Roth
2016-03-21 17:27 ` [Qemu-devel] [PATCH 01/35] ehci: make idt processing more robust Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 02/35] net: vmxnet3: avoid memory leakage in activate_device Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 03/35] target-ppc: kvm: fix floating point registers sync on little-endian hosts Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 04/35] configure: Fix shell syntax to placate OpenBSD's pdksh Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 05/35] xen/blkif: Avoid double access to src->nr_segments Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 06/35] xenfb: avoid reading twice the same fields from the shared page Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 07/35] virtio-9p: use accessor to get thread_pool Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 08/35] scsi: initialise info object with appropriate size Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 09/35] ivshmem: no need for opaque argument Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 10/35] ivshmem: remove redundant assignment, fix crash with msi=off Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 11/35] net: rocker: fix an incorrect array bounds check Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 12/35] block: Add blk_dev_has_tray() Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 13/35] blockdev: Fix 'change' for slot devices Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 14/35] net/dump: fix nfds->filename leak Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 15/35] net/filter: fix nf->netdev_id leak Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 16/35] net: ne2000: check ring buffer control registers Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 17/35] net: set endianness on all backend devices Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 18/35] ehci: update irq on reset Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 19/35] block/raw-posix: avoid bogus fixup for cylinders on DASD disks Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 20/35] s390x/ioinst: set type and len for SEI response Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 21/35] s390x/css: fix control flags during csch Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 22/35] fw_cfg: avoid calculating invalid current entry pointer Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 23/35] cpus: use broadcast on qemu_pause_cond Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 24/35] qmp: Fix reference-counting of qnull on empty output visit Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 25/35] block: set device_list.tqe_prev to NULL on BDS removal Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 26/35] block: qemu-iotests - add test for snapshot, commit, snapshot bug Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 27/35] e1000: eliminate infinite loops on out-of-bounds transfer start Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 28/35] spapr: skip configuration section during migration of older machines Michael Roth
2016-03-22  7:49   ` [Qemu-devel] [Qemu-stable] " Greg Kurz
2016-03-22 22:35     ` Michael Roth
2016-03-23  7:59       ` Greg Kurz
2016-03-21 17:28 ` [Qemu-devel] [PATCH 29/35] hw/virtio: fix double use of a virtio flag Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 30/35] hw/virtio: group virtio flags into an enum Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 31/35] fw_cfg: unbreak migration compatibility for 2.4 and earlier machines Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 32/35] vhost-user: don't merge regions with different fds Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 33/35] target-arm: Make reserved ranges in ID_AA64* spaces RAZ, not UNDEF Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 34/35] quorum: Fix crash in quorum_aio_cb() Michael Roth
2016-03-21 17:28 ` [Qemu-devel] [PATCH 35/35] vl.c: Fix regression in machine error message Michael Roth
2016-03-21 19:32 ` [Qemu-devel] [Qemu-stable] [PATCH 00/35] Patch Round-up for stable 2.5.1, freeze on 2016-03-25 Cole Robinson
2016-03-22 22:47   ` Michael Roth
2016-03-22 10:00 ` Peter Lieven
2016-03-22 22:45   ` Michael Roth

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.