ia64/xen-unstable

changeset 18906:415a69b41397

x86: Make MCE panic message more obvious

Make it more obvious to the untrained user that machine check reboots
are hardware faults, rather then just saying "CPU context corrupt".

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Dec 10 13:30:10 2008 +0000 (2008-12-10)
parents 265baac90802
children 2a349db39496
files xen/arch/x86/cpu/mcheck/amd_k8.c xen/arch/x86/cpu/mcheck/k7.c xen/arch/x86/cpu/mcheck/mce.c xen/arch/x86/cpu/mcheck/mce.h xen/arch/x86/cpu/mcheck/p4.c xen/arch/x86/cpu/mcheck/p6.c
line diff
     1.1 --- a/xen/arch/x86/cpu/mcheck/amd_k8.c	Wed Dec 10 13:28:58 2008 +0000
     1.2 +++ b/xen/arch/x86/cpu/mcheck/amd_k8.c	Wed Dec 10 13:30:10 2008 +0000
     1.3 @@ -219,7 +219,7 @@ void k8_machine_check(struct cpu_user_re
     1.4  			show_execution_state(regs);
     1.5  		}
     1.6  		x86_mcinfo_dump(mc_data);
     1.7 -		panic("End of MCE. Use mcelog to decode above error codes.\n");
     1.8 +		mc_panic("End of MCE. Use mcelog to decode above error codes.\n");
     1.9  	}
    1.10  
    1.11  	/* If Dom0 registered a machine check handler, which is only possible
    1.12 @@ -248,7 +248,7 @@ void k8_machine_check(struct cpu_user_re
    1.13  			/* Dom0 is impacted. Since noone can't handle
    1.14  			 * this error, panic! */
    1.15  			x86_mcinfo_dump(mc_data);
    1.16 -			panic("MCE occured in Dom0, which it can't handle\n");
    1.17 +			mc_panic("MCE occured in Dom0, which it can't handle\n");
    1.18  
    1.19  			/* UNREACHED */
    1.20  		} else {
     2.1 --- a/xen/arch/x86/cpu/mcheck/k7.c	Wed Dec 10 13:28:58 2008 +0000
     2.2 +++ b/xen/arch/x86/cpu/mcheck/k7.c	Wed Dec 10 13:30:10 2008 +0000
     2.3 @@ -57,9 +57,9 @@ static fastcall void k7_machine_check(st
     2.4  	}
     2.5  
     2.6  	if (recover&2)
     2.7 -		panic ("CPU context corrupt");
     2.8 +		mc_panic ("CPU context corrupt");
     2.9  	if (recover&1)
    2.10 -		panic ("Unable to continue");
    2.11 +		mc_panic ("Unable to continue");
    2.12  	printk (KERN_EMERG "Attempting to continue.\n");
    2.13  	mcgstl &= ~(1<<2);
    2.14  	wrmsr (MSR_IA32_MCG_STATUS,mcgstl, mcgsth);
     3.1 --- a/xen/arch/x86/cpu/mcheck/mce.c	Wed Dec 10 13:28:58 2008 +0000
     3.2 +++ b/xen/arch/x86/cpu/mcheck/mce.c	Wed Dec 10 13:30:10 2008 +0000
     3.3 @@ -9,6 +9,7 @@
     3.4  #include <xen/config.h>
     3.5  #include <xen/smp.h>
     3.6  #include <xen/errno.h>
     3.7 +#include <xen/console.h>
     3.8  
     3.9  #include <asm/processor.h> 
    3.10  #include <asm/system.h>
    3.11 @@ -574,3 +575,15 @@ long do_mca(XEN_GUEST_HANDLE(xen_mc_t) u
    3.12  
    3.13  	return ret;
    3.14  }
    3.15 +
    3.16 +void mc_panic(char *s)
    3.17 +{
    3.18 +    console_start_sync();
    3.19 +    printk("Fatal machine check: %s\n", s);
    3.20 +    printk("\n"
    3.21 +           "****************************************\n"
    3.22 +           "\n"
    3.23 +           "   The processor has reported a hardware error which cannot\n"
    3.24 +           "   be recovered from.  Xen will now reboot the machine.\n");
    3.25 +    panic("HARDWARE ERROR");
    3.26 +}
     4.1 --- a/xen/arch/x86/cpu/mcheck/mce.h	Wed Dec 10 13:28:58 2008 +0000
     4.2 +++ b/xen/arch/x86/cpu/mcheck/mce.h	Wed Dec 10 13:30:10 2008 +0000
     4.3 @@ -24,6 +24,7 @@ struct mc_info *x86_mcinfo_getptr(void);
     4.4  void x86_mcinfo_clear(struct mc_info *mi);
     4.5  int x86_mcinfo_add(struct mc_info *mi, void *mcinfo);
     4.6  void x86_mcinfo_dump(struct mc_info *mi);
     4.7 +void mc_panic(char *s);
     4.8  
     4.9  /* Global variables */
    4.10  extern int mce_disabled;
     5.1 --- a/xen/arch/x86/cpu/mcheck/p4.c	Wed Dec 10 13:28:58 2008 +0000
     5.2 +++ b/xen/arch/x86/cpu/mcheck/p4.c	Wed Dec 10 13:30:10 2008 +0000
     5.3 @@ -204,9 +204,9 @@ static fastcall void intel_machine_check
     5.4  	}
     5.5  
     5.6  	if (recover & 2)
     5.7 -		panic ("CPU context corrupt");
     5.8 +		mc_panic ("CPU context corrupt");
     5.9  	if (recover & 1)
    5.10 -		panic ("Unable to continue");
    5.11 +		mc_panic ("Unable to continue");
    5.12  
    5.13  	printk(KERN_EMERG "Attempting to continue.\n");
    5.14  	/* 
     6.1 --- a/xen/arch/x86/cpu/mcheck/p6.c	Wed Dec 10 13:28:58 2008 +0000
     6.2 +++ b/xen/arch/x86/cpu/mcheck/p6.c	Wed Dec 10 13:30:10 2008 +0000
     6.3 @@ -51,9 +51,9 @@ static fastcall void intel_machine_check
     6.4  	}
     6.5  
     6.6  	if (recover & 2)
     6.7 -		panic ("CPU context corrupt");
     6.8 +		mc_panic ("CPU context corrupt");
     6.9  	if (recover & 1)
    6.10 -		panic ("Unable to continue");
    6.11 +		mc_panic ("Unable to continue");
    6.12  
    6.13  	printk (KERN_EMERG "Attempting to continue.\n");
    6.14  	/*