From cc7e0ddf5a2307015eacfac2ac6a6a765898fcc3 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Thu, 26 Jul 2012 15:35:14 +0100 Subject: kvm: Decouple 'irqfds usable' from 'kernel irqchip' Instead of assuming that we can use irqfds if and only if kvm_irqchip_in_kernel(), add a bool to the KVMState which indicates this, and is set only on x86 and only if the irqchip is in the kernel. The kernel documentation implies that the only thing you need to use KVM_IRQFD is that KVM_CAP_IRQFD is advertised, but this seems to be untrue. In particular the kernel does not (alas) return a sensible error if you try to set up an irqfd when you haven't created an irqchip. If it did we could remove all this nonsense and let the kernel return the error code. Signed-off-by: Peter Maydell Acked-by: Jan Kiszka Signed-off-by: Avi Kivity --- kvm-stub.c | 1 + 1 file changed, 1 insertion(+) (limited to 'kvm-stub.c') diff --git a/kvm-stub.c b/kvm-stub.c index f2b0c61983..02e7fe0507 100644 --- a/kvm-stub.c +++ b/kvm-stub.c @@ -20,6 +20,7 @@ KVMState *kvm_state; bool kvm_kernel_irqchip; bool kvm_async_interrupts_allowed; +bool kvm_irqfds_allowed; int kvm_init_vcpu(CPUArchState *env) { -- cgit v1.2.1