[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH v5 2/3] spapr: introduce a IRQ controller backend
From: |
Cédric Le Goater |
Subject: |
Re: [Qemu-ppc] [PATCH v5 2/3] spapr: introduce a IRQ controller backend to the machine |
Date: |
Mon, 30 Jul 2018 15:57:41 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 |
>> +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.
The XIVE IRQ backend will also need to initialize the MSI allocator but
the XIVE IRQ number space covers the full number space, it has no IRQ
number offset. The initialization will differ slightly :
+ /* Initialize the MSI IRQ allocator */
+ spapr_irq_msi_init(spapr, nr_irqs - SPAPR_IRQ_MSI);
+
So I rather keep the call where it is today. This is really a small
duplication.
Thanks,
C.
[Qemu-ppc] [PATCH v5 3/3] spapr: increase the size of the IRQ number space, Cédric Le Goater, 2018/07/26