On Wed, 8 Jan 2020 at 11:33, Dongjiu Geng <gengdongjiu@xxxxxxxxxx> wrote: > > Record the GHEB address via fw_cfg file, when recording > a error to CPER, it will use this address to find out > Generic Error Data Entries and write the error. > > Make the HEST GHES to a GED device. > > Signed-off-by: Dongjiu Geng <gengdongjiu@xxxxxxxxxx> > Signed-off-by: Xiang Zheng <zhengxiang9@xxxxxxxxxx> > --- > hw/acpi/generic_event_device.c | 15 ++++++++++++++- > hw/acpi/ghes.c | 16 ++++++++++++++++ > hw/arm/virt-acpi-build.c | 13 ++++++++++++- > include/hw/acpi/generic_event_device.h | 2 ++ > include/hw/acpi/ghes.h | 6 ++++++ > 5 files changed, 50 insertions(+), 2 deletions(-) > > diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c > index 9cee90c..9bf37e4 100644 > --- a/hw/acpi/generic_event_device.c > +++ b/hw/acpi/generic_event_device.c > @@ -234,12 +234,25 @@ static const VMStateDescription vmstate_ged_state = { > } > }; > > +static const VMStateDescription vmstate_ghes_state = { > + .name = "acpi-ghes-state", > + .version_id = 1, > + .minimum_version_id = 1, > + .fields = (VMStateField[]) { > + VMSTATE_UINT64(ghes_addr_le, AcpiGhesState), > + VMSTATE_END_OF_LIST() > + } > +}; > + > static const VMStateDescription vmstate_acpi_ged = { > .name = "acpi-ged", > .version_id = 1, > .minimum_version_id = 1, > .fields = (VMStateField[]) { > - VMSTATE_STRUCT(ged_state, AcpiGedState, 1, vmstate_ged_state, GEDState), > + VMSTATE_STRUCT(ged_state, AcpiGedState, 1, > + vmstate_ged_state, GEDState), > + VMSTATE_STRUCT(ghes_state, AcpiGedState, 1, > + vmstate_ghes_state, AcpiGhesState), > VMSTATE_END_OF_LIST(), > }, > .subsections = (const VMStateDescription * []) { You can't just add fields to an existing VMStateDescription like this -- it will break migration compatibility. Instead you need to add a new subsection to this vmstate, with a '.needed' function which indicates when the subsection should be present. thanks -- PMM