qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Riku Voipio <riku.voipio@iki.fi>
To: qemu-devel@nongnu.org
Cc: Riku Voipio <riku.voipio@nokia.com>
Subject: [Qemu-devel] [PATCH 2/5] fix locking error with current_tb
Date: Tue, 26 Jan 2010 16:00:01 +0000	[thread overview]
Message-ID: <1264521604-2020-3-git-send-email-riku.voipio@iki.fi> (raw)
In-Reply-To: <1264521604-2020-1-git-send-email-riku.voipio@iki.fi>

From: Riku Voipio <riku.voipio@nokia.com>

Signed-off-by: Riku Voipio <riku.voipio@nokia.com>
---
 exec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/exec.c b/exec.c
index 1190591..71f655f 100644
--- a/exec.c
+++ b/exec.c
@@ -1537,15 +1537,15 @@ static void cpu_unlink_tb(CPUState *env)
     TranslationBlock *tb;
     static spinlock_t interrupt_lock = SPIN_LOCK_UNLOCKED;
 
+    spin_lock(&interrupt_lock);
     tb = env->current_tb;
     /* if the cpu is currently executing code, we must unlink it and
        all the potentially executing TB */
     if (tb) {
-        spin_lock(&interrupt_lock);
         env->current_tb = NULL;
         tb_reset_jump_recursive(tb);
-        spin_unlock(&interrupt_lock);
     }
+    spin_unlock(&interrupt_lock);
 }
 
 /* mask must never be zero, except for A20 change call */
-- 
1.6.5

  parent reply	other threads:[~2010-01-26 16:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-26 15:59 [Qemu-devel] [PATCH 0/5] linux-user for-usptream patches Riku Voipio
2010-01-26 16:00 ` [Qemu-devel] [PATCH 1/5] linux-user: adapt uname machine to emulated CPU Riku Voipio
2010-01-26 16:00 ` Riku Voipio [this message]
2010-01-26 16:00 ` [Qemu-devel] [PATCH 3/5] linux-user: remove signal handler before calling abort() Riku Voipio
2010-01-26 16:00 ` [Qemu-devel] [PATCH 4/5] linux-user: Add access to TLS registers Riku Voipio
2010-01-26 16:27   ` Laurent Desnogues
2010-01-26 20:00     ` Riku Voipio
2010-01-26 16:00 ` [Qemu-devel] [PATCH 5/5] target-arm: Thread ID Registers are ARMv6K + Riku Voipio
2010-01-26 16:28   ` Laurent Desnogues

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=1264521604-2020-3-git-send-email-riku.voipio@iki.fi \
    --to=riku.voipio@iki.fi \
    --cc=qemu-devel@nongnu.org \
    --cc=riku.voipio@nokia.com \
    /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).