diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-01-11 12:40:28 +0000 |
---|---|---|
committer | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2016-01-16 12:01:23 +0000 |
commit | 6d5322442a6904fef51a409ec40f2945581220d6 (patch) | |
tree | 1d647ef147cb02a49940419cf9bbe2666f7d925f | |
parent | 0e88d45a33928445aa3031ee76af354b4f6b3088 (diff) | |
download | qemu-6d5322442a6904fef51a409ec40f2945581220d6.zip qemu-6d5322442a6904fef51a409ec40f2945581220d6.tar.gz qemu-6d5322442a6904fef51a409ec40f2945581220d6.tar.bz2 |
target-sparc: Migrate CWP and PIL for SPARC64
In SPARC32 the env->cwp and env->psrpil state is part of the PSR
register, and gets migrated as part of that register.
In SPARC64 this state is in separate CWP and PIL registers, but we
were not doing anything to migrate those.
Add the missing fields to the migration vmstate (which is a
migration break, but without these fields migration is completely
broken anyway).
This change means that trying a save/load of a SPARC64 target at
the boot rom prompt now produces a system which at least responds
to keyboard input after the restore.
Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
-rw-r--r-- | target-sparc/machine.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/target-sparc/machine.c b/target-sparc/machine.c index f8eebdd..aecbe2c 100644 --- a/target-sparc/machine.c +++ b/target-sparc/machine.c @@ -100,7 +100,7 @@ static void cpu_pre_save(void *opaque) #ifndef TARGET_SPARC64 #define SPARC_VMSTATE_VER 7 #else -#define SPARC_VMSTATE_VER 8 +#define SPARC_VMSTATE_VER 9 #endif const VMStateDescription vmstate_sparc_cpu = { @@ -181,6 +181,9 @@ const VMStateDescription vmstate_sparc_cpu = { VMSTATE_UINT64(env.hstick_cmpr, SPARCCPU), VMSTATE_UINT64(env.ssr, SPARCCPU), VMSTATE_CPU_TIMER(env.hstick, SPARCCPU), + /* On SPARC32 env.psrpil and env.cwp are migrated as part of the PSR */ + VMSTATE_UINT32(env.psrpil, SPARCCPU), + VMSTATE_UINT32(env.cwp, SPARCCPU), #endif VMSTATE_END_OF_LIST() }, |