diff mbox

[v2,1/2] tcg: Save cpu flags in atomic execution

Message ID 20170210184525.10966-2-bobby.prani@gmail.com
State New
Headers show

Commit Message

Pranith Kumar Feb. 10, 2017, 6:45 p.m. UTC
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 mbox

Patch

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);