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 release/2.27/master updated. glibc-2.27-77-g2dab175


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, release/2.27/master has been updated
       via  2dab17550dd464bcf531088efa81a9d595167f2a (commit)
       via  a452341529ef0a952b576e20d3c7e3c48dcb8427 (commit)
      from  8623cfe300b4fe88e8b7343bb15829bfe4317609 (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=2dab17550dd464bcf531088efa81a9d595167f2a

commit 2dab17550dd464bcf531088efa81a9d595167f2a
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 29 06:08:59 2018 -0700

    x86: Populate COMMON_CPUID_INDEX_80000001 for Intel CPUs [BZ #23459]
    
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
    
    	[BZ #23459]
    	* sysdeps/x86/cpu-features.c (get_extended_indices): New
    	function.
    	(init_cpu_features): Call get_extended_indices for both Intel
    	and AMD CPUs.
    	* sysdeps/x86/cpu-features.h (COMMON_CPUID_INDEX_80000001):
    	Remove "for AMD" comment.
    
    (cherry picked from commit be525a69a6630abc83144c0a96474f2e26da7443)

diff --git a/ChangeLog b/ChangeLog
index 7d88c08..7fcb7d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2018-07-29  H.J. Lu  <hongjiu.lu@intel.com>
 
+	[BZ #23459]
+	* sysdeps/x86/cpu-features.c (get_extended_indices): New
+	function.
+	(init_cpu_features): Call get_extended_indices for both Intel
+	and AMD CPUs.
+	* sysdeps/x86/cpu-features.h (COMMON_CPUID_INDEX_80000001):
+	Remove "for AMD" comment.
+
+2018-07-29  H.J. Lu  <hongjiu.lu@intel.com>
+
 	[BZ #23456]
 	* sysdeps/x86/cpu-features.h (index_cpu_LZCNT): Set to
 	COMMON_CPUID_INDEX_80000001.
diff --git a/NEWS b/NEWS
index 7627bb0..bc150b6 100644
--- a/NEWS
+++ b/NEWS
@@ -88,6 +88,7 @@ The following bugs are resolved with this release:
   [23349] Various glibc headers no longer compatible with <linux/time.h>
   [23363] stdio-common/tst-printf.c has non-free license
   [23456] Wrong index_cpu_LZCNT
+  [23459] COMMON_CPUID_INDEX_80000001 isn't populated for Intel processors
 
 
 Version 2.27
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index 0fc3674..1223728 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -31,6 +31,20 @@ extern void TUNABLE_CALLBACK (set_hwcaps) (tunable_val_t *)
 #endif
 
 static void
+get_extended_indices (struct cpu_features *cpu_features)
+{
+  unsigned int eax, ebx, ecx, edx;
+  __cpuid (0x80000000, eax, ebx, ecx, edx);
+  if (eax >= 0x80000001)
+    __cpuid (0x80000001,
+	     cpu_features->cpuid[COMMON_CPUID_INDEX_80000001].eax,
+	     cpu_features->cpuid[COMMON_CPUID_INDEX_80000001].ebx,
+	     cpu_features->cpuid[COMMON_CPUID_INDEX_80000001].ecx,
+	     cpu_features->cpuid[COMMON_CPUID_INDEX_80000001].edx);
+
+}
+
+static void
 get_common_indeces (struct cpu_features *cpu_features,
 		    unsigned int *family, unsigned int *model,
 		    unsigned int *extended_model, unsigned int *stepping)
@@ -205,6 +219,8 @@ init_cpu_features (struct cpu_features *cpu_features)
       get_common_indeces (cpu_features, &family, &model, &extended_model,
 			  &stepping);
 
+      get_extended_indices (cpu_features);
+
       if (family == 0x06)
 	{
 	  model += extended_model;
@@ -324,16 +340,9 @@ init_cpu_features (struct cpu_features *cpu_features)
       get_common_indeces (cpu_features, &family, &model, &extended_model,
 			  &stepping);
 
-      ecx = cpu_features->cpuid[COMMON_CPUID_INDEX_1].ecx;
+      get_extended_indices (cpu_features);
 
-      unsigned int eax;
-      __cpuid (0x80000000, eax, ebx, ecx, edx);
-      if (eax >= 0x80000001)
-	__cpuid (0x80000001,
-		 cpu_features->cpuid[COMMON_CPUID_INDEX_80000001].eax,
-		 cpu_features->cpuid[COMMON_CPUID_INDEX_80000001].ebx,
-		 cpu_features->cpuid[COMMON_CPUID_INDEX_80000001].ecx,
-		 cpu_features->cpuid[COMMON_CPUID_INDEX_80000001].edx);
+      ecx = cpu_features->cpuid[COMMON_CPUID_INDEX_1].ecx;
 
       if (HAS_ARCH_FEATURE (AVX_Usable))
 	{
diff --git a/sysdeps/x86/cpu-features.h b/sysdeps/x86/cpu-features.h
index 906ad50..4588c11 100644
--- a/sysdeps/x86/cpu-features.h
+++ b/sysdeps/x86/cpu-features.h
@@ -106,7 +106,7 @@ enum
   {
     COMMON_CPUID_INDEX_1 = 0,
     COMMON_CPUID_INDEX_7,
-    COMMON_CPUID_INDEX_80000001,	/* for AMD */
+    COMMON_CPUID_INDEX_80000001,
     /* Keep the following line at the end.  */
     COMMON_CPUID_INDEX_MAX
   };

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

commit a452341529ef0a952b576e20d3c7e3c48dcb8427
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sun Jul 29 06:08:59 2018 -0700

    x86: Correct index_cpu_LZCNT [BZ #23456]
    
    cpu-features.h has
    
     #define bit_cpu_LZCNT		(1 << 5)
     #define index_cpu_LZCNT	COMMON_CPUID_INDEX_1
     #define reg_LZCNT
    
    But the LZCNT feature bit is in COMMON_CPUID_INDEX_80000001:
    
    Initial EAX Value: 80000001H
    ECX Extended Processor Signature and Feature Bits:
    Bit 05: LZCNT available
    
    index_cpu_LZCNT should be COMMON_CPUID_INDEX_80000001, not
    COMMON_CPUID_INDEX_1.  The VMX feature bit is in COMMON_CPUID_INDEX_1:
    
    Initial EAX Value: 01H
    Feature Information Returned in the ECX Register:
    5 VMX
    
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
    
    	[BZ #23456]
    	* sysdeps/x86/cpu-features.h (index_cpu_LZCNT): Set to
    	COMMON_CPUID_INDEX_80000001.
    
    (cherry picked from commit 65d87ade1ee6f3ac099105e3511bd09bdc24cf3f)

diff --git a/ChangeLog b/ChangeLog
index 1c77ca2..7d88c08 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-07-29  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #23456]
+	* sysdeps/x86/cpu-features.h (index_cpu_LZCNT): Set to
+	COMMON_CPUID_INDEX_80000001.
+
 2018-07-10  Florian Weimer  <fweimer@redhat.com>
 
 	[BZ #23036]
diff --git a/NEWS b/NEWS
index 957035d..7627bb0 100644
--- a/NEWS
+++ b/NEWS
@@ -87,6 +87,7 @@ The following bugs are resolved with this release:
   [23313] libio: Disable vtable validation in case of interposition
   [23349] Various glibc headers no longer compatible with <linux/time.h>
   [23363] stdio-common/tst-printf.c has non-free license
+  [23456] Wrong index_cpu_LZCNT
 
 
 Version 2.27
diff --git a/sysdeps/x86/cpu-features.h b/sysdeps/x86/cpu-features.h
index c60c2e4..906ad50 100644
--- a/sysdeps/x86/cpu-features.h
+++ b/sysdeps/x86/cpu-features.h
@@ -202,7 +202,7 @@ extern const struct cpu_features *__get_cpu_features (void)
 # define index_cpu_HTT		COMMON_CPUID_INDEX_1
 # define index_cpu_BMI1		COMMON_CPUID_INDEX_7
 # define index_cpu_BMI2		COMMON_CPUID_INDEX_7
-# define index_cpu_LZCNT	COMMON_CPUID_INDEX_1
+# define index_cpu_LZCNT	COMMON_CPUID_INDEX_80000001
 # define index_cpu_MOVBE	COMMON_CPUID_INDEX_1
 # define index_cpu_POPCNT	COMMON_CPUID_INDEX_1
 # define index_cpu_IBT		COMMON_CPUID_INDEX_7

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

Summary of changes:
 ChangeLog                  |   16 ++++++++++++++++
 NEWS                       |    2 ++
 sysdeps/x86/cpu-features.c |   27 ++++++++++++++++++---------
 sysdeps/x86/cpu-features.h |    4 ++--
 4 files changed, 38 insertions(+), 11 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]