Fiona Ebner <f.eb...@proxmox.com> wrote: > Am 03.05.23 um 02:27 schrieb Leonardo Bras: >> Since it's implementation on v8.0.0-rc0, having the PCI_ERR_UNCOR_MASK >> set for machine types < 8.0 will cause migration to fail if the target >> QEMU version is < 8.0.0 : >> >> qemu-system-x86_64: get_pci_config_device: Bad config data: i=0x10a read: 40 >> device: 0 cmask: ff wmask: 0 w1cmask:0 >> qemu-system-x86_64: Failed to load PCIDevice:config >> qemu-system-x86_64: Failed to load e1000e:parent_obj >> qemu-system-x86_64: error while loading state for instance 0x0 of device >> '0000:00:02.0/e1000e' >> qemu-system-x86_64: load of migration failed: Invalid argument >> >> The above test migrated a 7.2 machine type from QEMU master to QEMU 7.2.0, >> with this cmdline: >> >> ./qemu-system-x86_64 -M pc-q35-7.2 [-incoming XXX] >> >> In order to fix this, property x-pcie-err-unc-mask was introduced to >> control when PCI_ERR_UNCOR_MASK is enabled. This property is enabled by >> default, but is disabled if machine type <= 7.2. >> >> Fixes: 010746ae1d ("hw/pci/aer: Implement PCI_ERR_UNCOR_MASK register") >> Suggested-by: Michael S. Tsirkin <m...@redhat.com> >> Signed-off-by: Leonardo Bras <leob...@redhat.com> > > Thank you for the patch! > > Closes: https://gitlab.com/qemu-project/qemu/-/issues/1576 > > AFAICT, this breaks (forward) migration from 8.0 to 8.0 + this patch > when using machine type <= 7.2. That is because after this patch, when > using machine type <= 7.2, the wmask for the register is not set and > when 8.0 sends a nonzero value for the register, the error condition in > get_pci_config_device() will trigger again.
I think that works correctly. See https://lists.gnu.org/archive/html/qemu-devel/2023-05/msg02733.html What we have (before this patch) (using abbrevs as in the doc before) Current state: (1) qemu-8.0 -M pc-8.0 -> qemu-8.0 -M pc-8.0 works not affected by the patch (2) qemu-7.2 -M pc-7.2 -> qemu-8.0 -M pc-8.0 works works well because 7.2 don't change that field (3) qemu-8.0 -M pc-7.2 -> qemu-7.2 -M pc-7.2 fails With the patch we fixed 3, so once it is in stable, 1 and 2 continue as usual and for (3) we will have: (3) qemu-8.0.1 -M pc-7.2 -> qemu-7.2 -M pc-7.2 works If what you mean is that: (3) qemu-8.0 -M pc-7.2 -> qemu-8.0.1 -M pc-7.2 works Will fail, that is true, but I can think a "sane" way to fix this. > Is it necessary to also handle that? Maybe by special casing the error > condition in get_pci_config_device() to be prepared to accept such a > stream from 8.0? Well, we can do that, but it is to the pci maintainers to decide if that is "sane". > If that is considered not worth it, consider this: > > Tested-by: Fiona Ebner <f.eb...@proxmox.com> > > Best Regards, > Fiona Later, Juan.