From 5a01ab7b838c967ba38720136a71d8b89d5b79ce Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 10 Oct 2007 01:22:45 +0000 Subject: [PATCH] * sysdeps/x86_64/cacheinfo.c (init_cacheinfo): Work around problem with some Pentium Ds. --- ChangeLog | 5 +++++ localedata/locales/de_DE | 1 - sysdeps/x86_64/cacheinfo.c | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4c774652b5..04615d17db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-10-09 Ulrich Drepper + + * sysdeps/x86_64/cacheinfo.c (init_cacheinfo): Work around problem + with some Pentium Ds. + 2007-10-08 Ulrich Drepper * sysdeps/unix/sysv/linux/eventfd_read.c (eventfd_read): Use diff --git a/localedata/locales/de_DE b/localedata/locales/de_DE index 7f22b22c28..a694dc2888 100644 --- a/localedata/locales/de_DE +++ b/localedata/locales/de_DE @@ -120,7 +120,6 @@ day "";/ "";/ "";/ "" -week 7;19971201;4 abmon "";"";/ "";"";/ "";"";/ diff --git a/sysdeps/x86_64/cacheinfo.c b/sysdeps/x86_64/cacheinfo.c index 5b92bd5849..12102fea81 100644 --- a/sysdeps/x86_64/cacheinfo.c +++ b/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) -- 2.43.5