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: 95118 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3QI1XHc020936 for ; Mon, 26 Apr 2010 18:01:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753974Ab0DZSAu (ORCPT ); Mon, 26 Apr 2010 14:00:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38147 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754051Ab0DZSAh (ORCPT ); Mon, 26 Apr 2010 14:00:37 -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 Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Marcelo Tosatti , Avi Kivity Subject: [PATCH 05/10] kvm_init_vcpu requires global lock held 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 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 26 Apr 2010 18:01:40 +0000 (UTC) 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);