xref: /qemu/hw/ppc/spapr_irq.c (revision 7bcdbcca2f498b8c93f33241488305a3694a941c)
1 /*
2  * QEMU PowerPC sPAPR IRQ interface
3  *
4  * Copyright (c) 2018, IBM Corporation.
5  *
6  * This code is licensed under the GPL version 2 or later. See the
7  * COPYING file in the top-level directory.
8  */
9 
10 #include "qemu/osdep.h"
11 #include "qemu/log.h"
12 #include "qemu/error-report.h"
13 #include "qapi/error.h"
14 #include "hw/irq.h"
15 #include "hw/ppc/spapr.h"
16 #include "hw/ppc/spapr_cpu_core.h"
17 #include "hw/ppc/spapr_xive.h"
18 #include "hw/ppc/xics.h"
19 #include "hw/ppc/xics_spapr.h"
20 #include "hw/qdev-properties.h"
21 #include "cpu-models.h"
22 #include "sysemu/kvm.h"
23 
24 #include "trace.h"
25 
26 static const TypeInfo spapr_intc_info = {
27     .name = TYPE_SPAPR_INTC,
28     .parent = TYPE_INTERFACE,
29     .class_size = sizeof(SpaprInterruptControllerClass),
30 };
31 
32 void spapr_irq_msi_init(SpaprMachineState *spapr, uint32_t nr_msis)
33 {
34     spapr->irq_map_nr = nr_msis;
35     spapr->irq_map = bitmap_new(spapr->irq_map_nr);
36 }
37 
38 int spapr_irq_msi_alloc(SpaprMachineState *spapr, uint32_t num, bool align,
39                         Error **errp)
40 {
41     int irq;
42 
43     /*
44      * The 'align_mask' parameter of bitmap_find_next_zero_area()
45      * should be one less than a power of 2; 0 means no
46      * alignment. Adapt the 'align' value of the former allocator
47      * to fit the requirements of bitmap_find_next_zero_area()
48      */
49     align -= 1;
50 
51     irq = bitmap_find_next_zero_area(spapr->irq_map, spapr->irq_map_nr, 0, num,
52                                      align);
53     if (irq == spapr->irq_map_nr) {
54         error_setg(errp, "can't find a free %d-IRQ block", num);
55         return -1;
56     }
57 
58     bitmap_set(spapr->irq_map, irq, num);
59 
60     return irq + SPAPR_IRQ_MSI;
61 }
62 
63 void spapr_irq_msi_free(SpaprMachineState *spapr, int irq, uint32_t num)
64 {
65     bitmap_clear(spapr->irq_map, irq - SPAPR_IRQ_MSI, num);
66 }
67 
68 static void spapr_irq_init_kvm(SpaprMachineState *spapr,
69                                   SpaprIrq *irq, Error **errp)
70 {
71     MachineState *machine = MACHINE(spapr);
72     Error *local_err = NULL;
73 
74     if (kvm_enabled() && machine_kernel_irqchip_allowed(machine)) {
75         irq->init_kvm(spapr, &local_err);
76         if (local_err && machine_kernel_irqchip_required(machine)) {
77             error_prepend(&local_err,
78                           "kernel_irqchip requested but unavailable: ");
79             error_propagate(errp, local_err);
80             return;
81         }
82 
83         if (!local_err) {
84             return;
85         }
86 
87         /*
88          * We failed to initialize the KVM device, fallback to
89          * emulated mode
90          */
91         error_prepend(&local_err, "kernel_irqchip allowed but unavailable: ");
92         error_append_hint(&local_err, "Falling back to kernel-irqchip=off\n");
93         warn_report_err(local_err);
94     }
95 }
96 
97 /*
98  * XICS IRQ backend.
99  */
100 
101 static void spapr_irq_print_info_xics(SpaprMachineState *spapr, Monitor *mon)
102 {
103     CPUState *cs;
104 
105     CPU_FOREACH(cs) {
106         PowerPCCPU *cpu = POWERPC_CPU(cs);
107 
108         icp_pic_print_info(spapr_cpu_state(cpu)->icp, mon);
109     }
110 
111     ics_pic_print_info(spapr->ics, mon);
112 }
113 
114 static int spapr_irq_post_load_xics(SpaprMachineState *spapr, int version_id)
115 {
116     if (!kvm_irqchip_in_kernel()) {
117         CPUState *cs;
118         CPU_FOREACH(cs) {
119             PowerPCCPU *cpu = POWERPC_CPU(cs);
120             icp_resend(spapr_cpu_state(cpu)->icp);
121         }
122     }
123     return 0;
124 }
125 
126 static void spapr_irq_reset_xics(SpaprMachineState *spapr, Error **errp)
127 {
128     Error *local_err = NULL;
129 
130     spapr_irq_init_kvm(spapr, &spapr_irq_xics, &local_err);
131     if (local_err) {
132         error_propagate(errp, local_err);
133         return;
134     }
135 }
136 
137 static void spapr_irq_init_kvm_xics(SpaprMachineState *spapr, Error **errp)
138 {
139     if (kvm_enabled()) {
140         xics_kvm_connect(spapr, errp);
141     }
142 }
143 
144 SpaprIrq spapr_irq_xics = {
145     .nr_xirqs    = SPAPR_NR_XIRQS,
146     .nr_msis     = SPAPR_NR_MSIS,
147     .xics        = true,
148     .xive        = false,
149 
150     .print_info  = spapr_irq_print_info_xics,
151     .dt_populate = spapr_dt_xics,
152     .post_load   = spapr_irq_post_load_xics,
153     .reset       = spapr_irq_reset_xics,
154     .init_kvm    = spapr_irq_init_kvm_xics,
155 };
156 
157 /*
158  * XIVE IRQ backend.
159  */
160 
161 static void spapr_irq_print_info_xive(SpaprMachineState *spapr,
162                                       Monitor *mon)
163 {
164     CPUState *cs;
165 
166     CPU_FOREACH(cs) {
167         PowerPCCPU *cpu = POWERPC_CPU(cs);
168 
169         xive_tctx_pic_print_info(spapr_cpu_state(cpu)->tctx, mon);
170     }
171 
172     spapr_xive_pic_print_info(spapr->xive, mon);
173 }
174 
175 static int spapr_irq_post_load_xive(SpaprMachineState *spapr, int version_id)
176 {
177     return spapr_xive_post_load(spapr->xive, version_id);
178 }
179 
180 static void spapr_irq_reset_xive(SpaprMachineState *spapr, Error **errp)
181 {
182     CPUState *cs;
183     Error *local_err = NULL;
184 
185     CPU_FOREACH(cs) {
186         PowerPCCPU *cpu = POWERPC_CPU(cs);
187 
188         /* (TCG) Set the OS CAM line of the thread interrupt context. */
189         spapr_xive_set_tctx_os_cam(spapr_cpu_state(cpu)->tctx);
190     }
191 
192     spapr_irq_init_kvm(spapr, &spapr_irq_xive, &local_err);
193     if (local_err) {
194         error_propagate(errp, local_err);
195         return;
196     }
197 
198     /* Activate the XIVE MMIOs */
199     spapr_xive_mmio_set_enabled(spapr->xive, true);
200 }
201 
202 static void spapr_irq_init_kvm_xive(SpaprMachineState *spapr, Error **errp)
203 {
204     if (kvm_enabled()) {
205         kvmppc_xive_connect(spapr->xive, errp);
206     }
207 }
208 
209 SpaprIrq spapr_irq_xive = {
210     .nr_xirqs    = SPAPR_NR_XIRQS,
211     .nr_msis     = SPAPR_NR_MSIS,
212     .xics        = false,
213     .xive        = true,
214 
215     .print_info  = spapr_irq_print_info_xive,
216     .dt_populate = spapr_dt_xive,
217     .post_load   = spapr_irq_post_load_xive,
218     .reset       = spapr_irq_reset_xive,
219     .init_kvm    = spapr_irq_init_kvm_xive,
220 };
221 
222 /*
223  * Dual XIVE and XICS IRQ backend.
224  *
225  * Both interrupt mode, XIVE and XICS, objects are created but the
226  * machine starts in legacy interrupt mode (XICS). It can be changed
227  * by the CAS negotiation process and, in that case, the new mode is
228  * activated after an extra machine reset.
229  */
230 
231 /*
232  * Returns the sPAPR IRQ backend negotiated by CAS. XICS is the
233  * default.
234  */
235 static SpaprIrq *spapr_irq_current(SpaprMachineState *spapr)
236 {
237     return spapr_ovec_test(spapr->ov5_cas, OV5_XIVE_EXPLOIT) ?
238         &spapr_irq_xive : &spapr_irq_xics;
239 }
240 
241 static void spapr_irq_print_info_dual(SpaprMachineState *spapr, Monitor *mon)
242 {
243     spapr_irq_current(spapr)->print_info(spapr, mon);
244 }
245 
246 static void spapr_irq_dt_populate_dual(SpaprMachineState *spapr,
247                                        uint32_t nr_servers, void *fdt,
248                                        uint32_t phandle)
249 {
250     spapr_irq_current(spapr)->dt_populate(spapr, nr_servers, fdt, phandle);
251 }
252 
253 static int spapr_irq_post_load_dual(SpaprMachineState *spapr, int version_id)
254 {
255     /*
256      * Force a reset of the XIVE backend after migration. The machine
257      * defaults to XICS at startup.
258      */
259     if (spapr_ovec_test(spapr->ov5_cas, OV5_XIVE_EXPLOIT)) {
260         if (kvm_irqchip_in_kernel()) {
261             xics_kvm_disconnect(spapr, &error_fatal);
262         }
263         spapr_irq_xive.reset(spapr, &error_fatal);
264     }
265 
266     return spapr_irq_current(spapr)->post_load(spapr, version_id);
267 }
268 
269 static void spapr_irq_reset_dual(SpaprMachineState *spapr, Error **errp)
270 {
271     Error *local_err = NULL;
272 
273     /*
274      * Deactivate the XIVE MMIOs. The XIVE backend will reenable them
275      * if selected.
276      */
277     spapr_xive_mmio_set_enabled(spapr->xive, false);
278 
279     /* Destroy all KVM devices */
280     if (kvm_irqchip_in_kernel()) {
281         xics_kvm_disconnect(spapr, &local_err);
282         if (local_err) {
283             error_propagate(errp, local_err);
284             error_prepend(errp, "KVM XICS disconnect failed: ");
285             return;
286         }
287         kvmppc_xive_disconnect(spapr->xive, &local_err);
288         if (local_err) {
289             error_propagate(errp, local_err);
290             error_prepend(errp, "KVM XIVE disconnect failed: ");
291             return;
292         }
293     }
294 
295     spapr_irq_current(spapr)->reset(spapr, errp);
296 }
297 
298 /*
299  * Define values in sync with the XIVE and XICS backend
300  */
301 SpaprIrq spapr_irq_dual = {
302     .nr_xirqs    = SPAPR_NR_XIRQS,
303     .nr_msis     = SPAPR_NR_MSIS,
304     .xics        = true,
305     .xive        = true,
306 
307     .print_info  = spapr_irq_print_info_dual,
308     .dt_populate = spapr_irq_dt_populate_dual,
309     .post_load   = spapr_irq_post_load_dual,
310     .reset       = spapr_irq_reset_dual,
311     .init_kvm    = NULL, /* should not be used */
312 };
313 
314 
315 static int spapr_irq_check(SpaprMachineState *spapr, Error **errp)
316 {
317     MachineState *machine = MACHINE(spapr);
318 
319     /*
320      * Sanity checks on non-P9 machines. On these, XIVE is not
321      * advertised, see spapr_dt_ov5_platform_support()
322      */
323     if (!ppc_type_check_compat(machine->cpu_type, CPU_POWERPC_LOGICAL_3_00,
324                                0, spapr->max_compat_pvr)) {
325         /*
326          * If the 'dual' interrupt mode is selected, force XICS as CAS
327          * negotiation is useless.
328          */
329         if (spapr->irq == &spapr_irq_dual) {
330             spapr->irq = &spapr_irq_xics;
331             return 0;
332         }
333 
334         /*
335          * Non-P9 machines using only XIVE is a bogus setup. We have two
336          * scenarios to take into account because of the compat mode:
337          *
338          * 1. POWER7/8 machines should fail to init later on when creating
339          *    the XIVE interrupt presenters because a POWER9 exception
340          *    model is required.
341 
342          * 2. POWER9 machines using the POWER8 compat mode won't fail and
343          *    will let the OS boot with a partial XIVE setup : DT
344          *    properties but no hcalls.
345          *
346          * To cover both and not confuse the OS, add an early failure in
347          * QEMU.
348          */
349         if (spapr->irq == &spapr_irq_xive) {
350             error_setg(errp, "XIVE-only machines require a POWER9 CPU");
351             return -1;
352         }
353     }
354 
355     /*
356      * On a POWER9 host, some older KVM XICS devices cannot be destroyed and
357      * re-created. Detect that early to avoid QEMU to exit later when the
358      * guest reboots.
359      */
360     if (kvm_enabled() &&
361         spapr->irq == &spapr_irq_dual &&
362         machine_kernel_irqchip_required(machine) &&
363         xics_kvm_has_broken_disconnect(spapr)) {
364         error_setg(errp, "KVM is too old to support ic-mode=dual,kernel-irqchip=on");
365         return -1;
366     }
367 
368     return 0;
369 }
370 
371 /*
372  * sPAPR IRQ frontend routines for devices
373  */
374 #define ALL_INTCS(spapr_) \
375     { SPAPR_INTC((spapr_)->ics), SPAPR_INTC((spapr_)->xive), }
376 
377 int spapr_irq_cpu_intc_create(SpaprMachineState *spapr,
378                               PowerPCCPU *cpu, Error **errp)
379 {
380     SpaprInterruptController *intcs[] = ALL_INTCS(spapr);
381     int i;
382     int rc;
383 
384     for (i = 0; i < ARRAY_SIZE(intcs); i++) {
385         SpaprInterruptController *intc = intcs[i];
386         if (intc) {
387             SpaprInterruptControllerClass *sicc = SPAPR_INTC_GET_CLASS(intc);
388             rc = sicc->cpu_intc_create(intc, cpu, errp);
389             if (rc < 0) {
390                 return rc;
391             }
392         }
393     }
394 
395     return 0;
396 }
397 
398 static void spapr_set_irq(void *opaque, int irq, int level)
399 {
400     SpaprMachineState *spapr = SPAPR_MACHINE(opaque);
401     SpaprInterruptControllerClass *sicc
402         = SPAPR_INTC_GET_CLASS(spapr->active_intc);
403 
404     sicc->set_irq(spapr->active_intc, irq, level);
405 }
406 
407 void spapr_irq_init(SpaprMachineState *spapr, Error **errp)
408 {
409     MachineState *machine = MACHINE(spapr);
410 
411     if (machine_kernel_irqchip_split(machine)) {
412         error_setg(errp, "kernel_irqchip split mode not supported on pseries");
413         return;
414     }
415 
416     if (!kvm_enabled() && machine_kernel_irqchip_required(machine)) {
417         error_setg(errp,
418                    "kernel_irqchip requested but only available with KVM");
419         return;
420     }
421 
422     if (spapr_irq_check(spapr, errp) < 0) {
423         return;
424     }
425 
426     /* Initialize the MSI IRQ allocator. */
427     if (!SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) {
428         spapr_irq_msi_init(spapr, spapr->irq->nr_msis);
429     }
430 
431     if (spapr->irq->xics) {
432         Error *local_err = NULL;
433         Object *obj;
434 
435         obj = object_new(TYPE_ICS_SPAPR);
436         object_property_add_child(OBJECT(spapr), "ics", obj, &local_err);
437         if (local_err) {
438             error_propagate(errp, local_err);
439             return;
440         }
441 
442         object_property_add_const_link(obj, ICS_PROP_XICS, OBJECT(spapr),
443                                        &local_err);
444         if (local_err) {
445             error_propagate(errp, local_err);
446             return;
447         }
448 
449         object_property_set_int(obj, spapr->irq->nr_xirqs, "nr-irqs",
450                                 &local_err);
451         if (local_err) {
452             error_propagate(errp, local_err);
453             return;
454         }
455 
456         object_property_set_bool(obj, true, "realized", &local_err);
457         if (local_err) {
458             error_propagate(errp, local_err);
459             return;
460         }
461 
462         spapr->ics = ICS_SPAPR(obj);
463     }
464 
465     if (spapr->irq->xive) {
466         uint32_t nr_servers = spapr_max_server_number(spapr);
467         DeviceState *dev;
468         int i;
469 
470         dev = qdev_create(NULL, TYPE_SPAPR_XIVE);
471         qdev_prop_set_uint32(dev, "nr-irqs",
472                              spapr->irq->nr_xirqs + SPAPR_XIRQ_BASE);
473         /*
474          * 8 XIVE END structures per CPU. One for each available
475          * priority
476          */
477         qdev_prop_set_uint32(dev, "nr-ends", nr_servers << 3);
478         qdev_init_nofail(dev);
479 
480         spapr->xive = SPAPR_XIVE(dev);
481 
482         /* Enable the CPU IPIs */
483         for (i = 0; i < nr_servers; ++i) {
484             SpaprInterruptControllerClass *sicc
485                 = SPAPR_INTC_GET_CLASS(spapr->xive);
486 
487             if (sicc->claim_irq(SPAPR_INTC(spapr->xive), SPAPR_IRQ_IPI + i,
488                                 false, errp) < 0) {
489                 return;
490             }
491         }
492 
493         spapr_xive_hcall_init(spapr);
494     }
495 
496     spapr->qirqs = qemu_allocate_irqs(spapr_set_irq, spapr,
497                                       spapr->irq->nr_xirqs + SPAPR_XIRQ_BASE);
498 }
499 
500 int spapr_irq_claim(SpaprMachineState *spapr, int irq, bool lsi, Error **errp)
501 {
502     SpaprInterruptController *intcs[] = ALL_INTCS(spapr);
503     int i;
504     int rc;
505 
506     assert(irq >= SPAPR_XIRQ_BASE);
507     assert(irq < (spapr->irq->nr_xirqs + SPAPR_XIRQ_BASE));
508 
509     for (i = 0; i < ARRAY_SIZE(intcs); i++) {
510         SpaprInterruptController *intc = intcs[i];
511         if (intc) {
512             SpaprInterruptControllerClass *sicc = SPAPR_INTC_GET_CLASS(intc);
513             rc = sicc->claim_irq(intc, irq, lsi, errp);
514             if (rc < 0) {
515                 return rc;
516             }
517         }
518     }
519 
520     return 0;
521 }
522 
523 void spapr_irq_free(SpaprMachineState *spapr, int irq, int num)
524 {
525     SpaprInterruptController *intcs[] = ALL_INTCS(spapr);
526     int i, j;
527 
528     assert(irq >= SPAPR_XIRQ_BASE);
529     assert((irq + num) <= (spapr->irq->nr_xirqs + SPAPR_XIRQ_BASE));
530 
531     for (i = irq; i < (irq + num); i++) {
532         for (j = 0; j < ARRAY_SIZE(intcs); j++) {
533             SpaprInterruptController *intc = intcs[j];
534 
535             if (intc) {
536                 SpaprInterruptControllerClass *sicc
537                     = SPAPR_INTC_GET_CLASS(intc);
538                 sicc->free_irq(intc, i);
539             }
540         }
541     }
542 }
543 
544 qemu_irq spapr_qirq(SpaprMachineState *spapr, int irq)
545 {
546     /*
547      * This interface is basically for VIO and PHB devices to find the
548      * right qemu_irq to manipulate, so we only allow access to the
549      * external irqs for now.  Currently anything which needs to
550      * access the IPIs most naturally gets there via the guest side
551      * interfaces, we can change this if we need to in future.
552      */
553     assert(irq >= SPAPR_XIRQ_BASE);
554     assert(irq < (spapr->irq->nr_xirqs + SPAPR_XIRQ_BASE));
555 
556     if (spapr->ics) {
557         assert(ics_valid_irq(spapr->ics, irq));
558     }
559     if (spapr->xive) {
560         assert(irq < spapr->xive->nr_irqs);
561         assert(xive_eas_is_valid(&spapr->xive->eat[irq]));
562     }
563 
564     return spapr->qirqs[irq];
565 }
566 
567 int spapr_irq_post_load(SpaprMachineState *spapr, int version_id)
568 {
569     spapr_irq_update_active_intc(spapr);
570     return spapr->irq->post_load(spapr, version_id);
571 }
572 
573 void spapr_irq_reset(SpaprMachineState *spapr, Error **errp)
574 {
575     assert(!spapr->irq_map || bitmap_empty(spapr->irq_map, spapr->irq_map_nr));
576 
577     spapr_irq_update_active_intc(spapr);
578 
579     if (spapr->irq->reset) {
580         spapr->irq->reset(spapr, errp);
581     }
582 }
583 
584 int spapr_irq_get_phandle(SpaprMachineState *spapr, void *fdt, Error **errp)
585 {
586     const char *nodename = "interrupt-controller";
587     int offset, phandle;
588 
589     offset = fdt_subnode_offset(fdt, 0, nodename);
590     if (offset < 0) {
591         error_setg(errp, "Can't find node \"%s\": %s",
592                    nodename, fdt_strerror(offset));
593         return -1;
594     }
595 
596     phandle = fdt_get_phandle(fdt, offset);
597     if (!phandle) {
598         error_setg(errp, "Can't get phandle of node \"%s\"", nodename);
599         return -1;
600     }
601 
602     return phandle;
603 }
604 
605 static void set_active_intc(SpaprMachineState *spapr,
606                             SpaprInterruptController *new_intc)
607 {
608     SpaprInterruptControllerClass *sicc;
609 
610     assert(new_intc);
611 
612     if (new_intc == spapr->active_intc) {
613         /* Nothing to do */
614         return;
615     }
616 
617     if (spapr->active_intc) {
618         sicc = SPAPR_INTC_GET_CLASS(spapr->active_intc);
619         if (sicc->deactivate) {
620             sicc->deactivate(spapr->active_intc);
621         }
622     }
623 
624     sicc = SPAPR_INTC_GET_CLASS(new_intc);
625     if (sicc->activate) {
626         sicc->activate(new_intc, &error_fatal);
627     }
628 
629     spapr->active_intc = new_intc;
630 }
631 
632 void spapr_irq_update_active_intc(SpaprMachineState *spapr)
633 {
634     SpaprInterruptController *new_intc;
635 
636     if (!spapr->ics) {
637         /*
638          * XXX before we run CAS, ov5_cas is initialized empty, which
639          * indicates XICS, even if we have ic-mode=xive.  TODO: clean
640          * up the CAS path so that we have a clearer way of handling
641          * this.
642          */
643         new_intc = SPAPR_INTC(spapr->xive);
644     } else if (spapr_ovec_test(spapr->ov5_cas, OV5_XIVE_EXPLOIT)) {
645         new_intc = SPAPR_INTC(spapr->xive);
646     } else {
647         new_intc = SPAPR_INTC(spapr->ics);
648     }
649 
650     set_active_intc(spapr, new_intc);
651 }
652 
653 /*
654  * XICS legacy routines - to deprecate one day
655  */
656 
657 static int ics_find_free_block(ICSState *ics, int num, int alignnum)
658 {
659     int first, i;
660 
661     for (first = 0; first < ics->nr_irqs; first += alignnum) {
662         if (num > (ics->nr_irqs - first)) {
663             return -1;
664         }
665         for (i = first; i < first + num; ++i) {
666             if (!ics_irq_free(ics, i)) {
667                 break;
668             }
669         }
670         if (i == (first + num)) {
671             return first;
672         }
673     }
674 
675     return -1;
676 }
677 
678 int spapr_irq_find(SpaprMachineState *spapr, int num, bool align, Error **errp)
679 {
680     ICSState *ics = spapr->ics;
681     int first = -1;
682 
683     assert(ics);
684 
685     /*
686      * MSIMesage::data is used for storing VIRQ so
687      * it has to be aligned to num to support multiple
688      * MSI vectors. MSI-X is not affected by this.
689      * The hint is used for the first IRQ, the rest should
690      * be allocated continuously.
691      */
692     if (align) {
693         assert((num == 1) || (num == 2) || (num == 4) ||
694                (num == 8) || (num == 16) || (num == 32));
695         first = ics_find_free_block(ics, num, num);
696     } else {
697         first = ics_find_free_block(ics, num, 1);
698     }
699 
700     if (first < 0) {
701         error_setg(errp, "can't find a free %d-IRQ block", num);
702         return -1;
703     }
704 
705     return first + ics->offset;
706 }
707 
708 #define SPAPR_IRQ_XICS_LEGACY_NR_XIRQS     0x400
709 
710 SpaprIrq spapr_irq_xics_legacy = {
711     .nr_xirqs    = SPAPR_IRQ_XICS_LEGACY_NR_XIRQS,
712     .nr_msis     = SPAPR_IRQ_XICS_LEGACY_NR_XIRQS,
713     .xics        = true,
714     .xive        = false,
715 
716     .print_info  = spapr_irq_print_info_xics,
717     .dt_populate = spapr_dt_xics,
718     .post_load   = spapr_irq_post_load_xics,
719     .reset       = spapr_irq_reset_xics,
720     .init_kvm    = spapr_irq_init_kvm_xics,
721 };
722 
723 static void spapr_irq_register_types(void)
724 {
725     type_register_static(&spapr_intc_info);
726 }
727 
728 type_init(spapr_irq_register_types)
729