You need to sign in or sign up before continuing.
  1. 19 1月, 2017 1 次提交
    • S
      Revert "virtio: turn vq->notification into a nested counter" · 332fa82d
      Stefan Hajnoczi 提交于
      This reverts commit aff8fd18.
      
      Both virtio-net and virtio-crypto do not balance
      virtio_queue_set_notification() enable and disable calls.  This makes
      the notifications_disabled counter unreliable and Doug Goldstein
      reported the following assertion failure:
      
        #3  0x00007ffff44d1c62 in __GI___assert_fail (
            assertion=assertion@entry=0x555555ae8e8a "vq->notification_disabled > 0",
            file=file@entry=0x555555ae89c0 "/home/doug/work/qemu/hw/virtio/virtio.c",
            line=line@entry=215,
            function=function@entry=0x555555ae9630 <__PRETTY_FUNCTION__.43707>
            "virtio_queue_set_notification") at assert.c:101
        #4  0x00005555557f25d6 in virtio_queue_set_notification (vq=0x55555666aa90,
            enable=enable@entry=1) at /home/doug/work/qemu/hw/virtio/virtio.c:215
        #5  0x00005555557dc311 in virtio_net_has_buffers (q=<optimized out>,
            q=<optimized out>, bufsize=102)
            at /home/doug/work/qemu/hw/net/virtio-net.c:1008
        #6  virtio_net_receive (nc=<optimized out>, buf=0x555557386b88 "", size=102)
            at /home/doug/work/qemu/hw/net/virtio-net.c:1148
        #7  0x00005555559cad33 in nc_sendv_compat (flags=<optimized out>, iovcnt=1,
            iov=0x7fffead746d0, nc=0x55555788b340) at net/net.c:705
        #8  qemu_deliver_packet_iov (sender=<optimized out>, flags=<optimized out>,
            iov=0x7fffead746d0, iovcnt=1, opaque=0x55555788b340) at net/net.c:732
        #9  0x00005555559cd929 in qemu_net_queue_deliver (size=<optimized out>,
            data=<optimized out>, flags=<optimized out>, sender=<optimized out>,
            queue=0x55555788b550) at net/queue.c:164
        #10 qemu_net_queue_flush (queue=0x55555788b550) at net/queue.c:261
      
      This patch is safe to revert since it's just an optimization for
      virtqueue polling.  The next patch will improve the situation again
      without resorting to nesting.
      Reported-by: NDoug Goldstein <cardoe@cardoe.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Tested-by: NRichard Henderson <rth@twiddle.net>
      Tested-by: NLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      332fa82d
  2. 10 1月, 2017 4 次提交
  3. 04 1月, 2017 4 次提交
  4. 18 11月, 2016 3 次提交
  5. 15 11月, 2016 4 次提交
  6. 31 10月, 2016 7 次提交
  7. 10 10月, 2016 3 次提交
  8. 24 9月, 2016 9 次提交
  9. 23 9月, 2016 1 次提交
  10. 10 9月, 2016 2 次提交
    • S
      virtio: add virtqueue_rewind() · 297a75e6
      Stefan Hajnoczi 提交于
      virtqueue_discard() requires a VirtQueueElement but virtio-balloon does
      not migrate its in-use element.  Introduce a new function that is
      similar to virtqueue_discard() but doesn't require a VirtQueueElement.
      
      This will allow virtio-balloon to access element again after migration
      with the usual proviso that the guest may have modified the vring since
      last time.
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Roman Kagan <rkagan@virtuozzo.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NLadi Prosek <lprosek@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      297a75e6
    • S
      virtio: zero vq->inuse in virtio_reset() · 4b7f91ed
      Stefan Hajnoczi 提交于
      vq->inuse must be zeroed upon device reset like most other virtqueue
      fields.
      
      In theory, virtio_reset() just needs assert(vq->inuse == 0) since
      devices must clean up in-flight requests during reset (requests cannot
      not be leaked!).
      
      In practice, it is difficult to achieve vq->inuse == 0 across reset
      because balloon, blk, 9p, etc implement various different strategies for
      cleaning up requests.  Most devices call g_free(elem) directly without
      telling virtio.c that the VirtQueueElement is cleaned up.  Therefore
      vq->inuse is not decremented during reset.
      
      This patch zeroes vq->inuse and trusts that devices are not leaking
      VirtQueueElements across reset.
      
      I will send a follow-up series that refactors request life-cycle across
      all devices and converts vq->inuse = 0 into assert(vq->inuse == 0) but
      this more invasive approach is not appropriate for stable trees.
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Cc: qemu-stable <qemu-stable@nongnu.org>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NLadi Prosek <lprosek@redhat.com>
      4b7f91ed
  11. 24 8月, 2016 2 次提交