[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 7/8] Initialize in-kernel irqchip
From: |
Glauber Costa |
Subject: |
[Qemu-devel] [PATCH 7/8] Initialize in-kernel irqchip |
Date: |
Fri, 6 Nov 2009 16:26:29 -0200 |
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 <address@hidden>
---
kvm-all.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/kvm-all.c b/kvm-all.c
index 7684957..94b07bf 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 = 0;
+#if defined(CONFIG_IOTHREAD)
+ 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;
+#endif
+ return ret;
+}
+
int kvm_init(int smp_cpus)
{
static const char upgrade_note[] =
@@ -539,6 +555,10 @@ int kvm_init(int smp_cpus)
}
#endif
+ ret = kvm_create_irqchip(s);
+ if (ret < 0)
+ goto err;
+
ret = kvm_arch_init(s, smp_cpus);
if (ret < 0)
goto err;
--
1.6.2.5
- [Qemu-devel] [PATCH 0/8] Split in-kernel devices, Glauber Costa, 2009/11/06
- [Qemu-devel] [PATCH 1/8] introduce VMSTATE_U64, Glauber Costa, 2009/11/06
- [Qemu-devel] [PATCH 2/8] Provide ioapic-kvm, Glauber Costa, 2009/11/06
- [Qemu-devel] [PATCH 3/8] provide apic_set_irq_delivered, Glauber Costa, 2009/11/06
- [Qemu-devel] [PATCH 4/8] provide i8259-kvm, Glauber Costa, 2009/11/06
- [Qemu-devel] [PATCH 5/8] Don't call apic functions directly from kvm code, Glauber Costa, 2009/11/06
- [Qemu-devel] [PATCH 6/8] provide apic-kvm, Glauber Costa, 2009/11/06
- [Qemu-devel] [PATCH 7/8] Initialize in-kernel irqchip,
Glauber Costa <=
- [Qemu-devel] [PATCH 8/8] Do GSI routing, Glauber Costa, 2009/11/06