From: Keir Fraser Date: Wed, 10 Dec 2008 13:30:10 +0000 (+0000) Subject: x86: Make MCE panic message more obvious X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14026^2~45 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=00118705d44feea9b8c93db25d13329b942685d9;p=xen.git 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 --- diff --git a/xen/arch/x86/cpu/mcheck/amd_k8.c b/xen/arch/x86/cpu/mcheck/amd_k8.c index 55910f2c69..8a4ed48073 100644 --- a/xen/arch/x86/cpu/mcheck/amd_k8.c +++ b/xen/arch/x86/cpu/mcheck/amd_k8.c @@ -219,7 +219,7 @@ void k8_machine_check(struct cpu_user_regs *regs, long error_code) show_execution_state(regs); } x86_mcinfo_dump(mc_data); - panic("End of MCE. Use mcelog to decode above error codes.\n"); + mc_panic("End of MCE. Use mcelog to decode above error codes.\n"); } /* If Dom0 registered a machine check handler, which is only possible @@ -248,7 +248,7 @@ void k8_machine_check(struct cpu_user_regs *regs, long error_code) /* Dom0 is impacted. Since noone can't handle * this error, panic! */ x86_mcinfo_dump(mc_data); - panic("MCE occured in Dom0, which it can't handle\n"); + mc_panic("MCE occured in Dom0, which it can't handle\n"); /* UNREACHED */ } else { diff --git a/xen/arch/x86/cpu/mcheck/k7.c b/xen/arch/x86/cpu/mcheck/k7.c index 59e60a14e8..045dd433a2 100644 --- a/xen/arch/x86/cpu/mcheck/k7.c +++ b/xen/arch/x86/cpu/mcheck/k7.c @@ -57,9 +57,9 @@ static fastcall void k7_machine_check(struct cpu_user_regs * regs, long error_co } if (recover&2) - panic ("CPU context corrupt"); + mc_panic ("CPU context corrupt"); if (recover&1) - panic ("Unable to continue"); + mc_panic ("Unable to continue"); printk (KERN_EMERG "Attempting to continue.\n"); mcgstl &= ~(1<<2); wrmsr (MSR_IA32_MCG_STATUS,mcgstl, mcgsth); diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c index 6406c33ca1..d4c6f05751 100644 --- a/xen/arch/x86/cpu/mcheck/mce.c +++ b/xen/arch/x86/cpu/mcheck/mce.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -574,3 +575,15 @@ long do_mca(XEN_GUEST_HANDLE(xen_mc_t) u_xen_mc) return ret; } + +void mc_panic(char *s) +{ + console_start_sync(); + printk("Fatal machine check: %s\n", s); + printk("\n" + "****************************************\n" + "\n" + " The processor has reported a hardware error which cannot\n" + " be recovered from. Xen will now reboot the machine.\n"); + panic("HARDWARE ERROR"); +} diff --git a/xen/arch/x86/cpu/mcheck/mce.h b/xen/arch/x86/cpu/mcheck/mce.h index b021f5bb01..8a48ef5fd1 100644 --- a/xen/arch/x86/cpu/mcheck/mce.h +++ b/xen/arch/x86/cpu/mcheck/mce.h @@ -24,6 +24,7 @@ struct mc_info *x86_mcinfo_getptr(void); void x86_mcinfo_clear(struct mc_info *mi); int x86_mcinfo_add(struct mc_info *mi, void *mcinfo); void x86_mcinfo_dump(struct mc_info *mi); +void mc_panic(char *s); /* Global variables */ extern int mce_disabled; diff --git a/xen/arch/x86/cpu/mcheck/p4.c b/xen/arch/x86/cpu/mcheck/p4.c index 65daca06ef..bb758e8e37 100644 --- a/xen/arch/x86/cpu/mcheck/p4.c +++ b/xen/arch/x86/cpu/mcheck/p4.c @@ -204,9 +204,9 @@ static fastcall void intel_machine_check(struct cpu_user_regs * regs, long error } if (recover & 2) - panic ("CPU context corrupt"); + mc_panic ("CPU context corrupt"); if (recover & 1) - panic ("Unable to continue"); + mc_panic ("Unable to continue"); printk(KERN_EMERG "Attempting to continue.\n"); /* diff --git a/xen/arch/x86/cpu/mcheck/p6.c b/xen/arch/x86/cpu/mcheck/p6.c index cfa500d331..a2f631ed27 100644 --- a/xen/arch/x86/cpu/mcheck/p6.c +++ b/xen/arch/x86/cpu/mcheck/p6.c @@ -51,9 +51,9 @@ static fastcall void intel_machine_check(struct cpu_user_regs * regs, long error } if (recover & 2) - panic ("CPU context corrupt"); + mc_panic ("CPU context corrupt"); if (recover & 1) - panic ("Unable to continue"); + mc_panic ("Unable to continue"); printk (KERN_EMERG "Attempting to continue.\n"); /*