[PATCH 1/2] arm: Replace CONFIG_HAS_TLS_REG with HWCAP_TLS and check for it on V6

Nicolas Pitre nico at fluxnic.net
Fri Apr 8 09:19:38 EDT 2011


On Fri, 8 Apr 2011, Li Li wrote:

> Dears,
> 
> I cannot understand how TLS EMU ensure it's SMP safe, because get_tls
> helper (at 0xffff0fe0) just read the value from 0xffff0ff0. But all
> SMP cores should have the exact same mapping to the vectors page (at
> 0xffff0000). So various threads running on different SMP cores at the
> same time would get the same emulated TLS value (instead of thread
> specific value set via set_tls). Could anybody explain this a little
> bit?

On SMP the hardware TLS register is always available, therefore the TLS 
value is not stored at 0xffff0ff0.  The code actually installed at 
0xffff0fe0 is modified at boot time by kuser_get_tls_init to select 
either the ldr or the mrc instruction to retrieve the TLS value.


Nicolas



More information about the linux-arm-kernel mailing list