qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.6] ppc: Fix migration of the XER register
@ 2016-04-15  9:03 Thomas Huth
  2016-04-15 10:17 ` Mark Cave-Ayland
  2016-04-18  1:53 ` David Gibson
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Huth @ 2016-04-15  9:03 UTC (permalink / raw)
  To: qemu-ppc, david; +Cc: agraf, qemu-devel, aik, rth

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 <thuth@redhat.com>
---
 In case somebody wants to test this, this problem can easily be
 seen with my SPRs kvm-unit-test on KVM running on a P8 machine:
 https://patchwork.ozlabs.org/patch/607981/

 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
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-18  4:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-15  9:03 [Qemu-devel] [PATCH for-2.6] ppc: Fix migration of the XER register Thomas Huth
2016-04-15 10:17 ` Mark Cave-Ayland
2016-04-15 12:17   ` Thomas Huth
2016-04-18  1:53 ` David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).