Commit 297e2105 authored by Paul Mackerras's avatar Paul Mackerras Committed by Paolo Bonzini

KVM: Give IRQFD its own separate enabling Kconfig option

Currently, the IRQFD code is conditional on CONFIG_HAVE_KVM_IRQ_ROUTING.
So that we can have the IRQFD code compiled in without having the
IRQ routing code, this creates a new CONFIG_HAVE_KVM_IRQFD, makes
the IRQFD code conditional on it instead of CONFIG_HAVE_KVM_IRQ_ROUTING,
and makes all the platforms that currently select HAVE_KVM_IRQ_ROUTING
also select HAVE_KVM_IRQFD.
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
Tested-by: default avatarEric Auger <eric.auger@linaro.org>
Tested-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent e4d57e1e
...@@ -25,6 +25,7 @@ config KVM ...@@ -25,6 +25,7 @@ config KVM
select PREEMPT_NOTIFIERS select PREEMPT_NOTIFIERS
select ANON_INODES select ANON_INODES
select HAVE_KVM_IRQCHIP select HAVE_KVM_IRQCHIP
select HAVE_KVM_IRQFD
select HAVE_KVM_IRQ_ROUTING select HAVE_KVM_IRQ_ROUTING
select KVM_APIC_ARCHITECTURE select KVM_APIC_ARCHITECTURE
select KVM_MMIO select KVM_MMIO
......
...@@ -158,6 +158,7 @@ config KVM_MPIC ...@@ -158,6 +158,7 @@ config KVM_MPIC
bool "KVM in-kernel MPIC emulation" bool "KVM in-kernel MPIC emulation"
depends on KVM && E500 depends on KVM && E500
select HAVE_KVM_IRQCHIP select HAVE_KVM_IRQCHIP
select HAVE_KVM_IRQFD
select HAVE_KVM_IRQ_ROUTING select HAVE_KVM_IRQ_ROUTING
select HAVE_KVM_MSI select HAVE_KVM_MSI
help help
......
...@@ -26,6 +26,7 @@ config KVM ...@@ -26,6 +26,7 @@ config KVM
select KVM_ASYNC_PF select KVM_ASYNC_PF
select KVM_ASYNC_PF_SYNC select KVM_ASYNC_PF_SYNC
select HAVE_KVM_IRQCHIP select HAVE_KVM_IRQCHIP
select HAVE_KVM_IRQFD
select HAVE_KVM_IRQ_ROUTING select HAVE_KVM_IRQ_ROUTING
---help--- ---help---
Support hosting paravirtualized guest machines using the SIE Support hosting paravirtualized guest machines using the SIE
......
...@@ -27,6 +27,7 @@ config KVM ...@@ -27,6 +27,7 @@ config KVM
select MMU_NOTIFIER select MMU_NOTIFIER
select ANON_INODES select ANON_INODES
select HAVE_KVM_IRQCHIP select HAVE_KVM_IRQCHIP
select HAVE_KVM_IRQFD
select HAVE_KVM_IRQ_ROUTING select HAVE_KVM_IRQ_ROUTING
select HAVE_KVM_EVENTFD select HAVE_KVM_EVENTFD
select KVM_APIC_ARCHITECTURE select KVM_APIC_ARCHITECTURE
......
...@@ -437,7 +437,7 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); ...@@ -437,7 +437,7 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu);
int __must_check vcpu_load(struct kvm_vcpu *vcpu); int __must_check vcpu_load(struct kvm_vcpu *vcpu);
void vcpu_put(struct kvm_vcpu *vcpu); void vcpu_put(struct kvm_vcpu *vcpu);
#ifdef CONFIG_HAVE_KVM_IRQ_ROUTING #ifdef CONFIG_HAVE_KVM_IRQFD
int kvm_irqfd_init(void); int kvm_irqfd_init(void);
void kvm_irqfd_exit(void); void kvm_irqfd_exit(void);
#else #else
...@@ -932,20 +932,20 @@ int kvm_set_routing_entry(struct kvm_kernel_irq_routing_entry *e, ...@@ -932,20 +932,20 @@ int kvm_set_routing_entry(struct kvm_kernel_irq_routing_entry *e,
const struct kvm_irq_routing_entry *ue); const struct kvm_irq_routing_entry *ue);
void kvm_free_irq_routing(struct kvm *kvm); void kvm_free_irq_routing(struct kvm *kvm);
int kvm_send_userspace_msi(struct kvm *kvm, struct kvm_msi *msi);
#else #else
static inline void kvm_free_irq_routing(struct kvm *kvm) {} static inline void kvm_free_irq_routing(struct kvm *kvm) {}
#endif #endif
int kvm_send_userspace_msi(struct kvm *kvm, struct kvm_msi *msi);
#ifdef CONFIG_HAVE_KVM_EVENTFD #ifdef CONFIG_HAVE_KVM_EVENTFD
void kvm_eventfd_init(struct kvm *kvm); void kvm_eventfd_init(struct kvm *kvm);
int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args); int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args);
#ifdef CONFIG_HAVE_KVM_IRQCHIP #ifdef CONFIG_HAVE_KVM_IRQFD
int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args); int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args);
void kvm_irqfd_release(struct kvm *kvm); void kvm_irqfd_release(struct kvm *kvm);
void kvm_irq_routing_update(struct kvm *); void kvm_irq_routing_update(struct kvm *);
......
...@@ -6,6 +6,9 @@ config HAVE_KVM ...@@ -6,6 +6,9 @@ config HAVE_KVM
config HAVE_KVM_IRQCHIP config HAVE_KVM_IRQCHIP
bool bool
config HAVE_KVM_IRQFD
bool
config HAVE_KVM_IRQ_ROUTING config HAVE_KVM_IRQ_ROUTING
bool bool
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#include "irq.h" #include "irq.h"
#include "iodev.h" #include "iodev.h"
#ifdef CONFIG_HAVE_KVM_IRQ_ROUTING #ifdef CONFIG_HAVE_KVM_IRQFD
/* /*
* -------------------------------------------------------------------- * --------------------------------------------------------------------
* irqfd: Allows an fd to be used to inject an interrupt to the guest * irqfd: Allows an fd to be used to inject an interrupt to the guest
...@@ -450,7 +450,7 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args) ...@@ -450,7 +450,7 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
void void
kvm_eventfd_init(struct kvm *kvm) kvm_eventfd_init(struct kvm *kvm)
{ {
#ifdef CONFIG_HAVE_KVM_IRQ_ROUTING #ifdef CONFIG_HAVE_KVM_IRQFD
spin_lock_init(&kvm->irqfds.lock); spin_lock_init(&kvm->irqfds.lock);
INIT_LIST_HEAD(&kvm->irqfds.items); INIT_LIST_HEAD(&kvm->irqfds.items);
INIT_LIST_HEAD(&kvm->irqfds.resampler_list); INIT_LIST_HEAD(&kvm->irqfds.resampler_list);
...@@ -459,7 +459,7 @@ kvm_eventfd_init(struct kvm *kvm) ...@@ -459,7 +459,7 @@ kvm_eventfd_init(struct kvm *kvm)
INIT_LIST_HEAD(&kvm->ioeventfds); INIT_LIST_HEAD(&kvm->ioeventfds);
} }
#ifdef CONFIG_HAVE_KVM_IRQ_ROUTING #ifdef CONFIG_HAVE_KVM_IRQFD
/* /*
* shutdown any irqfd's that match fd+gsi * shutdown any irqfd's that match fd+gsi
*/ */
......
...@@ -2337,7 +2337,7 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg) ...@@ -2337,7 +2337,7 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
#ifdef CONFIG_HAVE_KVM_MSI #ifdef CONFIG_HAVE_KVM_MSI
case KVM_CAP_SIGNAL_MSI: case KVM_CAP_SIGNAL_MSI:
#endif #endif
#ifdef CONFIG_HAVE_KVM_IRQ_ROUTING #ifdef CONFIG_HAVE_KVM_IRQFD
case KVM_CAP_IRQFD_RESAMPLE: case KVM_CAP_IRQFD_RESAMPLE:
#endif #endif
case KVM_CAP_CHECK_EXTENSION_VM: case KVM_CAP_CHECK_EXTENSION_VM:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment