summaryrefslogtreecommitdiffstats
path: root/include/hw/pci-host/spapr.h
diff options
context:
space:
mode:
authorDavid Gibson2016-11-23 00:26:38 +0100
committerDavid Gibson2016-11-23 02:00:48 +0100
commit5c4537bded40640b166ec77e112592174b048c21 (patch)
tree506803edd7d5ef141a374e26644c3b236270c404 /include/hw/pci-host/spapr.h
parentRevert "spapr: Fix migration of PCI host bridges from qemu-2.7" (diff)
downloadqemu-5c4537bded40640b166ec77e112592174b048c21.tar.gz
qemu-5c4537bded40640b166ec77e112592174b048c21.tar.xz
qemu-5c4537bded40640b166ec77e112592174b048c21.zip
spapr: Fix 2.7<->2.8 migration of PCI host bridge
daa2369 "spapr_pci: Add a 64-bit MMIO window" subtly broke migration from qemu-2.7 to the current version. It split the device's MMIO window into two pieces for 32-bit and 64-bit MMIO. The patch included backwards compatibility code to convert the old property into the new format. However, the property value was also transferred in the migration stream and compared with a (probably unwise) VMSTATE_EQUAL. So, the "raw" value from 2.7 is compared to the new style converted value from (pre-)2.8 giving a mismatch and migration failure. Along with the actual field that caused the breakage, there are several other ill-advised VMSTATE_EQUAL()s. To fix forwards migration, we read the values in the stream into scratch variables and ignore them, instead of comparing for equality. To fix backwards migration, we populate those scratch variables in pre_save() with adjusted values to match the old behaviour. To permit the eventual possibility of removing this cruft from the stream, we only include these compatibility fields if a new 'pre-2.8-migration' property is set. We clear it on the pseries-2.8 machine type, which obviously can't be migrated backwards, but set it on earlier machine type versions. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'include/hw/pci-host/spapr.h')
-rw-r--r--include/hw/pci-host/spapr.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h
index b92c1b59f1..092294ed5a 100644
--- a/include/hw/pci-host/spapr.h
+++ b/include/hw/pci-host/spapr.h
@@ -79,6 +79,12 @@ struct sPAPRPHBState {
uint64_t dma64_win_addr;
uint32_t numa_node;
+
+ /* Fields for migration compatibility hacks */
+ bool pre_2_8_migration;
+ uint32_t mig_liobn;
+ hwaddr mig_mem_win_addr, mig_mem_win_size;
+ hwaddr mig_io_win_addr, mig_io_win_size;
};
#define SPAPR_PCI_MEM_WIN_BUS_OFFSET 0x80000000ULL