On Fri, Jul 27, 2018 at 09:04:17AM +0200, Cédric Le Goater wrote: > [ ... ] > > >> +static void spapr_irq_init_xics(sPAPRMachineState *spapr, Error **errp) > >> +{ > >> + MachineState *machine = MACHINE(spapr); > >> + sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr); > >> + int nr_irqs = smc->irq->nr_irqs; > >> + Error *local_err = NULL; > >> + > >> + /* Initialize the MSI IRQ allocator. */ > >> + if (!SPAPR_MACHINE_GET_CLASS(spapr)->legacy_irq_allocation) { > >> + spapr_irq_msi_init(spapr, XICS_IRQ_BASE + nr_irqs - > >> SPAPR_IRQ_MSI); > >> + } > > > > I think this belongs in common code, rather than xics specific. > > yes. > > >> + > >> + if (kvm_enabled()) { > >> + if (machine_kernel_irqchip_allowed(machine) && > >> + !xics_kvm_init(spapr, &local_err)) { > >> + spapr->icp_type = TYPE_KVM_ICP; > >> + spapr->ics = spapr_ics_create(spapr, TYPE_ICS_KVM, nr_irqs, > >> + &local_err); > >> + } > >> + if (machine_kernel_irqchip_required(machine) && !spapr->ics) { > >> + error_prepend(&local_err, > >> + "kernel_irqchip requested but unavailable: "); > >> + goto error; > >> + } > >> + error_free(local_err); > >> + local_err = NULL; > >> + } > >> + > >> + if (!spapr->ics) { > > > > When could this get called with spapr->ics already initialized? > > if the code above succeeds when running with the KVM accel. > > What are thinking about ? introducing a xics-kvm backend ?
Duh, sorry, no I just wasnt reading the earlier code clearly enough. -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature