blob: a9d7fd1f1d6a8e5d0a1a9074d8ca19844da42059 [file] [log] [blame]
Xiantao Zhang3de42dc2008-10-06 13:48:45 +08001/*
2 * irq_comm.c: Common API for in kernel interrupt controller
3 * Copyright (c) 2007, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16 * Place - Suite 330, Boston, MA 02111-1307 USA.
17 * Authors:
18 * Yaozu (Eddie) Dong <Eddie.dong@intel.com>
19 *
20 */
21
22#include <linux/kvm_host.h>
Marcelo Tosatti229456f2009-06-17 09:22:14 -030023#include <trace/events/kvm.h>
Sheng Yang79950e12009-02-10 13:57:06 +080024
Sheng Yang79950e12009-02-10 13:57:06 +080025#include <asm/msidef.h>
Gleb Natapov58c2dde2009-03-05 16:35:04 +020026#ifdef CONFIG_IA64
27#include <asm/iosapic.h>
28#endif
Sheng Yang79950e12009-02-10 13:57:06 +080029
Xiantao Zhang3de42dc2008-10-06 13:48:45 +080030#include "irq.h"
31
32#include "ioapic.h"
33
Gleb Natapov49256632009-02-04 17:28:14 +020034static int kvm_set_pic_irq(struct kvm_kernel_irq_routing_entry *e,
35 struct kvm *kvm, int level)
Avi Kivity399ec802008-11-19 13:58:46 +020036{
37#ifdef CONFIG_X86
Gleb Natapov49256632009-02-04 17:28:14 +020038 return kvm_pic_set_irq(pic_irqchip(kvm), e->irqchip.pin, level);
39#else
40 return -1;
Avi Kivity399ec802008-11-19 13:58:46 +020041#endif
42}
43
Gleb Natapov49256632009-02-04 17:28:14 +020044static int kvm_set_ioapic_irq(struct kvm_kernel_irq_routing_entry *e,
45 struct kvm *kvm, int level)
Avi Kivity399ec802008-11-19 13:58:46 +020046{
Gleb Natapov49256632009-02-04 17:28:14 +020047 return kvm_ioapic_set_irq(kvm->arch.vioapic, e->irqchip.pin, level);
Avi Kivity399ec802008-11-19 13:58:46 +020048}
49
Gleb Natapov58c2dde2009-03-05 16:35:04 +020050inline static bool kvm_is_dm_lowest_prio(struct kvm_lapic_irq *irq)
Sheng Yang116191b2009-02-11 16:03:37 +080051{
Gleb Natapov58c2dde2009-03-05 16:35:04 +020052#ifdef CONFIG_IA64
53 return irq->delivery_mode ==
54 (IOSAPIC_LOWEST_PRIORITY << IOSAPIC_DELIVERY_SHIFT);
55#else
56 return irq->delivery_mode == APIC_DM_LOWEST;
57#endif
58}
Sheng Yang116191b2009-02-11 16:03:37 +080059
Gleb Natapov58c2dde2009-03-05 16:35:04 +020060int kvm_irq_delivery_to_apic(struct kvm *kvm, struct kvm_lapic *src,
61 struct kvm_lapic_irq *irq)
62{
63 int i, r = -1;
64 struct kvm_vcpu *vcpu, *lowest = NULL;
65
Marcelo Tosattifa40a822009-06-04 15:08:24 -030066 WARN_ON(!mutex_is_locked(&kvm->irq_lock));
67
Gleb Natapov58c2dde2009-03-05 16:35:04 +020068 if (irq->dest_mode == 0 && irq->dest_id == 0xff &&
69 kvm_is_dm_lowest_prio(irq))
Gleb Natapov343f94f2009-03-05 16:34:54 +020070 printk(KERN_INFO "kvm: apic: phys broadcast and lowest prio\n");
71
Gleb Natapov988a2ca2009-06-09 15:56:29 +030072 kvm_for_each_vcpu(i, vcpu, kvm) {
73 if (!kvm_apic_present(vcpu))
Gleb Natapov343f94f2009-03-05 16:34:54 +020074 continue;
Sheng Yang74a3a8f2009-03-04 13:33:02 +080075
Gleb Natapov58c2dde2009-03-05 16:35:04 +020076 if (!kvm_apic_match_dest(vcpu, src, irq->shorthand,
77 irq->dest_id, irq->dest_mode))
Gleb Natapov343f94f2009-03-05 16:34:54 +020078 continue;
79
Gleb Natapov58c2dde2009-03-05 16:35:04 +020080 if (!kvm_is_dm_lowest_prio(irq)) {
81 if (r < 0)
82 r = 0;
83 r += kvm_apic_set_irq(vcpu, irq);
Gleb Natapove1035712009-03-05 16:34:59 +020084 } else {
Gleb Natapov58c2dde2009-03-05 16:35:04 +020085 if (!lowest)
86 lowest = vcpu;
87 else if (kvm_apic_compare_prio(vcpu, lowest) < 0)
88 lowest = vcpu;
Gleb Natapove1035712009-03-05 16:34:59 +020089 }
Gleb Natapov343f94f2009-03-05 16:34:54 +020090 }
91
Gleb Natapov58c2dde2009-03-05 16:35:04 +020092 if (lowest)
93 r = kvm_apic_set_irq(lowest, irq);
94
95 return r;
Sheng Yang116191b2009-02-11 16:03:37 +080096}
97
Gleb Natapov49256632009-02-04 17:28:14 +020098static int kvm_set_msi(struct kvm_kernel_irq_routing_entry *e,
99 struct kvm *kvm, int level)
Sheng Yang79950e12009-02-10 13:57:06 +0800100{
Gleb Natapov58c2dde2009-03-05 16:35:04 +0200101 struct kvm_lapic_irq irq;
Sheng Yang79950e12009-02-10 13:57:06 +0800102
Gleb Natapov58c2dde2009-03-05 16:35:04 +0200103 irq.dest_id = (e->msi.address_lo &
Sheng Yang116191b2009-02-11 16:03:37 +0800104 MSI_ADDR_DEST_ID_MASK) >> MSI_ADDR_DEST_ID_SHIFT;
Gleb Natapov58c2dde2009-03-05 16:35:04 +0200105 irq.vector = (e->msi.data &
Sheng Yang116191b2009-02-11 16:03:37 +0800106 MSI_DATA_VECTOR_MASK) >> MSI_DATA_VECTOR_SHIFT;
Gleb Natapov58c2dde2009-03-05 16:35:04 +0200107 irq.dest_mode = (1 << MSI_ADDR_DEST_MODE_SHIFT) & e->msi.address_lo;
108 irq.trig_mode = (1 << MSI_DATA_TRIGGER_SHIFT) & e->msi.data;
109 irq.delivery_mode = e->msi.data & 0x700;
110 irq.level = 1;
111 irq.shorthand = 0;
Sheng Yang116191b2009-02-11 16:03:37 +0800112
113 /* TODO Deal with RH bit of MSI message address */
Gleb Natapov58c2dde2009-03-05 16:35:04 +0200114 return kvm_irq_delivery_to_apic(kvm, NULL, &irq);
Sheng Yang79950e12009-02-10 13:57:06 +0800115}
116
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300117/* This should be called with the kvm->irq_lock mutex held
Gleb Natapov49256632009-02-04 17:28:14 +0200118 * Return value:
119 * < 0 Interrupt was ignored (masked or not delivered for other reasons)
120 * = 0 Interrupt was coalesced (previous irq is still pending)
121 * > 0 Number of CPUs interrupt was delivered to
122 */
123int kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level)
Xiantao Zhang3de42dc2008-10-06 13:48:45 +0800124{
Avi Kivity399ec802008-11-19 13:58:46 +0200125 struct kvm_kernel_irq_routing_entry *e;
Sheng Yang79950e12009-02-10 13:57:06 +0800126 unsigned long *irq_state, sig_level;
Gleb Natapov49256632009-02-04 17:28:14 +0200127 int ret = -1;
Sheng Yang5550af42008-10-15 20:15:06 +0800128
Avi Kivityae8c1c42009-07-01 12:09:41 +0300129 trace_kvm_set_irq(irq, level, irq_source_id);
Marcelo Tosatti229456f2009-06-17 09:22:14 -0300130
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300131 WARN_ON(!mutex_is_locked(&kvm->irq_lock));
132
Sheng Yang79950e12009-02-10 13:57:06 +0800133 if (irq < KVM_IOAPIC_NUM_PINS) {
134 irq_state = (unsigned long *)&kvm->arch.irq_states[irq];
135
136 /* Logical OR for level trig interrupt */
137 if (level)
138 set_bit(irq_source_id, irq_state);
139 else
140 clear_bit(irq_source_id, irq_state);
141 sig_level = !!(*irq_state);
Michael S. Tsirkin07fb8bb2009-07-05 21:27:58 +0300142 } else if (!level)
143 return ret;
144 else /* Deal with MSI/MSI-X */
Sheng Yang79950e12009-02-10 13:57:06 +0800145 sig_level = 1;
Sheng Yang5550af42008-10-15 20:15:06 +0800146
Xiantao Zhang3de42dc2008-10-06 13:48:45 +0800147 /* Not possible to detect if the guest uses the PIC or the
148 * IOAPIC. So set the bit in both. The guest will ignore
149 * writes to the unused one.
150 */
Avi Kivity399ec802008-11-19 13:58:46 +0200151 list_for_each_entry(e, &kvm->irq_routing, link)
Gleb Natapov49256632009-02-04 17:28:14 +0200152 if (e->gsi == irq) {
153 int r = e->set(e, kvm, sig_level);
154 if (r < 0)
155 continue;
156
157 ret = r + ((ret < 0) ? 0 : ret);
158 }
159 return ret;
Xiantao Zhang3de42dc2008-10-06 13:48:45 +0800160}
161
Marcelo Tosatti44882ee2009-01-27 15:12:38 -0200162void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin)
Xiantao Zhang3de42dc2008-10-06 13:48:45 +0800163{
Marcelo Tosatti44882ee2009-01-27 15:12:38 -0200164 struct kvm_kernel_irq_routing_entry *e;
Xiantao Zhang3de42dc2008-10-06 13:48:45 +0800165 struct kvm_irq_ack_notifier *kian;
166 struct hlist_node *n;
Marcelo Tosatti44882ee2009-01-27 15:12:38 -0200167 unsigned gsi = pin;
168
Marcelo Tosatti229456f2009-06-17 09:22:14 -0300169 trace_kvm_ack_irq(irqchip, pin);
170
Marcelo Tosatti44882ee2009-01-27 15:12:38 -0200171 list_for_each_entry(e, &kvm->irq_routing, link)
Michael S. Tsirkin5116d8f2009-07-26 17:10:01 +0300172 if (e->type == KVM_IRQ_ROUTING_IRQCHIP &&
173 e->irqchip.irqchip == irqchip &&
Marcelo Tosatti44882ee2009-01-27 15:12:38 -0200174 e->irqchip.pin == pin) {
175 gsi = e->gsi;
176 break;
177 }
Xiantao Zhang3de42dc2008-10-06 13:48:45 +0800178
179 hlist_for_each_entry(kian, n, &kvm->arch.irq_ack_notifier_list, link)
180 if (kian->gsi == gsi)
181 kian->irq_acked(kian);
182}
183
184void kvm_register_irq_ack_notifier(struct kvm *kvm,
185 struct kvm_irq_ack_notifier *kian)
186{
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300187 mutex_lock(&kvm->irq_lock);
Xiantao Zhang3de42dc2008-10-06 13:48:45 +0800188 hlist_add_head(&kian->link, &kvm->arch.irq_ack_notifier_list);
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300189 mutex_unlock(&kvm->irq_lock);
Xiantao Zhang3de42dc2008-10-06 13:48:45 +0800190}
191
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300192void kvm_unregister_irq_ack_notifier(struct kvm *kvm,
193 struct kvm_irq_ack_notifier *kian)
Xiantao Zhang3de42dc2008-10-06 13:48:45 +0800194{
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300195 mutex_lock(&kvm->irq_lock);
Mark McLoughlinfdd897e2008-12-01 13:57:46 +0000196 hlist_del_init(&kian->link);
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300197 mutex_unlock(&kvm->irq_lock);
Xiantao Zhang3de42dc2008-10-06 13:48:45 +0800198}
Sheng Yang5550af42008-10-15 20:15:06 +0800199
Sheng Yang5550af42008-10-15 20:15:06 +0800200int kvm_request_irq_source_id(struct kvm *kvm)
201{
202 unsigned long *bitmap = &kvm->arch.irq_sources_bitmap;
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300203 int irq_source_id;
204
205 mutex_lock(&kvm->irq_lock);
206 irq_source_id = find_first_zero_bit(bitmap,
Sheng Yang5550af42008-10-15 20:15:06 +0800207 sizeof(kvm->arch.irq_sources_bitmap));
Mark McLoughlin61552362008-12-01 13:57:48 +0000208
Sheng Yang5550af42008-10-15 20:15:06 +0800209 if (irq_source_id >= sizeof(kvm->arch.irq_sources_bitmap)) {
210 printk(KERN_WARNING "kvm: exhaust allocatable IRQ sources!\n");
Mark McLoughlin61552362008-12-01 13:57:48 +0000211 return -EFAULT;
212 }
213
214 ASSERT(irq_source_id != KVM_USERSPACE_IRQ_SOURCE_ID);
215 set_bit(irq_source_id, bitmap);
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300216 mutex_unlock(&kvm->irq_lock);
Mark McLoughlin61552362008-12-01 13:57:48 +0000217
Sheng Yang5550af42008-10-15 20:15:06 +0800218 return irq_source_id;
219}
220
221void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id)
222{
223 int i;
224
Mark McLoughlin61552362008-12-01 13:57:48 +0000225 ASSERT(irq_source_id != KVM_USERSPACE_IRQ_SOURCE_ID);
226
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300227 mutex_lock(&kvm->irq_lock);
Mark McLoughlin61552362008-12-01 13:57:48 +0000228 if (irq_source_id < 0 ||
Sheng Yang5550af42008-10-15 20:15:06 +0800229 irq_source_id >= sizeof(kvm->arch.irq_sources_bitmap)) {
230 printk(KERN_ERR "kvm: IRQ source ID out of range!\n");
231 return;
232 }
233 for (i = 0; i < KVM_IOAPIC_NUM_PINS; i++)
234 clear_bit(irq_source_id, &kvm->arch.irq_states[i]);
235 clear_bit(irq_source_id, &kvm->arch.irq_sources_bitmap);
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300236 mutex_unlock(&kvm->irq_lock);
Sheng Yang5550af42008-10-15 20:15:06 +0800237}
Avi Kivity75858a82009-01-04 17:10:50 +0200238
239void kvm_register_irq_mask_notifier(struct kvm *kvm, int irq,
240 struct kvm_irq_mask_notifier *kimn)
241{
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300242 mutex_lock(&kvm->irq_lock);
Avi Kivity75858a82009-01-04 17:10:50 +0200243 kimn->irq = irq;
244 hlist_add_head(&kimn->link, &kvm->mask_notifier_list);
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300245 mutex_unlock(&kvm->irq_lock);
Avi Kivity75858a82009-01-04 17:10:50 +0200246}
247
248void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq,
249 struct kvm_irq_mask_notifier *kimn)
250{
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300251 mutex_lock(&kvm->irq_lock);
Avi Kivity75858a82009-01-04 17:10:50 +0200252 hlist_del(&kimn->link);
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300253 mutex_unlock(&kvm->irq_lock);
Avi Kivity75858a82009-01-04 17:10:50 +0200254}
255
256void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask)
257{
258 struct kvm_irq_mask_notifier *kimn;
259 struct hlist_node *n;
260
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300261 WARN_ON(!mutex_is_locked(&kvm->irq_lock));
262
Avi Kivity75858a82009-01-04 17:10:50 +0200263 hlist_for_each_entry(kimn, n, &kvm->mask_notifier_list, link)
264 if (kimn->irq == irq)
265 kimn->func(kimn, mask);
266}
267
Avi Kivity399ec802008-11-19 13:58:46 +0200268static void __kvm_free_irq_routing(struct list_head *irq_routing)
269{
270 struct kvm_kernel_irq_routing_entry *e, *n;
271
272 list_for_each_entry_safe(e, n, irq_routing, link)
273 kfree(e);
274}
275
276void kvm_free_irq_routing(struct kvm *kvm)
277{
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300278 mutex_lock(&kvm->irq_lock);
Avi Kivity399ec802008-11-19 13:58:46 +0200279 __kvm_free_irq_routing(&kvm->irq_routing);
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300280 mutex_unlock(&kvm->irq_lock);
Avi Kivity399ec802008-11-19 13:58:46 +0200281}
282
Hannes Edercded19f2009-02-21 02:19:13 +0100283static int setup_routing_entry(struct kvm_kernel_irq_routing_entry *e,
284 const struct kvm_irq_routing_entry *ue)
Avi Kivity399ec802008-11-19 13:58:46 +0200285{
286 int r = -EINVAL;
287 int delta;
288
289 e->gsi = ue->gsi;
Michael S. Tsirkin5116d8f2009-07-26 17:10:01 +0300290 e->type = ue->type;
Avi Kivity399ec802008-11-19 13:58:46 +0200291 switch (ue->type) {
292 case KVM_IRQ_ROUTING_IRQCHIP:
293 delta = 0;
294 switch (ue->u.irqchip.irqchip) {
295 case KVM_IRQCHIP_PIC_MASTER:
296 e->set = kvm_set_pic_irq;
297 break;
298 case KVM_IRQCHIP_PIC_SLAVE:
Gleb Natapov49256632009-02-04 17:28:14 +0200299 e->set = kvm_set_pic_irq;
Avi Kivity399ec802008-11-19 13:58:46 +0200300 delta = 8;
301 break;
302 case KVM_IRQCHIP_IOAPIC:
Chris Wrightefbc1002009-05-01 14:15:43 -0700303 e->set = kvm_set_ioapic_irq;
Avi Kivity399ec802008-11-19 13:58:46 +0200304 break;
305 default:
306 goto out;
307 }
308 e->irqchip.irqchip = ue->u.irqchip.irqchip;
309 e->irqchip.pin = ue->u.irqchip.pin + delta;
310 break;
Sheng Yang79950e12009-02-10 13:57:06 +0800311 case KVM_IRQ_ROUTING_MSI:
312 e->set = kvm_set_msi;
313 e->msi.address_lo = ue->u.msi.address_lo;
314 e->msi.address_hi = ue->u.msi.address_hi;
315 e->msi.data = ue->u.msi.data;
316 break;
Avi Kivity399ec802008-11-19 13:58:46 +0200317 default:
318 goto out;
319 }
320 r = 0;
321out:
322 return r;
323}
324
325
326int kvm_set_irq_routing(struct kvm *kvm,
327 const struct kvm_irq_routing_entry *ue,
328 unsigned nr,
329 unsigned flags)
330{
331 struct list_head irq_list = LIST_HEAD_INIT(irq_list);
332 struct list_head tmp = LIST_HEAD_INIT(tmp);
333 struct kvm_kernel_irq_routing_entry *e = NULL;
334 unsigned i;
335 int r;
336
337 for (i = 0; i < nr; ++i) {
338 r = -EINVAL;
339 if (ue->gsi >= KVM_MAX_IRQ_ROUTES)
340 goto out;
341 if (ue->flags)
342 goto out;
343 r = -ENOMEM;
344 e = kzalloc(sizeof(*e), GFP_KERNEL);
345 if (!e)
346 goto out;
347 r = setup_routing_entry(e, ue);
348 if (r)
349 goto out;
350 ++ue;
351 list_add(&e->link, &irq_list);
352 e = NULL;
353 }
354
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300355 mutex_lock(&kvm->irq_lock);
Avi Kivity399ec802008-11-19 13:58:46 +0200356 list_splice(&kvm->irq_routing, &tmp);
357 INIT_LIST_HEAD(&kvm->irq_routing);
358 list_splice(&irq_list, &kvm->irq_routing);
359 INIT_LIST_HEAD(&irq_list);
360 list_splice(&tmp, &irq_list);
Marcelo Tosattifa40a822009-06-04 15:08:24 -0300361 mutex_unlock(&kvm->irq_lock);
Avi Kivity399ec802008-11-19 13:58:46 +0200362
363 r = 0;
364
365out:
366 kfree(e);
367 __kvm_free_irq_routing(&irq_list);
368 return r;
369}
370
371#define IOAPIC_ROUTING_ENTRY(irq) \
372 { .gsi = irq, .type = KVM_IRQ_ROUTING_IRQCHIP, \
373 .u.irqchip.irqchip = KVM_IRQCHIP_IOAPIC, .u.irqchip.pin = (irq) }
374#define ROUTING_ENTRY1(irq) IOAPIC_ROUTING_ENTRY(irq)
375
376#ifdef CONFIG_X86
Avi Kivity399ec802008-11-19 13:58:46 +0200377# define PIC_ROUTING_ENTRY(irq) \
378 { .gsi = irq, .type = KVM_IRQ_ROUTING_IRQCHIP, \
379 .u.irqchip.irqchip = SELECT_PIC(irq), .u.irqchip.pin = (irq) % 8 }
380# define ROUTING_ENTRY2(irq) \
381 IOAPIC_ROUTING_ENTRY(irq), PIC_ROUTING_ENTRY(irq)
382#else
383# define ROUTING_ENTRY2(irq) \
384 IOAPIC_ROUTING_ENTRY(irq)
385#endif
386
387static const struct kvm_irq_routing_entry default_routing[] = {
388 ROUTING_ENTRY2(0), ROUTING_ENTRY2(1),
389 ROUTING_ENTRY2(2), ROUTING_ENTRY2(3),
390 ROUTING_ENTRY2(4), ROUTING_ENTRY2(5),
391 ROUTING_ENTRY2(6), ROUTING_ENTRY2(7),
392 ROUTING_ENTRY2(8), ROUTING_ENTRY2(9),
393 ROUTING_ENTRY2(10), ROUTING_ENTRY2(11),
394 ROUTING_ENTRY2(12), ROUTING_ENTRY2(13),
395 ROUTING_ENTRY2(14), ROUTING_ENTRY2(15),
396 ROUTING_ENTRY1(16), ROUTING_ENTRY1(17),
397 ROUTING_ENTRY1(18), ROUTING_ENTRY1(19),
398 ROUTING_ENTRY1(20), ROUTING_ENTRY1(21),
399 ROUTING_ENTRY1(22), ROUTING_ENTRY1(23),
400#ifdef CONFIG_IA64
401 ROUTING_ENTRY1(24), ROUTING_ENTRY1(25),
402 ROUTING_ENTRY1(26), ROUTING_ENTRY1(27),
403 ROUTING_ENTRY1(28), ROUTING_ENTRY1(29),
404 ROUTING_ENTRY1(30), ROUTING_ENTRY1(31),
405 ROUTING_ENTRY1(32), ROUTING_ENTRY1(33),
406 ROUTING_ENTRY1(34), ROUTING_ENTRY1(35),
407 ROUTING_ENTRY1(36), ROUTING_ENTRY1(37),
408 ROUTING_ENTRY1(38), ROUTING_ENTRY1(39),
409 ROUTING_ENTRY1(40), ROUTING_ENTRY1(41),
410 ROUTING_ENTRY1(42), ROUTING_ENTRY1(43),
411 ROUTING_ENTRY1(44), ROUTING_ENTRY1(45),
412 ROUTING_ENTRY1(46), ROUTING_ENTRY1(47),
413#endif
414};
415
416int kvm_setup_default_irq_routing(struct kvm *kvm)
417{
418 return kvm_set_irq_routing(kvm, default_routing,
419 ARRAY_SIZE(default_routing), 0);
420}