[PATCH] x86: Correct index_cpu_LZCNT [BZ # 23456]

H.J. Lu hjl.tools@gmail.com
Thu Jul 26 18:13:00 GMT 2018


On Thu, Jul 26, 2018 at 11:05 AM, Carlos O'Donell <carlos@redhat.com> wrote:
> On 07/26/2018 12:46 PM, H.J. Lu wrote:
>> 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
>>
>>       [BZ # 23456]
>>       * sysdeps/x86/cpu-features.h (index_cpu_LZCNT): Set to
>>       COMMON_CPUID_INDEX_80000001.
>
> OK for 2.28.
>
> Reviewed-by: Carlos O'Donell <carlos@redhat.com>

Done.  We also need this for 2.28:

https://sourceware.org/ml/libc-alpha/2018-07/msg00914.html

Otherwise, we fail to detect LZCNT on Intel CPUs.


-- 
H.J.



More information about the Libc-alpha mailing list