From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUOPf-0002aG-Ux for qemu-devel@nongnu.org; Tue, 25 Aug 2015 20:18:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUOPe-0000Md-Sx for qemu-devel@nongnu.org; Tue, 25 Aug 2015 20:17:59 -0400 Received: from mail-wi0-x230.google.com ([2a00:1450:400c:c05::230]:34889) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUOPe-0000M7-Mi for qemu-devel@nongnu.org; Tue, 25 Aug 2015 20:17:58 -0400 Received: by wicne3 with SMTP id ne3so29606784wic.0 for ; Tue, 25 Aug 2015 17:17:58 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Wed, 26 Aug 2015 02:17:41 +0200 Message-Id: <1440548265-4755-6-git-send-email-pbonzini@redhat.com> In-Reply-To: <1440548265-4755-1-git-send-email-pbonzini@redhat.com> References: <1440548265-4755-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 5/9] 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 Cc: mttcg@greensocs.com, cota@braap.org, rth@twiddle.net 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. Signed-off-by: Paolo Bonzini --- cpu-exec.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/cpu-exec.c b/cpu-exec.c index 2c3cb7d..7fcc46f 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -528,17 +528,13 @@ int cpu_exec(CPUState *cpu) next_tb & TB_EXIT_MASK, tb); } tb_unlock(); - /* 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 @@ -581,7 +577,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