qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 07/13] ppc/pnv: Introduce PnvChipClass::intc_print_info() met


From: Cédric Le Goater
Subject: Re: [PATCH 07/13] ppc/pnv: Introduce PnvChipClass::intc_print_info() method
Date: Mon, 16 Dec 2019 08:54:39 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1

>> May be we should introduce a helper such as : 
>>
>> int pnv_chip_cpu_foreach(PnvChip *chip,
>>        int (*doit)(PnvChip *chip, PowerPCCPU *cpu, void *opaque), void 
>> *opaque)
>> {
>>     int i, j;
>>     int ret = 0;
>>
>>     for (i = 0; i < chip->nr_cores; i++) {
>>         PnvCore *pc = chip->cores[i];
>>         CPUCore *cc = CPU_CORE(pc);
>>
>>         for (j = 0; j < cc->nr_threads; j++) {
>>             PowerPCCPU *cpu = pc->threads[j];
>>             ret = doit(chip, cpu, opaque);
>>             if (ret) { 
>>                 break;
>>             }
>>         }
>>     }
>>     return ret;
>> }
> 
> What I'd actually like to work towards is just having the interrupt
> controllers themselves advertize TYPE_INTERRUPT_STATS_PROVIDER and not
> needing anything specific at the machine level to locate them, just
> let the generic code in hmp_info_pic handle it.

OK. It would good to at least loop on the chips, so that the output
of the possible TYPE_INTERRUPT_STATS_PROVIDER (IC, PSIHB, PHB, NPU) 
are ordered. 

C.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]