qemu/include/hw/acpi
Dr. David Alan Gilbert a83c284490 acpi: fix acpi_index migration
vmstate_acpi_pcihp_use_acpi_index() was expecting AcpiPciHpState
as state but it actually received PIIX4PMState, because
VMSTATE_PCI_HOTPLUG is a macro and not another struct.
So it ended up accessing random pointer, which resulted
in 'false' return value and acpi_index field wasn't ever
sent.

However in 7.0 that pointer de-references to value > 0, and
destination QEMU starts to expect the field which isn't
sent in migratioon stream from older QEMU (6.2 and older).
As result migration fails with:
  qemu-system-x86_64: Missing section footer for 0000:00:01.3/piix4_pm
  qemu-system-x86_64: load of migration failed: Invalid argument

In addition with QEMU-6.2, destination due to not expected
state, also never expects the acpi_index field in migration
stream.

Q35 is not affected as it always sends/expects the field as
long as acpi based PCI hotplug is enabled.

Fix issue by introducing compat knob to never send/expect
acpi_index in migration stream for 6.2 and older PC machine
types and always send it for 7.0 and newer PC machine types.

Diagnosed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Fixes: b32bd76 ("pci: introduce acpi-index property for PCI device")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/932
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2022-04-06 20:03:26 +01:00
..
acpi_dev_interface.h acpi: x86: set enabled when composing _MAT entries 2021-10-05 17:30:57 -04:00
acpi-defs.h hw/acpi: add indication for i8042 in IA-PC boot flags of the FADT table 2022-03-06 16:06:16 -05:00
acpi.h hw/acpi: define PIIX4 acpi pci hotplug property strings at a single place 2021-09-04 09:07:45 -04:00
aml-build.h Replace GCC_FMT_ATTR with G_GNUC_PRINTF 2022-03-22 14:40:51 +04:00
bios-linker-loader.h
cpu_hotplug.h
cpu.h x86: acpi: let the firmware handle pending "CPU remove" events in SMM 2020-12-09 13:04:17 -05:00
erst.h ACPI ERST: create ACPI ERST table for pc/x86 machines 2022-02-06 04:33:50 -05:00
generic_event_device.h acpi: Delete broken ACPI_GED_X86 macro 2021-09-04 09:07:46 -04:00
ghes.h hw/acpi: Provide function acpi_ghes_present() 2021-06-21 16:49:37 +01:00
ich9.h hw/acpi/ich9: Add compat prop to keep HPC bit set for 6.1 machine type 2021-11-15 09:44:46 -05:00
ipmi.h ipmi: Fix SSIF ACPI handling to use the right CRS 2019-09-20 14:08:10 -05:00
memory_hotplug.h hw/acpi: Make ACPI IO address space configurable 2019-10-05 17:12:08 -04:00
pc-hotplug.h
pci.h pci: acpi: add _DSM method to PCI devices 2021-03-22 18:58:19 -04:00
pcihp.h acpi: fix acpi_index migration 2022-04-06 20:03:26 +01:00
tco.h Include migration/vmstate.h less 2019-08-16 13:31:52 +02:00
tpm.h acpi: Eliminate all TPM related code if CONFIG_TPM is not set 2021-06-15 10:55:03 -04:00
utils.h acpi: Move maximum size logic into acpi_add_rom_blob() 2021-03-22 18:58:19 -04:00
vmgenid.h acpi: Permit OEM ID and OEM table ID fields to be changed 2021-02-05 08:52:59 -05:00