This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.27.9000-560-g397c54c


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  397c54c1afa531242602fe3ac7bb47eff0e909f9 (commit)
       via  d0cd79807157e399ff58e67cb51651f90442122e (commit)
      from  ddb3c626b0a159de3547d901420198b626c29554 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=397c54c1afa531242602fe3ac7bb47eff0e909f9

commit 397c54c1afa531242602fe3ac7bb47eff0e909f9
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Thu Jun 28 15:30:32 2018 +0100

    aarch64: add HWCAP_ATOMICS to HWCAP_IMPORTANT
    
    This enables searching shared libraries in atomics/ when the hardware
    supports LSE atomics of armv8.1 so one can provide optimized variants
    of libraries in a portable way.
    
    LSE atomics does not affect library abi, the new instructions can
    interoperate with old ones.
    
    I considered the earlier comments on the patch
    
    https://sourceware.org/ml/libc-alpha/2018-04/msg00400.html
    https://sourceware.org/ml/libc-alpha/2018-04/msg00625.html
    
    It turns out that the way glibc dynamic linker decides on the search
    path is not very flexible: it wants to use hwcap bits and associated
    strings.  So some targets reuse hwcap bits for glibc internal purposes
    to affect the search logic.  But hwcap is an interface with the kernel,
    glibc should not allocate bits in it for its internal logic as that
    limits future hwcap extensions and confusing to users who expect to see
    hwcap bits in ifunc resolvers.  Instead of rewriting the dynamic linker
    path logic (which affects all targets) this patch just uses the existing
    mechanism, however this means that the path name has to be the hwcap
    name "atomics" and cannot be changed to something more meaningful to
    users.
    
    It is hard to tell how much performance benefit this can give, in
    principle armv8.1 atomics can be better optimized in the hardware, so it
    can make a difference for synchronization heavy code.  On some systems
    such multilib setup may be the only viable way to get optimized
    libraries used.
    
    	* sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h (HWCAP_IMPORTANT): Add
    	HWCAP_ATOMICS.

diff --git a/ChangeLog b/ChangeLog
index 9cb3dda..b8bf887 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2018-07-06  Szabolcs Nagy  <szabolcs.nagy@arm.com>
 
+	* sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h (HWCAP_IMPORTANT): Add
+	HWCAP_ATOMICS.
+
+2018-07-06  Szabolcs Nagy  <szabolcs.nagy@arm.com>
+
 	* sysdeps/unix/sysv/linux/aarch64/cpu-features.c (init_cpu_features):
 	Use dl_hwcap without masking.
 	* sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h (HWCAP_IMPORTANT):
diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
index c0dcce1..f746f52 100644
--- a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
+++ b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
@@ -28,7 +28,7 @@
 #define _dl_procinfo(type, word) -1
 
 /* No additional library search paths.  */
-#define HWCAP_IMPORTANT 0
+#define HWCAP_IMPORTANT HWCAP_ATOMICS
 
 static inline const char *
 __attribute__ ((unused))

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d0cd79807157e399ff58e67cb51651f90442122e

commit d0cd79807157e399ff58e67cb51651f90442122e
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Thu Jun 28 14:43:07 2018 +0100

    aarch64: Remove HWCAP_CPUID from HWCAP_IMPORTANT
    
    This partially reverts
    
    commit f82e9672ad89ea1ef40bbe1af71478e255e87c5e
    Author:     Siddhesh Poyarekar <siddhesh@sourceware.org>
    
        aarch64: Allow overriding HWCAP_CPUID feature check using HWCAP_MASK
    
    The idea was to make it possible to disable cpuid based ifunc resolution
    in glibc by changing the hwcap mask which the user could already control.
    
    However the hwcap mask has an orthogonal role: it specifies additional
    library search paths for the dynamic linker.  So "cpuid" got added to
    the search paths when it was set in the default mask (HWCAP_IMPORTANT),
    which is not useful behaviour, the hwcap masking should not be reused
    in the cpu features code.
    
    Meanwhile there is a tunable to set the cpu explicitly so it is possible
    to disable the cpuid based dispatch without using a hwcap mask:
    
      GLIBC_TUNABLES=glibc.tune.cpu=generic
    
    	* sysdeps/unix/sysv/linux/aarch64/cpu-features.c (init_cpu_features):
    	Use dl_hwcap without masking.
    	* sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h (HWCAP_IMPORTANT):
    	Remove HWCAP_CPUID.

diff --git a/ChangeLog b/ChangeLog
index 13c7293..9cb3dda 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-07-06  Szabolcs Nagy  <szabolcs.nagy@arm.com>
+
+	* sysdeps/unix/sysv/linux/aarch64/cpu-features.c (init_cpu_features):
+	Use dl_hwcap without masking.
+	* sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h (HWCAP_IMPORTANT):
+	Remove HWCAP_CPUID.
+
 2018-07-06  Florian Weimer  <fweimer@redhat.com>
 
 	* conform/conformtest.pl (checknamespace): Escape literal braces
diff --git a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
index 203f839..39eba01 100644
--- a/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
+++ b/sysdeps/unix/sysv/linux/aarch64/cpu-features.c
@@ -53,9 +53,6 @@ get_midr_from_mcpu (const char *mcpu)
 static inline void
 init_cpu_features (struct cpu_features *cpu_features)
 {
-  uint64_t hwcap_mask = GET_HWCAP_MASK();
-  uint64_t hwcap = GLRO (dl_hwcap) & hwcap_mask;
-
   register uint64_t midr = UINT64_MAX;
 
 #if HAVE_TUNABLES
@@ -69,7 +66,7 @@ init_cpu_features (struct cpu_features *cpu_features)
      allows it.  */
   if (midr == UINT64_MAX)
     {
-      if (hwcap & HWCAP_CPUID)
+      if (GLRO (dl_hwcap) & HWCAP_CPUID)
 	asm volatile ("mrs %0, midr_el1" : "=r"(midr));
       else
 	midr = 0;
diff --git a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
index 6887713..c0dcce1 100644
--- a/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
+++ b/sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h
@@ -27,9 +27,8 @@
 /* We cannot provide a general printing function.  */
 #define _dl_procinfo(type, word) -1
 
-/* HWCAP_CPUID should be available by default to influence IFUNC as well as
-   library search.  */
-#define HWCAP_IMPORTANT HWCAP_CPUID
+/* No additional library search paths.  */
+#define HWCAP_IMPORTANT 0
 
 static inline const char *
 __attribute__ ((unused))

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                      |   12 ++++++++++++
 sysdeps/unix/sysv/linux/aarch64/cpu-features.c |    5 +----
 sysdeps/unix/sysv/linux/aarch64/dl-procinfo.h  |    5 ++---
 3 files changed, 15 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]