qemu-e2k/include/migration
Peter Xu 9d6b9db19c 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>
2018-02-08 21:06:41 +02:00
..
blocker.h migration: Create migration/blocker.h 2017-05-17 12:04:59 +02:00
colo.h migration: remove check against colo support 2017-07-18 17:36:24 +02:00
cpu.h migration: Add VMSTATE_UINTTL_2DARRAY() 2017-05-04 09:39:01 +09:00
failover.h
global_state.h migration: move global_state.optional out 2017-06-28 11:18:38 +02:00
misc.h migration: finalize current_migration object 2018-01-15 12:48:05 +01:00
qemu-file-types.h migration: Split qemu-file.h 2017-06-01 18:49:22 +02:00
register.h migration: add has_postcopy savevm handler 2017-09-22 14:11:25 +02:00
snapshot.h migration: Create include for migration snapshots 2017-06-01 18:49:23 +02:00
vmstate.h pci/bus: let it has higher migration priority 2018-02-08 21:06:41 +02:00