[PATCH v6 07/13] ARC: Linux Syscall Interface

Vineet Gupta Vineet.Gupta1@synopsys.com
Wed Jun 3 19:46:12 GMT 2020

On 5/29/20 9:49 AM, Adhemerval Zanella via Libc-alpha wrote:
>> +	; ----- child starts here ---------
>> +
>> +	; Setup TP register (only recent kernels v4.19+ do that)
>> +	and.f	0, r12, CLONE_SETTLS
>> +	mov.nz	r25, r9
> Do you still need to set it since the minimum supported kernel
> for ARC is 5.1 ?


> It should be safe for internal glibc usage, since for both pthread
> and posix_spawn it blocks all signals including SIGCANCEL and SIGXID.
> However this is still small race window if this is called directly 
> with pthread cancellation or g*uid in multithread.

I'm not sure what you mean above. Do you mean not doing this in glibc and even if
kernel support didn't exist should be safe internally ?

fwiw as mentioned above kernel sets up TP for clone (SETTLS). I detested doing
that for a long time, give ABI implications but ended up doing it anyways due to
an actual race hit when running uClibc tst-kill6 [1]

[1] http://lists.infradead.org/pipermail/linux-snps-arc/2018-October/004480.html

More information about the Libc-alpha mailing list