[PATCH 11/11] powerpc64le: Add glibc-hwcaps support
Florian Weimer
fweimer@redhat.com
Wed Dec 2 14:31:44 GMT 2020
* Adhemerval Zanella:
> On 02/12/2020 10:51, Florian Weimer wrote:
>> * Adhemerval Zanella:
>>
>>>> +uint32_t
>>>> +_dl_hwcaps_subdirs_active (void)
>>>> +{
>>>> + int active = 0;
>>>> +
>>>> + /* Test in reverse preference order. Altivec and VSX are implied by
>>>> + the powerpc64le ABI definition. */
>>>> +
>>>> + /* POWER9. GCC enables float128 hardware support for -mcpu=power9. */
>>>> + if ((GLRO (dl_hwcap2) & PPC_FEATURE2_ARCH_3_00) == 0
>>>> + || (GLRO (dl_hwcap2) & PPC_FEATURE2_HAS_IEEE128) == 0)
>>>> + return _dl_hwcaps_subdirs_build_bitmask (subdirs_count, active);
>>>> + ++active;
>>>
>>> Should we test PPC_FEATURE2_DARN as well? I think cryptographic and related
>>> libraries might use it as source of entropy.
>>
>> It does not show up in the compiler preprocessor macros. There also
>> have been cases where randomness-generating instructions have been
>> disabled in firmware (but probably not on POWER). I think it's safer
>> not to include cryptographic stuff.
>
> GCC does provides it through a compiler builtin, only enabled for
> power9 and newer. And I think hardware entropy instruction are not
> used on cryptographic, but also on different fields as simulations.
Maybe Tulio can comment. I do not have a strong opinion (although the
x86 precedent is kind of unsettling).
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