From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZflo-0005nd-EZ for qemu-devel@nongnu.org; Wed, 09 Sep 2015 09:50:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZflk-000342-N3 for qemu-devel@nongnu.org; Wed, 09 Sep 2015 09:50:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49112) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZflk-00033o-8v for qemu-devel@nongnu.org; Wed, 09 Sep 2015 09:50:36 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id E94FDAA0D6 for ; Wed, 9 Sep 2015 13:50:35 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-83.ams2.redhat.com [10.36.112.83]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t89DoEhv030571 for ; Wed, 9 Sep 2015 09:50:35 -0400 From: Paolo Bonzini Date: Wed, 9 Sep 2015 15:49:42 +0200 Message-Id: <1441806613-13775-13-git-send-email-pbonzini@redhat.com> In-Reply-To: <1441806613-13775-1-git-send-email-pbonzini@redhat.com> References: <1441806613-13775-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 12/43] tcg: assign cpu->current_tb in a simpler place List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org TCG has not been reading cpu->current_tb from signal handlers for years. The code that synchronized cpu_exec with the signal handler is not needed anymore. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- cpu-exec.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/cpu-exec.c b/cpu-exec.c index 5153f1b..567ae8b 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -493,18 +493,13 @@ int cpu_exec(CPUState *cpu) } have_tb_lock = false; spin_unlock(&tcg_ctx.tb_ctx.tb_lock); - - /* cpu_interrupt might be called while translating the - TB, but before it is linked into a potentially - infinite loop and becomes env->current_tb. Avoid - starting execution if there is a pending interrupt. */ - cpu->current_tb = tb; - barrier(); if (likely(!cpu->exit_request)) { trace_exec_tb(tb, tb->pc); tc_ptr = tb->tc_ptr; /* execute the generated code */ + cpu->current_tb = tb; next_tb = cpu_tb_exec(cpu, tc_ptr); + cpu->current_tb = NULL; switch (next_tb & TB_EXIT_MASK) { case TB_EXIT_REQUESTED: /* Something asked us to stop executing @@ -543,7 +538,6 @@ int cpu_exec(CPUState *cpu) break; } } - cpu->current_tb = NULL; /* Try to align the host and virtual clocks if the guest is in advance */ align_clocks(&sc, cpu); -- 2.4.3