qemu-e2k/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_interface.c
acpi-cpu-hotplug-stub.c hw/acpi: refactor acpi hp modules so that targets can just use what they need 2021-09-04 09:07:46 -04:00
acpi-mem-hotplug-stub.c hw/acpi: refactor acpi hp modules so that targets can just use what they need 2021-09-04 09:07:46 -04:00
acpi-nvdimm-stub.c hw/acpi: refactor acpi hp modules so that targets can just use what they need 2021-09-04 09:07:46 -04:00
acpi-pci-hotplug-stub.c acpi: fix acpi_index migration 2022-04-06 20:03:26 +01:00
acpi-stub.c
acpi-x86-stub.c acpi: x86: set enabled when composing _MAT entries 2021-10-05 17:30:57 -04:00
aml-build-stub.c acpi: add aml builder stubs 2020-10-21 11:36:19 +02:00
aml-build.c Replace GCC_FMT_ATTR with G_GNUC_PRINTF 2022-03-22 14:40:51 +04:00
bios-linker-loader.c
core.c acpi: fix QEMU crash when started with SLIC table 2022-01-07 19:30:13 -05:00
cpu_hotplug.c
cpu.c Remove unnecessary minimum_version_id_old fields 2022-01-28 15:38:23 +01:00
erst.c hw/acpi/erst: clean up unused IS_UEFI_CPER_RECORD macro 2022-03-04 08:30:52 -05:00
generic_event_device.c acpi/ged: fix reset cause 2021-07-03 03:12:35 -04:00
ghes-stub.c hw/acpi: Provide function acpi_ghes_present() 2021-06-21 16:49:37 +01:00
ghes.c acpi: acpi_build_hest: use acpi_table_begin()/acpi_table_end() instead of build_header() 2021-10-05 17:30:57 -04:00
hmat.c Use g_new() & friends where that makes obvious sense 2022-03-21 15:44:44 +01:00
hmat.h acpi: Permit OEM ID and OEM table ID fields to be changed 2021-02-05 08:52:59 -05:00
ich9.c Remove unnecessary minimum_version_id_old fields 2022-01-28 15:38:23 +01:00
ipmi-stub.c
ipmi.c
Kconfig ACPI ERST: support for ACPI ERST feature 2022-02-06 04:33:50 -05:00
memory_hotplug.c hw/acpi/memory_hotplug: Remove unused 'hw/acpi/pc-hotplug.h' header 2022-02-21 10:18:06 +01:00
meson.build configure, meson: move TPM check to meson 2022-02-21 10:35:53 +01:00
nvdimm.c nvdimm: release the correct device list 2021-10-05 17:30:57 -04:00
pci.c acpi: build_mcfg: use acpi_table_begin()/acpi_table_end() instead of build_header() 2021-10-05 17:30:57 -04:00
pcihp.c acpi: fix acpi_index migration 2022-04-06 20:03:26 +01:00
piix4.c acpi: fix acpi_index migration 2022-04-06 20:03:26 +01:00
tco.c Remove unnecessary minimum_version_id_old fields 2022-01-28 15:38:23 +01:00
tpm.c docs: fix references to docs/specs/tpm.rst 2021-06-02 06:51:09 +02:00
trace-events ACPI ERST: support for ACPI ERST feature 2022-02-06 04:33:50 -05:00
trace.h
utils.c acpi: Set proper maximum size for "etc/acpi/rsdp" blob 2021-03-22 18:58:19 -04:00
viot.c hw/acpi: Add VIOT table 2021-11-01 18:49:10 -04:00
viot.h hw/acpi: Add VIOT table 2021-11-01 18:49:10 -04:00
vmgenid.c acpi: vmgenid_build_acpi: use acpi_table_begin()/acpi_table_end() instead of build_header() 2021-10-05 17:30:57 -04:00