[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-7.2.5 37/44] vfio/pci: Disable INTx in vfio_realize error path
From: |
Michael Tokarev |
Subject: |
[Stable-7.2.5 37/44] vfio/pci: Disable INTx in vfio_realize error path |
Date: |
Sat, 5 Aug 2023 22:38:00 +0300 |
From: Zhenzhong Duan <zhenzhong.duan@intel.com>
When vfio realize fails, INTx isn't disabled if it has been enabled.
This may confuse host side with unhandled interrupt report.
Fixes: c5478fea27ac ("vfio/pci: Respond to KVM irqchip change notifier")
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
(cherry picked from commit adee0da0368f50b3ee934cdeeb6076466dabb268)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 92a45de4c3..71509f9c7e 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3158,6 +3158,9 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
return;
out_deregister:
+ if (vdev->interrupt == VFIO_INT_INTx) {
+ vfio_intx_disable(vdev);
+ }
pci_device_set_intx_routing_notifier(&vdev->pdev, NULL);
if (vdev->irqchip_change_notifier.notify) {
kvm_irqchip_remove_change_notifier(&vdev->irqchip_change_notifier);
--
2.39.2
- [Stable-7.2.5 00/44] Patch Round-up for stable 7.2.5, freeze on 2023-08-05, Michael Tokarev, 2023/08/05
- [Stable-7.2.5 37/44] vfio/pci: Disable INTx in vfio_realize error path,
Michael Tokarev <=
- [Stable-7.2.5 38/44] vdpa: Fix possible use-after-free for VirtQueueElement, Michael Tokarev, 2023/08/05
- [Stable-7.2.5 39/44] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_mac(), Michael Tokarev, 2023/08/05
- [Stable-7.2.5 40/44] vdpa: Return -EIO if device ack is VIRTIO_NET_ERR in _load_mq(), Michael Tokarev, 2023/08/05
- [Stable-7.2.5 41/44] target/ppc: Implement ASDR register for ISA v3.0 for HPT, Michael Tokarev, 2023/08/05
- [Stable-7.2.5 42/44] target/ppc: Fix pending HDEC when entering PM state, Michael Tokarev, 2023/08/05
- [Stable-7.2.5 43/44] target/ppc: Fix VRMA page size for ISA v3.0, Michael Tokarev, 2023/08/05
- [Stable-7.2.5 44/44] target/i386: Check CR0.TS before enter_mmx, Michael Tokarev, 2023/08/05