qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [PATCH 3/3] ppc/pnv: add a PowerNVCPUCore object


From: Cédric Le Goater
Subject: Re: [Qemu-ppc] [PATCH 3/3] ppc/pnv: add a PowerNVCPUCore object
Date: Tue, 30 Aug 2016 09:23:40 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

On 08/30/2016 08:15 AM, Benjamin Herrenschmidt wrote:
> On Mon, 2016-08-29 at 10:30 -0400, David Gibson wrote:
>>
>> Possibly.  In fact, I'm planning to eliminate cpu->cpu_dt_id at some
>> point, in favour of having the machine type construct the id when it
>> actually builds the dt.  It's not really a cpu level construct.

>From my understanding, cs->cpu_index is becoming the main CPU identifier.
sPAPRCPUCore assigns it :

        cs->cpu_index = cc->core_id + i

which I reused in PnvCPUCore to hold the real HW identifiers. 
ppc_get_vcpu_by_dt_id() can also safely use cs->cpu_index I think. 

So pnv mostly work without ->cpu_dt_id but there is :

> On PowerNV it is as it's equal to the PIR, the HW interrupt server,
> etc...

xics in the way ... Now that pnv uses real hw core ids, it is 
interesting to see how lost it gets without a cpu with index=0 ...

The most obvious issue is the way we look for the ICPState of a cpu :

    ICPState *ss = &xics->ss[cs->cpu_index];

how about introducing a helper like (this one I hacked) :

+ICPState *xics_find_icp(XICSState *xics, int cpu_index)
+{
+    int i;
+
+    for (i = 0 ; i < xics->nr_servers; i++) {
+        ICPState *ss = &xics->ss[i];
+        if (ss->cs && ss->cs->cpu_index == cpu_index)
+            return ss;
+    }
+
+    return NULL;
+}
+

That might have been already discussed on the mailing list ? 

Thanks,

C.




reply via email to

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