Properly count number of logical processors on Intel CPUs.
commita546baa9cd2e5176e9851811d5df6f23e35d3bb8
authorH.J. Lu <hongjiu.lu@intel.com>
Fri, 7 Aug 2009 16:39:36 +0000 (7 09:39 -0700)
committerUlrich Drepper <drepper@redhat.com>
Fri, 7 Aug 2009 16:39:36 +0000 (7 09:39 -0700)
tree1db7355ddca82021eef7f9f2d2baa11e3da78a2b
parent77c84aeb81808c3109665949448dba59965c391e
Properly count number of logical processors on Intel CPUs.

The meaning of the 25-14 bits in EAX returned from cpuid with EAX = 4
has been changed from "the maximum number of threads sharing the cache"
to "the maximum number of addressable IDs for logical processors sharing
the cache" if cpuid takes EAX = 11.  We need to use results from both
EAX = 4 and EAX = 11 to get the number of threads sharing the cache.

The 25-14 bits in EAX on Core i7 is 15 although the number of logical
processors is 8.  Here is a white paper on this:

http://software.intel.com/en-us/articles/intel-64-architecture-processor-topology-enumeration/

This patch correctly counts number of logical processors on Intel CPUs
with EAX = 11 support on cpuid.  Tested on Dinnington, Core i7 and
Nehalem EX/EP.

It also fixed Pentium Ds workaround since EBX may not have the right
value returned from cpuid with EAX = 1.
ChangeLog
sysdeps/x86_64/cacheinfo.c