On 26.09.2017 10:49, Igor Mammedov wrote:
> On Mon, 25 Sep 2017 16:14:16 -0700
> Richard Henderson <richard.hender...@linaro.org> wrote:
> 
>> On 09/18/2017 08:59 AM, David Hildenbrand wrote:
>>>      /* sync cs->cpu_index and env->core_id. The latter is needed for TCG. 
>>> */
>>> -    cs->cpu_index = env->core_id;
>>> +    cs->cpu_index = cpu->env.core_id;
>>> +#endif  
>>
>> Any reason not to drop core_id entirely in favour of cpu_index?
>> (Since cpu_index itself is generic and can't be dropped.)
> I prefer core_id vs cpu_index as the later is too generic
> (and we were trying to decouple target specific attributes
> /coreid/cpuid/whatnot from cpu_index as much as possible
> so it would be more clear what they mean and if possible
> make them in-depended of QEMU internal cpu_index which is
> essentially not owned by target).
> 

As x86 also has this split I also prefer to keep it for now as it is.

cpu_index just has to match our core id, otherwise e.g. migration could
break (cpu_index is used as identifier for cpus in the migration stream).

If we would drop core_id, we would have to implement a handler for the
STAP instruction, as the CPU object is not accessible from translate.c.
(not a big problem, just another reason to simply leave it as is for
now), and also a new property handler, so only a uint16_t can be set
using "core-id" onto a CPU object.

-- 

Thanks,

David

Reply via email to