[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [v15 12/15] vfio: add bus in reset flag
From: |
Cao jin |
Subject: |
[Qemu-devel] [v15 12/15] vfio: add bus in reset flag |
Date: |
Tue, 5 Jan 2016 09:20:53 +0800 |
From: Chen Fan <address@hidden>
mark the host bus be in reset. avoid multiple devices trigger the
host bus reset many times.
Signed-off-by: Chen Fan <address@hidden>
---
hw/vfio/pci.c | 6 ++++++
include/hw/vfio/vfio-common.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index ee88db3..aa0d945 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2249,6 +2249,11 @@ static int vfio_pci_hot_reset(VFIOPCIDevice *vdev, bool
single)
trace_vfio_pci_hot_reset(vdev->vbasedev.name, single ? "one" : "multi");
+ if (vdev->vbasedev.bus_in_reset) {
+ vdev->vbasedev.bus_in_reset = false;
+ return 0;
+ }
+
vfio_pci_pre_reset(vdev);
vdev->vbasedev.needs_reset = false;
@@ -2312,6 +2317,7 @@ static int vfio_pci_hot_reset(VFIOPCIDevice *vdev, bool
single)
}
vfio_pci_pre_reset(tmp);
tmp->vbasedev.needs_reset = false;
+ tmp->vbasedev.bus_in_reset = true;
multi = true;
break;
}
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index f037f3c..44b19d7 100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -95,6 +95,7 @@ typedef struct VFIODevice {
bool reset_works;
bool needs_reset;
bool no_mmap;
+ bool bus_in_reset;
VFIODeviceOps *ops;
unsigned int num_irqs;
unsigned int num_regions;
--
1.9.3
- [Qemu-devel] [v15 04/15] vfio: make the 4 bytes aligned for capability size, (continued)
- [Qemu-devel] [v15 04/15] vfio: make the 4 bytes aligned for capability size, Cao jin, 2016/01/04
- [Qemu-devel] [v15 06/15] aer: impove pcie_aer_init to support vfio device, Cao jin, 2016/01/04
- [Qemu-devel] [v15 07/15] vfio: add aer support for vfio device, Cao jin, 2016/01/04
- [Qemu-devel] [v15 15/15] vfio: add 'aer' property to expose aercap, Cao jin, 2016/01/04
- [Qemu-devel] [v15 09/15] add check reset mechanism when hotplug vfio device, Cao jin, 2016/01/04
- [Qemu-devel] [v15 11/15] vfio: add hot reset callback, Cao jin, 2016/01/04
- [Qemu-devel] [v15 10/15] pci: Introduce device hot reset, Cao jin, 2016/01/04
- [Qemu-devel] [v15 13/15] pcie_aer: expose pcie_aer_msg() interface, Cao jin, 2016/01/04
- [Qemu-devel] [v15 14/15] vfio-pci: pass the aer error to guest, Cao jin, 2016/01/04
- [Qemu-devel] [v15 03/15] pcie: modify the capability size assert, Cao jin, 2016/01/04
- [Qemu-devel] [v15 12/15] vfio: add bus in reset flag,
Cao jin <=
[Qemu-devel] [v15 05/15] vfio: add pcie extanded capability support, Cao jin, 2016/01/04
[Qemu-devel] [v15 08/15] vfio: add check host bus reset is support or not, Cao jin, 2016/01/04