From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: Stefan Liebler <stli@linux.ibm.com>, libc-alpha@sourceware.org
Cc: fweimer@redhat.com, devel@otheo.eu, bergner@linux.ibm.com
Subject: Re: [RFC 2/9] elf: Remove loading legacy hwcaps/platform entries in dynamic loader
Date: Tue, 11 Jun 2024 15:57:56 -0300 [thread overview]
Message-ID: <99b22594-d7d6-4605-ae41-1adacfc4f3e7@linaro.org> (raw)
In-Reply-To: <20240607114543.659306-3-stli@linux.ibm.com>
On 07/06/24 08:42, Stefan Liebler wrote:
> The legacy hwcaps mechanism was removed with glibc 2.37:
> See this commit series:
> - d178c67535f0d159df73843e7c18cbdb39b4d25d
> x86_64: Remove platform directory library loading test
> - 6099908fb84debee4c3bcb05d88769410c2aecd1
> elf: Remove legacy hwcaps support from the dynamic loader
> - b78ff5a25dc8ba9d8c6df10bb0a533254bdd193f
> elf: Remove legacy hwcaps support from ldconfig
> - 4a7094119ce05cadf927f52cc5d723e2195e65f9
> elf: Remove hwcap parameter from add_to_cache signature
> - cfbf883db36727a84ef7929af49ef68c195b5972
> elf: Remove hwcap and bits_hwcap fields from struct cache_entry
> - 78d9a1620b840deb0880686e4159eaf70708866a
> Add NEWS entry for legacy hwcaps removal
> - ab40f20364f4a417a63dd51fdd943742070bfe96
> elf: Remove _dl_string_hwcap
> - e76369ed6371734f77f468eab097ef4e5b5db1c5
> elf: Simplify output of hwcap subdirectories in ld.so help
>
> According to Florian Weimer, this was an oversight and should also
> have been removed.
>
> As ldconfig does not generate ld.so.cache entries with hwcap/platform
> bits in the hwcap-field anymore, this patch now skips those entries.
> Thus currently only named-hwcap-entries and the default entries are
> allowed.
> For named-hwcap entries bit 62 is set and also the isa-level bits can
> be set.
> For the default entries the hwcap-field is 0.
LGTM, thanks.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
> ---
> elf/dl-cache.c | 22 +++-------------------
> 1 file changed, 3 insertions(+), 19 deletions(-)
>
> diff --git a/elf/dl-cache.c b/elf/dl-cache.c
> index 85f3f179ed..7c7dc58745 100644
> --- a/elf/dl-cache.c
> +++ b/elf/dl-cache.c
> @@ -27,10 +27,6 @@
> #include <dl-hwcaps.h>
> #include <dl-isa-level.h>
>
> -#ifndef _DL_PLATFORMS_COUNT
> -# define _DL_PLATFORMS_COUNT 0
> -#endif
> -
> /* This is the starting address and the size of the mmap()ed file. */
> static struct cache_file *cache;
> static struct cache_file_new *cache_new;
> @@ -201,15 +197,6 @@ search_cache (const char *string_table, uint32_t string_table_size,
> struct file_entry *libs, uint32_t nlibs, uint32_t entry_size,
> const char *name)
> {
> - /* Used by the HWCAP check in the struct file_entry_new case. */
> - uint64_t platform = _dl_string_platform (GLRO (dl_platform));
> - if (platform != (uint64_t) -1)
> - platform = 1ULL << platform;
> - uint64_t hwcap_mask = TUNABLE_GET (glibc, cpu, hwcap_mask, uint64_t, NULL);
> -#define _DL_HWCAP_TLS_MASK (1LL << 63)
> - uint64_t hwcap_exclude = ~((GLRO (dl_hwcap) & hwcap_mask)
> - | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK);
> -
> int left = 0;
> int right = nlibs - 1;
> const char *best = NULL;
> @@ -295,12 +282,9 @@ search_cache (const char *string_table, uint32_t string_table_size,
> if (!named_hwcap && best != NULL)
> break;
>
> - if ((libnew->hwcap & hwcap_exclude) && !named_hwcap)
> - continue;
> - if (_DL_PLATFORMS_COUNT
> - && (libnew->hwcap & _DL_HWCAP_PLATFORM) != 0
> - && ((libnew->hwcap & _DL_HWCAP_PLATFORM)
> - != platform))
> + /* Skip entries with the legacy hwcap/platform mechanism
> + which was removed with glibc 2.37. */
> + if (!named_hwcap && libnew->hwcap != 0)
> continue;
>
> #ifdef SHARED
next prev parent reply other threads:[~2024-06-11 18:58 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-07 11:42 [RFC 0/9] Remove legacy platform bits and cleanups Stefan Liebler
2024-06-07 11:42 ` [RFC 1/9] x86: Remove HWCAP_START and HWCAP_COUNT Stefan Liebler
2024-06-11 18:14 ` Adhemerval Zanella Netto
2024-06-07 11:42 ` [RFC 2/9] elf: Remove loading legacy hwcaps/platform entries in dynamic loader Stefan Liebler
2024-06-11 18:57 ` Adhemerval Zanella Netto [this message]
2024-06-07 11:42 ` [RFC 3/9] elf: Remove _dl_string_platform Stefan Liebler
2024-06-11 19:09 ` Adhemerval Zanella Netto
2024-06-07 11:42 ` [RFC 4/9] elf: Remove platform strings in dl-procinfo.c Stefan Liebler
2024-06-11 19:20 ` Adhemerval Zanella Netto
2024-06-12 7:32 ` [V2] " Stefan Liebler
2024-06-14 12:58 ` Adhemerval Zanella Netto
2024-06-07 11:42 ` [RFC 5/9] elf: Remove _DL_HWCAP_PLATFORM Stefan Liebler
2024-06-11 19:28 ` Adhemerval Zanella Netto
2024-06-07 11:42 ` [RFC 6/9] elf: Remove _DL_FIRST_PLATFORM Stefan Liebler
2024-06-11 19:29 ` Adhemerval Zanella Netto
2024-06-07 11:42 ` [RFC 7/9] elf: Remove _DL_PLATFORMS_COUNT Stefan Liebler
2024-06-11 19:48 ` Adhemerval Zanella Netto
2024-06-07 11:42 ` [RFC 8/9] elf: Remove LD_HWCAP_MASK / tunable glibc.cpu.hwcap_mask Stefan Liebler
2024-06-11 20:04 ` Adhemerval Zanella Netto
2024-06-07 11:42 ` [RFC 9/9] elf: Remove HWCAP_IMPORTANT Stefan Liebler
2024-06-11 20:07 ` Adhemerval Zanella Netto
2024-06-07 12:18 ` [RFC 0/9] Remove legacy platform bits and cleanups Florian Weimer
2024-06-10 13:23 ` Stefan Liebler
2024-06-10 14:03 ` Florian Weimer
2024-06-11 12:24 ` Stefan Liebler
2024-06-08 11:09 ` Florian Weimer
2024-06-10 13:36 ` Stefan Liebler
2024-06-11 12:13 ` Stefan Liebler
2024-06-12 7:50 ` Stefan Liebler
2024-06-18 8:55 ` Stefan Liebler
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=99b22594-d7d6-4605-ae41-1adacfc4f3e7@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=bergner@linux.ibm.com \
--cc=devel@otheo.eu \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
--cc=stli@linux.ibm.com \
/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).