Add tainted bit for machine checks
PATCH 1/1 Add tainted bit for machine checks
Add a new "M" tainted bit in oopses for machine checks.
This shows in a oops when the machine had already a machine check. That information may be useful to see if the machine has hardware trouble and if it's really worth to invest much time into a mysterious oops.
Support for i386 and x86-64 so far.
arch/x86_64/kernel/mce.c +1 -0
@@ -227,6 +227,7 @@ } out: + tainted |=TAINT_MACHINE_CHECK ;/* Last thing done in the machine check exception to clear state. */ wrmsrl (MSR_IA32_MCG_STATUS ,0 ); }
kernel/panic.c +3 -1
@@ -111,6 +111,7 @@* 'P' - Proprietary module has been loaded. * 'F' - Module has been forcibly loaded. * 'S' - SMP with CPUs not designed for SMP. +* 'M' - Machine had a machine check experience. * * The string is overwritten by the next call to print_taint(). */
@@ -119,7 +120,8 @@ {static char buf[20 ];if (tainted) { -snprintf (buf,sizeof (buf),"Tainted: %c%c%c" , +snprintf (buf,sizeof (buf),"Tainted: %c%c%c%c" , + tainted &TAINT_MACHINE_CHECK ?'M' :' ' , tainted &TAINT_PROPRIETARY_MODULE ?'P' :'G' , tainted &TAINT_FORCED_MODULE ?'F' :' ' , tainted &TAINT_UNSAFE_SMP ?'S' :' ' );
include/linux/kernel.h +1 -0
@@ -141,6 +141,7 @@SYSTEM_RESTART , } system_state; +#define TAINT_MACHINE_CHECK (1<<10)#define TAINT_PROPRIETARY_MODULE (1<<0)#define TAINT_FORCED_MODULE (1<<1)#define TAINT_UNSAFE_SMP (1<<2)
arch/i386/kernel/cpu/mcheck/k7.c +2 -0
@@ -64,6 +64,8 @@printk (KERN_EMERG "Attempting to continue.\n" ); mcgstl &= ~(1 <<2 );wrmsr (MSR_IA32_MCG_STATUS ,mcgstl, mcgsth); + + tainted |=TAINT_MACHINE_CHECK ; }
arch/i386/kernel/cpu/mcheck/p6.c +2 -0
@@ -76,6 +76,8 @@ } mcgstl &= ~(1 <<2 );wrmsr (MSR_IA32_MCG_STATUS ,mcgstl, mcgsth); + + tainted |=TAINT_MACHINE_CHECK ; }/* Set up machine check reporting for processors with Intel style MCE */
arch/i386/kernel/cpu/mcheck/p4.c +2 -0
@@ -226,6 +226,8 @@ } mcgstl &= ~(1 <<2 );wrmsr (MSR_IA32_MCG_STATUS ,mcgstl, mcgsth); + + tainted |=TAINT_MACHINE_CHECK ; }
arch/i386/kernel/cpu/mcheck/p5.c +2 -0
@@ -25,6 +25,8 @@printk (KERN_EMERG "CPU#%d: Machine Check Exception: 0x%8X (type 0x%8X).\n" ,smp_processor_id (), loaddr, lotype);if (lotype&(1 <<5 ))printk (KERN_EMERG "CPU#%d: Possible thermal failure (CPU on fire ?).\n" ,smp_processor_id ()); + + tainted |=TAINT_MACHINE_CHECK ; }/* Set up machine check reporting for processors with Intel style MCE */
arch/i386/kernel/cpu/mcheck/winchip.c +1 -0
@@ -19,6 +19,7 @@ static asmlinkage void winchip_machine_check(struct pt_regs * regs, long error_code) {printk (KERN_EMERG "CPU0: Machine Check Exception.\n" ); + tainted |=TAINT_MACHINE_CHECK ; }/* Set up machine check reporting on the Winchip C6 series */