* [Qemu-devel] [PATCH] target-i386: Don't modify env->eflags around cpu_dump_state
@ 2013-03-19 19:11 Richard Henderson
2013-03-23 18:23 ` Blue Swirl
0 siblings, 1 reply; 2+ messages in thread
From: Richard Henderson @ 2013-03-19 19:11 UTC (permalink / raw)
To: qemu-devel; +Cc: Blue Swirl
We can compute the value in cpu_dump_state anyway, and gratuitous
modifications to eflags creates heisenbugs.
Cc: Blue Swirl <blauwirbel@gmail.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
cpu-exec.c | 3 ---
target-i386/helper.c | 2 +-
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/cpu-exec.c b/cpu-exec.c
index 94fedc5..c3ac8f5 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -570,10 +570,7 @@ int cpu_exec(CPUArchState *env)
if (qemu_loglevel_mask(CPU_LOG_TB_CPU)) {
/* restore flags in standard format */
#if defined(TARGET_I386)
- env->eflags = env->eflags | cpu_cc_compute_all(env, CC_OP)
- | (DF & DF_MASK);
log_cpu_state(env, CPU_DUMP_CCOP);
- env->eflags &= ~(DF_MASK | CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
#elif defined(TARGET_M68K)
cpu_m68k_flush_flags(env, env->cc_op);
env->cc_op = CC_OP_FLAGS;
diff --git a/target-i386/helper.c b/target-i386/helper.c
index 9449a0c..282494f 100644
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -189,7 +189,7 @@ void cpu_dump_state(CPUX86State *env, FILE *f, fprintf_function cpu_fprintf,
cpu_synchronize_state(env);
- eflags = env->eflags;
+ eflags = cpu_compute_eflags(env);
#ifdef TARGET_X86_64
if (env->hflags & HF_CS64_MASK) {
cpu_fprintf(f,
--
1.8.1.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] target-i386: Don't modify env->eflags around cpu_dump_state
2013-03-19 19:11 [Qemu-devel] [PATCH] target-i386: Don't modify env->eflags around cpu_dump_state Richard Henderson
@ 2013-03-23 18:23 ` Blue Swirl
0 siblings, 0 replies; 2+ messages in thread
From: Blue Swirl @ 2013-03-23 18:23 UTC (permalink / raw)
To: Richard Henderson; +Cc: qemu-devel
Thanks, applied.
On Tue, Mar 19, 2013 at 7:11 PM, Richard Henderson <rth@twiddle.net> wrote:
> We can compute the value in cpu_dump_state anyway, and gratuitous
> modifications to eflags creates heisenbugs.
>
> Cc: Blue Swirl <blauwirbel@gmail.com>
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
> cpu-exec.c | 3 ---
> target-i386/helper.c | 2 +-
> 2 files changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/cpu-exec.c b/cpu-exec.c
> index 94fedc5..c3ac8f5 100644
> --- a/cpu-exec.c
> +++ b/cpu-exec.c
> @@ -570,10 +570,7 @@ int cpu_exec(CPUArchState *env)
> if (qemu_loglevel_mask(CPU_LOG_TB_CPU)) {
> /* restore flags in standard format */
> #if defined(TARGET_I386)
> - env->eflags = env->eflags | cpu_cc_compute_all(env, CC_OP)
> - | (DF & DF_MASK);
> log_cpu_state(env, CPU_DUMP_CCOP);
> - env->eflags &= ~(DF_MASK | CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C);
> #elif defined(TARGET_M68K)
> cpu_m68k_flush_flags(env, env->cc_op);
> env->cc_op = CC_OP_FLAGS;
> diff --git a/target-i386/helper.c b/target-i386/helper.c
> index 9449a0c..282494f 100644
> --- a/target-i386/helper.c
> +++ b/target-i386/helper.c
> @@ -189,7 +189,7 @@ void cpu_dump_state(CPUX86State *env, FILE *f, fprintf_function cpu_fprintf,
>
> cpu_synchronize_state(env);
>
> - eflags = env->eflags;
> + eflags = cpu_compute_eflags(env);
> #ifdef TARGET_X86_64
> if (env->hflags & HF_CS64_MASK) {
> cpu_fprintf(f,
> --
> 1.8.1.4
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-23 18:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-19 19:11 [Qemu-devel] [PATCH] target-i386: Don't modify env->eflags around cpu_dump_state Richard Henderson
2013-03-23 18:23 ` Blue Swirl
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).