1. 18 2月, 2017 1 次提交
  2. 18 11月, 2016 1 次提交
    • P
      virtio: set ISR on dataplane notifications · 83d768b5
      Paolo Bonzini 提交于
      Dataplane has been omitting forever the step of setting ISR when
      an interrupt is raised.  This caused little breakage, because the
      specification actually says that ISR may not be updated in MSI mode.
      
      Some versions of the Windows drivers however didn't clear MSI mode
      correctly, and proceeded using polling mode (using ISR, not the used
      ring index!) for crashdump and hibernation.  If it were just crashdump
      and hibernation it would not be a big deal, but recent releases of
      Windows do not really shut down, but rather log out and hibernate to
      make the next startup faster.  Hence, this manifested as a more serious
      hang during shutdown with e.g. Windows 8.1 and virtio-win 1.8.0 RPMs.
      Newer versions fixed this, while older versions do not use MSI at all.
      
      The failure has always been there for virtio dataplane, but it became
      visible after commits 9ffe337c ("virtio-blk: always use dataplane path
      if ioeventfd is active", 2016-10-30) and ad07cd69 ("virtio-scsi: always
      use dataplane path if ioeventfd is active", 2016-10-30) made virtio-blk
      and virtio-scsi always use the dataplane code under KVM.  The good news
      therefore is that it was not a bug in the patches---they were doing
      exactly what they were meant for, i.e. shake out remaining dataplane bugs.
      
      The fix is not hard, so it's worth arranging for the broken drivers.
      The virtio_should_notify+event_notifier_set pair that is common to
      virtio-blk and virtio-scsi dataplane is replaced with a new public
      function virtio_notify_irqfd that also sets ISR.  The irqfd emulation
      code now need not set ISR anymore, so virtio_irq is removed.
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Tested-by: NFarhan Ali <alifm@linux.vnet.ibm.com>
      Tested-by: NAlex Williamson <alex.williamson@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      83d768b5
  3. 31 10月, 2016 2 次提交
  4. 28 10月, 2016 1 次提交
    • P
      block: only call aio_poll on the current thread's AioContext · c9d1a561
      Paolo Bonzini 提交于
      aio_poll is not thread safe; for example bdrv_drain can hang if
      the last in-flight I/O operation is completed in the I/O thread after
      the main thread has checked bs->in_flight.
      
      The bug remains latent as long as all of it is called within
      aio_context_acquire/aio_context_release, but this will change soon.
      
      To fix this, if bdrv_drain is called from outside the I/O thread,
      signal the main AioContext through a dummy bottom half.  The event
      loop then only runs in the I/O thread.
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <1477565348-5458-18-git-send-email-pbonzini@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      c9d1a561
  5. 12 7月, 2016 1 次提交
  6. 24 6月, 2016 2 次提交
  7. 08 4月, 2016 2 次提交
  8. 23 3月, 2016 1 次提交
  9. 25 2月, 2016 1 次提交
  10. 07 2月, 2016 1 次提交
    • P
      virtio: move allocation to virtqueue_pop/vring_pop · 51b19ebe
      Paolo Bonzini 提交于
      The return code of virtqueue_pop/vring_pop is unused except to check for
      errors or 0.  We can thus easily move allocation inside the functions
      and just return a pointer to the VirtQueueElement.
      
      The advantage is that we will be able to allocate only the space that
      is needed for the actual size of the s/g list instead of the full
      VIRTQUEUE_MAX_SIZE items.  Currently VirtQueueElement takes about 48K
      of memory, and this kind of allocation puts a lot of stress on malloc.
      By cutting the size by two or three orders of magnitude, malloc can
      use much more efficient algorithms.
      
      The patch is pretty large, but changes to each device are testable
      more or less independently.  Splitting it would mostly add churn.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      51b19ebe
  11. 29 1月, 2016 1 次提交
  12. 24 10月, 2015 2 次提交
  13. 13 10月, 2015 1 次提交
  14. 26 3月, 2015 1 次提交
  15. 18 3月, 2015 1 次提交
  16. 02 3月, 2015 1 次提交
    • M
      virtio-scsi: Allocate op blocker reason before blocking · f6758f7d
      Max Reitz 提交于
      s->blocker is really only used in hw/scsi/virtio-scsi.c; the only places
      where it is used in hw/scsi/virtio-scsi-dataplane.c is when it is
      allocated and when it is freed. That does not make a whole lot of sense
      (and is actually wrong because this leads to s->blocker potentially
      being NULL when blk_op_block_all() is called in virtio-scsi.c), so move
      the allocation and destruction of s->blocker to the device realization
      and unrealization in virtio-scsi.c, respectively.
      
      Case in point:
      
      $ echo -e 'eject drv\nquit' | \
          x86_64-softmmu/qemu-system-x86_64 \
              -monitor stdio -machine accel=qtest -display none \
              -object iothread,id=thr -device virtio-scsi-pci,iothread=thr \
              -drive if=none,file=test.qcow2,format=qcow2,id=drv \
              -device scsi-cd,drive=drv
      
      Without this patch:
      
      (qemu) eject drv
      [1]    10102 done
             10103 segmentation fault (core dumped)
      
      With this patch:
      
      (qemu) eject drv
      Device 'drv' is busy: block device is in use by data plane
      (qemu) quit
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-Id: <1425057113-26940-1-git-send-email-mreitz@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f6758f7d
  17. 16 2月, 2015 1 次提交
  18. 12 11月, 2014 1 次提交
  19. 11 11月, 2014 1 次提交
  20. 01 11月, 2014 1 次提交
  21. 23 10月, 2014 4 次提交
  22. 20 10月, 2014 1 次提交
    • M
      hw: Convert from BlockDriverState to BlockBackend, mostly · 4be74634
      Markus Armbruster 提交于
      Device models should access their block backends only through the
      block-backend.h API.  Convert them, and drop direct includes of
      inappropriate headers.
      
      Just four uses of BlockDriverState are left:
      
      * The Xen paravirtual block device backend (xen_disk.c) opens images
        itself when set up via xenbus, bypassing blockdev.c.  I figure it
        should go through qmp_blockdev_add() instead.
      
      * Device model "usb-storage" prompts for keys.  No other device model
        does, and this one probably shouldn't do it, either.
      
      * ide_issue_trim_cb() uses bdrv_aio_discard() instead of
        blk_aio_discard() because it fishes its backend out of a BlockAIOCB,
        which has only the BlockDriverState.
      
      * PC87312State has an unused BlockDriverState[] member.
      
      The next two commits take care of the latter two.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      4be74634
  23. 30 9月, 2014 3 次提交