[v2,10/11] target/arm: Migrate v7m.other_sp

Message ID 20180209165810.6668-11-peter.maydell@linaro.org
State Superseded
Headers show
Series
  • v8m: minor missing regs and bugfixes
Related show

Commit Message

Peter Maydell Feb. 9, 2018, 4:58 p.m.
In commit abc24d86cc0364f we accidentally broke migration of
the stack pointer value for the mode (process, handler) the CPU
is not currently running as. (The commit correctly removed the
no-longer-used v7m.current_sp flag from the VMState but also
deleted the still very much in use v7m.other_sp SP value field.)

Add a subsection to migrate it again. (We don't need to care
about trying to retain compatibility with pre-abc24d86cc0364f
versions of QEMU, because that commit bumped the version_id
and we've since bumped it again a couple of times.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

---
 target/arm/machine.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

-- 
2.16.1

Comments

Richard Henderson Feb. 9, 2018, 9:13 p.m. | #1
On 02/09/2018 08:58 AM, Peter Maydell wrote:
> In commit abc24d86cc0364f we accidentally broke migration of

> the stack pointer value for the mode (process, handler) the CPU

> is not currently running as. (The commit correctly removed the

> no-longer-used v7m.current_sp flag from the VMState but also

> deleted the still very much in use v7m.other_sp SP value field.)

> 

> Add a subsection to migrate it again. (We don't need to care

> about trying to retain compatibility with pre-abc24d86cc0364f

> versions of QEMU, because that commit bumped the version_id

> and we've since bumped it again a couple of times.)

> 

> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

> ---

>  target/arm/machine.c | 11 +++++++++++

>  1 file changed, 11 insertions(+)


Reviewed-by: Richard Henderson <richard.henderson@linaro.org>



r~

Patch

diff --git a/target/arm/machine.c b/target/arm/machine.c
index 25cdf4d581..1a20d6c36c 100644
--- a/target/arm/machine.c
+++ b/target/arm/machine.c
@@ -236,6 +236,16 @@  static const VMStateDescription vmstate_m_scr = {
     }
 };
 
+static const VMStateDescription vmstate_m_other_sp = {
+    .name = "cpu/m/other-sp",
+    .version_id = 1,
+    .minimum_version_id = 1,
+    .fields = (VMStateField[]) {
+        VMSTATE_UINT32(env.v7m.other_sp, ARMCPU),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
 static const VMStateDescription vmstate_m = {
     .name = "cpu/m",
     .version_id = 4,
@@ -259,6 +269,7 @@  static const VMStateDescription vmstate_m = {
         &vmstate_m_faultmask_primask,
         &vmstate_m_csselr,
         &vmstate_m_scr,
+        &vmstate_m_other_sp,
         NULL
     }
 };