]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
x86: Correct index_cpu_LZCNT [BZ # 23456]
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 26 Jul 2018 18:10:08 +0000 (11:10 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 26 Jul 2018 18:10:44 +0000 (11:10 -0700)
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.

ChangeLog
sysdeps/x86/cpu-features.h

index 3e25bd7a18308d2dd253a5d74c4f8407df703733..dcd8258635e1681b631af553d94809cdfc5b4bfe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-07-26  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-26  Stefan Liebler  <stli@linux.ibm.com>
 
        * string/tst-xbzero-opt.c (use_test_buffer): New function.
index 624e681e96a66be54afb20268f1df342061e47a7..3807a9d6110f68638892d7ee2f3d7749139795db 100644 (file)
@@ -204,7 +204,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