Received: from eggs.gnu.org ([2001:4830:134:3::10]:53383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIbst-0004Il-Qf for qemu-devel@nongnu.org; Mon, 11 Jan 2016 07:47:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aIbss-0008Bv-7p for qemu-devel@nongnu.org; Mon, 11 Jan 2016 07:47:43 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:59281) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aIbsr-0008BK-WA for qemu-devel@nongnu.org; Mon, 11 Jan 2016 07:47:42 -0500 From: Peter Maydell Date: Mon, 11 Jan 2016 12:40:28 +0000 Message-Id: <1452516028-25218-9-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1452516028-25218-1-git-send-email-peter.maydell@linaro.org> References: <1452516028-25218-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH v2 8/8] target-sparc: Migrate CWP and PIL for SPARC64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Juan Quintela , patches@linaro.org, Mark Cave-Ayland , Blue Swirl , Amit Shah , Paolo Bonzini 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 Signed-off-by: Peter Maydell --- target-sparc/machine.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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() }, -- 1.9.1