From 1138817dd2e38293f59e12c4fc7eb54a1a882c91 Mon Sep 17 00:00:00 2001 From: Julian Taylor Date: Sat, 15 Dec 2012 13:29:46 +0100 Subject: [PATCH] add a sanity check on the detected cpu type if we have 64 bit pointers we can't have a 32 bit cpu, so fall back to the 64bit cpu fallback (prescott) E.g. the cpu detection fails in amd qemu64 emulation (family 6 model 2) causing it to use the uninitialized gotoblas_ATHLON --- driver/others/dynamic.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/driver/others/dynamic.c b/driver/others/dynamic.c index 5d2bc782f..23de095ca 100644 --- a/driver/others/dynamic.c +++ b/driver/others/dynamic.c @@ -273,6 +273,15 @@ void gotoblas_dynamic_init(void) { if (gotoblas == NULL) gotoblas = &gotoblas_KATMAI; #else if (gotoblas == NULL) gotoblas = &gotoblas_PRESCOTT; + /* sanity check, if 64bit pointer we can't have a 32 bit cpu */ + if (sizeof(void*) == 8) { + if (gotoblas == &gotoblas_KATMAI || + gotoblas == &gotoblas_COPPERMINE || + gotoblas == &gotoblas_NORTHWOOD || + gotoblas == &gotoblas_BANIAS || + gotoblas == &gotoblas_ATHLON) + gotoblas = &gotoblas_PRESCOTT; + } #endif if (gotoblas && gotoblas -> init) {