From 4710dab9db5e778b693e9e66be17a508fb07c85b Mon Sep 17 00:00:00 2001 From: GNU Libc Maintainers Date: Sat, 17 Sep 2016 18:00:44 +0000 Subject: [PATCH] local-cpuid-level2 Gbp-Pq: Topic i386 Gbp-Pq: Name local-cpuid-level2.diff --- sysdeps/x86/cacheinfo.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sysdeps/x86/cacheinfo.c b/sysdeps/x86/cacheinfo.c index cf4f64b0d..8217f35af 100644 --- a/sysdeps/x86/cacheinfo.c +++ b/sysdeps/x86/cacheinfo.c @@ -259,7 +259,13 @@ intel_check_word (int name, unsigned int value, bool *has_level_2, static long int __attribute__ ((noinline)) handle_intel (int name, unsigned int maxidx) { - assert (maxidx >= 2); + if (maxidx < 2) + { + /* This should never happen as all Intel i686 CPU support a CPUID + level of 2 minimum. However valgrind sometimes load the i686 + library with a P55C CPUID. Return 0 in that case. */ + return 0; + } /* OK, we can use the CPUID instruction to get all info about the caches. */ -- 2.30.2