]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
x86: Correct index_cpu_LZCNT [BZ #23456]
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 29 Jul 2018 13:08:59 +0000 (06:08 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 29 Jul 2018 13:30:59 +0000 (06:30 -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.

(cherry picked from commit 65d87ade1ee6f3ac099105e3511bd09bdc24cf3f)

ChangeLog
NEWS
sysdeps/x86/cpu-features.h

index 1c77ca2a6c93cde79411793161ace6fb6971da5a..7d88c08491a9f0056ec5bbad9191a77b13edb651 100644 (file)
--- 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 957035d2f315a264281905976dfe03f7c99cef43..7627bb0b6edff4d0f81b27c7fe24960e7b309900 100644 (file)
--- 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
 
 \f
 Version 2.27
index c60c2e4eeb8a01b754b6782b618284ae68ccbe16..906ad50920a74705a8c11d9e6663b81b6d3e0cb8 100644 (file)
@@ -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