Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 488813 Details for
Bug 692177
sysconf(_SC_*CACHE) returns 0 for all caches on some CPUs.
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh92 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Variation of the patch posted upstream to use cpuid 4 rather than cpuid 2 when possible
glibc-orabug11872171.patch (text/plain), 1.87 KB, created by
john.haxby@oracle.com
on 2011-03-30 15:57:52 UTC
(
hide
)
Description:
Variation of the patch posted upstream to use cpuid 4 rather than cpuid 2 when possible
Filename:
MIME Type:
Creator:
john.haxby@oracle.com
Created:
2011-03-30 15:57:52 UTC
Size:
1.87 KB
patch
obsolete
>diff -up glibc-2.12-2-gc4ccff1/sysdeps/x86_64/cacheinfo.c~ glibc-2.12-2-gc4ccff1/sysdeps/x86_64/cacheinfo.c >--- glibc-2.12-2-gc4ccff1/sysdeps/x86_64/cacheinfo.c~ 2011-03-25 10:27:55.928658708 +0000 >+++ glibc-2.12-2-gc4ccff1/sysdeps/x86_64/cacheinfo.c 2011-03-25 10:30:14.440595193 +0000 >@@ -264,6 +264,58 @@ handle_intel (int name, unsigned int max > bool no_level_2_or_3 = false; > bool has_level_2 = false; > >+ if (maxidx >= 4) >+ { >+ /* CPUID leaf 0x4 contains all the information. We need to >+ iterate over it. */ >+ unsigned int eax; >+ unsigned int ebx; >+ unsigned int ecx; >+ unsigned int edx; >+ /* Fold the name. The _SC_ constants are always in the order SIZE, >+ ASSOC, LINESIZE. */ >+ int folded_rel_name = (M(name) / 3) * 3; >+ >+ unsigned int round = 0; >+ while (1) >+ { >+ __cpuid_count(4, round, eax, ebx, ecx, edx); >+ >+ enum { null = 0, data = 1, inst = 2, uni = 3 } type = eax & 0x1f; >+ if (type == null) >+ /* That was the end. */ >+ break; >+ >+ unsigned int level = (eax >> 5) & 0x7; >+ >+ if ((level == 1 && type == data >+ && folded_rel_name == M(_SC_LEVEL1_DCACHE_SIZE)) >+ || (level == 1 && type == inst >+ && folded_rel_name == M(_SC_LEVEL1_ICACHE_SIZE)) >+ || (level == 2 && folded_rel_name == M(_SC_LEVEL2_CACHE_SIZE)) >+ || (level == 3 && folded_rel_name == M(_SC_LEVEL3_CACHE_SIZE)) >+ || (level == 4 && folded_rel_name == M(_SC_LEVEL4_CACHE_SIZE))) >+ { >+ unsigned int offset = M(name) - folded_rel_name; >+ >+ if (offset == 0) >+ /* Cache size. */ >+ return (((ebx >> 22) + 1) >+ * (((ebx >> 12) & 0x3ff) + 1) >+ * ((ebx & 0xfff) + 1) >+ * (ecx + 1)); >+ if (offset == 1) >+ return (ebx >> 22) + 1; >+ >+ assert (offset == 2); >+ return (ebx & 0xfff) + 1; >+ } >+ >+ ++round; >+ } >+ return 0; >+ } >+ > while (cnt++ < max) > { > unsigned int eax;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 692177
: 488813