This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.27.9000-648-gbe525a6
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 26 Jul 2018 20:49:35 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.27.9000-648-gbe525a6
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 be525a69a6630abc83144c0a96474f2e26da7443 (commit)
from 65d87ade1ee6f3ac099105e3511bd09bdc24cf3f (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=be525a69a6630abc83144c0a96474f2e26da7443
commit be525a69a6630abc83144c0a96474f2e26da7443
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Jul 26 10:49:19 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.
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c
index 8108256..ea0b64f 100644
--- a/sysdeps/x86/cpu-features.c
+++ b/sysdeps/x86/cpu-features.c
@@ -43,6 +43,20 @@ extern void TUNABLE_CALLBACK (set_x86_shstk) (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)
@@ -224,6 +238,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;
@@ -338,16 +354,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 3807a9d..347a4b1 100644
--- a/sysdeps/x86/cpu-features.h
+++ b/sysdeps/x86/cpu-features.h
@@ -108,7 +108,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
};
-----------------------------------------------------------------------
Summary of changes:
sysdeps/x86/cpu-features.c | 27 ++++++++++++++++++---------
sysdeps/x86/cpu-features.h | 2 +-
2 files changed, 19 insertions(+), 10 deletions(-)
hooks/post-receive
--
GNU C Library master sources