aboutsummaryrefslogtreecommitdiff
path: root/include/migration/vmstate.h
diff options
context:
space:
mode:
authorPeter Xu <peterx@redhat.com>2018-02-06 15:39:33 +0800
committerMichael S. Tsirkin <mst@redhat.com>2018-02-08 21:06:41 +0200
commit9d6b9db19c4b99ce5a1ad75b490c01edd2c2b0cf (patch)
tree862561dfb8ba77db1a987e3c4c13b9e7770ccfec /include/migration/vmstate.h
parented247f40db84c8bd4bb7d10948702cd47cc4d5ae (diff)
downloadqemu-9d6b9db19c4b99ce5a1ad75b490c01edd2c2b0cf.zip
qemu-9d6b9db19c4b99ce5a1ad75b490c01edd2c2b0cf.tar.gz
qemu-9d6b9db19c4b99ce5a1ad75b490c01edd2c2b0cf.tar.bz2
pci/bus: let it has higher migration priority
In the past, we prioritized IOMMU migration so that we have such a priority order: IOMMU > PCI Devices When migrating a guest with both vIOMMU and a pcie-root-port, we'll always migrate vIOMMU first, since pci buses will be seen to have the same priority of general PCI devices. That's problematic. The thing is that PCI bus number information is stored in the root port, and that is needed by vIOMMU during post_load(), e.g., to figure out context entry for a device. If we don't have correct bus numbers for devices, we won't be able to recover device state of the DMAR memory regions, and things will be messed up. So let's boost the PCIe root ports to be even with higher priority: PCIe Root Port > IOMMU > PCI Devices A smoke test shows that this patch fixes bug 1538953. Also, apply this rule to all the PCI bus/bridge devices: ioh3420, xio3130_downstream, xio3130_upstream, pcie_pci_bridge, pci-pci bridge, i82801b11. I noted that we set pcie_pci_bridge_dev_vmstate twice. Clean that up together. CC: Alex Williamson <alex.williamson@redhat.com> CC: Marcel Apfelbaum <marcel@redhat.com> CC: Michael S. Tsirkin <mst@redhat.com> CC: Dr. David Alan Gilbert <dgilbert@redhat.com> CC: Juan Quintela <quintela@redhat.com> CC: Laurent Vivier <lvivier@redhat.com> Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1538953 Reported-by: Maxime Coquelin <maxime.coquelin@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/migration/vmstate.h')
-rw-r--r--include/migration/vmstate.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index 8c38894..df463fd 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -148,6 +148,7 @@ enum VMStateFlags {
typedef enum {
MIG_PRI_DEFAULT = 0,
MIG_PRI_IOMMU, /* Must happen before PCI devices */
+ MIG_PRI_PCI_BUS, /* Must happen before IOMMU */
MIG_PRI_GICV3_ITS, /* Must happen before PCI devices */
MIG_PRI_GICV3, /* Must happen before the ITS */
MIG_PRI_MAX,