diff options
author | Paul Mackerras <paulus@ozlabs.org> | 2016-08-10 01:27:27 (GMT) |
---|---|---|
committer | Paul Mackerras <paulus@ozlabs.org> | 2016-08-19 03:00:06 (GMT) |
commit | 34a75b0f63356097ae9f706d64a793934891002f (patch) | |
tree | b1ff9c0443423559c057724bc596e859b8a7140e /arch/powerpc/kvm | |
parent | e48ba1cbce12eb4546771d45c09dd94c3404efe8 (diff) | |
download | linux-34a75b0f63356097ae9f706d64a793934891002f.tar.xz |
KVM: PPC: Implement kvm_arch_intc_initialized() for PPC
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>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r-- | arch/powerpc/kvm/powerpc.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 6ce40dd..ab2b3d5 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -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) { |