qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 0/1] VFIO fixes 2020-01-06
@ 2020-01-06 22:09 Alex Williamson
  2020-01-06 22:09 ` [PULL 1/1] vfio/pci: Don't remove irqchip notifier if not registered Alex Williamson
  2020-01-07 14:30 ` [PULL 0/1] VFIO fixes 2020-01-06 Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Alex Williamson @ 2020-01-06 22:09 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit 48008198270e3ebcc9394401d676c54ed5ac139c:

  Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2019-12-20 11:20:25 +0000)

are available in the Git repository at:

  git://github.com/awilliam/qemu-vfio.git tags/vfio-fixes-20200106.0

for you to fetch changes up to 0446f8121723b134ca1d1ed0b73e96d4a0a8689d:

  vfio/pci: Don't remove irqchip notifier if not registered (2020-01-06 14:19:42 -0700)

----------------------------------------------------------------
VFIO fixes 2020-01-06

 - Fix irqchip notifier de-registration if not registered (Peter Xu)

----------------------------------------------------------------
Peter Xu (1):
      vfio/pci: Don't remove irqchip notifier if not registered

 hw/vfio/pci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)



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

* [PULL 1/1] vfio/pci: Don't remove irqchip notifier if not registered
  2020-01-06 22:09 [PULL 0/1] VFIO fixes 2020-01-06 Alex Williamson
@ 2020-01-06 22:09 ` Alex Williamson
  2020-01-07 14:30 ` [PULL 0/1] VFIO fixes 2020-01-06 Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Williamson @ 2020-01-06 22:09 UTC (permalink / raw)
  To: qemu-devel

From: Peter Xu <peterx@redhat.com>

The kvm irqchip notifier is only registered if the device supports
INTx, however it's unconditionally removed.  If the assigned device
does not support INTx, this will cause QEMU to crash when unplugging
the device from the system.  Change it to conditionally remove the
notifier only if the notify hook is setup.

CC: Eduardo Habkost <ehabkost@redhat.com>
CC: David Gibson <david@gibson.dropbear.id.au>
CC: Alex Williamson <alex.williamson@redhat.com>
Cc: qemu-stable@nongnu.org # v4.2
Reported-by: yanghliu@redhat.com
Debugged-by: Eduardo Habkost <ehabkost@redhat.com>
Fixes: c5478fea27ac ("vfio/pci: Respond to KVM irqchip change notifier")
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1782678
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
 hw/vfio/pci.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 2d40b396f24c..337a173ce7c6 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3076,7 +3076,9 @@ static void vfio_exitfn(PCIDevice *pdev)
     vfio_unregister_req_notifier(vdev);
     vfio_unregister_err_notifier(vdev);
     pci_device_set_intx_routing_notifier(&vdev->pdev, NULL);
-    kvm_irqchip_remove_change_notifier(&vdev->irqchip_change_notifier);
+    if (vdev->irqchip_change_notifier.notify) {
+        kvm_irqchip_remove_change_notifier(&vdev->irqchip_change_notifier);
+    }
     vfio_disable_interrupts(vdev);
     if (vdev->intx.mmap_timer) {
         timer_free(vdev->intx.mmap_timer);



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

* Re: [PULL 0/1] VFIO fixes 2020-01-06
  2020-01-06 22:09 [PULL 0/1] VFIO fixes 2020-01-06 Alex Williamson
  2020-01-06 22:09 ` [PULL 1/1] vfio/pci: Don't remove irqchip notifier if not registered Alex Williamson
@ 2020-01-07 14:30 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2020-01-07 14:30 UTC (permalink / raw)
  To: Alex Williamson; +Cc: QEMU Developers

On Mon, 6 Jan 2020 at 22:11, Alex Williamson <alex.williamson@redhat.com> wrote:
>
> The following changes since commit 48008198270e3ebcc9394401d676c54ed5ac139c:
>
>   Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging (2019-12-20 11:20:25 +0000)
>
> are available in the Git repository at:
>
>   git://github.com/awilliam/qemu-vfio.git tags/vfio-fixes-20200106.0
>
> for you to fetch changes up to 0446f8121723b134ca1d1ed0b73e96d4a0a8689d:
>
>   vfio/pci: Don't remove irqchip notifier if not registered (2020-01-06 14:19:42 -0700)
>
> ----------------------------------------------------------------
> VFIO fixes 2020-01-06
>
>  - Fix irqchip notifier de-registration if not registered (Peter Xu)
>

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/5.0
for any user-visible changes.

-- PMM


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

end of thread, other threads:[~2020-01-07 14:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06 22:09 [PULL 0/1] VFIO fixes 2020-01-06 Alex Williamson
2020-01-06 22:09 ` [PULL 1/1] vfio/pci: Don't remove irqchip notifier if not registered Alex Williamson
2020-01-07 14:30 ` [PULL 0/1] VFIO fixes 2020-01-06 Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).