From: SeokYeon Hwang Date: Thu, 3 Nov 2016 13:07:55 +0000 (+0900) Subject: hax: fix "hflags" synchronization problem X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~19^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=10313ec1de30cbcd794075e91f002d0d5f727fa3;p=sdk%2Femulator%2Fqemu.git hax: fix "hflags" synchronization problem CPUState synchronization should be done after MSR_EFER is updated. Change-Id: I904564896d64ec9c31137cd5f2c47738ef2b79fd Signed-off-by: SeokYeon Hwang --- diff --git a/hw/yagl/yagl_process.c b/hw/yagl/yagl_process.c index 16bff173a3..1e6844f831 100644 --- a/hw/yagl/yagl_process.c +++ b/hw/yagl/yagl_process.c @@ -62,7 +62,6 @@ struct yagl_process_state &((CPUX86State *)current_cpu->env_ptr)->cr[0], sizeof(ps->cr)); ps->hflags = env->hflags; - ps->efer = env->efer; } #endif diff --git a/hw/yagl/yagl_process.h b/hw/yagl/yagl_process.h index 0768f07c41..bbf4568b58 100644 --- a/hw/yagl/yagl_process.h +++ b/hw/yagl/yagl_process.h @@ -58,7 +58,6 @@ struct yagl_process_state #if defined (CONFIG_KVM) || defined (CONFIG_HAX) target_ulong cr[5]; uint32_t hflags; - uint64_t efer; #endif }; diff --git a/hw/yagl/yagl_thread.c b/hw/yagl/yagl_thread.c index 9481f48131..b965e32371 100644 --- a/hw/yagl/yagl_thread.c +++ b/hw/yagl/yagl_thread.c @@ -62,13 +62,6 @@ static __inline void yagl_cpu_synchronize_state(struct yagl_process_state *ps) &ps->cr[0], sizeof(ps->cr)); env->hflags = ps->hflags; - - // FIXME: Somtimes "hflags" is not synced propery on HAX. - // It can be bug on synchronizing CPU state - env->efer = ps->efer; - if (env->efer & MSR_EFER_LMA) { - env->hflags |= HF_LMA_MASK; - } } } #else diff --git a/target-i386/hax-all.c b/target-i386/hax-all.c index dfff5279db..10fec180a3 100644 --- a/target-i386/hax-all.c +++ b/target-i386/hax-all.c @@ -1234,8 +1234,14 @@ static int hax_sync_vcpu_register(CPUArchState *env, int set) if (ret < 0) return -1; } + + // it should be done after get_msrs, since it needs + // EFER synchonization +#if 0 if (!set) hax_setup_qemu_emulator(env); +#endif + return 0; } @@ -1406,6 +1412,8 @@ static int hax_arch_get_registers(CPUArchState *env) if (ret < 0) return ret; + hax_setup_qemu_emulator(env); + return 0; }