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.22-566-g9627da3


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  9627da32ec76600244e7723e99b9d4e27691f1ff (commit)
      from  5f75f6bdf830e66aa6bd6eef675dbdc144b771c6 (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=9627da32ec76600244e7723e99b9d4e27691f1ff

commit 9627da32ec76600244e7723e99b9d4e27691f1ff
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Nov 30 08:53:37 2015 -0800

    Update family and model detection for AMD CPUs
    
    AMD CPUs uses the similar encoding scheme for extended family and model
    as Intel CPUs as shown in:
    
    http://support.amd.com/TechDocs/25481.pdf
    
    This patch updates get_common_indeces to get family and model for both
    Intel and AMD CPUs when family == 0x0f.
    
    	[BZ #19214]
    	* sysdeps/x86/cpu-features.c (get_common_indeces): Add an
    	argument to return extended model.  Update family and model
    	with extended family and model when family == 0x0f.
    	(init_cpu_features): Updated.

diff --git a/ChangeLog b/ChangeLog
index b769a0e..038181c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-11-30  Amit Pawar  <amit.pawar@amd.com>
+
+	[BZ #19214]
+	* sysdeps/x86/cpu-features.c (get_common_indeces): Add an
+	argument to return extended model.  Update family and model
+	with extended family and model when family == 0x0f.
+	(init_cpu_features): Updated.
+
 2015-11-29  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
 	The RPC interface used by mmap uses the unsigned vm_offset_t, not the
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index b03451d..fba3ef0 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -21,7 +21,8 @@
 
 static inline void
 get_common_indeces (struct cpu_features *cpu_features,
-		    unsigned int *family, unsigned int *model)
+		    unsigned int *family, unsigned int *model,
+		    unsigned int *extended_model)
 {
   unsigned int eax;
   __cpuid (1, eax, cpu_features->cpuid[COMMON_CPUID_INDEX_1].ebx,
@@ -30,6 +31,12 @@ get_common_indeces (struct cpu_features *cpu_features,
   GLRO(dl_x86_cpu_features).cpuid[COMMON_CPUID_INDEX_1].eax = eax;
   *family = (eax >> 8) & 0x0f;
   *model = (eax >> 4) & 0x0f;
+  *extended_model = (eax >> 12) & 0xf0;
+  if (*family == 0x0f)
+    {
+      *family += (eax >> 20) & 0xff;
+      *model += *extended_model;
+    }
 }
 
 static inline void
@@ -53,19 +60,13 @@ init_cpu_features (struct cpu_features *cpu_features)
   /* This spells out "GenuineIntel".  */
   if (ebx == 0x756e6547 && ecx == 0x6c65746e && edx == 0x49656e69)
     {
+      unsigned int extended_model;
+
       kind = arch_kind_intel;
 
-      get_common_indeces (cpu_features, &family, &model);
+      get_common_indeces (cpu_features, &family, &model, &extended_model);
 
-      unsigned int eax = cpu_features->cpuid[COMMON_CPUID_INDEX_1].eax;
-      unsigned int extended_family = (eax >> 20) & 0xff;
-      unsigned int extended_model = (eax >> 12) & 0xf0;
-      if (family == 0x0f)
-	{
-	  family += extended_family;
-	  model += extended_model;
-	}
-      else if (family == 0x06)
+      if (family == 0x06)
 	{
 	  ecx = cpu_features->cpuid[COMMON_CPUID_INDEX_1].ecx;
 	  model += extended_model;
@@ -132,9 +133,11 @@ init_cpu_features (struct cpu_features *cpu_features)
   /* This spells out "AuthenticAMD".  */
   else if (ebx == 0x68747541 && ecx == 0x444d4163 && edx == 0x69746e65)
     {
+      unsigned int extended_model;
+
       kind = arch_kind_amd;
 
-      get_common_indeces (cpu_features, &family, &model);
+      get_common_indeces (cpu_features, &family, &model, &extended_model);
 
       ecx = cpu_features->cpuid[COMMON_CPUID_INDEX_1].ecx;
 

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

Summary of changes:
 ChangeLog                  |    8 ++++++++
 sysdeps/x86/cpu-features.c |   27 +++++++++++++++------------
 2 files changed, 23 insertions(+), 12 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]