Thread (40 messages) 40 messages, 8 authors, 2013-08-08
STALE4696d

[PATCH] ARM: v6: prevent gcc from reordering extended CP15 reads above is_smp() test

From: paul@pwsan.com (Paul Walmsley)
Date: 2013-07-30 10:58:24
Also in: linux-omap

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help