On 26/06/2015 16:56, Paolo Bonzini wrote:

On 26/06/2015 16:47, fred.kon...@greensocs.com wrote:
diff --git a/target-arm/translate.c b/target-arm/translate.c
index 971b6db..47345aa 100644
--- a/target-arm/translate.c
+++ b/target-arm/translate.c
@@ -11162,6 +11162,8 @@ static inline void 
gen_intermediate_code_internal(ARMCPU *cpu,
dc->tb = tb; + tb_lock();
+
      dc->is_jmp = DISAS_NEXT;
      dc->pc = pc_start;
      dc->singlestep_enabled = cs->singlestep_enabled;
@@ -11499,6 +11501,7 @@ done_generating:
          tb->size = dc->pc - pc_start;
          tb->icount = num_insns;
      }
+    tb_unlock();
  }
void gen_intermediate_code(CPUARMState *env, TranslationBlock *tb)
@@ -11567,6 +11570,7 @@ void arm_cpu_dump_state(CPUState *cs, FILE *f, 
fprintf_function cpu_fprintf,
void restore_state_to_opc(CPUARMState *env, TranslationBlock *tb, int pc_pos)
  {
+    tb_lock();
      if (is_a64(env)) {
          env->pc = tcg_ctx.gen_opc_pc[pc_pos];
          env->condexec_bits = 0;
@@ -11574,4 +11578,5 @@ void restore_state_to_opc(CPUARMState *env, 
TranslationBlock *tb, int pc_pos)
          env->regs[15] = tcg_ctx.gen_opc_pc[pc_pos];
          env->condexec_bits = gen_opc_condexec_bits[pc_pos];
      }
+    tb_unlock();
  }
Should these instead be added to the callers?

Paolo
Good point,
I see only one caller and the mutex is already locked.

Fred

Reply via email to