qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: mttcg@greensocs.com, cota@braap.org, rth@twiddle.net
Subject: [Qemu-devel] [PATCH 5/9] tcg: assign cpu->current_tb in a simpler place
Date: Wed, 26 Aug 2015 02:17:41 +0200	[thread overview]
Message-ID: <1440548265-4755-6-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1440548265-4755-1-git-send-email-pbonzini@redhat.com>

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 <pbonzini@redhat.com>
---
 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

  parent reply	other threads:[~2015-08-26  0:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26  0:17 [Qemu-devel] [PATCH v2 0/9] tcg: signal-free qemu_cpu_kick Paolo Bonzini
2015-08-26  0:17 ` [Qemu-devel] [PATCH 1/9] i8257: rewrite DMA_schedule to avoid hooking into the CPU loop Paolo Bonzini
2015-08-26  0:17 ` [Qemu-devel] [PATCH 2/9] i8257: remove cpu_request_exit irq Paolo Bonzini
2015-08-26  0:17 ` [Qemu-devel] [PATCH 3/9] tcg: introduce tcg_current_cpu Paolo Bonzini
2015-08-26  0:17 ` [Qemu-devel] [PATCH 4/9] remove qemu/tls.h Paolo Bonzini
2015-08-26  0:17 ` Paolo Bonzini [this message]
2015-08-26  0:17 ` [Qemu-devel] [PATCH 6/9] tcg: synchronize cpu->exit_request and cpu->tcg_exit_req accesses Paolo Bonzini
2015-08-28  2:19   ` Emilio G. Cota
2015-08-28  8:50     ` Paolo Bonzini
2015-08-26  0:17 ` [Qemu-devel] [PATCH 7/9] tcg: synchronize exit_request and tcg_current_cpu accesses Paolo Bonzini
2015-08-26  0:17 ` [Qemu-devel] [PATCH 8/9] use qemu_cpu_kick instead of cpu_exit or qemu_cpu_kick_thread Paolo Bonzini
2015-08-26  0:17 ` [Qemu-devel] [PATCH 9/9] tcg: signal-free qemu_cpu_kick Paolo Bonzini
2015-08-28  4:21 ` [Qemu-devel] [PATCH v2 0/9] " Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1440548265-4755-6-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=cota@braap.org \
    --cc=mttcg@greensocs.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).