qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Glauber Costa <glommer@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com
Subject: [Qemu-devel] [PATCH 6/6] Initialize in-kernel irqchip
Date: Mon, 28 Sep 2009 18:15:17 -0300	[thread overview]
Message-ID: <1254172517-28216-7-git-send-email-glommer@redhat.com> (raw)
In-Reply-To: <1254172517-28216-6-git-send-email-glommer@redhat.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 <glommer@redhat.com>
---
 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

  reply	other threads:[~2009-09-28 21:15 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-28 21:15 [Qemu-devel] [PATCH 0/6] in kernel irqchip support Glauber Costa
2009-09-28 21:15 ` [Qemu-devel] [PATCH 1/6] provide in-kernel ioapic Glauber Costa
2009-09-28 21:15   ` [Qemu-devel] [PATCH 2/6] provide in-kernel apic Glauber Costa
2009-09-28 21:15     ` [Qemu-devel] [PATCH 3/6] provide apic_set_irq_delivered Glauber Costa
2009-09-28 21:15       ` [Qemu-devel] [PATCH 4/6] provide in-kernel i8259 chip Glauber Costa
2009-09-28 21:15         ` [Qemu-devel] [PATCH 5/6] initialize " Glauber Costa
2009-09-28 21:15           ` Glauber Costa [this message]
2009-10-02 20:33             ` [Qemu-devel] Re: [PATCH 6/6] Initialize in-kernel irqchip Jan Kiszka
2009-10-02 21:59               ` Jamie Lokier
2009-10-02 22:22                 ` Glauber Costa
2009-09-28 22:04         ` [Qemu-devel] Re: [PATCH 4/6] provide in-kernel i8259 chip Juan Quintela
2009-09-28 22:25           ` Glauber Costa
2009-09-28 22:39             ` Juan Quintela
2009-10-02 20:33               ` Jan Kiszka
     [not found]   ` <m3my4eagcp.fsf@neno.mitica>
2009-09-28 22:24     ` [Qemu-devel] Re: [PATCH 1/6] provide in-kernel ioapic Glauber Costa
2009-09-29  0:39 ` [Qemu-devel] [PATCH 0/6] in kernel irqchip support Jamie Lokier
2009-09-29  1:06   ` Glauber Costa
2009-09-29  8:15 ` Avi Kivity
2009-09-30 20:01 ` Anthony Liguori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1254172517-28216-7-git-send-email-glommer@redhat.com \
    --to=glommer@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).