From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cO7aL-0001GK-V9 for qemu-devel@nongnu.org; Mon, 02 Jan 2017 13:43:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cO7aI-0005uC-Tg for qemu-devel@nongnu.org; Mon, 02 Jan 2017 13:43:54 -0500 Received: from mail-yw0-x244.google.com ([2607:f8b0:4002:c05::244]:36001) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cO7aI-0005sf-PR for qemu-devel@nongnu.org; Mon, 02 Jan 2017 13:43:50 -0500 Received: by mail-yw0-x244.google.com with SMTP id r204so36288055ywb.3 for ; Mon, 02 Jan 2017 10:43:49 -0800 (PST) From: Pranith Kumar Date: Mon, 2 Jan 2017 13:42:58 -0500 Message-Id: <20170102184258.2442-1-bobby.prani@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH] mttcg: Add missing tb_lock/unlock() in cpu_exec_step() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , Peter Crosthwaite , Richard Henderson , "open list:Overall" Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= The recent patch enabling lock assertions uncovered the missing lock acquisition in cpu_exec_step(). This patch adds them. CC: Richard Henderson CC: Alex Bennée Signed-off-by: Pranith Kumar --- cpu-exec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpu-exec.c b/cpu-exec.c index aa8318d864..ef328087be 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -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) -- 2.11.0