From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH 11/11] powerpc64le: Add glibc-hwcaps support
Date: Wed, 2 Dec 2020 11:27:45 -0300 [thread overview]
Message-ID: <887f5bfe-a8b6-3c52-cc11-5610b237ed87@linaro.org> (raw)
In-Reply-To: <87h7p471ug.fsf@oldenburg2.str.redhat.com>
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.
>
>>> +
>>> + /* POWER10. GCC defines __MMA__ for -mcpu=power10. */
>>
>> Double space after period.
>
> Thanks, fixed.
>
>>> +/* Return the POWER level, 8 for the baseline. */
>>> +static int
>>> +compute_level (void)
>>> +{
>>> + const char *platform = (const char *) getauxval (AT_PLATFORM);
>>> + if (strcmp (platform, "power8") == 0)
>>> + return 8;
>>> + if (strcmp (platform, "power9") == 0)
>>> + return 9;
>>> + if (strcmp (platform, "power10") == 0)
>>> + return 10;
>>
>> Why not use HWCAP? Is it to decouple from the loader code that uses it?
>> I am asking because by using hwcap we can check if this tests is working
>> on different chips by using qemu-ppc64le with -mcpu.
>
> And that doesn't affect AT_PLATFORM? That would be a QEMU bug.
At least not with v5.2.0-rc0-99-g3493c36f03, not sure if is has been
fixed/change upstream.
next prev parent reply other threads:[~2020-12-02 14:27 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-09 18:40 [PATCH v4 00/11] " Florian Weimer
2020-11-09 18:40 ` [PATCH 01/11] support: Add support_copy_file Florian Weimer
2020-11-26 16:43 ` Adhemerval Zanella
2020-11-26 17:22 ` Florian Weimer
2020-11-09 18:40 ` [PATCH 02/11] elf: Introduce enum opt_format in the ldconfig implementation Florian Weimer
2020-11-26 16:44 ` Adhemerval Zanella
2020-11-26 18:54 ` [PATCH 12/11] s390x: Add Add glibc-hwcaps support Florian Weimer
2020-12-07 8:16 ` Florian Weimer
2020-12-08 15:47 ` Stefan Liebler
2020-12-09 18:52 ` Florian Weimer
2020-12-10 10:22 ` Stefan Liebler
2020-12-10 14:54 ` Florian Weimer
2020-11-09 18:40 ` [PATCH 03/11] elf: Add glibc-hwcaps support for LD_LIBRARY_PATH Florian Weimer
2020-11-26 20:29 ` Adhemerval Zanella
2020-11-27 19:49 ` Florian Weimer
2020-11-30 18:59 ` Adhemerval Zanella
2020-12-04 12:25 ` Matheus Castanho
2020-12-04 12:43 ` Florian Weimer
2020-12-04 12:59 ` Matheus Castanho
2020-11-09 18:40 ` [PATCH 04/11] elf: Add endianness markup to ld.so.cache Florian Weimer
2020-11-27 13:56 ` Adhemerval Zanella
2020-11-27 19:49 ` Florian Weimer
2020-11-30 19:00 ` Adhemerval Zanella
2020-11-09 18:40 ` [PATCH 05/11] elf: Add extension mechanism " Florian Weimer
2020-11-27 18:01 ` Adhemerval Zanella
2020-11-27 18:55 ` Florian Weimer
2020-11-27 18:56 ` Adhemerval Zanella
2020-11-09 18:40 ` [PATCH 06/11] elf: Implement a string table for ldconfig, with tail merging Florian Weimer
2020-11-27 19:29 ` Adhemerval Zanella
2020-11-27 19:49 ` Florian Weimer
2020-11-30 19:01 ` Adhemerval Zanella
2020-11-09 18:41 ` [PATCH 07/11] elf: Implement tail merging of strings in ldconfig Florian Weimer
2020-11-30 18:41 ` Adhemerval Zanella
2020-12-01 10:28 ` Florian Weimer
2020-11-09 18:41 ` [PATCH 08/11] elf: Process glibc-hwcaps subdirectories " Florian Weimer
2020-11-30 19:46 ` Adhemerval Zanella
2020-11-09 18:41 ` [PATCH 09/11] elf: Add glibc-hwcaps subdirectory support to ld.so cache processing Florian Weimer
2020-11-26 17:11 ` Florian Weimer
2020-12-01 17:45 ` Adhemerval Zanella
2020-12-01 20:45 ` Florian Weimer
2020-12-02 12:08 ` Adhemerval Zanella
2020-12-02 12:16 ` Florian Weimer
2020-11-09 18:41 ` [PATCH 10/11] x86_64: Add glibc-hwcaps support Florian Weimer
2020-12-02 12:49 ` Adhemerval Zanella
2020-11-09 18:41 ` [PATCH 11/11] powerpc64le: " Florian Weimer
2020-12-02 13:46 ` Adhemerval Zanella
2020-12-02 13:51 ` Florian Weimer
2020-12-02 14:27 ` Adhemerval Zanella [this message]
2020-12-02 14:31 ` Florian Weimer
2020-12-02 15:34 ` Carlos Seo
2020-12-02 20:14 ` Tulio Magno Quites Machado Filho
2020-12-04 8:56 ` Florian Weimer
2020-12-04 12:35 ` Adhemerval Zanella
2020-11-09 21:56 ` [PATCH v4 00/11] " Dan Horák
2020-11-10 10:41 ` Florian Weimer
2020-11-25 15:46 ` Florian Weimer
2020-11-25 15:58 ` H.J. Lu
2020-11-25 17:20 ` Adhemerval Zanella
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=887f5bfe-a8b6-3c52-cc11-5610b237ed87@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).