aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2013-04-15 04:42:33 -0400
committerAlexander Graf <agraf@suse.de>2013-04-26 14:27:13 -0400
commit8175e5b79c38a1d85225da516fa1a0ecbf2fdbca (patch)
tree9fdf768971d7c10292a34b9d15c5f7a1abe1301c
parentc35635efdc0312e013ebda1c8f3b5dd038c0d0e7 (diff)
KVM: Add KVM_IRQCHIP_NUM_PINS in addition to KVM_IOAPIC_NUM_PINS
The concept of routing interrupt lines to an irqchip is nothing that is IOAPIC specific. Every irqchip has a maximum number of pins that can be linked to irq lines. So let's add a new define that allows us to reuse generic code for non-IOAPIC platforms. Signed-off-by: Alexander Graf <agraf@suse.de> Acked-by: Michael S. Tsirkin <mst@redhat.com>
-rw-r--r--arch/x86/include/asm/kvm_host.h2
-rw-r--r--include/linux/kvm_host.h2
-rw-r--r--virt/kvm/irq_comm.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 18635ae42a8e..14337fa464bc 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -43,6 +43,8 @@
43#define KVM_PIO_PAGE_OFFSET 1 43#define KVM_PIO_PAGE_OFFSET 1
44#define KVM_COALESCED_MMIO_PAGE_OFFSET 2 44#define KVM_COALESCED_MMIO_PAGE_OFFSET 2
45 45
46#define KVM_IRQCHIP_NUM_PINS KVM_IOAPIC_NUM_PINS
47
46#define CR0_RESERVED_BITS \ 48#define CR0_RESERVED_BITS \
47 (~(unsigned long)(X86_CR0_PE | X86_CR0_MP | X86_CR0_EM | X86_CR0_TS \ 49 (~(unsigned long)(X86_CR0_PE | X86_CR0_MP | X86_CR0_EM | X86_CR0_TS \
48 | X86_CR0_ET | X86_CR0_NE | X86_CR0_WP | X86_CR0_AM \ 50 | X86_CR0_ET | X86_CR0_NE | X86_CR0_WP | X86_CR0_AM \
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 93a50054d46c..bf3b1dcb8b3d 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -307,7 +307,7 @@ struct kvm_kernel_irq_routing_entry {
307#ifdef __KVM_HAVE_IOAPIC 307#ifdef __KVM_HAVE_IOAPIC
308 308
309struct kvm_irq_routing_table { 309struct kvm_irq_routing_table {
310 int chip[KVM_NR_IRQCHIPS][KVM_IOAPIC_NUM_PINS]; 310 int chip[KVM_NR_IRQCHIPS][KVM_IRQCHIP_NUM_PINS];
311 struct kvm_kernel_irq_routing_entry *rt_entries; 311 struct kvm_kernel_irq_routing_entry *rt_entries;
312 u32 nr_rt_entries; 312 u32 nr_rt_entries;
313 /* 313 /*
diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c
index 25ab48007adb..7c0071de9e85 100644
--- a/virt/kvm/irq_comm.c
+++ b/virt/kvm/irq_comm.c
@@ -480,7 +480,7 @@ int kvm_set_irq_routing(struct kvm *kvm,
480 480
481 new->nr_rt_entries = nr_rt_entries; 481 new->nr_rt_entries = nr_rt_entries;
482 for (i = 0; i < 3; i++) 482 for (i = 0; i < 3; i++)
483 for (j = 0; j < KVM_IOAPIC_NUM_PINS; j++) 483 for (j = 0; j < KVM_IRQCHIP_NUM_PINS; j++)
484 new->chip[i][j] = -1; 484 new->chip[i][j] = -1;
485 485
486 for (i = 0; i < nr; ++i) { 486 for (i = 0; i < nr; ++i) {