[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86, mce: Dump mce log by ERST when mc panic



# HG changeset patch
# User Liu, Jinsong <jinsong.liu@xxxxxxxxx>
# Date 1311407818 -3600
# Node ID 3d18ff6589e33646a43d059106bb53264ce251ca
# Parent  31683aa4bfb38376cf98e0e45b4f34f80c1c21be
x86, mce: Dump mce log by ERST when mc panic

We have implemented basic ERST logic before. Now linux3.0 as dom0 has
included APEI logic. Hence it's time to add mce apei interface and
enable APEI ERST feature.
With it, it can save mce log by ERST method when mc panic.

Signed-off-by: Liu, Jinsong <jinsong.liu@xxxxxxxxx>
---


diff -r 31683aa4bfb3 -r 3d18ff6589e3 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c     Sat Jul 23 08:55:59 2011 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.c     Sat Jul 23 08:56:58 2011 +0100
@@ -919,6 +919,28 @@
     return buf;
 }
 
+static void x86_mcinfo_apei_save(
+    struct mcinfo_global *mc_global, struct mcinfo_bank *mc_bank)
+{
+    struct mce m;
+
+    memset(&m, 0, sizeof(struct mce));
+
+    m.cpu = mc_global->mc_coreid;
+    m.cpuvendor = boot_cpu_data.x86_vendor;
+    m.cpuid = cpuid_eax(1);
+    m.socketid = mc_global->mc_socketid;
+    m.apicid = mc_global->mc_apicid;
+
+    m.mcgstatus = mc_global->mc_gstatus;
+    m.status = mc_bank->mc_status;
+    m.misc = mc_bank->mc_misc;
+    m.addr = mc_bank->mc_addr;
+    m.bank = mc_bank->mc_bank;
+
+    apei_write_mce(&m);
+}
+
 /* Dump machine check information in a format,
  * mcelog can parse. This is used only when
  * Dom0 does not take the notification. */
@@ -962,8 +984,11 @@
             printk("[%16"PRIx64"]", mc_bank->mc_misc);
         if (mc_bank->mc_status & MCi_STATUS_ADDRV)
             printk(" at %16"PRIx64, mc_bank->mc_addr);
+        printk("\n");
 
-        printk("\n");
+        if (is_mc_panic)
+            x86_mcinfo_apei_save(mc_global, mc_bank);
+
     next:
         mic = x86_mcinfo_next(mic); /* next entry */
         if ((mic == NULL) || (mic->size == 0))
diff -r 31683aa4bfb3 -r 3d18ff6589e3 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h     Sat Jul 23 08:55:59 2011 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.h     Sat Jul 23 08:56:58 2011 +0100
@@ -210,4 +210,6 @@
     __u64 mcgcap;   /* MCGCAP MSR: machine check capabilities of CPU */
 };
 
+extern int apei_write_mce(struct mce *m);
+
 #endif /* _MCE_H */
diff -r 31683aa4bfb3 -r 3d18ff6589e3 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c       Sat Jul 23 08:55:59 2011 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c       Sat Jul 23 08:56:58 2011 +0100
@@ -283,6 +283,7 @@
     {
     case MCER_RESET:
         dprintk(XENLOG_ERR, "MCE delayed action failed\n");
+        is_mc_panic = 1;
         x86_mcinfo_dump(mctelem_dataptr(mctc));
         panic("MCE: Software recovery failed for the UCR\n");
         break;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.