diff options
author | Gleb Natapov <gleb@redhat.com> | 2009-08-24 04:54:20 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-12-03 02:32:07 -0500 |
commit | 46e624b95c36d729bdf24010fff11d16f6fe94fa (patch) | |
tree | e505df028d91f767778afb8e2cfc89cd6e7440e8 /include/linux | |
parent | 1a6e4a8c276e122dbeb6f9c610f29735e4236bfd (diff) |
KVM: Change irq routing table to use gsi indexed array
Use gsi indexed array instead of scanning all entries on each interrupt
injection.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/kvm_host.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 1c7f8c49e4e8..f403e66557fb 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -128,7 +128,17 @@ struct kvm_kernel_irq_routing_entry { | |||
128 | } irqchip; | 128 | } irqchip; |
129 | struct msi_msg msi; | 129 | struct msi_msg msi; |
130 | }; | 130 | }; |
131 | struct list_head link; | 131 | struct hlist_node link; |
132 | }; | ||
133 | |||
134 | struct kvm_irq_routing_table { | ||
135 | struct kvm_kernel_irq_routing_entry *rt_entries; | ||
136 | u32 nr_rt_entries; | ||
137 | /* | ||
138 | * Array indexed by gsi. Each entry contains list of irq chips | ||
139 | * the gsi is connected to. | ||
140 | */ | ||
141 | struct hlist_head map[0]; | ||
132 | }; | 142 | }; |
133 | 143 | ||
134 | struct kvm { | 144 | struct kvm { |
@@ -166,7 +176,7 @@ struct kvm { | |||
166 | 176 | ||
167 | struct mutex irq_lock; | 177 | struct mutex irq_lock; |
168 | #ifdef CONFIG_HAVE_KVM_IRQCHIP | 178 | #ifdef CONFIG_HAVE_KVM_IRQCHIP |
169 | struct list_head irq_routing; /* of kvm_kernel_irq_routing_entry */ | 179 | struct kvm_irq_routing_table *irq_routing; |
170 | struct hlist_head mask_notifier_list; | 180 | struct hlist_head mask_notifier_list; |
171 | #endif | 181 | #endif |
172 | 182 | ||
@@ -390,7 +400,12 @@ void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq, | |||
390 | struct kvm_irq_mask_notifier *kimn); | 400 | struct kvm_irq_mask_notifier *kimn); |
391 | void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask); | 401 | void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask); |
392 | 402 | ||
393 | int kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level); | 403 | #ifdef __KVM_HAVE_IOAPIC |
404 | void kvm_get_intr_delivery_bitmask(struct kvm_ioapic *ioapic, | ||
405 | union kvm_ioapic_redirect_entry *entry, | ||
406 | unsigned long *deliver_bitmask); | ||
407 | #endif | ||
408 | int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level); | ||
394 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); | 409 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); |
395 | void kvm_register_irq_ack_notifier(struct kvm *kvm, | 410 | void kvm_register_irq_ack_notifier(struct kvm *kvm, |
396 | struct kvm_irq_ack_notifier *kian); | 411 | struct kvm_irq_ack_notifier *kian); |