From patchwork Tue Jan 26 16:00:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 43712 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9EBA6B7DF1 for ; Wed, 27 Jan 2010 03:07:55 +1100 (EST) Received: from localhost ([127.0.0.1]:56212 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZnwK-0005gp-5K for incoming@patchwork.ozlabs.org; Tue, 26 Jan 2010 11:06:52 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NZnps-0007vh-VS for qemu-devel@nongnu.org; Tue, 26 Jan 2010 11:00:13 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NZnpp-0007qe-38 for qemu-devel@nongnu.org; Tue, 26 Jan 2010 11:00:09 -0500 Received: from [199.232.76.173] (port=45566 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NZnpo-0007qN-Oc for qemu-devel@nongnu.org; Tue, 26 Jan 2010 11:00:08 -0500 Received: from afflict.kos.to ([92.243.29.197]:36704) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NZnpo-0000Vb-51 for qemu-devel@nongnu.org; Tue, 26 Jan 2010 11:00:08 -0500 Received: by afflict.kos.to (Postfix, from userid 1000) id 32A2F26581; Tue, 26 Jan 2010 16:00:04 +0000 (UTC) From: Riku Voipio To: qemu-devel@nongnu.org Date: Tue, 26 Jan 2010 16:00:01 +0000 Message-Id: <1264521604-2020-3-git-send-email-riku.voipio@iki.fi> X-Mailer: git-send-email 1.6.5 In-Reply-To: <1264521604-2020-1-git-send-email-riku.voipio@iki.fi> References: <1264521604-2020-1-git-send-email-riku.voipio@iki.fi> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Riku Voipio Subject: [Qemu-devel] [PATCH 2/5] fix locking error with current_tb X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Riku Voipio Signed-off-by: Riku Voipio --- 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 */