Re: [PATCH v2] acpi: fix acpi_index migration

2022-04-06 Thread Michael S. Tsirkin
On Wed, Apr 06, 2022 at 09:29:02PM +0100, Peter Maydell wrote: > On Wed, 6 Apr 2022 at 19:59, Dr. David Alan Gilbert > wrote: > > > > * Igor Mammedov (imamm...@redhat.com) wrote: > > > From: "Dr. David Alan Gilbert" > > > > > > vmstate_acpi_pcihp_use_acpi_index() was expecting AcpiPciHpState > >

Re: [PATCH v2] acpi: fix acpi_index migration

2022-04-06 Thread Peter Maydell
On Wed, 6 Apr 2022 at 19:59, Dr. David Alan Gilbert wrote: > > * Igor Mammedov (imamm...@redhat.com) wrote: > > From: "Dr. David Alan Gilbert" > > > > vmstate_acpi_pcihp_use_acpi_index() was expecting AcpiPciHpState > > as state but it actually received PIIX4PMState, because > > VMSTATE_PCI_HOTPL

Re: [PATCH v2] acpi: fix acpi_index migration

2022-04-06 Thread Dr. David Alan Gilbert
* Igor Mammedov (imamm...@redhat.com) wrote: > From: "Dr. David Alan Gilbert" > > 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 p

[PATCH v2] acpi: fix acpi_index migration

2022-04-06 Thread Igor Mammedov
From: "Dr. David Alan Gilbert" 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_i