From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MsNZI-00007r-RK for qemu-devel@nongnu.org; Mon, 28 Sep 2009 17:15:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MsNZD-0008Vp-MU for qemu-devel@nongnu.org; Mon, 28 Sep 2009 17:15:35 -0400 Received: from [199.232.76.173] (port=49507 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MsNZD-0008Vc-5Q for qemu-devel@nongnu.org; Mon, 28 Sep 2009 17:15:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26147) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MsNZC-0001xr-KZ for qemu-devel@nongnu.org; Mon, 28 Sep 2009 17:15:30 -0400 From: Glauber Costa Date: Mon, 28 Sep 2009 18:15:17 -0300 Message-Id: <1254172517-28216-7-git-send-email-glommer@redhat.com> In-Reply-To: <1254172517-28216-6-git-send-email-glommer@redhat.com> References: <1254172517-28216-1-git-send-email-glommer@redhat.com> <1254172517-28216-2-git-send-email-glommer@redhat.com> <1254172517-28216-3-git-send-email-glommer@redhat.com> <1254172517-28216-4-git-send-email-glommer@redhat.com> <1254172517-28216-5-git-send-email-glommer@redhat.com> <1254172517-28216-6-git-send-email-glommer@redhat.com> Subject: [Qemu-devel] [PATCH 6/6] Initialize in-kernel irqchip 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 Now that we have all devices set up, this patch initializes the irqchip. This is dependant on the io-thread, since we need someone to pull ourselves out of the halted state. I believe this should be the default when we are running over the io-thread. Later on, I plan to post a patch that makes it optional. Signed-off-by: Glauber Costa --- kvm-all.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 50616d1..30df418 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -453,6 +453,22 @@ int kvm_set_irq(int irq, int level, int *status) return 1; } + +static int kvm_create_irqchip(KVMState *s) +{ + int ret; + + if (!kvm_check_extension(s, KVM_CAP_IRQCHIP)) + return -1; + + ret = kvm_vm_ioctl(s, KVM_CREATE_IRQCHIP); + if (ret < 0) + return ret; + + s->irqchip_in_kernel = 1; + + return 0; +} #endif int kvm_init(int smp_cpus) @@ -536,6 +552,11 @@ int kvm_init(int smp_cpus) } #endif +#if defined(CONFIG_IOTHREAD) && defined(KVM_CAP_IRQCHIP) + ret = kvm_create_irqchip(s); + if (ret < 0) + goto err; +#endif ret = kvm_arch_init(s, smp_cpus); if (ret < 0) goto err; -- 1.6.2.5