KVM: PPC: Implement kvm_arch_intc_initialized() for PPC
authorPaul Mackerras <paulus@ozlabs.org>
Wed, 10 Aug 2016 01:27:27 +0000 (11:27 +1000)
committerPaul Mackerras <paulus@ozlabs.org>
Fri, 19 Aug 2016 03:00:06 +0000 (13:00 +1000)
It doesn't make sense to create irqfds for a VM that doesn't have
in-kernel interrupt controller emulation.  There is an existing
interface for architecture code to tell the irqfd code whether or
not any interrupt controller has been initialized, called
kvm_arch_intc_initialized(), so let's implement that for powerpc.

Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/kvm/powerpc.c

index ec35af34a3fb411d6d8f536be997daac9e3b57ce..e36ce0cff76658707d1adffdad36b3c9548c02ac 100644 (file)
@@ -43,6 +43,8 @@
 #include <asm/cputhreads.h>
 #define KVM_MAX_VCPU_ID                (threads_per_subcore * KVM_MAX_VCORES)
 
+#define __KVM_HAVE_ARCH_INTC_INITIALIZED
+
 #ifdef CONFIG_KVM_MMIO
 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
 #endif
index 6ce40dd6fe51a1d8701020bfc8257ba3c4ea6c85..ab2b3d54493785f412418c35d421a568f1b3c792 100644 (file)
@@ -1167,6 +1167,19 @@ static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu,
        return r;
 }
 
+bool kvm_arch_intc_initialized(struct kvm *kvm)
+{
+#ifdef CONFIG_KVM_MPIC
+       if (kvm->arch.mpic)
+               return true;
+#endif
+#ifdef CONFIG_KVM_XICS
+       if (kvm->arch.xics)
+               return true;
+#endif
+       return false;
+}
+
 int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu,
                                     struct kvm_mp_state *mp_state)
 {
This page took 0.025953 seconds and 5 git commands to generate.