From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8VpE-0002tA-K5 for qemu-devel@nongnu.org; Fri, 26 Jun 2015 11:45:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8Vp6-0000sI-UH for qemu-devel@nongnu.org; Fri, 26 Jun 2015 11:45:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44537) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8Vp6-0000s8-PJ for qemu-devel@nongnu.org; Fri, 26 Jun 2015 11:45:48 -0400 References: <1435330053-18733-1-git-send-email-fred.konrad@greensocs.com> <1435330053-18733-6-git-send-email-fred.konrad@greensocs.com> <558D682F.4080804@redhat.com> <558D7224.1070304@greensocs.com> From: Paolo Bonzini Message-ID: <558D73A7.4090502@redhat.com> Date: Fri, 26 Jun 2015 17:45:43 +0200 MIME-Version: 1.0 In-Reply-To: <558D7224.1070304@greensocs.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH V6 05/18] protect TBContext with tb_lock. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Frederic Konrad , qemu-devel@nongnu.org, mttcg@greensocs.com Cc: peter.maydell@linaro.org, a.spyridakis@virtualopensystems.com, mark.burton@greensocs.com, agraf@suse.de, alistair.francis@xilinx.com, guillaume.delbergue@greensocs.com, alex.bennee@linaro.org On 26/06/2015 17:39, Frederic Konrad wrote: >>> >>> @@ -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. Good, then add a comment in include/exec/exec-all.h ("/* Called with tb_lock held. */") please!