summaryrefslogtreecommitdiffstats
path: root/target-i386/kvm.c
diff options
context:
space:
mode:
authorAnthony Liguori2012-08-13 16:25:48 +0200
committerAnthony Liguori2012-08-13 16:25:48 +0200
commitd517872ec289f5bfa6bd9f385a90e09483e9949c (patch)
treeda187195eaa2e0c9c6102f5afa3435d4ab1ffd3f /target-i386/kvm.c
parentqom: Reimplement Interfaces (diff)
parentkvm: Add documentation comment for kvm_irqchip_in_kernel() (diff)
downloadqemu-d517872ec289f5bfa6bd9f385a90e09483e9949c.tar.gz
qemu-d517872ec289f5bfa6bd9f385a90e09483e9949c.tar.xz
qemu-d517872ec289f5bfa6bd9f385a90e09483e9949c.zip
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
* qemu-kvm/uq/master: kvm: Add documentation comment for kvm_irqchip_in_kernel() kvm: Decouple 'GSI routing' from 'kernel irqchip' kvm: Decouple 'MSI routing via irqfds' from 'kernel irqchip' kvm: Decouple 'irqfds usable' from 'kernel irqchip' kvm: Move kvm_allows_irq0_override() to target-i386, fix return type kvm: Rename kvm_irqchip_set_irq() to kvm_set_irq() kvm: Decouple 'async interrupt delivery' from 'kernel irqchip' configure: Don't implicitly hardcode list of KVM architectures kvm: Check if smp_cpus exceeds max cpus supported by kvm
Diffstat (limited to 'target-i386/kvm.c')
-rw-r--r--target-i386/kvm.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 4cfb3faf01..696b14a04a 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -23,6 +23,7 @@
#include "qemu-common.h"
#include "sysemu.h"
#include "kvm.h"
+#include "kvm_i386.h"
#include "cpu.h"
#include "gdbstub.h"
#include "host-utils.h"
@@ -65,6 +66,11 @@ static bool has_msr_async_pf_en;
static bool has_msr_misc_enable;
static int lm_capable_kernel;
+bool kvm_allows_irq0_override(void)
+{
+ return !kvm_irqchip_in_kernel() || kvm_has_gsi_routing();
+}
+
static struct kvm_cpuid2 *try_get_cpuid(KVMState *s, int max)
{
struct kvm_cpuid2 *cpuid;
@@ -2041,4 +2047,11 @@ void kvm_arch_init_irq_routing(KVMState *s)
*/
no_hpet = 1;
}
+ /* We know at this point that we're using the in-kernel
+ * irqchip, so we can use irqfds, and on x86 we know
+ * we can use msi via irqfd and GSI routing.
+ */
+ kvm_irqfds_allowed = true;
+ kvm_msi_via_irqfd_allowed = true;
+ kvm_gsi_routing_allowed = true;
}