qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH V6 05/18] protect TBContext with tb_lock.


From: Frederic Konrad
Subject: Re: [Qemu-devel] [RFC PATCH V6 05/18] protect TBContext with tb_lock.
Date: Fri, 26 Jun 2015 17:39:16 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

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

On 26/06/2015 16:47, address@hidden 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

[Prev in Thread] Current Thread [Next in Thread]