Hi!

I am looking to see if there would be any support for a patch introducing an 
option to the compiler for ARM to allow for generation of code using TPIDRURW 
(the user-writable thread ID register in CP15) as the thread ID instead of 
TPIDRURO.

Currently, GCC claims to support using CP15 for the thread ID, however of the 
two registers it contains that are accessible by EL0, it only supports 
generating code that accesses TPIDRURO, which is not writable by the user.

I'm currently working on a project to improve support for TLS within the seL4 
kernel. On ARMv6 and ARMv7 architectures where there are dedicated thread ID 
registers available we want to use TPIDURW as the standard register for the 
thread ID (as tpidr_el0 is used for AARCH64).

We can currently work around this with the soft method but it would be 
beneficial to include an option to use TPIDRURW instead of TPIDRURO as it would 
improve all accesses to thread-local variables.

We particularly want to use the user-writable register as it is useful to 
processes performing green-threading as they would be able to perform context 
switches internally with no intervention from the kernel (and thus with 
drastically lower overhead).

>From a cursory view of the implementation, it doesn't seem that this would be 
>too difficult to implement. I am interesting in putting forward a patch if it 
>is likely it will be fully considered.

Cheers,
Curtis

Reply via email to