From: Robert Kuban Date: Tue, 16 Aug 2022 18:53:21 +0000 (+0200) Subject: uk_init_tls: Return tcb pointer in __uk_copy_tls X-Git-Tag: RELEASE-0.11.0~15 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a989d560c2a24da1a0676b5a6f82e63fe941f63e;p=unikraft%2Flibs%2Fmusl.git uk_init_tls: Return tcb pointer in __uk_copy_tls Translate the tlsp to the tcb pointer before using as TCB. On x86_64 both pointer are identical, but in aarch64 the tlsp points into the last 16 bytes of the TCB. Signed-off-by: Robert Kuban Reviewed-by: Eduard Vintilă Reviewed-by: Razvan Virtan Reviewed-by: Razvan Deaconescu Approved-by: Razvan Deaconescu Tested-by: Unikraft CI GitHub-Closes: #6 --- diff --git a/__uk_init_tls.c b/__uk_init_tls.c index 10c1140..6bae322 100644 --- a/__uk_init_tls.c +++ b/__uk_init_tls.c @@ -94,7 +94,7 @@ void *__uk_copy_tls(unsigned char *mem) tls_area = mem; ukarch_tls_area_init(tls_area); - td = (pthread_t) ukarch_tls_tlsp(tls_area); + td = (pthread_t) ukarch_tls_tcb_get(ukarch_tls_tlsp(tls_area)); td->dtv = td->dtv_copy = tls_area; return td;