diff options
author | Paul Mackerras <paulus@samba.org> | 2014-06-30 06:51:13 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-08-05 08:26:28 -0400 |
commit | 297e21053a52f060944e9f0de4c64fad9bcd72fc (patch) | |
tree | 9ee54fbee84f31d76ac02db4639b044f92a24051 | |
parent | e4d57e1ee1ab59f0cef0272800ac6c52e0ec814a (diff) |
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: Paul Mackerras <paulus@samba.org>
Tested-by: Eric Auger <eric.auger@linaro.org>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | arch/ia64/kvm/Kconfig | 1 | ||||
-rw-r--r-- | arch/powerpc/kvm/Kconfig | 1 | ||||
-rw-r--r-- | arch/s390/kvm/Kconfig | 1 | ||||
-rw-r--r-- | arch/x86/kvm/Kconfig | 1 | ||||
-rw-r--r-- | include/linux/kvm_host.h | 8 | ||||
-rw-r--r-- | virt/kvm/Kconfig | 3 | ||||
-rw-r--r-- | virt/kvm/eventfd.c | 6 | ||||
-rw-r--r-- | virt/kvm/kvm_main.c | 2 |
8 files changed, 15 insertions, 8 deletions
diff --git a/arch/ia64/kvm/Kconfig b/arch/ia64/kvm/Kconfig index 990b86420cc6..3d50ea955c4c 100644 --- a/arch/ia64/kvm/Kconfig +++ b/arch/ia64/kvm/Kconfig | |||
@@ -25,6 +25,7 @@ config KVM | |||
25 | select PREEMPT_NOTIFIERS | 25 | select PREEMPT_NOTIFIERS |
26 | select ANON_INODES | 26 | select ANON_INODES |
27 | select HAVE_KVM_IRQCHIP | 27 | select HAVE_KVM_IRQCHIP |
28 | select HAVE_KVM_IRQFD | ||
28 | select HAVE_KVM_IRQ_ROUTING | 29 | select HAVE_KVM_IRQ_ROUTING |
29 | select KVM_APIC_ARCHITECTURE | 30 | select KVM_APIC_ARCHITECTURE |
30 | select KVM_MMIO | 31 | select KVM_MMIO |
diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig index 8f104a6879f0..d4741dba91af 100644 --- a/arch/powerpc/kvm/Kconfig +++ b/arch/powerpc/kvm/Kconfig | |||
@@ -158,6 +158,7 @@ config KVM_MPIC | |||
158 | bool "KVM in-kernel MPIC emulation" | 158 | bool "KVM in-kernel MPIC emulation" |
159 | depends on KVM && E500 | 159 | depends on KVM && E500 |
160 | select HAVE_KVM_IRQCHIP | 160 | select HAVE_KVM_IRQCHIP |
161 | select HAVE_KVM_IRQFD | ||
161 | select HAVE_KVM_IRQ_ROUTING | 162 | select HAVE_KVM_IRQ_ROUTING |
162 | select HAVE_KVM_MSI | 163 | select HAVE_KVM_MSI |
163 | help | 164 | help |
diff --git a/arch/s390/kvm/Kconfig b/arch/s390/kvm/Kconfig index 10d529ac9821..646db9c467d1 100644 --- a/arch/s390/kvm/Kconfig +++ b/arch/s390/kvm/Kconfig | |||
@@ -26,6 +26,7 @@ config KVM | |||
26 | select KVM_ASYNC_PF | 26 | select KVM_ASYNC_PF |
27 | select KVM_ASYNC_PF_SYNC | 27 | select KVM_ASYNC_PF_SYNC |
28 | select HAVE_KVM_IRQCHIP | 28 | select HAVE_KVM_IRQCHIP |
29 | select HAVE_KVM_IRQFD | ||
29 | select HAVE_KVM_IRQ_ROUTING | 30 | select HAVE_KVM_IRQ_ROUTING |
30 | ---help--- | 31 | ---help--- |
31 | Support hosting paravirtualized guest machines using the SIE | 32 | Support hosting paravirtualized guest machines using the SIE |
diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index 287e4c85fff9..f9d16ff56c6b 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig | |||
@@ -27,6 +27,7 @@ config KVM | |||
27 | select MMU_NOTIFIER | 27 | select MMU_NOTIFIER |
28 | select ANON_INODES | 28 | select ANON_INODES |
29 | select HAVE_KVM_IRQCHIP | 29 | select HAVE_KVM_IRQCHIP |
30 | select HAVE_KVM_IRQFD | ||
30 | select HAVE_KVM_IRQ_ROUTING | 31 | select HAVE_KVM_IRQ_ROUTING |
31 | select HAVE_KVM_EVENTFD | 32 | select HAVE_KVM_EVENTFD |
32 | select KVM_APIC_ARCHITECTURE | 33 | select KVM_APIC_ARCHITECTURE |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index ddd33e1aeee1..8593d2e61cbf 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -437,7 +437,7 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); | |||
437 | int __must_check vcpu_load(struct kvm_vcpu *vcpu); | 437 | int __must_check vcpu_load(struct kvm_vcpu *vcpu); |
438 | void vcpu_put(struct kvm_vcpu *vcpu); | 438 | void vcpu_put(struct kvm_vcpu *vcpu); |
439 | 439 | ||
440 | #ifdef CONFIG_HAVE_KVM_IRQ_ROUTING | 440 | #ifdef CONFIG_HAVE_KVM_IRQFD |
441 | int kvm_irqfd_init(void); | 441 | int kvm_irqfd_init(void); |
442 | void kvm_irqfd_exit(void); | 442 | void kvm_irqfd_exit(void); |
443 | #else | 443 | #else |
@@ -932,20 +932,20 @@ int kvm_set_routing_entry(struct kvm_kernel_irq_routing_entry *e, | |||
932 | const struct kvm_irq_routing_entry *ue); | 932 | const struct kvm_irq_routing_entry *ue); |
933 | void kvm_free_irq_routing(struct kvm *kvm); | 933 | void kvm_free_irq_routing(struct kvm *kvm); |
934 | 934 | ||
935 | int kvm_send_userspace_msi(struct kvm *kvm, struct kvm_msi *msi); | ||
936 | |||
937 | #else | 935 | #else |
938 | 936 | ||
939 | static inline void kvm_free_irq_routing(struct kvm *kvm) {} | 937 | static inline void kvm_free_irq_routing(struct kvm *kvm) {} |
940 | 938 | ||
941 | #endif | 939 | #endif |
942 | 940 | ||
941 | int kvm_send_userspace_msi(struct kvm *kvm, struct kvm_msi *msi); | ||
942 | |||
943 | #ifdef CONFIG_HAVE_KVM_EVENTFD | 943 | #ifdef CONFIG_HAVE_KVM_EVENTFD |
944 | 944 | ||
945 | void kvm_eventfd_init(struct kvm *kvm); | 945 | void kvm_eventfd_init(struct kvm *kvm); |
946 | int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args); | 946 | int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args); |
947 | 947 | ||
948 | #ifdef CONFIG_HAVE_KVM_IRQCHIP | 948 | #ifdef CONFIG_HAVE_KVM_IRQFD |
949 | int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args); | 949 | int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args); |
950 | void kvm_irqfd_release(struct kvm *kvm); | 950 | void kvm_irqfd_release(struct kvm *kvm); |
951 | void kvm_irq_routing_update(struct kvm *); | 951 | void kvm_irq_routing_update(struct kvm *); |
diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig index 13f2d19793e3..fc0c5e603eb4 100644 --- a/virt/kvm/Kconfig +++ b/virt/kvm/Kconfig | |||
@@ -6,6 +6,9 @@ config HAVE_KVM | |||
6 | config HAVE_KVM_IRQCHIP | 6 | config HAVE_KVM_IRQCHIP |
7 | bool | 7 | bool |
8 | 8 | ||
9 | config HAVE_KVM_IRQFD | ||
10 | bool | ||
11 | |||
9 | config HAVE_KVM_IRQ_ROUTING | 12 | config HAVE_KVM_IRQ_ROUTING |
10 | bool | 13 | bool |
11 | 14 | ||
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index 99957df69cf2..f5f61548f60d 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #include "irq.h" | 39 | #include "irq.h" |
40 | #include "iodev.h" | 40 | #include "iodev.h" |
41 | 41 | ||
42 | #ifdef CONFIG_HAVE_KVM_IRQ_ROUTING | 42 | #ifdef CONFIG_HAVE_KVM_IRQFD |
43 | /* | 43 | /* |
44 | * -------------------------------------------------------------------- | 44 | * -------------------------------------------------------------------- |
45 | * irqfd: Allows an fd to be used to inject an interrupt to the guest | 45 | * irqfd: Allows an fd to be used to inject an interrupt to the guest |
@@ -450,7 +450,7 @@ out: | |||
450 | void | 450 | void |
451 | kvm_eventfd_init(struct kvm *kvm) | 451 | kvm_eventfd_init(struct kvm *kvm) |
452 | { | 452 | { |
453 | #ifdef CONFIG_HAVE_KVM_IRQ_ROUTING | 453 | #ifdef CONFIG_HAVE_KVM_IRQFD |
454 | spin_lock_init(&kvm->irqfds.lock); | 454 | spin_lock_init(&kvm->irqfds.lock); |
455 | INIT_LIST_HEAD(&kvm->irqfds.items); | 455 | INIT_LIST_HEAD(&kvm->irqfds.items); |
456 | INIT_LIST_HEAD(&kvm->irqfds.resampler_list); | 456 | INIT_LIST_HEAD(&kvm->irqfds.resampler_list); |
@@ -459,7 +459,7 @@ kvm_eventfd_init(struct kvm *kvm) | |||
459 | INIT_LIST_HEAD(&kvm->ioeventfds); | 459 | INIT_LIST_HEAD(&kvm->ioeventfds); |
460 | } | 460 | } |
461 | 461 | ||
462 | #ifdef CONFIG_HAVE_KVM_IRQ_ROUTING | 462 | #ifdef CONFIG_HAVE_KVM_IRQFD |
463 | /* | 463 | /* |
464 | * shutdown any irqfd's that match fd+gsi | 464 | * shutdown any irqfd's that match fd+gsi |
465 | */ | 465 | */ |
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 1b95cc926cfc..a69a623938b8 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -2337,7 +2337,7 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg) | |||
2337 | #ifdef CONFIG_HAVE_KVM_MSI | 2337 | #ifdef CONFIG_HAVE_KVM_MSI |
2338 | case KVM_CAP_SIGNAL_MSI: | 2338 | case KVM_CAP_SIGNAL_MSI: |
2339 | #endif | 2339 | #endif |
2340 | #ifdef CONFIG_HAVE_KVM_IRQ_ROUTING | 2340 | #ifdef CONFIG_HAVE_KVM_IRQFD |
2341 | case KVM_CAP_IRQFD_RESAMPLE: | 2341 | case KVM_CAP_IRQFD_RESAMPLE: |
2342 | #endif | 2342 | #endif |
2343 | case KVM_CAP_CHECK_EXTENSION_VM: | 2343 | case KVM_CAP_CHECK_EXTENSION_VM: |