On 11/08/2011 04:07 AM, Peter Maydell wrote: > 2011/10/26 Peter Maydell <peter.mayd...@linaro.org>: > > On 25 October 2011 12:09, Benoît Canet <benoit.ca...@gmail.com> wrote: > >> +static const VMStateDescription vmstate_integratorcm = { > >> + .name = "integratorcm", > >> + .version_id = 1, > >> + .minimum_version_id = 1, > >> + .minimum_version_id_old = 1, > >> + .fields = (VMStateField[]) { > >> + VMSTATE_UINT32(memsz, integratorcm_state), > >> + VMSTATE_BOOL(flash_mapped, integratorcm_state), > > > > This raises a question. flash_mapped here is a flag which just > > tracks whether the associated MemoryRegion is currently mapped > > or unmapped. Do we need to do anything special to ensure that > > the MemoryRegion itself is reset to the correct mapped/unmapped > > state on restore? > > > > I recall discussing this kind of thing with Avi on IRC but I > > can't remember what the conclusion was. > > Avi, ping? I'm still interested in the answer to this question.
Sorry, missed this. Yes, you need to ensure the memory region mapping reflects flash_mapped. btw, is flash_mapped a real device state (corresponds to a real memory bit on the device) or just an artefact? It's usually a bad idea to cast implementation artefacts in vmstate concrete. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.