[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v10 15/19] vfio: improve vfio_pci_hot_reset to support
From: |
Chen Fan |
Subject: |
[Qemu-devel] [RFC v10 15/19] vfio: improve vfio_pci_hot_reset to support more case |
Date: |
Tue, 16 Jun 2015 16:10:59 +0800 |
the vfio_pci_hot_reset differentiate the single and multi in-used
devices for reset. but sometimes we own the group without any devices,
that also should support hot reset.
Signed-off-by: Chen Fan <address@hidden>
---
hw/vfio/pci.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index fad6a80..a86edab 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3407,6 +3407,7 @@ static int vfio_pci_hot_reset(VFIOPCIDevice *vdev, bool
single)
PCIHostDeviceAddress host;
VFIOPCIDevice *tmp;
VFIODevice *vbasedev_iter;
+ bool found;
host.domain = devices[i].segment;
host.bus = devices[i].bus;
@@ -3436,6 +3437,7 @@ static int vfio_pci_hot_reset(VFIOPCIDevice *vdev, bool
single)
goto out;
}
+ found = false;
/* Prep dependent devices for reset and clear our marker. */
QLIST_FOREACH(vbasedev_iter, &group->device_list, next) {
if (vbasedev_iter->type != VFIO_DEVICE_TYPE_PCI) {
@@ -3447,12 +3449,21 @@ static int vfio_pci_hot_reset(VFIOPCIDevice *vdev, bool
single)
ret = -EINVAL;
goto out_single;
}
+ found = true;
vfio_pci_pre_reset(tmp);
tmp->vbasedev.needs_reset = false;
multi = true;
break;
}
}
+
+ /*
+ * If we own the group but does not own the device, we also
+ * should call hot reset with multi.
+ */
+ if (!single && !found) {
+ multi = true;
+ }
}
if (!single && !multi) {
--
1.9.3
- [Qemu-devel] [RFC v10 04/19] vfio: make the 4 bytes aligned for capability size, (continued)
- [Qemu-devel] [RFC v10 04/19] vfio: make the 4 bytes aligned for capability size, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 06/19] aer: impove pcie_aer_init to support vfio device, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 08/19] vfio: add ref for group to support own affected groups, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 05/19] vfio: add pcie extanded capability support, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 10/19] vfio: improve vfio_get_group to support adding as is NULL., Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 07/19] vfio: add aer support for vfio device, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 09/19] vfio: extract vfio_register_container_listener from vfio_connect_container, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 11/19] get all affected groups for each device support aer, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 12/19] vfio: add check host bus reset is support or not, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 14/19] vfio: add sec_bus_reset notifier to notify physical bus reset is needed, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 15/19] vfio: improve vfio_pci_hot_reset to support more case,
Chen Fan <=
- [Qemu-devel] [RFC v10 16/19] vfio: do hot bus reset when do virtual secondary bus reset, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 17/19] pcie_aer: expose pcie_aer_msg() interface, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 18/19] vfio-pci: pass the aer error to guest, Chen Fan, 2015/06/16
- [Qemu-devel] [RFC v10 13/19] pci: add bus reset_notifiers callbacks for host bus reset, Chen Fan, 2015/06/16
[Qemu-devel] [RFC v10 19/19] vfio: add 'aer' property to expose aercap, Chen Fan, 2015/06/16