]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
tunables: Add LD_HWCAP_MASK to tunables
authorSiddhesh Poyarekar <siddhesh@sourceware.org>
Mon, 17 Apr 2017 04:30:35 +0000 (10:00 +0530)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Wed, 7 Jun 2017 05:41:37 +0000 (11:11 +0530)
Add LD_HWCAP_MASK to tunables in preparation of it being removed from
rtld.c.  This allows us to read LD_HWCAP_MASK much earlier so that it
can influence IFUNC resolution in aarch64.

This patch does not actually do anything other than read the
LD_HWCAP_MASK variable and add the tunables way to set the
LD_HWCAP_MASK, i.e. via the glibc.tune.hwcap_mask tunable.  In a
follow-up patch, the _dl_hwcap_mask will be replaced with
glibc.tune.hwcap_mask to complete the transition.

* elf/dl-tunables.list: Add glibc.tune.hwcap_mask.
* scripts/gen-tunables.awk: Include dl-procinfo.h.
* manual/tunables.texi: Document glibc.tune.hwcap_mask.

ChangeLog
elf/dl-tunables.list
manual/tunables.texi
scripts/gen-tunables.awk

index b85c6182ff10514c2c29da405f7338f20c84cfbf..7a42c789323119ac2dea9ee56c225aabf39fb5e8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2017-06-07  Siddhesh Poyarekar  <siddhesh@sourceware.org>
 
+       * elf/dl-tunables.list: Add glibc.tune.hwcap_mask.
+       * scripts/gen-tunables.awk: Include dl-procinfo.h.
+       * manual/tunables.texi: Document glibc.tune.hwcap_mask.
+
        * elf/Versions (__tunable_set_val): Rename to __tunable_get_val.
        * elf/dl-tunables.c: Likewise.
        (do_tunable_update_val): New function.
index b9f148879852eb28c840de42c1d308700c659f85..41ce9afa284e1446a6149909a1988b96e89350fe 100644 (file)
@@ -77,4 +77,11 @@ glibc {
       security_level: SXID_IGNORE
     }
   }
+  tune {
+    hwcap_mask {
+      type: UINT_64
+      env_alias: LD_HWCAP_MASK
+      default: HWCAP_IMPORTANT
+    }
+  }
 }
index ac8c38fbdefe0680a9dc49a730545ab36fc01a7e..c9a4cb7fe533012176ff0b5ee038b6311c44e81c 100644 (file)
@@ -31,6 +31,8 @@ their own namespace.
 @menu
 * Tunable names::  The structure of a tunable name
 * Memory Allocation Tunables::  Tunables in the memory allocation subsystem
+* Hardware Capability Tunables::  Tunables that modify the hardware
+                                 capabilities seen by @theglibc{}
 @end menu
 
 @node Tunable names
@@ -190,3 +192,24 @@ number of arenas is determined by the number of CPU cores online.  For 32-bit
 systems the limit is twice the number of cores online and on 64-bit systems, it
 is 8 times the number of cores online.
 @end deftp
+
+@node Hardware Capability Tunables
+@section Hardware Capability Tunables
+@cindex hardware capability tunables
+@cindex hwcap tunables
+@cindex tunables, hwcap
+
+@deftp {Tunable namespace} glibc.tune
+Behavior of @theglibc{} can be tuned to assume specific hardware capabilities
+by setting the following tunables in the @code{tune} namespace:
+@end deftp
+
+@deftp Tunable glibc.tune.hwcap_mask
+This tunable supersedes the @env{LD_HWCAP_MASK} environment variable and is
+identical in features.
+
+The @code{AT_HWCAP} key in the Auxilliary Vector specifies instruction set
+extensions available in the processor at runtime for some architectures.  The
+@code{glibc.tune.hwcap_mask} tunable allows the user to mask out those
+capabilities at runtime, thus disabling use of those extensions.
+@end deftp
index b10b00ebd6b7a9e702c12a5b2eca59996ab8200a..93e5aff0ef7b78c3c22abb2b9ed5549702ff0911 100644 (file)
@@ -134,6 +134,7 @@ END {
   print "# error \"Do not include this file directly.\""
   print "# error \"Include tunables.h instead.\""
   print "#endif"
+  print "#include <dl-procinfo.h>\n"
 
   # Now, the enum names
   print "\ntypedef enum"