Skip to content

Commit 297e210

Browse files
paulusmackbonzini
authored andcommitted
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>
1 parent e4d57e1 commit 297e210

8 files changed

Lines changed: 15 additions & 8 deletions

File tree

‎arch/ia64/kvm/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ config KVM
2525
select PREEMPT_NOTIFIERS
2626
select ANON_INODES
2727
select HAVE_KVM_IRQCHIP
28+
select HAVE_KVM_IRQFD
2829
select HAVE_KVM_IRQ_ROUTING
2930
select KVM_APIC_ARCHITECTURE
3031
select KVM_MMIO

‎arch/powerpc/kvm/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ config KVM_MPIC
158158
bool "KVM in-kernel MPIC emulation"
159159
depends on KVM && E500
160160
select HAVE_KVM_IRQCHIP
161+
select HAVE_KVM_IRQFD
161162
select HAVE_KVM_IRQ_ROUTING
162163
select HAVE_KVM_MSI
163164
help

‎arch/s390/kvm/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ config KVM
2626
select KVM_ASYNC_PF
2727
select KVM_ASYNC_PF_SYNC
2828
select HAVE_KVM_IRQCHIP
29+
select HAVE_KVM_IRQFD
2930
select HAVE_KVM_IRQ_ROUTING
3031
---help---
3132
Support hosting paravirtualized guest machines using the SIE

‎arch/x86/kvm/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ config KVM
2727
select MMU_NOTIFIER
2828
select ANON_INODES
2929
select HAVE_KVM_IRQCHIP
30+
select HAVE_KVM_IRQFD
3031
select HAVE_KVM_IRQ_ROUTING
3132
select HAVE_KVM_EVENTFD
3233
select KVM_APIC_ARCHITECTURE

‎include/linux/kvm_host.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu);
437437
int __must_check vcpu_load(struct kvm_vcpu *vcpu);
438438
void vcpu_put(struct kvm_vcpu *vcpu);
439439

440-
#ifdef CONFIG_HAVE_KVM_IRQ_ROUTING
440+
#ifdef CONFIG_HAVE_KVM_IRQFD
441441
int kvm_irqfd_init(void);
442442
void kvm_irqfd_exit(void);
443443
#else
@@ -932,20 +932,20 @@ int kvm_set_routing_entry(struct kvm_kernel_irq_routing_entry *e,
932932
const struct kvm_irq_routing_entry *ue);
933933
void kvm_free_irq_routing(struct kvm *kvm);
934934

935-
int kvm_send_userspace_msi(struct kvm *kvm, struct kvm_msi *msi);
936-
937935
#else
938936

939937
static inline void kvm_free_irq_routing(struct kvm *kvm) {}
940938

941939
#endif
942940

941+
int kvm_send_userspace_msi(struct kvm *kvm, struct kvm_msi *msi);
942+
943943
#ifdef CONFIG_HAVE_KVM_EVENTFD
944944

945945
void kvm_eventfd_init(struct kvm *kvm);
946946
int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args);
947947

948-
#ifdef CONFIG_HAVE_KVM_IRQCHIP
948+
#ifdef CONFIG_HAVE_KVM_IRQFD
949949
int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args);
950950
void kvm_irqfd_release(struct kvm *kvm);
951951
void kvm_irq_routing_update(struct kvm *);

‎virt/kvm/Kconfig‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ config HAVE_KVM
66
config HAVE_KVM_IRQCHIP
77
bool
88

9+
config HAVE_KVM_IRQFD
10+
bool
11+
912
config HAVE_KVM_IRQ_ROUTING
1013
bool
1114

‎virt/kvm/eventfd.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include "irq.h"
4040
#include "iodev.h"
4141

42-
#ifdef CONFIG_HAVE_KVM_IRQ_ROUTING
42+
#ifdef CONFIG_HAVE_KVM_IRQFD
4343
/*
4444
* --------------------------------------------------------------------
4545
* 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)
450450
void
451451
kvm_eventfd_init(struct kvm *kvm)
452452
{
453-
#ifdef CONFIG_HAVE_KVM_IRQ_ROUTING
453+
#ifdef CONFIG_HAVE_KVM_IRQFD
454454
spin_lock_init(&kvm->irqfds.lock);
455455
INIT_LIST_HEAD(&kvm->irqfds.items);
456456
INIT_LIST_HEAD(&kvm->irqfds.resampler_list);
@@ -459,7 +459,7 @@ kvm_eventfd_init(struct kvm *kvm)
459459
INIT_LIST_HEAD(&kvm->ioeventfds);
460460
}
461461

462-
#ifdef CONFIG_HAVE_KVM_IRQ_ROUTING
462+
#ifdef CONFIG_HAVE_KVM_IRQFD
463463
/*
464464
* shutdown any irqfd's that match fd+gsi
465465
*/

‎virt/kvm/kvm_main.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2337,7 +2337,7 @@ static long kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)
23372337
#ifdef CONFIG_HAVE_KVM_MSI
23382338
case KVM_CAP_SIGNAL_MSI:
23392339
#endif
2340-
#ifdef CONFIG_HAVE_KVM_IRQ_ROUTING
2340+
#ifdef CONFIG_HAVE_KVM_IRQFD
23412341
case KVM_CAP_IRQFD_RESAMPLE:
23422342
#endif
23432343
case KVM_CAP_CHECK_EXTENSION_VM:

0 commit comments

Comments
 (0)