local-cpuid-level2
authorGNU Libc Maintainers <debian-glibc@lists.debian.org>
Sat, 17 Sep 2016 18:00:44 +0000 (18:00 +0000)
committerAurelien Jarno <aurel32@debian.org>
Sat, 17 Sep 2016 18:00:44 +0000 (18:00 +0000)
Gbp-Pq: Topic i386
Gbp-Pq: Name local-cpuid-level2.diff

sysdeps/x86/cacheinfo.c

index cf4f64b0d8e2a4ab7cc7a3d7c96e28b42c0dcb61..8217f35af31d810ee17d92f2208c3e13af5c5d83 100644 (file)
@@ -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.  */