1. 19 10月, 2018 1 次提交
  2. 10 10月, 2018 1 次提交
    • M
      ivshmem: Fix unplug of device "ivshmem-plain" · b266f1d1
      Markus Armbruster 提交于
      Commit 2aece63c "hostmem: detect host backend memory is being used
      properly" fixed "ivshmem-plain" to reject memory backends that are
      already in use, and to block their deletion while in use.  Two bugs
      escaped review:
      
      * New ivshmem_plain_exit() fails to call ivshmem_exit().  This breaks
        unplug.  Reproducer: migration after unplug still fails with
        "Migration is disabled when using feature 'peer mode' in device
        'ivshmem'".
      
      * It failed to update legacy "ivshmem".  Harmless, because it creates
        the memory backend itself, and nothing else should use it.
      
      Fix by moving the two host_memory_backend_set_mapped() calls into
      ivshmem_common_realize() and ivshmem_exit(), guarded by s->hostmem.
      
      Fixes: 2aece63cSigned-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20180926163709.22876-1-armbru@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      b266f1d1
  3. 02 7月, 2018 1 次提交
  4. 29 6月, 2018 1 次提交
  5. 07 2月, 2018 4 次提交
    • L
      ivshmem: Disable irqfd on device reset · a4022791
      Ladi Prosek 提交于
      The effects of ivshmem_enable_irqfd() was not undone on device reset.
      
      This manifested as:
      ivshmem_add_kvm_msi_virq: Assertion `!s->msi_vectors[vector].pdev' failed.
      
      when irqfd was enabled before reset and then enabled again after reset, making
      ivshmem_enable_irqfd() run for the second time.
      
      To reproduce, run:
      
        ivshmem-server
      
      and QEMU with:
      
        -device ivshmem-doorbell,chardev=iv
        -chardev socket,path=/tmp/ivshmem_socket,id=iv
      
      then install the Windows driver, at the time of writing available at:
      
      https://github.com/virtio-win/kvm-guest-drivers-windows/tree/master/ivshmem
      
      and crash-reboot the guest by inducing a BSOD.
      Signed-off-by: NLadi Prosek <lprosek@redhat.com>
      Message-Id: <20171211072110.9058-5-lprosek@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      a4022791
    • L
      ivshmem: Improve MSI irqfd error handling · 0b88dd94
      Ladi Prosek 提交于
      Adds a rollback path to ivshmem_enable_irqfd() and fixes
      ivshmem_disable_irqfd() to bail if irqfd has not been enabled.
      
      To reproduce, run:
      
        ivshmem-server -n 0
      
      and QEMU with:
      
        -device ivshmem-doorbell,chardev=iv
        -chardev socket,path=/tmp/ivshmem_socket,id=iv
      
      then load, unload, and load again the Windows driver, at the time of writing
      available at:
      
      https://github.com/virtio-win/kvm-guest-drivers-windows/tree/master/ivshmem
      
      The issue is believed to have been masked by other guest drivers, notably
      Linux ones, not enabling MSI-X on the device.
      Signed-off-by: NLadi Prosek <lprosek@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20171211072110.9058-4-lprosek@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      0b88dd94
    • L
      ivshmem: Always remove irqfd notifiers · 089fd803
      Ladi Prosek 提交于
      As of commit 660c97ee ("ivshmem: use kvm irqfd for msi notifications"),
      QEMU crashes with:
      
      ivshmem: msix_set_vector_notifiers failed
      msix_unset_vector_notifiers: Assertion `dev->msix_vector_use_notifier && dev->msix_vector_release_notifier' failed.
      
      if MSI-X is repeatedly enabled and disabled on the ivshmem device, for example
      by loading and unloading the Windows ivshmem driver. This is because
      msix_unset_vector_notifiers() doesn't call any of the release notifier callbacks
      since MSI-X is already disabled at that point (msix_enabled() returning false
      is how this transition is detected in the first place). Thus ivshmem_vector_mask()
      doesn't run and when MSI-X is subsequently enabled again ivshmem_vector_unmask()
      fails.
      
      This is fixed by keeping track of unmasked vectors and making sure that
      ivshmem_vector_mask() always runs on MSI-X disable.
      
      Fixes: 660c97ee ("ivshmem: use kvm irqfd for msi notifications")
      Signed-off-by: NLadi Prosek <lprosek@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20171211072110.9058-3-lprosek@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      089fd803
    • L
      ivshmem: Don't update non-existent MSI routes · e6a354be
      Ladi Prosek 提交于
      As of commit 660c97ee ("ivshmem: use kvm irqfd for msi notifications"),
      QEMU crashes with:
      
        kvm_irqchip_commit_routes: Assertion `ret == 0' failed.
      
      if the ivshmem device is configured with more vectors than what the server
      supports. This is caused by the ivshmem_vector_unmask() being called on
      vectors that have not been initialized by ivshmem_add_kvm_msi_virq().
      
      This commit fixes it by adding a simple check to the mask and unmask
      callbacks.
      
      Note that the opposite mismatch, if the server supplies more vectors than
      what the device is configured for, is already handled and leads to output
      like:
      
        Too many eventfd received, device has 1 vectors
      
      To reproduce the assert, run:
      
        ivshmem-server -n 0
      
      and QEMU with:
      
        -device ivshmem-doorbell,chardev=iv
        -chardev socket,path=/tmp/ivshmem_socket,id=iv
      
      then load the Windows driver, at the time of writing available at:
      
      https://github.com/virtio-win/kvm-guest-drivers-windows/tree/master/ivshmem
      
      The issue is believed to have been masked by other guest drivers, notably
      Linux ones, not enabling MSI-X on the device.
      
      Fixes: 660c97ee ("ivshmem: use kvm irqfd for msi notifications")
      Signed-off-by: NLadi Prosek <lprosek@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20171211072110.9058-2-lprosek@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      e6a354be
  6. 18 12月, 2017 1 次提交
  7. 15 10月, 2017 1 次提交
  8. 20 9月, 2017 1 次提交
  9. 31 7月, 2017 1 次提交
  10. 14 7月, 2017 4 次提交
  11. 15 6月, 2017 1 次提交
  12. 02 6月, 2017 2 次提交
  13. 17 5月, 2017 1 次提交
  14. 24 2月, 2017 4 次提交
  15. 01 2月, 2017 1 次提交
    • C
      pci: Convert msix_init() to Error and fix callers · ee640c62
      Cao jin 提交于
      msix_init() reports errors with error_report(), which is wrong when
      it's used in realize().  The same issue was fixed for msi_init() in
      commit 1108b2f8. In order to make the API change as small as possible,
      leave the return value check to later patch.
      
      For some devices(like e1000e, vmxnet3, nvme) who won't fail because of
      msix_init's failure, suppress the error report by passing NULL error
      object.
      
      Bonus: add comment for msix_init.
      
      CC: Jiri Pirko <jiri@resnulli.us>
      CC: Gerd Hoffmann <kraxel@redhat.com>
      CC: Dmitry Fleytman <dmitry@daynix.com>
      CC: Jason Wang <jasowang@redhat.com>
      CC: Michael S. Tsirkin <mst@redhat.com>
      CC: Hannes Reinecke <hare@suse.de>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: Alex Williamson <alex.williamson@redhat.com>
      CC: Markus Armbruster <armbru@redhat.com>
      CC: Marcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: NCao jin <caoj.fnst@cn.fujitsu.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      ee640c62
  16. 28 1月, 2017 1 次提交
  17. 25 1月, 2017 1 次提交
  18. 18 11月, 2016 1 次提交
  19. 17 11月, 2016 1 次提交
  20. 24 10月, 2016 3 次提交
  21. 15 9月, 2016 1 次提交
  22. 22 7月, 2016 2 次提交
  23. 13 7月, 2016 1 次提交
  24. 17 6月, 2016 1 次提交
  25. 29 5月, 2016 1 次提交
  26. 13 4月, 2016 1 次提交
  27. 23 3月, 2016 1 次提交