diff options
author | Alexander Graf <agraf@suse.de> | 2013-04-17 07:29:30 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2013-04-26 14:27:14 -0400 |
commit | a725d56a02ec3582bb5b9756f261fdc6962c79ee (patch) | |
tree | 12951caba7ac5239b18b3aeaba875d4d29833a85 /virt/kvm | |
parent | 8175e5b79c38a1d85225da516fa1a0ecbf2fdbca (diff) |
KVM: Introduce CONFIG_HAVE_KVM_IRQ_ROUTING
Quite a bit of code in KVM has been conditionalized on availability of
IOAPIC emulation. However, most of it is generically applicable to
platforms that don't have an IOPIC, but a different type of irq chip.
Make code that only relies on IRQ routing, not an APIC itself, on
CONFIG_HAVE_KVM_IRQ_ROUTING, so that we can reuse it later.
Signed-off-by: Alexander Graf <agraf@suse.de>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'virt/kvm')
-rw-r--r-- | virt/kvm/Kconfig | 3 | ||||
-rw-r--r-- | virt/kvm/eventfd.c | 6 | ||||
-rw-r--r-- | virt/kvm/kvm_main.c | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig index d01b24b72c61..779262f59e25 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_IRQ_ROUTING | ||
10 | bool | ||
11 | |||
9 | config HAVE_KVM_EVENTFD | 12 | config HAVE_KVM_EVENTFD |
10 | bool | 13 | bool |
11 | select EVENTFD | 14 | select EVENTFD |
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index c5d43ffbf1f3..64ee720b75c7 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c | |||
@@ -35,7 +35,7 @@ | |||
35 | 35 | ||
36 | #include "iodev.h" | 36 | #include "iodev.h" |
37 | 37 | ||
38 | #ifdef __KVM_HAVE_IOAPIC | 38 | #ifdef CONFIG_HAVE_KVM_IRQ_ROUTING |
39 | /* | 39 | /* |
40 | * -------------------------------------------------------------------- | 40 | * -------------------------------------------------------------------- |
41 | * irqfd: Allows an fd to be used to inject an interrupt to the guest | 41 | * irqfd: Allows an fd to be used to inject an interrupt to the guest |
@@ -433,7 +433,7 @@ fail: | |||
433 | void | 433 | void |
434 | kvm_eventfd_init(struct kvm *kvm) | 434 | kvm_eventfd_init(struct kvm *kvm) |
435 | { | 435 | { |
436 | #ifdef __KVM_HAVE_IOAPIC | 436 | #ifdef CONFIG_HAVE_KVM_IRQ_ROUTING |
437 | spin_lock_init(&kvm->irqfds.lock); | 437 | spin_lock_init(&kvm->irqfds.lock); |
438 | INIT_LIST_HEAD(&kvm->irqfds.items); | 438 | INIT_LIST_HEAD(&kvm->irqfds.items); |
439 | INIT_LIST_HEAD(&kvm->irqfds.resampler_list); | 439 | INIT_LIST_HEAD(&kvm->irqfds.resampler_list); |
@@ -442,7 +442,7 @@ kvm_eventfd_init(struct kvm *kvm) | |||
442 | INIT_LIST_HEAD(&kvm->ioeventfds); | 442 | INIT_LIST_HEAD(&kvm->ioeventfds); |
443 | } | 443 | } |
444 | 444 | ||
445 | #ifdef __KVM_HAVE_IOAPIC | 445 | #ifdef CONFIG_HAVE_KVM_IRQ_ROUTING |
446 | /* | 446 | /* |
447 | * shutdown any irqfd's that match fd+gsi | 447 | * shutdown any irqfd's that match fd+gsi |
448 | */ | 448 | */ |
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index aaac1a7a9ea8..2c3b226bc13b 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -2404,7 +2404,7 @@ static long kvm_dev_ioctl_check_extension_generic(long arg) | |||
2404 | case KVM_CAP_SIGNAL_MSI: | 2404 | case KVM_CAP_SIGNAL_MSI: |
2405 | #endif | 2405 | #endif |
2406 | return 1; | 2406 | return 1; |
2407 | #ifdef KVM_CAP_IRQ_ROUTING | 2407 | #ifdef CONFIG_HAVE_KVM_IRQ_ROUTING |
2408 | case KVM_CAP_IRQ_ROUTING: | 2408 | case KVM_CAP_IRQ_ROUTING: |
2409 | return KVM_MAX_IRQ_ROUTES; | 2409 | return KVM_MAX_IRQ_ROUTES; |
2410 | #endif | 2410 | #endif |