From patchwork Tue Aug 25 22:13:36 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glauber Costa X-Patchwork-Id: 32101 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 bilbo.ozlabs.org (Postfix) with ESMTPS id BC19BB6F1F for ; Wed, 26 Aug 2009 12:15:04 +1000 (EST) Received: from localhost ([127.0.0.1]:58867 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mg82N-0005TT-HT for incoming@patchwork.ozlabs.org; Tue, 25 Aug 2009 22:14:59 -0400 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 Received: from int-mx06.intmail.prod.int.phx2.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.19]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7Q2DcH9012718; Tue, 25 Aug 2009 22:13:38 -0400 Received: from localhost.localdomain (virtlab1.virt.bos.redhat.com [10.16.72.21]) by int-mx06.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7Q2DboJ031989; Tue, 25 Aug 2009 22:13:38 -0400 From: Glauber Costa To: qemu-devel@nongnu.org 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> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.19 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: aliguori@us.ibm.com Subject: [Qemu-devel] [PATCH 2/2] do not issue ioctl from within the io thread 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 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);