[PATCH] ARM: v6: prevent gcc from reordering extended CP15 reads above is_smp() test
Paul Walmsley
paul at pwsan.com
Tue Jul 30 06:58:24 EDT 2013
Hi Will
On Mon, 29 Jul 2013, Will Deacon wrote:
> I wouldn't worry about checking for CPU_V6. Besides, we probably need this
> to be re-evaluated across barrier() when we get CPU migration on a
> big-little platform anyway (we should probably also drop the
> __attribute_const__ for that).
>
> So you can just replace the "cc" (now that Nico kindly explained why those
> aren't needed the other day) with "memory".
>
> An alternative is to add barrier() between is_smp() and the read_cpuid_ext()
> in all callers, adding a fake read from the stack to the latter (like I did
> for the per-cpu accessor). However, this relies on fixing all callers for
> very little gain, so I don't think it's worth the hassle.
>
> I can cook a patch if you're tied up with other things -- just let me know.
Makes sense to me. Have respun the patch and will post it shortly.
Thanks for the extra compiler research; it's been incorporated into the
patch description and comments.
- Paul
More information about the linux-arm-kernel
mailing list