target/arm: Add dummy needed functions to M profile vmstate subsections

Currently the migration code incorrectly treats a subsection with
no .needed function pointer as if it was the subsection list
terminator -- it is ignored and so is everything after it.
Work around this by giving various M profile vmstate structs
a 'needed' function that always returns true.
We reuse m_needed() for this, since it's always true here.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20180806123445.1459-4-peter.maydell@linaro.org
This commit is contained in:
Peter Maydell 2018-08-06 13:34:43 +01:00
parent adc4fda6d5
commit 7b69454a12

View File

@ -184,6 +184,7 @@ static const VMStateDescription vmstate_m_faultmask_primask = {
.name = "cpu/m/faultmask-primask", .name = "cpu/m/faultmask-primask",
.version_id = 1, .version_id = 1,
.minimum_version_id = 1, .minimum_version_id = 1,
.needed = m_needed,
.fields = (VMStateField[]) { .fields = (VMStateField[]) {
VMSTATE_UINT32(env.v7m.faultmask[M_REG_NS], ARMCPU), VMSTATE_UINT32(env.v7m.faultmask[M_REG_NS], ARMCPU),
VMSTATE_UINT32(env.v7m.primask[M_REG_NS], ARMCPU), VMSTATE_UINT32(env.v7m.primask[M_REG_NS], ARMCPU),
@ -230,6 +231,7 @@ static const VMStateDescription vmstate_m_scr = {
.name = "cpu/m/scr", .name = "cpu/m/scr",
.version_id = 1, .version_id = 1,
.minimum_version_id = 1, .minimum_version_id = 1,
.needed = m_needed,
.fields = (VMStateField[]) { .fields = (VMStateField[]) {
VMSTATE_UINT32(env.v7m.scr[M_REG_NS], ARMCPU), VMSTATE_UINT32(env.v7m.scr[M_REG_NS], ARMCPU),
VMSTATE_END_OF_LIST() VMSTATE_END_OF_LIST()
@ -240,6 +242,7 @@ static const VMStateDescription vmstate_m_other_sp = {
.name = "cpu/m/other-sp", .name = "cpu/m/other-sp",
.version_id = 1, .version_id = 1,
.minimum_version_id = 1, .minimum_version_id = 1,
.needed = m_needed,
.fields = (VMStateField[]) { .fields = (VMStateField[]) {
VMSTATE_UINT32(env.v7m.other_sp, ARMCPU), VMSTATE_UINT32(env.v7m.other_sp, ARMCPU),
VMSTATE_END_OF_LIST() VMSTATE_END_OF_LIST()