Bug 692177 - sysconf(_SC_*CACHE) returns 0 for all caches on some CPUs.
Summary: sysconf(_SC_*CACHE) returns 0 for all caches on some CPUs.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: glibc
Version: 6.0
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Andreas Schwab
QA Contact: qe-baseos-tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-30 15:57 UTC by john.haxby@oracle.com
Modified: 2016-11-24 15:45 UTC (History)
4 users (show)

Fixed In Version: glibc-2.12-1.25.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-19 13:16:31 UTC
Target Upstream Version:


Attachments (Terms of Use)
Variation of the patch posted upstream to use cpuid 4 rather than cpuid 2 when possible (1.87 KB, patch)
2011-03-30 15:57 UTC, john.haxby@oracle.com
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 692182 0 medium CLOSED sysconf(_SC_*CACHE) returns 0 for all caches on some CPUs. 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHBA-2011:0584 0 normal SHIPPED_LIVE glibc bug fix and enhancement update 2011-05-18 17:56:51 UTC
Sourceware 12587 0 None None None Never

Internal Links: 692182

Description john.haxby@oracle.com 2011-03-30 15:57:52 UTC
Created attachment 488813 [details]
Variation of the patch posted upstream to use cpuid 4 rather than cpuid 2 when possible

Description of problem:
  The mechanism that sysconf(3) uses to get the various CACHE parameters
  fails on the Xen 5670

Version-Release number of selected component (if applicable): 2.12-1.7.el6_0.4

How reproducible:
  Every time

Steps to Reproduce:
1.  Find a machine whose /proc/cpuinfo starts something like this:

  vendor_id       : GenuineIntel
  cpu family      : 6
  model           : 44
  model name      : Intel(R) Xeon(R) CPU           X5670  @ 2.93GHz
  stepping        : 2

2. run "getconf -a | grep CACHE"
3. Observe values printed
  
Actual results:
  All the cache parameter values are zero.

Expected results:
  Non-zero values for all but the level 4 cache

Additional info:
  Recent CPUs no longer have useful cpuid leaf 2 cache descriptors.  For this
  particular machine, cpuid 2 returns 0x55035a01 0xf0b2ff 0x0 0xca0000 in eax,
  ebx, ecx and edx respectively.  The 0xff in the least significant byte of
  ebx indicates that you need to use cpuid leaf 4.  Actually, for all but
  somewhat old CPUs you're better off using cpuid leaf 4 anyway (the only
  machines I have access to that have a cpuid level less than four are a
  "Intel(R) Pentium(R) 4 CPU 1.70GHz" and "Intel(R) Pentium(R) 4 CPU 2.40GHz"
  both of which are long past their use-by date).

Comment 5 errata-xmlrpc 2011-05-19 13:16:31 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0584.html


Note You need to log in before you can comment on or make changes to this bug.