diff options
author | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2007-10-11 11:59:55 +0000 |
---|---|---|
committer | joseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d> | 2007-10-11 11:59:55 +0000 |
commit | a6a5dd0d5b707d7da7fce387d68dfb5de2905978 (patch) | |
tree | a25f8b9e41cc36825f49f5d263fdd6059bc2a835 /libc/sysdeps/x86_64 | |
parent | 40520b2931f9d41ca4e3c2f3e8dea6578785624b (diff) | |
download | eglibc2-a6a5dd0d5b707d7da7fce387d68dfb5de2905978.tar.gz |
Merge changes between r3746 and r3777 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@3778 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sysdeps/x86_64')
-rw-r--r-- | libc/sysdeps/x86_64/cacheinfo.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libc/sysdeps/x86_64/cacheinfo.c b/libc/sysdeps/x86_64/cacheinfo.c index 5b92bd584..12102fea8 100644 --- a/libc/sysdeps/x86_64/cacheinfo.c +++ b/libc/sysdeps/x86_64/cacheinfo.c @@ -456,6 +456,13 @@ init_cacheinfo (void) asm volatile ("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "0" (4), "2" (i++)); + + /* There seems to be a bug in at least some Pentium Ds + which sometimes fail to iterate all cache parameters. + Do not loop indefinitely here, stop in this case and + assume there is no such information. */ + if ((eax & 0x1f) == 0) + goto intel_bug_no_cache_info; } while (((eax >> 5) & 0x7) != level); @@ -463,6 +470,7 @@ init_cacheinfo (void) } else { + intel_bug_no_cache_info: /* Assume that all logical threads share the highest cache level. */ asm volatile ("cpuid" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) |