Skip to contentSkip to conversation

mttcg: Add missing tb_lock/unlock() in cpu_exec_step()

PATCH New Pranith Kumar 1 participant 1 message Jan 2, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mttcg: Add missing tb_lock/unlock() in cpu_exec_step()

The recent patch enabling lock assertions uncovered the missing lock acquisition in cpu_exec_step(). This patch adds them.

CC Richard Henderson <[email protected]>
CC Alex Bennée <[email protected]>
---
 cpu-exec.c | 4 ++++
 1 file changed, 4 insertions(+)
cpu-exec.c +4 -0
index aa8318d864..ef328087be 100644
@@ -234,14 +234,18 @@ static void cpu_exec_step(CPUState *cpu)
     uint32_t flags;
 
     cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags);
+    tb_lock();
     tb = tb_gen_code(cpu, pc, cs_base, flags,
                      1 | CF_NOCACHE | CF_IGNORE_ICOUNT);
     tb->orig_tb = NULL;
+    tb_unlock();
     /* execute the generated code */
     trace_exec_tb_nocache(tb, pc);
     cpu_tb_exec(cpu, tb);
+    tb_lock();
     tb_phys_invalidate(tb, -1);
     tb_free(tb);
+    tb_unlock();
 }
 
 void cpu_exec_step_atomic(CPUState *cpu)
Signature · 1 line
2.11.0