From patchwork Mon Apr 26 17:59:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 50991 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 13D87B7D62 for ; Tue, 27 Apr 2010 04:18:17 +1000 (EST) Received: from localhost ([127.0.0.1]:47651 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6Sne-0005YI-8o for incoming@patchwork.ozlabs.org; Mon, 26 Apr 2010 14:12:54 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O6Sbx-0006Fm-MD for qemu-devel@nongnu.org; Mon, 26 Apr 2010 14:00:49 -0400 Received: from [140.186.70.92] (port=49231 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O6Sbm-0005xs-1v for qemu-devel@nongnu.org; Mon, 26 Apr 2010 14:00:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O6Sbj-0006x0-J6 for qemu-devel@nongnu.org; Mon, 26 Apr 2010 14:00:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7444) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O6Sbj-0006wZ-9N for qemu-devel@nongnu.org; Mon, 26 Apr 2010 14:00:35 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3QI0Y8m029884 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 26 Apr 2010 14:00:34 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3QI0WOJ017402; Mon, 26 Apr 2010 14:00:32 -0400 Received: from amt.cnet (vpn-8-113.rdu.redhat.com [10.11.8.113]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o3QI0UCL006741; Mon, 26 Apr 2010 14:00:31 -0400 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 897E565606D; Mon, 26 Apr 2010 15:00:09 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o3QI06RO023715; Mon, 26 Apr 2010 15:00:06 -0300 From: Marcelo Tosatti To: Anthony Liguori Date: Mon, 26 Apr 2010 14:59:01 -0300 Message-Id: <6164e6d6e86e8f3f0b5ff7ae08b677026cb291c3.1272304746.git.mtosatti@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org, Avi Kivity Subject: [Qemu-devel] [PATCH 05/10] kvm_init_vcpu requires global lock held 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 Since it accesses data protected by the lock. Signed-off-by: Avi Kivity --- cpus.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cpus.c b/cpus.c index 8450ee4..2bf87d2 100644 --- a/cpus.c +++ b/cpus.c @@ -401,6 +401,7 @@ static void *kvm_cpu_thread_fn(void *arg) { CPUState *env = arg; + qemu_mutex_lock(&qemu_global_mutex); qemu_thread_self(env->thread); if (kvm_enabled()) kvm_init_vcpu(env); @@ -408,7 +409,6 @@ static void *kvm_cpu_thread_fn(void *arg) kvm_block_io_signals(env); /* signal CPU creation */ - qemu_mutex_lock(&qemu_global_mutex); env->created = 1; qemu_cond_signal(&qemu_cpu_cond);