From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mg81C-0004lp-7H for qemu-devel@nongnu.org; Tue, 25 Aug 2009 22:13:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mg817-0004gL-3O for qemu-devel@nongnu.org; Tue, 25 Aug 2009 22:13:45 -0400 Received: from [199.232.76.173] (port=45240 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mg816-0004g6-Ry for qemu-devel@nongnu.org; Tue, 25 Aug 2009 22:13:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39350) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mg816-0008Of-60 for qemu-devel@nongnu.org; Tue, 25 Aug 2009 22:13:40 -0400 From: Glauber Costa Date: Tue, 25 Aug 2009 18:13:36 -0400 Message-Id: <1251238416-5088-3-git-send-email-glommer@redhat.com> In-Reply-To: <1251238416-5088-2-git-send-email-glommer@redhat.com> References: <1251238416-5088-1-git-send-email-glommer@redhat.com> <1251238416-5088-2-git-send-email-glommer@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] do not issue ioctl from within the io thread List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com According to Documentation/kvm/api.txt, (and well, to common sense), we should not be calling vcpu ioctls from within the iothread. Since vcpu initialization issues a vcpu ioctl, move it a little bit further in time to prevent it. Signed-off-by: Glauber Costa --- vl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/vl.c b/vl.c index aa5047e..89051b8 100644 --- a/vl.c +++ b/vl.c @@ -3675,6 +3675,7 @@ static void *kvm_cpu_thread_fn(void *arg) block_io_signals(); qemu_thread_self(env->thread); + kvm_init_vcpu(env); /* signal CPU creation */ qemu_mutex_lock(&qemu_global_mutex); @@ -3870,7 +3871,6 @@ static void tcg_init_vcpu(void *_env) static void kvm_start_vcpu(CPUState *env) { - kvm_init_vcpu(env); env->thread = qemu_mallocz(sizeof(QemuThread)); env->halt_cond = qemu_mallocz(sizeof(QemuCond)); qemu_cond_init(env->halt_cond); -- 1.6.2.2