x86: Make MCE panic message more obvious
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 10 Dec 2008 13:30:10 +0000 (13:30 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 10 Dec 2008 13:30:10 +0000 (13:30 +0000)
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>
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

index 55910f2c69f32979cefcf768f49f3eddbfd6e4ae..8a4ed480739420c75f0fc6c49298123cbb19f4c7 100644 (file)
@@ -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 {
index 59e60a14e853ec0ffce3f14a5188ea00dd2a650b..045dd433a2a9409235222d0135de18135e27cf2c 100644 (file)
@@ -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);
index 6406c33ca1c42faddd39157eec4942d5c2692b83..d4c6f057513b1fee487f5c37e9d9fc87b8e2d844 100644 (file)
@@ -9,6 +9,7 @@
 #include <xen/config.h>
 #include <xen/smp.h>
 #include <xen/errno.h>
+#include <xen/console.h>
 
 #include <asm/processor.h> 
 #include <asm/system.h>
@@ -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");
+}
index b021f5bb010a80fb931c791d3e9cd81e016bee76..8a48ef5fd1cf90588f6690ace285609dc02f40de 100644 (file)
@@ -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;
index 65daca06ef7a85174d5b6b04b4cc63c350a872a5..bb758e8e378d102964a9a1eb1837daa81c818aa0 100644 (file)
@@ -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");
        /* 
index cfa500d3311343f4bf18fc2d6a87b7e3d9731a85..a2f631ed27eab471e72d215453a9fc6728b9a07c 100644 (file)
@@ -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");
        /*