[PATCH 3/4] powerpc: Runtime selection between sc and scv for syscalls
Florian Weimer
fweimer@redhat.com
Tue Dec 1 13:11:16 GMT 2020
* Matheus Castanho via Libc-alpha:
> Hi Florian,
>
> On 11/19/20 5:35 PM, Florian Weimer wrote:
>> * Matheus Castanho:
>>
>>> That should work for shared libc, but in the static case we may also
>>> hit the same problem: trying to access the TLS to read hwcap2 before
>>> it has been initialized, but this time in csu/libc-tls.c
>>
>> Ahh.
>>
>>> Is there a way to also check if we are in the static startup code at
>>> compile time? If not, I'm afraid I'll have to keep the check for the
>>> thread pointer.
>>
>> Is the thread pointer in a regular register? Then you could install a
>> fake TCB early on that has a zero bit in the right place.
>>
>> The other option would be to always use the old interface for !SHARED.
>> Just saying. 8-)
>>
>
> I believe adding the fake TCB is a bit out of the scope of this patch, and I'd
> also prefer to keep the same behavior for both static and shared libcs, so we
> avoid surprises in the future.
>
> Do you see this as a blocker for merging this patch?
I think the run-time check in the shared builds is unnecessary. I don't
have an opinion on the static case, but I think ld.so should use the
legacy interface unconditionally, and shared libc.so should use a
dynamic check while assuming that the TCB is initialized. If we can
avoid making things harder for the branch predict, we should do so.
In the end, it's your port though, and I don't have a strong opinion
here.
Thanks,
Florian
--
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill
More information about the Libc-alpha
mailing list