Can cores have different CPU features in a SMP system?

Suzuki K Poulose Suzuki.Poulose at arm.com
Tue Aug 2 03:09:01 PDT 2016


On 01/08/16 20:08, Jun Sun wrote:
> I looked at the kernel source code again.  Kernel currently only
> detects CPU features of CPU0 and use it for all other CPUs.   In other
> words, it is assuming all cores must have the same CPU features, which
> in a sense is a form of "enforcing".

On arm64 kernels, the CPU features are detected based on their availability
on all the CPUs. Hence, for e.g, if one cluster doesn't have crypto, kernel
doesn't expose the ELF AUX_HWCAP  crypto bits to the application (which should be
consulted by the application before doing a CPU Feature specific operation).

>
> As a result, it is definitely no-no to have cores with different CPU
> features, which is what I suspected.  Case closed. :)

It is not recommended to have cores with different CPU features, but as
mentioned above, arm64 kernel can cope up with the situation and disallow
any features that aren't available across all the CPUs.
See arch/arm64/kernel/cpufeature.c for more information.

Cheers
Suzuki



>
> Jun
>
> On Fri, Jul 29, 2016 at 2:30 PM, Jun Sun <jsun at junsun.net> wrote:
>> One specific example is that if a phone has two clusters.  Cores in
>> one cluster has v8 crypto extension and cores in the other don't.
>> Will this work?
>>
>> My gut feeling is no, since many apps query cpu features at run-time.
>> And process can migrate among cores.  If an app starts on a core with
>> CE and migrates to another core without CE.  Illegal instruction fault
>> will happen.
>>
>> Just wanna confirm if this is indeed the case.  Surprisingly google
>> search did not yield any meaningful answers.
>>
>> Cheers.
>>
>> Jun
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>




More information about the linux-arm-kernel mailing list