read_cpuid_id() in arch/arm/kernel/setup.c

Russell King - ARM Linux linux at
Fri Mar 13 10:02:51 PDT 2015

On Fri, Mar 13, 2015 at 04:56:00PM +0000, Mark Rutland wrote:
> In the presence of big.LITTLE the comment and premise of the
> optimisation here is wrong. A thread can migrate between cores of
> differing microarchitectures.
> So __attribute_const__ is simply broken, and we probably need to do
> something like the black magic SP hazarding hack we do for the tpidr
> percpu accesses (only expecting this to be called in non-preemptible
> context) if it makes sense to allow the value to be cached.

Yes, it's true that with big.LITTLE, lots of stuff is broken in this
regard, and you are partially right, but you are not entirely right

It's not the reading of the CPU ID which is the problem, it's the
reading _and_ use of derived results which is a problem.

What this basically means is that in the presence of big.LITTLE, we
need __get_cpu_architecture() as a whole, and whatever makes use of
its return value to /all/ be non-preemptible... and probably a lot
more code too.

FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to

More information about the linux-arm-kernel mailing list