]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Remove --enable-tunables configure option
authorAdhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Thu, 23 Mar 2023 13:13:51 +0000 (10:13 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 29 Mar 2023 17:33:06 +0000 (14:33 -0300)
And make always supported.  The configure option was added on glibc 2.25
and some features require it (such as hwcap mask, huge pages support, and
lock elisition tuning).  It also simplifies the build permutations.

Changes from v1:
 * Remove glibc.rtld.dynamic_sort changes, it is orthogonal and needs
   more discussion.
 * Cleanup more code.
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
48 files changed:
INSTALL
Makeconfig
NEWS
config.h.in
config.make.in
configure
configure.ac
elf/Makefile
elf/dl-cache.c
elf/dl-hwcaps.h
elf/dl-sort-maps.c
elf/dl-support.c
elf/dl-tls.c
elf/dl-tunables.c
elf/dl-tunables.h
elf/dl-usage.c
elf/rtld.c
elf/tst-env-setuid-tunables.c
gmon/gmon.c
malloc/Makefile
malloc/arena.c
malloc/malloc-check.c
malloc/malloc.c
manual/install.texi
nptl/pthread_mutex_conf.c
nptl/tst-mutex8.c
scripts/build-many-glibcs.py
sysdeps/generic/ldsodefs.h
sysdeps/generic/unsecvars.h
sysdeps/nptl/dl-tls_init_tp.c
sysdeps/nptl/pthreadP.h
sysdeps/nptl/pthread_early_init.h
sysdeps/nptl/pthread_mutex_conf.h
sysdeps/powerpc/cpu-features.c
sysdeps/s390/cpu-features.c
sysdeps/sparc/sparc32/dl-machine.h
sysdeps/unix/sysv/linux/Makefile
sysdeps/unix/sysv/linux/aarch64/cpu-features.c
sysdeps/unix/sysv/linux/powerpc/elision-conf.c
sysdeps/unix/sysv/linux/s390/elision-conf.c
sysdeps/unix/sysv/linux/x86/elision-conf.c
sysdeps/unix/sysv/linux/x86_64/64/Makefile
sysdeps/x86/Makefile
sysdeps/x86/cacheinfo.h
sysdeps/x86/cpu-features.c
sysdeps/x86/cpu-tunables.c
sysdeps/x86/dl-cacheinfo.h
sysdeps/x86_64/Makefile

diff --git a/INSTALL b/INSTALL
index 32535709d959068e7581d877e8d9e03695c710f8..b406a11268a7078995349cb80e7484971f2b693c 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -228,25 +228,6 @@ if 'CFLAGS' is specified it must enable optimization.  For example:
      By default for x86_64, the GNU C Library is built with the vector
      math library.  Use this option to disable the vector math library.
 
-'--enable-tunables'
-     Tunables support allows additional library parameters to be
-     customized at runtime.  This feature is enabled by default.  This
-     option can take the following values:
-
-     'yes'
-          This is the default if no option is passed to configure.  This
-          enables tunables and selects the default frontend (currently
-          'valstring').
-
-     'no'
-          This option disables tunables.
-
-     'valstring'
-          This enables tunables and selects the 'valstring' frontend for
-          tunables.  This frontend allows users to specify tunables as a
-          colon-separated list in a single environment variable
-          'GLIBC_TUNABLES'.
-
 '--disable-crypt'
      Do not install the passphrase-hashing library 'libcrypt' or the
      header file 'crypt.h'.  'unistd.h' will still declare the function
index 2fda4af5f78463d5225aecd832ea1efc69e6dc76..2514db35f6b83f6577d77a1a3068a75834f7d8bd 100644 (file)
@@ -1017,11 +1017,8 @@ CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \
           $(CPPFLAGS-$(suffix $@)) \
           $(foreach lib,$(libof-$(basename $(@F))) \
                         $(libof-$(<F)) $(libof-$(@F)),$(CPPFLAGS-$(lib))) \
-          $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
-
-ifneq (no,$(have-tunables))
-CPPFLAGS += -DTOP_NAMESPACE=glibc
-endif
+          $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F))) \
+          -DTOP_NAMESPACE=glibc
 
 override CFLAGS        = -std=gnu11 -fgnu89-inline $(config-extra-cflags) \
                  $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
@@ -1203,7 +1200,6 @@ endif
 
 # Build the tunables list header early since it could be used by any module in
 # glibc.
-ifneq (no,$(have-tunables))
 before-compile += $(common-objpfx)dl-tunable-list.h
 common-generated += dl-tunable-list.h dl-tunable-list.stmp
 
@@ -1216,7 +1212,6 @@ $(common-objpfx)dl-tunable-list.stmp: \
        $(AWK) -f $^ > ${@:stmp=T}
        $(move-if-change) ${@:stmp=T} ${@:stmp=h}
        touch $@
-endif
 
 # Dump the GCC macros used by the default compiler flags to a header
 # file, so that they can be inspected when using different compiler
diff --git a/NEWS b/NEWS
index d5816923c6b2966401371683429a890a578d0ab2..83d082afad753628e0949ae61767cffe3e7a2260 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -34,6 +34,9 @@ Deprecated and removed features, and other changes affecting compatibility:
   cache can still be disable per-application using tunables
   (glibc.malloc.tcache_count set to zero).
 
+* The configure option --enable-tunables has been removed.  The tunable
+  feature is now always enabled.
+
 Changes to build and runtime requirements:
 
   [Add changes to build and runtime requirements here]
index 09730d9d523d1f07bc826873841b2441ebfa5bcd..c87008b6a9d9f8b48084d3b4c297b58872f3b7b4 100644 (file)
 /* PowerPC32 uses fctidz for floating point to long long conversions.  */
 #define HAVE_PPC_FCTIDZ 0
 
-/* Build glibc with tunables support.  */
-#define HAVE_TUNABLES 0
-
 /* Define if PIE is unsupported.  */
 #undef PIE_UNSUPPORTED
 
index dce93ecf7343701fb92d1a6e093724c9f75a87d2..4afd37feaf80b8fbb92f8fc833df480cf07cb5f1 100644 (file)
@@ -93,7 +93,6 @@ build-nscd = @build_nscd@
 use-nscd = @use_nscd@
 build-hardcoded-path-in-tests= @hardcoded_path_in_tests@
 build-pt-chown = @build_pt_chown@
-have-tunables = @have_tunables@
 pthread-in-libc = @pthread_in_libc@
 
 # Build tools.
index 904fc689e792bd4237d2251d5e1db2639dfd2e09..f84040644bcd565d0d0330756905af5794ff3c20 100755 (executable)
--- a/configure
+++ b/configure
@@ -664,7 +664,6 @@ INSTALL_DATA
 INSTALL_SCRIPT
 INSTALL_PROGRAM
 base_machine
-have_tunables
 build_pt_chown
 build_nscd
 libc_cv_static_nss_crypt
@@ -780,7 +779,6 @@ enable_systemtap
 enable_build_nscd
 enable_nscd
 enable_pt_chown
-enable_tunables
 enable_mathvec
 enable_cet
 enable_scv
@@ -1448,8 +1446,6 @@ Optional Features:
   --disable-build-nscd    disable building and installing the nscd daemon
   --disable-nscd          library functions will not contact the nscd daemon
   --enable-pt_chown       Enable building and installing pt_chown
-  --enable-tunables       Enable tunables support. Known values are 'yes',
-                          'no' and 'valstring'
   --enable-mathvec        Enable building and installing mathvec [default
                           depends on architecture]
   --enable-cet            enable Intel Control-flow Enforcement Technology
@@ -3658,19 +3654,6 @@ if test "$build_pt_chown" = yes; then
 
 fi
 
-# Check whether --enable-tunables was given.
-if test "${enable_tunables+set}" = set; then :
-  enableval=$enable_tunables; have_tunables=$enableval
-else
-  have_tunables=yes
-fi
-
-
-if test "$have_tunables" = yes; then
-  $as_echo "#define HAVE_TUNABLES 1" >>confdefs.h
-
-fi
-
 # The abi-tags file uses a fairly simplistic model for name recognition that
 # can't distinguish i486-pc-linux-gnu fully from i486-pc-gnu.  So we mutate a
 # $host_os of `gnu*' here to be `gnu-gnu*' just so that it can tell.
index 48ca0d370741b95abdc862009662d8bc03d59341..88df3e5eed50b6ca70e8d1a60e5ce642257ac7a0 100644 (file)
@@ -427,16 +427,6 @@ if test "$build_pt_chown" = yes; then
   AC_DEFINE(HAVE_PT_CHOWN)
 fi
 
-AC_ARG_ENABLE([tunables],
-             [AS_HELP_STRING([--enable-tunables],
-              [Enable tunables support. Known values are 'yes', 'no' and 'valstring'])],
-             [have_tunables=$enableval],
-             [have_tunables=yes])
-AC_SUBST(have_tunables)
-if test "$have_tunables" = yes; then
-  AC_DEFINE(HAVE_TUNABLES)
-fi
-
 # The abi-tags file uses a fairly simplistic model for name recognition that
 # can't distinguish i486-pc-linux-gnu fully from i486-pc-gnu.  So we mutate a
 # $host_os of `gnu*' here to be `gnu-gnu*' just so that it can tell.
index 8cf46ba782e52f98cbb58baaed04369a9c79f487..396ec51424dfae55f8ee9d9c21b39edfb1e55763 100644 (file)
@@ -82,6 +82,7 @@ dl-routines = \
   dl-tls \
   dl-tls_init_tp \
   dl-trampoline \
+  dl-tunables \
   dl-version \
   dl-write \
   # dl-routines
@@ -90,11 +91,6 @@ ifeq (yes,$(use-ldconfig))
 dl-routines += dl-cache
 endif
 
-ifneq (no,$(have-tunables))
-dl-routines += dl-tunables
-tunables-type = $(addprefix TUNABLES_FRONTEND_,$(have-tunables))
-CPPFLAGS-dl-tunables.c += -DTUNABLES_FRONTEND=$(tunables-type)
-
 ifeq (yesyes,$(build-shared)$(run-built-tests))
 tests-special += $(objpfx)list-tunables.out
 endif
@@ -104,7 +100,6 @@ endif
 ifeq (yes,$(have-loop-to-function))
 CFLAGS-dl-tunables.c += -fno-tree-loop-distribute-patterns
 endif
-endif
 
 all-dl-routines = $(dl-routines) $(sysdep-dl-routines)
 # But they are absent from the shared libc, because that code is in ld.so.
@@ -1173,7 +1168,6 @@ postclean-generated += $(objpfx)/dso-sort-tests-2.generated-makefile \
                       $(objpfx)/dso-sort-tests-2.generated-makefile
 
 # Generate from each testcase description file
-ifeq (yes,$(have-tunables))
 $(eval $(call include_dsosort_tests,dso-sort-tests-1.def))
 $(eval $(call include_dsosort_tests,dso-sort-tests-2.def))
 
@@ -1181,7 +1175,6 @@ $(eval $(call include_dsosort_tests,dso-sort-tests-2.def))
 LDFLAGS-tst-bz15311-b.so += -Wl,-z,lazy
 LDFLAGS-tst-bz15311-c.so += -Wl,-z,lazy
 LDFLAGS-tst-bz15311-d.so += -Wl,-z,lazy
-endif
 
 check-abi: $(objpfx)check-abi-ld.out \
           $(objpfx)check-abi-version-libc.out
index 07c054b11a3c0416fa8cbac325948ba8e669f657..631286832d6c88ae2355cdd9b50bd4e4fd9a542e 100644 (file)
@@ -205,7 +205,7 @@ search_cache (const char *string_table, uint32_t string_table_size,
   uint64_t platform = _dl_string_platform (GLRO (dl_platform));
   if (platform != (uint64_t) -1)
     platform = 1ULL << platform;
-  uint64_t hwcap_mask = GET_HWCAP_MASK ();
+  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);
index abe6aaf7c5665b7497b3c89763ebe81909f2120d..3012ebf2b47d2f46a05c1529818312c0fdef31c6 100644 (file)
 
 #include <elf/dl-tunables.h>
 
-#if HAVE_TUNABLES
-# define GET_HWCAP_MASK() TUNABLE_GET (glibc, cpu, hwcap_mask, uint64_t, NULL)
-#else
-# ifdef SHARED
-#   define GET_HWCAP_MASK() GLRO(dl_hwcap_mask)
-# else
-/* HWCAP_MASK is ignored in static binaries when built without tunables.  */
-#  define GET_HWCAP_MASK() (0)
-# endif
-#endif
-
 #define GLIBC_HWCAPS_SUBDIRECTORY "glibc-hwcaps"
 #define GLIBC_HWCAPS_PREFIX GLIBC_HWCAPS_SUBDIRECTORY "/"
 
index 325e96388e1c179c1afebeabff95245d53292584..5616c8a6a33ebb1e982f4dca9d5a4f0c9e11c3b9 100644 (file)
@@ -121,11 +121,6 @@ _dl_sort_maps_original (struct link_map **maps, unsigned int nmaps,
     }
 }
 
-#if !HAVE_TUNABLES
-/* In this case, just default to the original algorithm.  */
-strong_alias (_dl_sort_maps_original, _dl_sort_maps);
-#else
-
 /* We use a recursive function due to its better clarity and ease of
    implementation, as well as faster execution speed. We already use
    alloca() for list allocation during the breadth-first search of
@@ -314,5 +309,3 @@ _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
   else
     _dl_sort_maps_dfs (maps, nmaps, force_first, for_fini);
 }
-
-#endif /* HAVE_TUNABLES.  */
index d2519ce1a967c9372daa8cf95f4de5f723381171..322599916f84381f8f3c5ff2631a91ac0be19015 100644 (file)
@@ -168,16 +168,6 @@ enum dso_sort_algorithm _dl_dso_sort_algo;
 /* The value of the FPU control word the kernel will preset in hardware.  */
 fpu_control_t _dl_fpu_control = _FPU_DEFAULT;
 
-#if !HAVE_TUNABLES
-/* This is not initialized to HWCAP_IMPORTANT, matching the definition
-   of _dl_important_hwcaps, below, where no hwcap strings are ever
-   used.  This mask is still used to mediate the lookups in the cache
-   file.  Since there is no way to set this nonzero (we don't grok the
-   LD_HWCAP_MASK environment variable here), there is no real point in
-   setting _dl_hwcap nonzero below, but we do anyway.  */
-uint64_t _dl_hwcap_mask;
-#endif
-
 /* Prevailing state of the stack.  Generally this includes PF_X, indicating it's
  * executable but this isn't true for all platforms.  */
 ElfW(Word) _dl_stack_flags = DEFAULT_STACK_PERMS;
@@ -328,11 +318,6 @@ _dl_non_dynamic_init (void)
          __unsetenv (cp);
          cp = strchr (cp, '\0') + 1;
        }
-
-#if !HAVE_TUNABLES
-      if (__access ("/etc/suid-debug", F_OK) != 0)
-       __unsetenv ("MALLOC_CHECK_");
-#endif
     }
 
 #ifdef DL_PLATFORM_INIT
index 8943a3b4ae29e8f14104dc492e26b0294b235d26..4ef7bc3f1e28625d419c6a6b8a4a75a8eae4c6df 100644 (file)
@@ -97,14 +97,8 @@ _dl_tls_static_surplus_init (size_t naudit)
 {
   size_t nns, opt_tls;
 
-#if HAVE_TUNABLES
   nns = TUNABLE_GET (nns, size_t, NULL);
   opt_tls = TUNABLE_GET (optional_static_tls, size_t, NULL);
-#else
-  /* Default values of the tunables.  */
-  nns = DEFAULT_NNS;
-  opt_tls = OPTIONAL_TLS;
-#endif
   if (nns > DL_NNS)
     nns = DL_NNS;
   if (DL_NNS - nns < naudit)
index 327b9eb52f0942cc197c1c13e0d6c5dc9700eddb..62b7332d95b61ce3428040522271f6e93e9d53ed 100644 (file)
 
 #include <not-errno.h>
 
-#if TUNABLES_FRONTEND == TUNABLES_FRONTEND_valstring
-# define GLIBC_TUNABLES "GLIBC_TUNABLES"
-#endif
-
-#if TUNABLES_FRONTEND == TUNABLES_FRONTEND_valstring
 static char *
 tunables_strdup (const char *in)
 {
@@ -62,7 +57,6 @@ tunables_strdup (const char *in)
 
   return out;
 }
-#endif
 
 static char **
 get_next_env (char **envp, char **name, size_t *namelen, char **val,
@@ -160,7 +154,6 @@ __tunable_set_val (tunable_id_t id, tunable_val_t *valp, tunable_num_t *minp,
   do_tunable_update_val (cur, valp, minp, maxp);
 }
 
-#if TUNABLES_FRONTEND == TUNABLES_FRONTEND_valstring
 /* Parse the tunable string TUNESTR and adjust it to drop any tunables that may
    be unsafe for AT_SECURE processes so that it can be used as the new
    environment variable value for GLIBC_TUNABLES.  VALSTRING is the original
@@ -255,7 +248,6 @@ parse_tunables (char *tunestr, char *valstring)
        p += len + 1;
     }
 }
-#endif
 
 /* Enable the glibc.malloc.check tunable in SETUID/SETGID programs only when
    the system administrator has created the /etc/suid-debug file.  This is a
@@ -287,8 +279,7 @@ __tunables_init (char **envp)
   while ((envp = get_next_env (envp, &envname, &len, &envval,
                               &prev_envp)) != NULL)
     {
-#if TUNABLES_FRONTEND == TUNABLES_FRONTEND_valstring
-      if (tunable_is_name (GLIBC_TUNABLES, envname))
+      if (tunable_is_name ("GLIBC_TUNABLES", envname))
        {
          char *new_env = tunables_strdup (envname);
          if (new_env != NULL)
@@ -297,7 +288,6 @@ __tunables_init (char **envp)
          *prev_envp = new_env;
          continue;
        }
-#endif
 
       for (int i = 0; i < sizeof (tunable_list) / sizeof (tunable_t); i++)
        {
index ae6e014b956f475c8f2253e5bed459560dca6c04..45c191e021de50811e79eaab6b4ef7d6e86b2254 100644 (file)
 #ifndef _TUNABLES_H_
 #define _TUNABLES_H_
 
-#if !HAVE_TUNABLES
-static inline void
-__always_inline
-__tunables_init (char **unused __attribute__ ((unused)))
-{
-  /* This is optimized out if tunables are not enabled.  */
-}
-#else
-# include <stdbool.h>
-# include <stddef.h>
-# include <stdint.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
 
 typedef intmax_t tunable_num_t;
 
@@ -44,12 +36,12 @@ typedef union
 typedef void (*tunable_callback_t) (tunable_val_t *);
 
 /* Full name for a tunable is top_ns.tunable_ns.id.  */
-# define TUNABLE_NAME_S(top,ns,id) #top "." #ns "." #id
+#define TUNABLE_NAME_S(top,ns,id) #top "." #ns "." #id
 
-# define TUNABLE_ENUM_NAME(__top,__ns,__id) TUNABLE_ENUM_NAME1 (__top,__ns,__id)
-# define TUNABLE_ENUM_NAME1(__top,__ns,__id) __top ## _ ## __ns ## _ ## __id
+#define TUNABLE_ENUM_NAME(__top,__ns,__id) TUNABLE_ENUM_NAME1 (__top,__ns,__id)
+#define TUNABLE_ENUM_NAME1(__top,__ns,__id) __top ## _ ## __ns ## _ ## __id
 
-# include "dl-tunable-list.h"
+#include "dl-tunable-list.h"
 
 extern void __tunables_init (char **);
 extern void __tunables_print (void);
@@ -83,7 +75,7 @@ rtld_hidden_proto (__tunable_set_val)
 
 /* Get and return a tunable value.  If the tunable was set externally and __CB
    is defined then call __CB before returning the value.  */
-# define TUNABLE_GET_FULL(__top, __ns, __id, __type, __cb) \
+#define TUNABLE_GET_FULL(__top, __ns, __id, __type, __cb) \
 ({                                                                           \
   tunable_id_t id = TUNABLE_ENUM_NAME (__top, __ns, __id);                   \
   __type ret;                                                                \
@@ -92,14 +84,14 @@ rtld_hidden_proto (__tunable_set_val)
 })
 
 /* Set a tunable value.  */
-# define TUNABLE_SET_FULL(__top, __ns, __id, __val) \
+#define TUNABLE_SET_FULL(__top, __ns, __id, __val) \
 ({                                                                           \
   __tunable_set_val (TUNABLE_ENUM_NAME (__top, __ns, __id),                  \
                     & (tunable_val_t) {.numval = __val}, NULL, NULL);        \
 })
 
 /* Set a tunable value together with min/max values.  */
-# define TUNABLE_SET_WITH_BOUNDS_FULL(__top, __ns, __id,__val, __min, __max)  \
+#define TUNABLE_SET_WITH_BOUNDS_FULL(__top, __ns, __id,__val, __min, __max)  \
 ({                                                                           \
   __tunable_set_val (TUNABLE_ENUM_NAME (__top, __ns, __id),                  \
                     & (tunable_val_t) {.numval = __val},                     \
@@ -109,11 +101,7 @@ rtld_hidden_proto (__tunable_set_val)
 
 /* Namespace sanity for callback functions.  Use this macro to keep the
    namespace of the modules clean.  */
-# define TUNABLE_CALLBACK(__name) _dl_tunable_ ## __name
-
-# define TUNABLES_FRONTEND_valstring 1
-/* The default value for TUNABLES_FRONTEND.  */
-# define TUNABLES_FRONTEND_yes TUNABLES_FRONTEND_valstring
+#define TUNABLE_CALLBACK(__name) _dl_tunable_ ## __name
 
 static __always_inline bool
 tunable_val_lt (tunable_num_t lhs, tunable_num_t rhs, bool unsigned_cmp)
@@ -149,4 +137,3 @@ tunable_is_name (const char *orig, const char *envname)
 }
 
 #endif
-#endif
index 53535c1583fe3109260fe896edc5df5adcd275e6..98f0b0d027c9fd0e42ed21739866d7fb183c8392 100644 (file)
@@ -195,12 +195,8 @@ setting environment variables (which would be inherited by subprocesses).\n\
                         in LIST\n\
   --audit LIST          use objects named in LIST as auditors\n\
   --preload LIST        preload objects named in LIST\n\
-  --argv0 STRING        set argv[0] to STRING before running\n"
-#if HAVE_TUNABLES
-"\
-  --list-tunables       list all tunables with minimum and maximum values\n"
-#endif
-"\
+  --argv0 STRING        set argv[0] to STRING before running\n\
+  --list-tunables       list all tunables with minimum and maximum values\n\
   --list-diagnostics    list diagnostics information\n\
   --help                display this help and exit\n\
   --version             output version information and exit\n\
index f82fbeb1323b66bd0915b1d5af2bd742b225b9b2..c1e383b0555f336b53c8b56412d4ac4146da8537 100644 (file)
@@ -357,9 +357,6 @@ struct rtld_global_ro _rtld_global_ro attribute_relro =
     ._dl_sysinfo = DL_SYSINFO_DEFAULT,
 #endif
     ._dl_debug_fd = STDERR_FILENO,
-#if !HAVE_TUNABLES
-    ._dl_hwcap_mask = HWCAP_IMPORTANT,
-#endif
     ._dl_lazy = 1,
     ._dl_fpu_control = _FPU_DEFAULT,
     ._dl_pagesize = EXEC_PAGESIZE,
@@ -1483,7 +1480,6 @@ dl_main (const ElfW(Phdr) *phdr,
            _dl_argc -= 2;
            _dl_argv += 2;
          }
-#if HAVE_TUNABLES
        else if (! strcmp (_dl_argv[1], "--list-tunables"))
          {
            state.mode = rtld_mode_list_tunables;
@@ -1491,7 +1487,6 @@ dl_main (const ElfW(Phdr) *phdr,
            --_dl_argc;
            ++_dl_argv;
          }
-#endif
        else if (! strcmp (_dl_argv[1], "--list-diagnostics"))
          {
            state.mode = rtld_mode_list_diagnostics;
@@ -1519,13 +1514,11 @@ dl_main (const ElfW(Phdr) *phdr,
        else
          break;
 
-#if HAVE_TUNABLES
       if (__glibc_unlikely (state.mode == rtld_mode_list_tunables))
        {
          __tunables_print ();
          _exit (0);
        }
-#endif
 
       if (state.mode == rtld_mode_list_diagnostics)
        _dl_print_diagnostics (_environ);
@@ -2624,15 +2617,6 @@ process_envvars (struct dl_main_state *state)
            _dl_show_auxv ();
          break;
 
-#if !HAVE_TUNABLES
-       case 10:
-         /* Mask for the important hardware capabilities.  */
-         if (!__libc_enable_secure
-             && memcmp (envline, "HWCAP_MASK", 10) == 0)
-           GLRO(dl_hwcap_mask) = _dl_strtoul (&envline[11], NULL);
-         break;
-#endif
-
        case 11:
          /* Path where the binary is found.  */
          if (!__libc_enable_secure
@@ -2695,12 +2679,7 @@ process_envvars (struct dl_main_state *state)
       while (*nextp != '\0');
 
       if (__access ("/etc/suid-debug", F_OK) != 0)
-       {
-#if !HAVE_TUNABLES
-         unsetenv ("MALLOC_CHECK_");
-#endif
-         GLRO(dl_debug_mask) = 0;
-       }
+       GLRO(dl_debug_mask) = 0;
 
       if (state->mode != rtld_mode_normal)
        _exit (5);
index 807b426012e9753a4ee3d7049b798dd668bd0ec5..7dfb0e073ae1a9c63f6790a8b80433e237010e22 100644 (file)
@@ -19,8 +19,6 @@
    glibc.malloc.check and glibc.malloc.mmap_threshold but also retain
    glibc.malloc.mmap_threshold in an unprivileged child.  */
 
-/* This is compiled as part of the testsuite but needs to see
-   HAVE_TUNABLES. */
 #define _LIBC 1
 #include "config.h"
 #undef _LIBC
@@ -83,7 +81,6 @@ test_child (int off)
 {
   const char *val = getenv ("GLIBC_TUNABLES");
 
-#if HAVE_TUNABLES
   if (val != NULL && strcmp (val, resultstrings[off]) == 0)
     return 0;
 
@@ -91,14 +88,6 @@ test_child (int off)
     printf ("[%d] Unexpected GLIBC_TUNABLES VALUE %s\n", off, val);
 
   return 1;
-#else
-  if (val != NULL)
-    {
-      printf ("[%d] GLIBC_TUNABLES not cleared\n", off);
-      return 1;
-    }
-  return 0;
-#endif
 }
 
 static int
index 5e99a7351dc716660583b34b54922c680f62b9f6..bc0e29438a02cbe7db36e0a1d3b5495547277ec3 100644 (file)
 #include <libc-internal.h>
 #include <not-cancel.h>
 
-#if HAVE_TUNABLES
-# define TUNABLE_NAMESPACE gmon
-# include <elf/dl-tunables.h>
-#endif
+#define TUNABLE_NAMESPACE gmon
+#include <elf/dl-tunables.h>
 
 #ifdef PIC
 # include <link.h>
@@ -130,7 +128,6 @@ __monstartup (u_long lowpc, u_long highpc)
   struct gmonparam *p = &_gmonparam;
   long int minarcs, maxarcs;
 
-#if HAVE_TUNABLES
   /* Read minarcs/maxarcs tunables. */
   minarcs = TUNABLE_GET (minarcs, int32_t, NULL);
   maxarcs = TUNABLE_GET (maxarcs, int32_t, NULL);
@@ -139,11 +136,6 @@ __monstartup (u_long lowpc, u_long highpc)
       ERR("monstartup: maxarcs < minarcs, setting maxarcs = minarcs\n");
       maxarcs = minarcs;
     }
-#else
-  /* No tunables, we use hardcoded defaults */
-  minarcs = MINARCS;
-  maxarcs = MAXARCS;
-#endif
 
   /*
    * If we are incorrectly called twice in a row (without an
index f685fc6e6c37926d89c1d0f3abcead94f8771fad..0717df626ec5b165211302b910c0b3300ecaeb77 100644 (file)
@@ -61,9 +61,7 @@ tests-internal += \
         tst-dynarray-fail \
         tst-dynarray-at-fail \
 
-ifneq (no,$(have-tunables))
 tests += tst-malloc-usable-tunables tst-mxfast
-endif
 
 tests += $(tests-static)
 test-srcs = tst-mtrace
index ccd193953b1c23dc441405c5dd738e7146e78e9b..e98b779dbb67c3f51115326f96fe76d45c3972e7 100644 (file)
@@ -18,9 +18,7 @@
 
 #include <stdbool.h>
 
-#if HAVE_TUNABLES
-# define TUNABLE_NAMESPACE malloc
-#endif
+#define TUNABLE_NAMESPACE malloc
 #include <elf/dl-tunables.h>
 
 /* Compile-time constants.  */
 static inline size_t
 heap_min_size (void)
 {
-#if HAVE_TUNABLES
   return mp_.hp_pagesize == 0 ? HEAP_MIN_SIZE : mp_.hp_pagesize;
-#else
-  return HEAP_MIN_SIZE;
-#endif
 }
 
 static inline size_t
 heap_max_size (void)
 {
-#if HAVE_TUNABLES
   return mp_.hp_pagesize == 0 ? HEAP_MAX_SIZE : mp_.hp_pagesize * 4;
-#else
-  return HEAP_MAX_SIZE;
-#endif
 }
 
 /***************************************************************************/
@@ -239,8 +229,7 @@ __malloc_fork_unlock_child (void)
   __libc_lock_init (list_lock);
 }
 
-#if HAVE_TUNABLES
-# define TUNABLE_CALLBACK_FNDECL(__name, __type) \
+#define TUNABLE_CALLBACK_FNDECL(__name, __type) \
 static inline int do_ ## __name (__type value);                                      \
 static void                                                                          \
 TUNABLE_CALLBACK (__name) (tunable_val_t *valp)                                      \
@@ -263,42 +252,6 @@ TUNABLE_CALLBACK_FNDECL (set_tcache_unsorted_limit, size_t)
 #endif
 TUNABLE_CALLBACK_FNDECL (set_mxfast, size_t)
 TUNABLE_CALLBACK_FNDECL (set_hugetlb, size_t)
-#else
-/* Initialization routine. */
-#include <string.h>
-extern char **_environ;
-
-static char *
-next_env_entry (char ***position)
-{
-  char **current = *position;
-  char *result = NULL;
-
-  while (*current != NULL)
-    {
-      if (__builtin_expect ((*current)[0] == 'M', 0)
-          && (*current)[1] == 'A'
-          && (*current)[2] == 'L'
-          && (*current)[3] == 'L'
-          && (*current)[4] == 'O'
-          && (*current)[5] == 'C'
-          && (*current)[6] == '_')
-        {
-          result = &(*current)[7];
-
-          /* Save current position for next visit.  */
-          *position = ++current;
-
-          break;
-        }
-
-      ++current;
-    }
-
-  return result;
-}
-#endif
-
 
 #if USE_TCACHE
 static void tcache_key_initialize (void);
@@ -343,7 +296,6 @@ ptmalloc_init (void)
 
   malloc_init_state (&main_arena);
 
-#if HAVE_TUNABLES
   TUNABLE_GET (top_pad, size_t, TUNABLE_CALLBACK (set_top_pad));
   TUNABLE_GET (perturb, int32_t, TUNABLE_CALLBACK (set_perturb_byte));
   TUNABLE_GET (mmap_threshold, size_t, TUNABLE_CALLBACK (set_mmap_threshold));
@@ -363,70 +315,6 @@ ptmalloc_init (void)
     /* Force mmap for main arena instead of sbrk, so hugepages are explicitly
        used.  */
     __always_fail_morecore = true;
-#else
-  if (__glibc_likely (_environ != NULL))
-    {
-      char **runp = _environ;
-      char *envline;
-
-      while (__builtin_expect ((envline = next_env_entry (&runp)) != NULL,
-                               0))
-        {
-          size_t len = strcspn (envline, "=");
-
-          if (envline[len] != '=')
-            /* This is a "MALLOC_" variable at the end of the string
-               without a '=' character.  Ignore it since otherwise we
-               will access invalid memory below.  */
-            continue;
-
-          switch (len)
-            {
-            case 8:
-              if (!__builtin_expect (__libc_enable_secure, 0))
-                {
-                  if (memcmp (envline, "TOP_PAD_", 8) == 0)
-                    __libc_mallopt (M_TOP_PAD, strtol (&envline[9], NULL, 10));
-                  else if (memcmp (envline, "PERTURB_", 8) == 0)
-                    __libc_mallopt (M_PERTURB, strtol (&envline[9], NULL, 10));
-                }
-              break;
-            case 9:
-              if (!__builtin_expect (__libc_enable_secure, 0))
-                {
-                  if (memcmp (envline, "MMAP_MAX_", 9) == 0)
-                    __libc_mallopt (M_MMAP_MAX, strtol (&envline[10],
-                                                       NULL, 10));
-                  else if (memcmp (envline, "ARENA_MAX", 9) == 0)
-                    __libc_mallopt (M_ARENA_MAX, strtol (&envline[10],
-                                                        NULL, 10));
-                }
-              break;
-            case 10:
-              if (!__builtin_expect (__libc_enable_secure, 0))
-                {
-                  if (memcmp (envline, "ARENA_TEST", 10) == 0)
-                    __libc_mallopt (M_ARENA_TEST, strtol (&envline[11],
-                                                         NULL, 10));
-                }
-              break;
-            case 15:
-              if (!__builtin_expect (__libc_enable_secure, 0))
-                {
-                  if (memcmp (envline, "TRIM_THRESHOLD_", 15) == 0)
-                    __libc_mallopt (M_TRIM_THRESHOLD, strtol (&envline[16],
-                                                             NULL, 10));
-                  else if (memcmp (envline, "MMAP_THRESHOLD_", 15) == 0)
-                    __libc_mallopt (M_MMAP_THRESHOLD, strtol (&envline[16],
-                                                             NULL, 10));
-                }
-              break;
-            default:
-              break;
-            }
-        }
-    }
-#endif
 }
 
 /* Managing heaps and arenas (for concurrent threads) */
@@ -561,7 +449,6 @@ alloc_new_heap  (size_t size, size_t top_pad, size_t pagesize,
 static heap_info *
 new_heap (size_t size, size_t top_pad)
 {
-#if HAVE_TUNABLES
   if (__glibc_unlikely (mp_.hp_pagesize != 0))
     {
       heap_info *h = alloc_new_heap (size, top_pad, mp_.hp_pagesize,
@@ -569,7 +456,6 @@ new_heap (size_t size, size_t top_pad)
       if (h != NULL)
        return h;
     }
-#endif
   return alloc_new_heap (size, top_pad, GLRO (dl_pagesize), 0);
 }
 
index af27fd2c528c207533d3e1559956dcaecc526545..5732d81bf1874aa07c0d2bd49bc443499afc6a5c 100644 (file)
@@ -376,7 +376,6 @@ memalign_check (size_t alignment, size_t bytes)
   return mem2mem_check (tag_new_usable (mem), bytes);
 }
 
-#if HAVE_TUNABLES
 static void
 TUNABLE_CALLBACK (set_mallopt_check) (tunable_val_t *valp)
 {
@@ -384,7 +383,6 @@ TUNABLE_CALLBACK (set_mallopt_check) (tunable_val_t *valp)
   if (value != 0)
     __malloc_debug_enable (MALLOC_CHECK_HOOK);
 }
-#endif
 
 static bool
 initialize_malloc_check (void)
@@ -392,12 +390,6 @@ initialize_malloc_check (void)
   /* This is the copy of the malloc initializer that we pulled in along with
      malloc-check.  This does not affect any of the libc malloc structures.  */
   ptmalloc_init ();
-#if HAVE_TUNABLES
   TUNABLE_GET (check, int32_t, TUNABLE_CALLBACK (set_mallopt_check));
-#else
-  const char *s = secure_getenv ("MALLOC_CHECK_");
-  if (s && s[0] != '\0' && s[0] != '0')
-    __malloc_debug_enable (MALLOC_CHECK_HOOK);
-#endif
   return __is_malloc_debug_enabled (MALLOC_CHECK_HOOK);
 }
index 76c50e3f581771d0d14552eb13b3d7bbd7d4b922..05e65a2d54f9b3850fa0c4d2c7dfaae3dfd94dac 100644 (file)
@@ -1856,14 +1856,12 @@ struct malloc_par
   INTERNAL_SIZE_T arena_test;
   INTERNAL_SIZE_T arena_max;
 
-#if HAVE_TUNABLES
   /* Transparent Large Page support.  */
   INTERNAL_SIZE_T thp_pagesize;
   /* A value different than 0 means to align mmap allocation to hp_pagesize
      add hp_flags on flags.  */
   INTERNAL_SIZE_T hp_pagesize;
   int hp_flags;
-#endif
 
   /* Memory map support */
   int n_mmaps;
@@ -1998,7 +1996,7 @@ free_perturb (char *p, size_t n)
 static inline void
 madvise_thp (void *p, INTERNAL_SIZE_T size)
 {
-#if HAVE_TUNABLES && defined (MADV_HUGEPAGE)
+#ifdef MADV_HUGEPAGE
   /* Do not consider areas smaller than a huge page or if the tunable is
      not active.  */
   if (mp_.thp_pagesize == 0 || size < mp_.thp_pagesize)
@@ -2557,7 +2555,6 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
          && (mp_.n_mmaps < mp_.n_mmaps_max)))
     {
       char *mm;
-#if HAVE_TUNABLES
       if (mp_.hp_pagesize > 0 && nb >= mp_.hp_pagesize)
        {
          /* There is no need to isse the THP madvise call if Huge Pages are
@@ -2566,7 +2563,6 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
          if (mm != MAP_FAILED)
            return mm;
        }
-#endif
       mm = sysmalloc_mmap (nb, pagesize, 0, av);
       if (mm != MAP_FAILED)
        return mm;
@@ -2679,7 +2675,7 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
          previous calls. Otherwise, we correct to page-align below.
        */
 
-#if HAVE_TUNABLES && defined (MADV_HUGEPAGE)
+#ifdef MADV_HUGEPAGE
       /* Defined in brk.c.  */
       extern void *__curbrk;
       if (__glibc_unlikely (mp_.thp_pagesize != 0))
@@ -2718,12 +2714,10 @@ sysmalloc (INTERNAL_SIZE_T nb, mstate av)
            */
 
          char *mbrk = MAP_FAILED;
-#if HAVE_TUNABLES
          if (mp_.hp_pagesize > 0)
            mbrk = sysmalloc_mmap_fallback (&size, nb, old_size,
                                            mp_.hp_pagesize, mp_.hp_pagesize,
                                            mp_.hp_flags, av);
-#endif
          if (mbrk == MAP_FAILED)
            mbrk = sysmalloc_mmap_fallback (&size, nb, old_size, MMAP_AS_MORECORE_SIZE,
                                            pagesize, 0, av);
@@ -2966,7 +2960,7 @@ systrim (size_t pad, mstate av)
     return 0;
 
   /* Release in pagesize units and round down to the nearest page.  */
-#if HAVE_TUNABLES && defined (MADV_HUGEPAGE)
+#ifdef MADV_HUGEPAGE
   if (__glibc_unlikely (mp_.thp_pagesize != 0))
     extra = ALIGN_DOWN (top_area - pad, mp_.thp_pagesize);
   else
@@ -5410,7 +5404,6 @@ do_set_mxfast (size_t value)
   return 0;
 }
 
-#if HAVE_TUNABLES
 static __always_inline int
 do_set_hugetlb (size_t value)
 {
@@ -5429,7 +5422,6 @@ do_set_hugetlb (size_t value)
                              &mp_.hp_flags);
   return 0;
 }
-#endif
 
 int
 __libc_mallopt (int param_number, int value)
index 37986d8b0c73a90866d76cc05ddbbb90803025ef..f507ebff7bce79536824660951aef8224250f2f3 100644 (file)
@@ -256,25 +256,6 @@ configure with @option{--disable-werror}.
 By default for x86_64, @theglibc{} is built with the vector math library.
 Use this option to disable the vector math library.
 
-@item --enable-tunables
-Tunables support allows additional library parameters to be customized at
-runtime.  This feature is enabled by default.  This option can take the
-following values:
-
-@table @code
-@item yes
-This is the default if no option is passed to configure. This enables tunables
-and selects the default frontend (currently @samp{valstring}).
-
-@item no
-This option disables tunables.
-
-@item valstring
-This enables tunables and selects the @samp{valstring} frontend for tunables.
-This frontend allows users to specify tunables as a colon-separated list in a
-single environment variable @env{GLIBC_TUNABLES}.
-@end table
-
 @item --disable-crypt
 Do not install the passphrase-hashing library @file{libcrypt} or the
 header file @file{crypt.h}.  @file{unistd.h} will still declare the
index 329c4cbb8f026f194fa2a93f686996e060842e39..9133384d47a2e8609341e6698bcab6bc19c4db94 100644 (file)
@@ -16,8 +16,7 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#if HAVE_TUNABLES
-# define TUNABLE_NAMESPACE pthread
+#define TUNABLE_NAMESPACE pthread
 #include <pthread_mutex_conf.h>
 #include <stdint.h>
 #include <stdbool.h>
@@ -53,4 +52,3 @@ __pthread_tunables_init (void)
   TUNABLE_GET (stack_cache_size, size_t,
                TUNABLE_CALLBACK (set_stack_cache_size));
 }
-#endif
index 4ac5f5059f37433ccddf9bc03bd86d69180ea4a6..e16284d29e92ff70a77012625ee1dbc739c0325e 100644 (file)
@@ -98,7 +98,6 @@ check_type (const char *mas, pthread_mutexattr_t *ma)
   /* Check if a mutex will be elided.  Lock elision can only be activated via
      the tunables framework.  By default, lock elision is disabled.  */
   bool assume_elided_mutex = false;
-#if HAVE_TUNABLES
   int ma_type = PTHREAD_MUTEX_TIMED_NP;
   if (ma != NULL)
     {
@@ -117,7 +116,6 @@ check_type (const char *mas, pthread_mutexattr_t *ma)
       if (TUNABLE_GET_FULL (glibc, elision, enable, int32_t, NULL) == 1)
        assume_elided_mutex = true;
     }
-#endif
 
   e = pthread_mutex_init (m, ma);
   if (e != 0)
index 9c5c77f42355551e698b86ce4f5b7a125d6580e9..e8bb82ed9d366661348a7e0b035b6c86f12035e2 100755 (executable)
@@ -445,7 +445,6 @@ class Context(object):
                                                '--disable-profile',
                                                '--disable-timezone-tools',
                                                '--disable-mathvec',
-                                               '--disable-tunables',
                                                '--disable-crypt',
                                                '--disable-build-nscd',
                                                '--disable-nscd']},
index c99dad77ccb90d38a9aef00fb406e21556a06059..e1ab272a7966f9c26f9475a1d50f09ac446b5337 100644 (file)
@@ -586,11 +586,6 @@ struct rtld_global_ro
   /* Mask for hardware capabilities that are available.  */
   EXTERN uint64_t _dl_hwcap;
 
-#if !HAVE_TUNABLES
-  /* Mask for important hardware capabilities we honour. */
-  EXTERN uint64_t _dl_hwcap_mask;
-#endif
-
 #ifdef HAVE_AUX_VECTOR
   /* Pointer to the auxv list supplied to the program at startup.  */
   EXTERN ElfW(auxv_t) *_dl_auxv;
@@ -1192,22 +1187,13 @@ extern struct link_map * _dl_get_dl_main_map (void)
    brk.  */
 void *_dl_early_allocate (size_t size) attribute_hidden;
 
-/* Initialize the DSO sort algorithm to use.  */
-#if !HAVE_TUNABLES
-static inline void
-__always_inline
-_dl_sort_maps_init (void)
-{
-  /* This is optimized out if tunables are not enabled.  */
-}
-#else
-extern void _dl_sort_maps_init (void) attribute_hidden;
-#endif
-
 /* Initialization of libpthread for statically linked applications.
    If libpthread is not linked in, this is an empty function.  */
 void __pthread_initialize_minimal (void) weak_function;
 
+/* Initialize the DSO sort algorithm to use.  */
+extern void _dl_sort_maps_init (void) attribute_hidden;
+
 /* Allocate memory for static TLS block (unless MEM is nonzero) and dtv.  */
 extern void *_dl_allocate_tls (void *mem);
 rtld_hidden_proto (_dl_allocate_tls)
index b50331b50fe05bdfa4734319bf1863e6cc565b49..81397fb90ba48d7e0e4c2ba99c8efb5daf1d6c5b 100644 (file)
@@ -1,16 +1,10 @@
-#if !HAVE_TUNABLES
-# define GLIBC_TUNABLES_ENVVAR "GLIBC_TUNABLES\0"
-#else
-# define GLIBC_TUNABLES_ENVVAR
-#endif
-
 /* Environment variable to be removed for SUID programs.  The names are
    all stuffed in a single string which means they have to be terminated
    with a '\0' explicitly.  */
 #define UNSECURE_ENVVARS \
   "GCONV_PATH\0"                                                             \
   "GETCONF_DIR\0"                                                            \
-  GLIBC_TUNABLES_ENVVAR                                                              \
+  "GLIBC_TUNABLES\0"                                                         \
   "HOSTALIASES\0"                                                            \
   "LD_AUDIT\0"                                                               \
   "LD_DEBUG\0"                                                               \
index 0db0349c4b3ed6a30d0c131284c83e994c10e1d9..50dc778852ae6dd6f95deea55100a49b10ff7f6c 100644 (file)
@@ -102,9 +102,7 @@ __tls_init_tp (void)
 
   {
     bool do_rseq = true;
-#if HAVE_TUNABLES
     do_rseq = TUNABLE_GET (rseq, int, NULL);
-#endif
     if (rseq_register_current_thread (pd, do_rseq))
       {
         /* We need a writable view of the variables.  They are in
index 536b75b5825218d974768261700bfebb63a773ef..54f919868124ef26e44bb318c6a345268ab5c0fb 100644 (file)
 
 static inline short max_adaptive_count (void)
 {
-#if HAVE_TUNABLES
   return __mutex_aconf.spin_count;
-#else
-  return DEFAULT_ADAPTIVE_COUNT;
-#endif
 }
 
 
index 39255d928c97fa0a6f533e0af0cc207194da9f22..f1a3b65d1a5bcd286bf970f546fa41ed97cb1b54 100644 (file)
@@ -53,9 +53,7 @@ __pthread_early_init (void)
   __default_pthread_attr.internal.stacksize = limit.rlim_cur;
   __default_pthread_attr.internal.guardsize = GLRO (dl_pagesize);
 
-#if HAVE_TUNABLES
   __pthread_tunables_init ();
-#endif
 }
 
 #endif  /* _PTHREAD_EARLY_INIT_H */
index 6d4b6ad880f94785cf156d2961137effe1c6b17d..8151bafce726a0d63fb1f5ac8e7d2a57cbe441f4 100644 (file)
@@ -20,7 +20,6 @@
 
 #include <adaptive_spin_count.h>
 
-#if HAVE_TUNABLES
 struct mutex_config
 {
   int spin_count;
@@ -30,12 +29,5 @@ extern struct mutex_config __mutex_aconf;
 libc_hidden_proto (__mutex_aconf)
 
 extern void __pthread_tunables_init (void) attribute_hidden;
-#else
-static inline void
-__pthread_tunables_init (void)
-{
-  /* No tunables to initialize.  */
-}
-#endif
 
 #endif
index 9ed0e5e8c18314dff15ea2b87499819038ad8824..0ef3cf89d2317b3965d2d5fe6f5dfa9e8c78d025 100644 (file)
 
 #include <stdint.h>
 #include <cpu-features.h>
-
-#if HAVE_TUNABLES
-# include <elf/dl-tunables.h>
-#endif
+#include <elf/dl-tunables.h>
 
 static inline void
 init_cpu_features (struct cpu_features *cpu_features)
@@ -29,11 +26,7 @@ init_cpu_features (struct cpu_features *cpu_features)
   /* Default is to use aligned memory access on optimized function unless
      tunables is enable, since for this case user can explicit disable
      unaligned optimizations.  */
-#if HAVE_TUNABLES
   int32_t cached_memfunc = TUNABLE_GET (glibc, cpu, cached_memopt, int32_t,
                                        NULL);
   cpu_features->use_cached_memopt = (cached_memfunc > 0);
-#else
-  cpu_features->use_cached_memopt = false;
-#endif
 }
index afeb9b56382efa96cf467a844ac798f1f28b4e47..39f8c23a60ef38c9db72c66933b9591210ee8fc3 100644 (file)
 
 #include <cpu-features.h>
 
-#if HAVE_TUNABLES
-# include <elf/dl-tunables.h>
-# include <ifunc-memcmp.h>
-# include <string.h>
+#include <elf/dl-tunables.h>
+#include <ifunc-memcmp.h>
+#include <string.h>
 extern __typeof (memcmp) MEMCMP_DEFAULT;
-#endif
 
-#if HAVE_TUNABLES
-# define S390_COPY_CPU_FEATURES(SRC_PTR, DEST_PTR)     \
+#define S390_COPY_CPU_FEATURES(SRC_PTR, DEST_PTR)      \
   (DEST_PTR)->hwcap = (SRC_PTR)->hwcap;                        \
   (DEST_PTR)->stfle_bits[0] = (SRC_PTR)->stfle_bits[0];
 
@@ -205,7 +202,6 @@ TUNABLE_CALLBACK (set_hwcaps) (tunable_val_t *valp)
   cpu_features->stfle_bits[0] = cpu_features_curr.stfle_bits[0]
     & cpu_features_orig.stfle_bits[0];
 }
-#endif
 
 static inline void
 init_cpu_features (struct cpu_features *cpu_features)
@@ -233,7 +229,5 @@ init_cpu_features (struct cpu_features *cpu_features)
       cpu_features->stfle_bits[0] = 0ULL;
     }
 
-#if HAVE_TUNABLES
   TUNABLE_GET (glibc, cpu, hwcaps, tunable_val_t *, TUNABLE_CALLBACK (set_hwcaps));
-#endif
 }
index 835e68925bb011320736a94ecff0fe570145c16f..9b57ae1a93073864dbedb4f10f05ec3cfa3d6955 100644 (file)
@@ -39,8 +39,9 @@ elf_machine_matches_host (const Elf32_Ehdr *ehdr)
     return 1;
   else if (ehdr->e_machine == EM_SPARC32PLUS)
     {
-#if HAVE_TUNABLES || defined SHARED
-      uint64_t hwcap_mask = GET_HWCAP_MASK();
+#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;
index f8bd12d9915508cb05babea7b58d8c9b8175e6f8..b4323b260487162dd9ea2af5e18aff020ed07030 100644 (file)
@@ -245,11 +245,9 @@ tests-internal += \
   tst-sigcontext-get_pc \
   # tests-internal
 
-ifneq (no,$(have-tunables))
 tests-internal += \
   tst-rseq-disable \
-  # tests-internal $(have-tunables)
-endif
+  # tests-internal
 
 tests-time64 += \
   tst-adjtimex-time64 \
index 0380f116de1150a94b09770f799f9e3b2f87801f..dc09c1c8274855c8215c2c6d57af9a2b5f8a7e2f 100644 (file)
@@ -30,7 +30,6 @@
    to see when pointer have been correctly tagged.  */
 #define MTE_ALLOWED_TAGS (0xfffe << PR_MTE_TAG_SHIFT)
 
-#if HAVE_TUNABLES
 struct cpu_list
 {
   const char *name;
@@ -59,19 +58,16 @@ get_midr_from_mcpu (const char *mcpu)
 
   return UINT64_MAX;
 }
-#endif
 
 static inline void
 init_cpu_features (struct cpu_features *cpu_features)
 {
   register uint64_t midr = UINT64_MAX;
 
-#if HAVE_TUNABLES
   /* Get the tunable override.  */
   const char *mcpu = TUNABLE_GET (glibc, cpu, name, const char *, NULL);
   if (mcpu != NULL)
     midr = get_midr_from_mcpu (mcpu);
-#endif
 
   /* If there was no useful tunable override, query the MIDR if the kernel
      allows it.  */
@@ -100,13 +96,11 @@ init_cpu_features (struct cpu_features *cpu_features)
   cpu_features->mte_state = 0;
 
 #ifdef USE_MTAG
-# if HAVE_TUNABLES
   int mte_state = TUNABLE_GET (glibc, mem, tagging, unsigned, 0);
   cpu_features->mte_state = (GLRO (dl_hwcap2) & HWCAP2_MTE) ? mte_state : 0;
   /* If we lack the MTE feature, disable the tunable, since it will
      otherwise cause instructions that won't run on this CPU to be used.  */
   TUNABLE_SET (glibc, mem, tagging, cpu_features->mte_state);
-# endif
 
   if (cpu_features->mte_state & 4)
     /* Enable choosing system-preferred faulting mode.  */
index 8cd945a6c5d72f333ae56ee342d9979be0706464..7c98dbd0d01b8ec720e0744ded9b3030df108577 100644 (file)
@@ -22,9 +22,7 @@
 #include <unistd.h>
 #include <dl-procinfo.h>
 
-#if HAVE_TUNABLES
-# define TUNABLE_NAMESPACE elision
-#endif
+#define TUNABLE_NAMESPACE elision
 #include <elf/dl-tunables.h>
 
 /* Reasonable initial tuning values, may be revised in the future.
@@ -51,7 +49,6 @@ struct elision_config __elision_aconf =
     .skip_trylock_internal_abort = 3,
   };
 
-#if HAVE_TUNABLES
 static inline void
 __always_inline
 do_set_elision_enable (int32_t elision_enable)
@@ -94,14 +91,12 @@ TUNABLE_CALLBACK_FNDECL (skip_lock_internal_abort, int32_t);
 TUNABLE_CALLBACK_FNDECL (skip_lock_out_of_tbegin_retries, int32_t);
 TUNABLE_CALLBACK_FNDECL (try_tbegin, int32_t);
 TUNABLE_CALLBACK_FNDECL (skip_trylock_internal_abort, int32_t);
-#endif
 
 /* Initialize elision.  */
 
 void
 __lll_elision_init (void)
 {
-#if HAVE_TUNABLES
   /* Elision depends on tunables and must be explicitly turned on by setting
      the appropriate tunable on a supported platform.  */
 
@@ -117,7 +112,6 @@ __lll_elision_init (void)
               TUNABLE_CALLBACK (set_elision_try_tbegin));
   TUNABLE_GET (skip_trylock_internal_abort, int32_t,
               TUNABLE_CALLBACK (set_elision_skip_trylock_internal_abort));
-#endif
 
   /* Linux from 3.9 through 4.2 do not abort HTM transaction on syscalls,
      instead it suspends the transaction and resumes it when returning to
index 5911e51097f5c831ba533a9197fd1b821c8ad552..6a6d6814eef78a177eeed0a59d5a6ddef0b68a18 100644 (file)
@@ -22,9 +22,7 @@
 #include <unistd.h>
 #include <dl-procinfo.h>
 
-#if HAVE_TUNABLES
-# define TUNABLE_NAMESPACE elision
-#endif
+#define TUNABLE_NAMESPACE elision
 #include <elf/dl-tunables.h>
 
 /* Reasonable initial tuning values, may be revised in the future.
@@ -51,7 +49,6 @@ struct elision_config __elision_aconf =
     .skip_trylock_internal_abort = 3,
   };
 
-#if HAVE_TUNABLES
 static inline void
 __always_inline
 do_set_elision_enable (int32_t elision_enable)
@@ -93,14 +90,12 @@ TUNABLE_CALLBACK_FNDECL (skip_lock_internal_abort, int32_t);
 TUNABLE_CALLBACK_FNDECL (skip_lock_out_of_tbegin_retries, int32_t);
 TUNABLE_CALLBACK_FNDECL (try_tbegin, int32_t);
 TUNABLE_CALLBACK_FNDECL (skip_trylock_internal_abort, int32_t);
-#endif
 
 /* Initialize elison.  */
 
 void
 __lll_elision_init (void)
 {
-#if HAVE_TUNABLES
   /* Elision depends on tunables and must be explicitly turned on by setting
      the appropriate tunable on a supported platform.  */
 
@@ -116,7 +111,6 @@ __lll_elision_init (void)
               TUNABLE_CALLBACK (set_elision_try_tbegin));
   TUNABLE_GET (skip_trylock_internal_abort, int32_t,
               TUNABLE_CALLBACK (set_elision_skip_trylock_internal_abort));
-#endif
 
   if (!__pthread_force_elision)
     __elision_aconf.try_tbegin = 0; /* Disable elision on rwlocks.  */
index 6447bda96ba1cec9da576c4e30308010caca4d25..cfd9a71e3144745bd30132dfc8161a57667ffc59 100644 (file)
@@ -22,9 +22,7 @@
 #include <elision-conf.h>
 #include <unistd.h>
 
-#if HAVE_TUNABLES
-# define TUNABLE_NAMESPACE elision
-#endif
+#define TUNABLE_NAMESPACE elision
 #include <elf/dl-tunables.h>
 
 /* Reasonable initial tuning values, may be revised in the future.
@@ -48,7 +46,6 @@ struct elision_config __elision_aconf =
     .skip_trylock_internal_abort = 3,
   };
 
-#if HAVE_TUNABLES
 static __always_inline void
 do_set_elision_enable (int32_t elision_enable)
 {
@@ -87,14 +84,12 @@ TUNABLE_CALLBACK_FNDECL (skip_lock_busy, int32_t);
 TUNABLE_CALLBACK_FNDECL (skip_lock_internal_abort, int32_t);
 TUNABLE_CALLBACK_FNDECL (retry_try_xbegin, int32_t);
 TUNABLE_CALLBACK_FNDECL (skip_trylock_internal_abort, int32_t);
-#endif
 
 /* Initialize elision.  */
 
 void
 __lll_elision_init (void)
 {
-#if HAVE_TUNABLES
   /* Elision depends on tunables and must be explicitly turned on by setting
      the appropriate tunable on a supported platform.  */
 
@@ -108,7 +103,6 @@ __lll_elision_init (void)
               TUNABLE_CALLBACK (set_elision_retry_try_xbegin));
   TUNABLE_GET (skip_trylock_internal_abort, int32_t,
               TUNABLE_CALLBACK (set_elision_skip_trylock_internal_abort));
-#endif
 
   if (!__pthread_force_elision)
     __elision_aconf.retry_try_xbegin = 0; /* Disable elision on rwlocks.  */
index 8ff4f27786a0d5a93d74d0f4a2cd54b2396e1ed6..1bf7d528b2521c082e8bc131897cb230f28e6bb8 100644 (file)
@@ -2,7 +2,6 @@
 default-abi := 64
 
 ifeq ($(subdir),elf)
-ifneq ($(have-tunables),no)
 
 tests-map-32bit = \
   tst-map-32bit-1a \
@@ -24,4 +23,3 @@ tst-map-32bit-1b-ENV = GLIBC_TUNABLES=glibc.cpu.prefer_map_32bit_exec=1
 $(objpfx)tst-map-32bit-1b: $(objpfx)tst-map-32bit-mod.so
 
 endif
-endif
index 56fd5fc805c41cede6e84472a53846bc3837ab3d..917c26f11661e2fef3d48ca29f21ec9e49d1058b 100644 (file)
@@ -25,7 +25,6 @@ tests-static += \
   tst-ifunc-isa-1-static
 test-xfail-tst-ifunc-isa-1 = $(with-lld)
 test-xfail-tst-ifunc-isa-1-static = $(with-lld)
-ifneq ($(have-tunables),no)
 tests += \
   tst-ifunc-isa-2 \
   tst-ifunc-isa-2-static
@@ -35,7 +34,6 @@ test-xfail-tst-ifunc-isa-2 = $(with-lld)
 test-xfail-tst-ifunc-isa-2-static = $(with-lld)
 endif
 endif
-endif
 ifeq (yes,$(enable-x86-isa-level))
 tests += tst-isa-level-1
 modules-names += tst-isa-level-mod-1-baseline \
@@ -65,11 +63,9 @@ $(objpfx)tst-isa-level-1.out: $(objpfx)tst-isa-level-mod-1-baseline.so \
                              $(objpfx)tst-isa-level-mod-1-v3.so \
                              $(objpfx)tst-isa-level-mod-1-v4.so
 endif
-ifneq ($(have-tunables),no)
 tst-ifunc-isa-2-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-SSE4_2,-AVX,-AVX2,-AVX512F
 tst-ifunc-isa-2-static-ENV = $(tst-ifunc-isa-2-ENV)
 endif
-endif
 
 ifeq ($(subdir),math)
 tests += tst-ldbl-nonnormal-printf
@@ -79,12 +75,10 @@ ifeq ($(subdir),setjmp)
 gen-as-const-headers += jmp_buf-ssp.sym
 sysdep_routines += __longjmp_cancel
 ifneq ($(enable-cet),no)
-ifneq ($(have-tunables),no)
 tests += tst-setjmp-cet
 tst-setjmp-cet-ENV = GLIBC_TUNABLES=glibc.cpu.x86_ibt=on:glibc.cpu.x86_shstk=on
 endif
 endif
-endif
 
 ifeq ($(subdir),string)
 sysdep_routines += cacheinfo
@@ -135,10 +129,8 @@ tests += tst-cet-legacy-1 tst-cet-legacy-1a tst-cet-legacy-2 \
         tst-cet-legacy-10 tst-cet-legacy-10-static
 tests-static += tst-cet-legacy-9-static tst-cet-legacy-10-static
 tst-cet-legacy-1a-ARGS = -- $(host-test-program-cmd)
-ifneq (no,$(have-tunables))
 tests += tst-cet-legacy-4a tst-cet-legacy-4b tst-cet-legacy-4c \
         tst-cet-legacy-5b tst-cet-legacy-6b
-endif
 modules-names += tst-cet-legacy-mod-1 tst-cet-legacy-mod-2 \
                 tst-cet-legacy-mod-4 tst-cet-legacy-mod-5a \
                 tst-cet-legacy-mod-5b tst-cet-legacy-mod-5c \
@@ -195,7 +187,6 @@ $(objpfx)tst-cet-legacy-6a.out: $(objpfx)tst-cet-legacy-mod-6a.so \
 $(objpfx)tst-cet-legacy-mod-6a.so: $(objpfx)tst-cet-legacy-mod-6c.so
 $(objpfx)tst-cet-legacy-mod-6b.so: $(objpfx)tst-cet-legacy-mod-6c.so
 LDFLAGS-tst-cet-legacy-mod-6c.so = -Wl,--enable-new-dtags,-z,nodelete
-ifneq (no,$(have-tunables))
 $(objpfx)tst-cet-legacy-4a.out: $(objpfx)tst-cet-legacy-mod-4.so
 tst-cet-legacy-4a-ENV = GLIBC_TUNABLES=glibc.cpu.x86_shstk=permissive
 $(objpfx)tst-cet-legacy-4b.out: $(objpfx)tst-cet-legacy-mod-4.so
@@ -211,7 +202,6 @@ tst-cet-legacy-6b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
 tst-cet-legacy-9-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
 tst-cet-legacy-9-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
 endif
-endif
 
 # Add -fcf-protection to CFLAGS when CET is enabled.
 CFLAGS-.o += -fcf-protection
index 7a99e04b73039a1524092dbf177c0a32a708cb2b..ec1bc142c4870facc7fb9f2497f7bac52d15f128 100644 (file)
 #include <cpuid.h>
 #include <cpu-features.h>
 
-#if HAVE_TUNABLES
-# define TUNABLE_NAMESPACE cpu
-# include <unistd.h>           /* Get STDOUT_FILENO for _dl_printf.  */
-# include <elf/dl-tunables.h>
-#endif
+#define TUNABLE_NAMESPACE cpu
+#include <unistd.h>            /* Get STDOUT_FILENO for _dl_printf.  */
+#include <elf/dl-tunables.h>
 
 #if IS_IN (libc)
 /* Data cache size for use in memory and string routines, typically
index 822688e21f77fa1ad5d0d43de89bf37d56081cd1..978eb29f72550deeb237cc76c5cf78c153f0ffb6 100644 (file)
 #include <dl-cacheinfo.h>
 #include <dl-minsigstacksize.h>
 
-#if HAVE_TUNABLES
 extern void TUNABLE_CALLBACK (set_hwcaps) (tunable_val_t *)
   attribute_hidden;
 
-# ifdef __LP64__
+#ifdef __LP64__
 static void
 TUNABLE_CALLBACK (set_prefer_map_32bit_exec) (tunable_val_t *valp)
 {
@@ -35,17 +34,14 @@ TUNABLE_CALLBACK (set_prefer_map_32bit_exec) (tunable_val_t *valp)
     GLRO(dl_x86_cpu_features).preferred[index_arch_Prefer_MAP_32BIT_EXEC]
       |= bit_arch_Prefer_MAP_32BIT_EXEC;
 }
-# endif
+#endif
 
-# if CET_ENABLED
+#if CET_ENABLED
 extern void TUNABLE_CALLBACK (set_x86_ibt) (tunable_val_t *)
   attribute_hidden;
 extern void TUNABLE_CALLBACK (set_x86_shstk) (tunable_val_t *)
   attribute_hidden;
-# endif
-#endif
 
-#if CET_ENABLED
 # include <dl-cet.h>
 #endif
 
@@ -712,13 +708,12 @@ no_cpuid:
 
   dl_init_cacheinfo (cpu_features);
 
-#if HAVE_TUNABLES
   TUNABLE_GET (hwcaps, tunable_val_t *, TUNABLE_CALLBACK (set_hwcaps));
 
-# ifdef __LP64__
+#ifdef __LP64__
   TUNABLE_GET (prefer_map_32bit_exec, tunable_val_t *,
               TUNABLE_CALLBACK (set_prefer_map_32bit_exec));
-# endif
+#endif
 
   bool disable_xsave_features = false;
 
@@ -774,13 +769,6 @@ no_cpuid:
       CPU_FEATURE_UNSET (cpu_features, FMA4);
     }
 
-#elif defined SHARED
-  /* Reuse dl_platform, dl_hwcap and dl_hwcap_mask for x86.  The
-     glibc.cpu.hwcap_mask tunable is initialized already, so no
-     need to do this.  */
-  GLRO(dl_hwcap_mask) = HWCAP_IMPORTANT;
-#endif
-
 #ifdef __x86_64__
   GLRO(dl_hwcap) = HWCAP_X86_64;
   if (cpu_features->basic.kind == arch_kind_intel)
@@ -828,12 +816,10 @@ no_cpuid:
 #endif
 
 #if CET_ENABLED
-# if HAVE_TUNABLES
   TUNABLE_GET (x86_ibt, tunable_val_t *,
               TUNABLE_CALLBACK (set_x86_ibt));
   TUNABLE_GET (x86_shstk, tunable_val_t *,
               TUNABLE_CALLBACK (set_x86_shstk));
-# endif
 
   /* Check CET status.  */
   unsigned int cet_status = get_cet_status ();
index 772fb0c4c2d149b4b4a259f4b19015ac8aecbcd7..0d4f328585d8405d40f0bb0d7de07799fe9cde0c 100644 (file)
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#if HAVE_TUNABLES
-# define TUNABLE_NAMESPACE cpu
-# include <stdbool.h>
-# include <stdint.h>
-# include <unistd.h>           /* Get STDOUT_FILENO for _dl_printf.  */
-# include <elf/dl-tunables.h>
-# include <string.h>
-# include <cpu-features.h>
-# include <ldsodefs.h>
+#define TUNABLE_NAMESPACE cpu
+#include <stdbool.h>
+#include <stdint.h>
+#include <unistd.h>            /* Get STDOUT_FILENO for _dl_printf.  */
+#include <elf/dl-tunables.h>
+#include <string.h>
+#include <cpu-features.h>
+#include <ldsodefs.h>
 
 /* We can't use IFUNC memcmp nor strlen in init_cpu_features from libc.a
    since IFUNC must be set up by init_cpu_features.  */
-# if defined USE_MULTIARCH && !defined SHARED
-#  ifdef __x86_64__
+#if defined USE_MULTIARCH && !defined SHARED
+# ifdef __x86_64__
 /* DEFAULT_MEMCMP by sysdeps/x86_64/memcmp-isa-default-impl.h.  */
-#   include <sysdeps/x86_64/memcmp-isa-default-impl.h>
-#  else
-#   define DEFAULT_MEMCMP      __memcmp_ia32
-#  endif
-extern __typeof (memcmp) DEFAULT_MEMCMP;
+#  include <sysdeps/x86_64/memcmp-isa-default-impl.h>
 # else
-#  define DEFAULT_MEMCMP       memcmp
+#  define DEFAULT_MEMCMP       __memcmp_ia32
 # endif
+extern __typeof (memcmp) DEFAULT_MEMCMP;
+#else
+# define DEFAULT_MEMCMP        memcmp
+#endif
 
-# define CHECK_GLIBC_IFUNC_CPU_OFF(f, cpu_features, name, len)         \
+#define CHECK_GLIBC_IFUNC_CPU_OFF(f, cpu_features, name, len)          \
   _Static_assert (sizeof (#name) - 1 == len, #name " != " #len);       \
   if (!DEFAULT_MEMCMP (f, #name, len))                                 \
     {                                                                  \
@@ -50,7 +49,7 @@ extern __typeof (memcmp) DEFAULT_MEMCMP;
 
 /* Disable a preferred feature NAME.  We don't enable a preferred feature
    which isn't available.  */
-# define CHECK_GLIBC_IFUNC_PREFERRED_OFF(f, cpu_features, name, len)   \
+#define CHECK_GLIBC_IFUNC_PREFERRED_OFF(f, cpu_features, name, len)    \
   _Static_assert (sizeof (#name) - 1 == len, #name " != " #len);       \
   if (!DEFAULT_MEMCMP (f, #name, len))                                 \
     {                                                                  \
@@ -60,7 +59,7 @@ extern __typeof (memcmp) DEFAULT_MEMCMP;
     }
 
 /* Enable/disable a preferred feature NAME.  */
-# define CHECK_GLIBC_IFUNC_PREFERRED_BOTH(f, cpu_features, name,       \
+#define CHECK_GLIBC_IFUNC_PREFERRED_BOTH(f, cpu_features, name,        \
                                          disable, len)                 \
   _Static_assert (sizeof (#name) - 1 == len, #name " != " #len);       \
   if (!DEFAULT_MEMCMP (f, #name, len))                                 \
@@ -74,7 +73,7 @@ extern __typeof (memcmp) DEFAULT_MEMCMP;
 
 /* Enable/disable a preferred feature NAME.  Enable a preferred feature
    only if the feature NEED is usable.  */
-# define CHECK_GLIBC_IFUNC_PREFERRED_NEED_BOTH(f, cpu_features, name,  \
+#define CHECK_GLIBC_IFUNC_PREFERRED_NEED_BOTH(f, cpu_features, name,   \
                                               need, disable, len)      \
   _Static_assert (sizeof (#name) - 1 == len, #name " != " #len);       \
   if (!DEFAULT_MEMCMP (f, #name, len))                                 \
@@ -286,8 +285,7 @@ TUNABLE_CALLBACK (set_hwcaps) (tunable_val_t *valp)
   while (*c != '\0');
 }
 
-# if CET_ENABLED
-
+#if CET_ENABLED
 attribute_hidden
 void
 TUNABLE_CALLBACK (set_x86_ibt) (tunable_val_t *valp)
@@ -313,5 +311,4 @@ TUNABLE_CALLBACK (set_x86_shstk) (tunable_val_t *valp)
                           sizeof ("permissive")) == 0)
     GL(dl_x86_feature_control).shstk = cet_permissive;
 }
-# endif
 #endif
index a0474af8d1fb7dd01da190b94fb0f68b64d64a88..ab671487da4907dcf1eee7ccc4fba1d1c045d25a 100644 (file)
@@ -760,10 +760,8 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
   else if (non_temporal_threshold > maximum_non_temporal_threshold)
     non_temporal_threshold = maximum_non_temporal_threshold;
 
-#if HAVE_TUNABLES
   /* NB: The REP MOVSB threshold must be greater than VEC_SIZE * 8.  */
   unsigned int minimum_rep_movsb_threshold;
-#endif
   /* NB: The default REP MOVSB threshold is 4096 * (VEC_SIZE / 16) for
      VEC_SIZE == 64 or 32.  For VEC_SIZE == 16, the default REP MOVSB
      threshold is 2048 * (VEC_SIZE / 16).  */
@@ -772,24 +770,18 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
       && !CPU_FEATURE_PREFERRED_P (cpu_features, Prefer_No_AVX512))
     {
       rep_movsb_threshold = 4096 * (64 / 16);
-#if HAVE_TUNABLES
       minimum_rep_movsb_threshold = 64 * 8;
-#endif
     }
   else if (CPU_FEATURE_PREFERRED_P (cpu_features,
                                    AVX_Fast_Unaligned_Load))
     {
       rep_movsb_threshold = 4096 * (32 / 16);
-#if HAVE_TUNABLES
       minimum_rep_movsb_threshold = 32 * 8;
-#endif
     }
   else
     {
       rep_movsb_threshold = 2048 * (16 / 16);
-#if HAVE_TUNABLES
       minimum_rep_movsb_threshold = 16 * 8;
-#endif
     }
   /* NB: The default REP MOVSB threshold is 2112 on processors with fast
      short REP MOVSB (FSRM).  */
@@ -799,7 +791,6 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
   /* The default threshold to use Enhanced REP STOSB.  */
   unsigned long int rep_stosb_threshold = 2048;
 
-#if HAVE_TUNABLES
   long int tunable_size;
 
   tunable_size = TUNABLE_GET (x86_data_cache_size, long int, NULL);
@@ -836,7 +827,6 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
                           minimum_rep_movsb_threshold, SIZE_MAX);
   TUNABLE_SET_WITH_BOUNDS (x86_rep_stosb_threshold, rep_stosb_threshold, 1,
                           SIZE_MAX);
-#endif
 
   unsigned long int rep_movsb_stop_threshold;
   /* ERMS feature is implemented from AMD Zen3 architecture and it is
index 688eb2d7c464b70bbc69199b8a71385f4793a645..54396c3c3fb6c8a285b3b1cc052f48b0b7df7f53 100644 (file)
@@ -57,7 +57,6 @@ $(objpfx)tst-quad2pie: $(objpfx)tst-quadmod2pie.o
 CFLAGS-tst-quad1pie.c = $(PIE-ccflag)
 CFLAGS-tst-quad2pie.c = $(PIE-ccflag)
 
-ifneq (no,$(have-tunables))
 tests += tst-platform-1
 modules-names += tst-platformmod-1 x86_64/tst-platformmod-2
 extra-test-objs += tst-platformmod-2.o
@@ -71,7 +70,6 @@ $(objpfx)tst-platform-1.out: $(objpfx)x86_64/tst-platformmod-2.so
 # always set to x86_64.
 tst-platform-1-ENV = LD_PRELOAD=$(objpfx)\$$PLATFORM/tst-platformmod-2.so \
        GLIBC_TUNABLES=glibc.cpu.hwcaps=-AVX512F,-AVX2
-endif
 
 tests += tst-audit3 tst-audit4 tst-audit5 tst-audit6 tst-audit7 \
         tst-audit10 tst-sse tst-avx tst-avx512