From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1as1Y2-0002Dl-4Y for qemu-devel@nongnu.org; Mon, 18 Apr 2016 01:16:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1as1Xy-0002NJ-V9 for qemu-devel@nongnu.org; Mon, 18 Apr 2016 01:16:34 -0400 From: David Gibson Date: Mon, 18 Apr 2016 15:17:47 +1000 Message-Id: <1460956667-9520-4-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <1460956667-9520-1-git-send-email-david@gibson.dropbear.id.au> References: <1460956667-9520-1-git-send-email-david@gibson.dropbear.id.au> Subject: [Qemu-devel] [PULL 3/3] ppc: Fix migration of the XER register List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: agraf@suse.de, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, Thomas Huth , David Gibson From: Thomas Huth env->xer only holds the lower bits of the XER register nowadays, the SO, OV and CA bits are stored in separate variables (see the function cpu_write_xer() for details). Since the migration code currently only reads the "xer" variable, the upper bits are lost during migration. Fix it by using cpu_read_xer() instead. Signed-off-by: Thomas Huth Signed-off-by: David Gibson --- target-ppc/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-ppc/machine.c b/target-ppc/machine.c index 692121e..46684fb 100644 --- a/target-ppc/machine.c +++ b/target-ppc/machine.c @@ -136,7 +136,7 @@ static void cpu_pre_save(void *opaque) env->spr[SPR_LR] = env->lr; env->spr[SPR_CTR] = env->ctr; - env->spr[SPR_XER] = env->xer; + env->spr[SPR_XER] = cpu_read_xer(env); #if defined(TARGET_PPC64) env->spr[SPR_CFAR] = env->cfar; #endif -- 2.5.5