diff -urN --exclude-from=/home/davej/.exclude linux-2.4.15-pre5/Documentation/oops-tracing.txt linux-2.4.15-pre5-dj/Documentation/oops-tracing.txt --- linux-2.4.15-pre5/Documentation/oops-tracing.txt Sun Sep 30 19:26:08 2001 +++ linux-2.4.15-pre5-dj/Documentation/oops-tracing.txt Fri Nov 16 21:52:34 2001 @@ -219,6 +219,11 @@ 2: 'F' if any module was force loaded by insmod -f, ' ' if all modules were loaded normally. + 3: 'S' if the oops occured on an SMP kernel running on hardware that + hasn't been certified as safe to run multiprocessor. + Currently this occurs only on various Athlons that are not + SMP capable. + The primary reason for the 'Tainted: ' string is to tell kernel debuggers if this is a clean kernel or if anything unusual has occurred. Tainting is permanent, even if an offending module is diff -urN --exclude-from=/home/davej/.exclude linux-2.4.15-pre5/arch/i386/kernel/setup.c linux-2.4.15-pre5-dj/arch/i386/kernel/setup.c --- linux-2.4.15-pre5/arch/i386/kernel/setup.c Fri Nov 16 18:14:11 2001 +++ linux-2.4.15-pre5-dj/arch/i386/kernel/setup.c Fri Nov 16 18:30:29 2001 @@ -2707,7 +2707,7 @@ /* AMD-defined */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, "mmxext", NULL, + NULL, NULL, NULL, "mp", NULL, NULL, "mmxext", NULL, NULL, NULL, NULL, NULL, NULL, "lm", "3dnowext", "3dnow", /* Transmeta-defined */ diff -urN --exclude-from=/home/davej/.exclude linux-2.4.15-pre5/arch/i386/kernel/smpboot.c linux-2.4.15-pre5-dj/arch/i386/kernel/smpboot.c --- linux-2.4.15-pre5/arch/i386/kernel/smpboot.c Fri Oct 5 01:42:54 2001 +++ linux-2.4.15-pre5-dj/arch/i386/kernel/smpboot.c Fri Nov 16 23:42:32 2001 @@ -30,10 +30,12 @@ * Tigran Aivazian : fixed "0.00 in /proc/uptime on SMP" bug. * Maciej W. Rozycki : Bits for genuine 82489DX APICs * Martin J. Bligh : Added support for multi-quad systems + * Dave Jones : Report invalid combinations of Athlon CPUs. */ #include #include +#include #include #include @@ -156,6 +158,35 @@ * Remember we have B step Pentia with bugs */ smp_b_stepping = 1; + + /* + * Certain Athlons might work (for various values of 'work') in SMP + * but they are not certified as MP capable. + */ + if ((c->x86_vendor == X86_VENDOR_AMD) && (c->x86 == 6)) { + + /* Athlon 660/661 is valid. */ + if ((c->x86_model==6) && ((c->x86_mask==0) || (c->x86_mask==1))) + goto valid_athlon; + + /* Duron 670 is valid */ + if ((c->x86_model==7) && (c->x86_mask==0)) + goto valid_athlon; + + /* Athlon 662, Duron 671, and Athlon >model 7 have capability bit */ + if (((c->x86_model==6) && (c->x86_mask>=2)) || + ((c->x86_model==7) && (c->x86_mask>=1)) || + (c->x86_model> 7)) + if (cpu_has_mp) + goto valid_athlon; + + /* If we get here, it's not a certified SMP capable AMD system. */ + printk (KERN_INFO "WARNING: This combination of AMD processors is not suitable for SMP.\n"); + tainted |= TAINT_UNSAFE_SMP; + + } +valid_athlon: + } /* diff -urN --exclude-from=/home/davej/.exclude linux-2.4.15-pre5/include/asm-i386/cpufeature.h linux-2.4.15-pre5-dj/include/asm-i386/cpufeature.h --- linux-2.4.15-pre5/include/asm-i386/cpufeature.h Mon Nov 13 05:55:50 2000 +++ linux-2.4.15-pre5-dj/include/asm-i386/cpufeature.h Fri Nov 16 18:29:24 2001 @@ -46,6 +46,7 @@ /* AMD-defined CPU features, CPUID level 0x80000001, word 1 */ /* Don't duplicate feature flags which are redundant with Intel! */ #define X86_FEATURE_SYSCALL (1*32+11) /* SYSCALL/SYSRET */ +#define X86_FEATURE_MP (1*32+19) /* MP Capable. */ #define X86_FEATURE_MMXEXT (1*32+22) /* AMD MMX extensions */ #define X86_FEATURE_LM (1*32+29) /* Long Mode (x86-64) */ #define X86_FEATURE_3DNOWEXT (1*32+30) /* AMD 3DNow! extensions */ diff -urN --exclude-from=/home/davej/.exclude linux-2.4.15-pre5/include/asm-i386/processor.h linux-2.4.15-pre5-dj/include/asm-i386/processor.h --- linux-2.4.15-pre5/include/asm-i386/processor.h Fri Nov 16 18:14:14 2001 +++ linux-2.4.15-pre5-dj/include/asm-i386/processor.h Fri Nov 16 19:08:34 2001 @@ -90,6 +90,7 @@ #define cpu_has_xmm (test_bit(X86_FEATURE_XMM, boot_cpu_data.x86_capability)) #define cpu_has_fpu (test_bit(X86_FEATURE_FPU, boot_cpu_data.x86_capability)) #define cpu_has_apic (test_bit(X86_FEATURE_APIC, boot_cpu_data.x86_capability)) +#define cpu_has_mp (test_bit(X86_FEATURE_MP, boot_cpu_data.x86_capability)) extern char ignore_irq13; diff -urN --exclude-from=/home/davej/.exclude linux-2.4.15-pre5/include/linux/kernel.h linux-2.4.15-pre5-dj/include/linux/kernel.h --- linux-2.4.15-pre5/include/linux/kernel.h Fri Nov 16 18:14:15 2001 +++ linux-2.4.15-pre5-dj/include/linux/kernel.h Fri Nov 16 21:49:32 2001 @@ -100,6 +100,9 @@ extern int tainted; extern const char *print_tainted(void); +#define TAINT_PROPRIETORY_MODULE (1<<0) +#define TAINT_FORCED_MODULE (1<<1) +#define TAINT_UNSAFE_SMP (1<<2) #if DEBUG #define pr_debug(fmt,arg...) \ diff -urN --exclude-from=/home/davej/.exclude linux-2.4.15-pre5/kernel/panic.c linux-2.4.15-pre5-dj/kernel/panic.c --- linux-2.4.15-pre5/kernel/panic.c Sun Sep 30 19:26:08 2001 +++ linux-2.4.15-pre5-dj/kernel/panic.c Sat Nov 17 11:34:52 2001 @@ -103,6 +103,10 @@ /** * print_tainted - return a string to represent the kernel taint state. * + * 'P' - Proprietory module has been loaded. + * 'F' - Module has been forcibly loaded. + * 'S' - SMP with CPUs not designed for SMP. + * * The string is overwritten by the next call to print_taint(). */ @@ -110,9 +114,10 @@ { static char buf[20]; if (tainted) { - snprintf(buf, sizeof(buf), "Tainted: %c%c", - tainted & 1 ? 'P' : 'G', - tainted & 2 ? 'F' : ' '); + snprintf(buf, sizeof(buf), "Tainted: %c%c%c", + tainted & TAINT_PROPRIETORY_MODULE ? 'P' : 'G', + tainted & TAINT_FORCED_MODULE ? 'F' : ' ', + tainted & TAINT_UNSAFE_SMP ? 'S' : ' '); } else snprintf(buf, sizeof(buf), "Not tainted");