[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 22/34] spapr, xics, xive: Move cpu_intc_create from SpaprI
From: |
Cédric Le Goater |
Subject: |
Re: [PATCH v3 22/34] spapr, xics, xive: Move cpu_intc_create from SpaprIrq to SpaprInterruptController |
Date: |
Wed, 2 Oct 2019 08:13:55 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 |
>> @@ -527,6 +471,30 @@ static int spapr_irq_check(SpaprMachineState *spapr,
>> Error **errp)
>> /*
>> * sPAPR IRQ frontend routines for devices
>> */
>> +#define ALL_INTCS(spapr_) \
>> + { SPAPR_INTC((spapr_)->ics), SPAPR_INTC((spapr_)->xive), }
>
> I would have expected this array to be under the machine.
>
>> +int spapr_irq_cpu_intc_create(SpaprMachineState *spapr,
>> + PowerPCCPU *cpu, Error **errp)
>> +{
>> + SpaprInterruptController *intcs[] = ALL_INTCS(spapr);
>> + int i;
>> + int rc;
>> +
>> + for (i = 0; i < ARRAY_SIZE(intcs); i++) {
>
> but it would have been difficult to use ARRAY_SIZE. OK then.
>
>> + SpaprInterruptController *intc = intcs[i];
>> + if (intc) {
>
> Is that test needed ?
I understand now : spapr->ics and spapr->xive can be NULL.
I think using a list would be better.
C.
- [PATCH v3 23/34] spapr, xics, xive: Move irq claim and free from SpaprIrq to SpaprInterruptController, (continued)
- [PATCH v3 23/34] spapr, xics, xive: Move irq claim and free from SpaprIrq to SpaprInterruptController, David Gibson, 2019/10/01
- Re: [PATCH v3 23/34] spapr, xics, xive: Move irq claim and free from SpaprIrq to SpaprInterruptController, Cédric Le Goater, 2019/10/02
- Re: [PATCH v3 23/34] spapr, xics, xive: Move irq claim and free from SpaprIrq to SpaprInterruptController, Greg Kurz, 2019/10/02
- Re: [PATCH v3 23/34] spapr, xics, xive: Move irq claim and free from SpaprIrq to SpaprInterruptController, Cédric Le Goater, 2019/10/02
- [PATCH v3 25/34] spapr, xics, xive: Move set_irq from SpaprIrq to SpaprInterruptController, David Gibson, 2019/10/01
- [PATCH v3 22/34] spapr, xics, xive: Move cpu_intc_create from SpaprIrq to SpaprInterruptController, David Gibson, 2019/10/01
- Re: [PATCH v3 22/34] spapr, xics, xive: Move cpu_intc_create from SpaprIrq to SpaprInterruptController, Cédric Le Goater, 2019/10/02
- Re: [PATCH v3 22/34] spapr, xics, xive: Move cpu_intc_create from SpaprIrq to SpaprInterruptController, David Gibson, 2019/10/02
- Re: [PATCH v3 22/34] spapr, xics, xive: Move cpu_intc_create from SpaprIrq to SpaprInterruptController,
Cédric Le Goater <=
- Re: [PATCH v3 22/34] spapr, xics, xive: Move cpu_intc_create from SpaprIrq to SpaprInterruptController, David Gibson, 2019/10/02
- Re: [PATCH v3 22/34] spapr, xics, xive: Move cpu_intc_create from SpaprIrq to SpaprInterruptController, Cédric Le Goater, 2019/10/02
- Re: [PATCH v3 22/34] spapr, xics, xive: Move cpu_intc_create from SpaprIrq to SpaprInterruptController, David Gibson, 2019/10/02
Re: [PATCH v3 22/34] spapr, xics, xive: Move cpu_intc_create from SpaprIrq to SpaprInterruptController, Greg Kurz, 2019/10/02
Re: [PATCH v3 22/34] spapr, xics, xive: Move cpu_intc_create from SpaprIrq to SpaprInterruptController, Cédric Le Goater, 2019/10/02
[PATCH v3 33/34] spapr: Move SpaprIrq::nr_xirqs to SpaprMachineClass, David Gibson, 2019/10/01
[PATCH v3 29/34] spapr: Remove SpaprIrq::init_kvm hook, David Gibson, 2019/10/01
[PATCH v3 28/34] spapr, xics, xive: Match signatures for XICS and XIVE KVM connect routines, David Gibson, 2019/10/01
[PATCH v3 27/34] spapr, xics, xive: Move dt_populate from SpaprIrq to SpaprInterruptController, David Gibson, 2019/10/01
[PATCH v3 32/34] spapr: Remove SpaprIrq::nr_msis, David Gibson, 2019/10/01