[Qemu-devel] [PATCH v2 1/2] tcg: Save cpu flags in atomic execution

Pranith Kumar posted 2 patches 8 years, 12 months ago
[Qemu-devel] [PATCH v2 1/2] tcg: Save cpu flags in atomic execution
Posted by Pranith Kumar 8 years, 12 months ago
The current mechanism discards the flags which were set in atomic
execution. Properly save them.

CC: Alex Bennée <alex.bennee@linaro.org>
CC: Richard Henderson <rth@twiddle.net>
CC: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 cpu-exec.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/cpu-exec.c b/cpu-exec.c
index b0ddada8c1..9200c643c2 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -228,6 +228,7 @@ static void cpu_exec_nocache(CPUState *cpu, int max_cycles,
 
 static void cpu_exec_step(CPUState *cpu)
 {
+    CPUClass *cc = CPU_GET_CLASS(cpu);
     CPUArchState *env = (CPUArchState *)cpu->env_ptr;
     TranslationBlock *tb;
     target_ulong cs_base, pc;
@@ -239,9 +240,13 @@ static void cpu_exec_step(CPUState *cpu)
                      1 | CF_NOCACHE | CF_IGNORE_ICOUNT);
     tb->orig_tb = NULL;
     tb_unlock();
+
+    cc->cpu_exec_enter(cpu);
     /* execute the generated code */
     trace_exec_tb_nocache(tb, pc);
     cpu_tb_exec(cpu, tb);
+
+    cc->cpu_exec_exit(cpu);
     tb_lock();
     tb_phys_invalidate(tb, -1);
     tb_free(tb);
-- 
2.11.0