public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
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 8/9] elf: Remove LD_HWCAP_MASK / tunable glibc.cpu.hwcap_mask
Date: Tue, 11 Jun 2024 17:04:00 -0300	[thread overview]
Message-ID: <4cfe3f53-a253-4527-aa66-40a6a6f78373@linaro.org> (raw)
In-Reply-To: <20240607114543.659306-9-stli@linux.ibm.com>



On 07/06/24 08:42, Stefan Liebler wrote:
> Remove the environment variable LD_HWCAP_MASK and the tunable
> glibc.cpu.hwcap_mask as those are not used anymore in common-code
> after removal in elf/dl-cache.c:search_cache().
> 
> The only remaining user is sparc32 where it is used in
> elf_machine_matches_host().  If sparc32 does not need it anymore,
> we can get rid of it at all.  Otherwise we could also move
> LD_HWCAP_MASK / tunable glibc.cpu.hwcap_mask to be sparc32 specific.

I don't think sparc32 would miss this. 

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  elf/dl-tunables.list               |  7 -------
>  elf/tst-env-setuid.c               |  1 -
>  manual/README.tunables             | 12 ++++++------
>  manual/tunables.texi               | 11 -----------
>  sysdeps/generic/unsecvars.h        |  1 -
>  sysdeps/sparc/sparc32/dl-machine.h |  6 ------
>  6 files changed, 6 insertions(+), 32 deletions(-)
> 
> diff --git a/elf/dl-tunables.list b/elf/dl-tunables.list
> index 1186272c81..40ac5b3776 100644
> --- a/elf/dl-tunables.list
> +++ b/elf/dl-tunables.list
> @@ -83,13 +83,6 @@ glibc {
>        minval: 0
>      }
>    }
> -  cpu {
> -    hwcap_mask {
> -      type: UINT_64
> -      env_alias: LD_HWCAP_MASK
> -      default: HWCAP_IMPORTANT
> -    }
> -  }
>  
>    elision {
>      enable {
> diff --git a/elf/tst-env-setuid.c b/elf/tst-env-setuid.c
> index 43047c48f3..59f2ffeb88 100644
> --- a/elf/tst-env-setuid.c
> +++ b/elf/tst-env-setuid.c
> @@ -52,7 +52,6 @@ static const struct envvar_t filtered_envvars[] =
>  {
>    { "GLIBC_TUNABLES",          FILTERED_VALUE },
>    { "LD_AUDIT",                FILTERED_VALUE },
> -  { "LD_HWCAP_MASK",           FILTERED_VALUE },
>    { "LD_LIBRARY_PATH",         FILTERED_VALUE },
>    { "LD_PRELOAD",              FILTERED_VALUE },
>    { "LD_PROFILE",              PROFILE_LIB },
> diff --git a/manual/README.tunables b/manual/README.tunables
> index 72ae00dc02..594879397b 100644
> --- a/manual/README.tunables
> +++ b/manual/README.tunables
> @@ -96,11 +96,11 @@ where 'check' is the tunable name and 'val' is a value of same type.
>  To get and set tunables in a different namespace from that module, use the full
>  form of the macros as follows:
>  
> -  val = TUNABLE_GET_FULL (glibc, cpu, hwcap_mask, uint64_t, NULL)
> +  val = TUNABLE_GET_FULL (glibc, malloc, mmap_max, int32_t, NULL)
>  
> -  TUNABLE_SET_FULL (glibc, cpu, hwcap_mask, val)
> +  TUNABLE_SET_FULL (glibc, malloc, mmap_max, val)
>  
> -where 'glibc' is the top namespace, 'cpu' is the tunable namespace and the
> +where 'glibc' is the top namespace, 'malloc' is the tunable namespace and the
>  remaining arguments are the same as the short form macros.
>  
>  The minimum and maximum values can updated together with the tunable value
> @@ -114,11 +114,11 @@ where 'check' is the tunable name, 'val' is a value of same type, 'min' and
>  To set the minimum and maximum values of tunables in a different namespace
>  from that module, use the full form of the macros as follows:
>  
> -  val = TUNABLE_GET_FULL (glibc, cpu, hwcap_mask, uint64_t, NULL)
> +  val = TUNABLE_GET_FULL (glibc, malloc, mmap_max, int32_t, NULL)
>  
> -  TUNABLE_SET_WITH_BOUNDS_FULL (glibc, cpu, hwcap_mask, val, min, max)
> +  TUNABLE_SET_WITH_BOUNDS_FULL (glibc, malloc, mmap_max, val, min, max)
>  
> -where 'glibc' is the top namespace, 'cpu' is the tunable namespace and the
> +where 'glibc' is the top namespace, 'malloc' is the tunable namespace and the
>  remaining arguments are the same as the short form macros.
>  
>  When TUNABLE_NAMESPACE is not defined in a module, TUNABLE_GET is equivalent to
> diff --git a/manual/tunables.texi b/manual/tunables.texi
> index 8dd02d8149..0b1b2898c0 100644
> --- a/manual/tunables.texi
> +++ b/manual/tunables.texi
> @@ -55,7 +55,6 @@ glibc.cpu.x86_non_temporal_threshold: 0xc0000 (min: 0x4040, max: 0xfffffffffffff
>  glibc.cpu.x86_memset_non_temporal_threshold: 0xc0000 (min: 0x4040, max: 0xfffffffffffffff)
>  glibc.cpu.x86_shstk:
>  glibc.pthread.stack_cache_size: 0x2800000 (min: 0x0, max: 0xffffffffffffffff)
> -glibc.cpu.hwcap_mask: 0x6 (min: 0x0, max: 0xffffffffffffffff)
>  glibc.malloc.mmap_max: 0 (min: 0, max: 2147483647)
>  glibc.elision.skip_trylock_internal_abort: 3 (min: 0, max: 2147483647)
>  glibc.cpu.plt_rewrite: 0 (min: 0, max: 2)
> @@ -504,16 +503,6 @@ Behavior of @theglibc{} can be tuned to assume specific hardware capabilities
>  by setting the following tunables in the @code{cpu} namespace:
>  @end deftp
>  
> -@deftp Tunable glibc.cpu.hwcap_mask
> -This tunable supersedes the @env{LD_HWCAP_MASK} environment variable and is
> -identical in features.
> -
> -The @code{AT_HWCAP} key in the Auxiliary Vector specifies instruction set
> -extensions available in the processor at runtime for some architectures.  The
> -@code{glibc.cpu.hwcap_mask} tunable allows the user to mask out those
> -capabilities at runtime, thus disabling use of those extensions.
> -@end deftp
> -
>  @deftp Tunable glibc.cpu.hwcaps
>  The @code{glibc.cpu.hwcaps=-xxx,yyy,-zzz...} tunable allows the user to
>  enable CPU/ARCH feature @code{yyy}, disable CPU/ARCH feature @code{xxx}
> diff --git a/sysdeps/generic/unsecvars.h b/sysdeps/generic/unsecvars.h
> index f1724efe0f..97857a11aa 100644
> --- a/sysdeps/generic/unsecvars.h
> +++ b/sysdeps/generic/unsecvars.h
> @@ -12,7 +12,6 @@
>    "LD_DEBUG\0"								      \
>    "LD_DEBUG_OUTPUT\0"							      \
>    "LD_DYNAMIC_WEAK\0"							      \
> -  "LD_HWCAP_MASK\0"							      \
>    "LD_LIBRARY_PATH\0"							      \
>    "LD_ORIGIN_PATH\0"							      \
>    "LD_PRELOAD\0"							      \
> diff --git a/sysdeps/sparc/sparc32/dl-machine.h b/sysdeps/sparc/sparc32/dl-machine.h
> index d855c66fe3..2c56d8a80e 100644
> --- a/sysdeps/sparc/sparc32/dl-machine.h
> +++ b/sysdeps/sparc/sparc32/dl-machine.h
> @@ -39,13 +39,7 @@ elf_machine_matches_host (const Elf32_Ehdr *ehdr)
>      return 1;
>    else if (ehdr->e_machine == EM_SPARC32PLUS)
>      {
> -#if defined SHARED
> -      uint64_t hwcap_mask = TUNABLE_GET (glibc, cpu, hwcap_mask, uint64_t,
> -					 NULL);
> -      return GLRO(dl_hwcap) & hwcap_mask & HWCAP_SPARC_V9;
> -#else
>        return GLRO(dl_hwcap) & HWCAP_SPARC_V9;
> -#endif
>      }
>    else
>      return 0;

  reply	other threads:[~2024-06-11 20:04 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
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 [this message]
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=4cfe3f53-a253-4527-aa66-40a6a6f78373@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).