YaGL: Fix QEMU 1.6 merge cpu state related bugs
authorStanislav Vorobiov <s.vorobiov@samsung.com>
Mon, 16 Sep 2013 13:47:41 +0000 (17:47 +0400)
committerStanislav Vorobiov <s.vorobiov@samsung.com>
Mon, 16 Sep 2013 13:47:41 +0000 (17:47 +0400)
current_cpu is not CPUX86State,
CPUX86State is in current_cpu->env_ptr now

hw/yagl_process.c
hw/yagl_thread.c

index 3e384288e7939b767f9a6de63b182bdaf6e59014..2c672aa23337d206ced5a18de31999647e5ce3f8 100644 (file)
@@ -18,7 +18,7 @@ struct yagl_process_state
 
 #ifdef CONFIG_KVM
     cpu_synchronize_state(current_cpu);
-    memcpy(&ps->cr[0], &((CPUX86State*)current_cpu)->cr[0], sizeof(ps->cr));
+    memcpy(&ps->cr[0], &((CPUX86State*)current_cpu->env_ptr)->cr[0], sizeof(ps->cr));
 #endif
 
     return ps;
index b497ccdc93392b2b3cccdbb33d83e6c9f414b893..eded5b5b815544c25d7b5269e9aa98491091fb18 100644 (file)
@@ -15,7 +15,7 @@ YAGL_DEFINE_TLS(struct yagl_thread_state*, cur_ts);
 static __inline void yagl_cpu_synchronize_state(struct yagl_process_state *ps)
 {
     if (kvm_enabled()) {
-        memcpy(&((CPUX86State*)current_cpu)->cr[0], &ps->cr[0], sizeof(ps->cr));
+        memcpy(&((CPUX86State*)current_cpu->env_ptr)->cr[0], &ps->cr[0], sizeof(ps->cr));
     }
 }
 #else