WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Dump mce log by ERST when mc panic

To: Keir Fraser <keir.xen@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Dump mce log by ERST when mc panic
From: "Liu, Jinsong" <jinsong.liu@xxxxxxxxx>
Date: Fri, 22 Jul 2011 15:10:45 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Delivery-date: Fri, 22 Jul 2011 00:12:33 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcxIPnnNRLH/8Ei9SfqIMQwnVI4QuQ==
Thread-topic: [PATCH] Dump mce log by ERST when mc panic
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 ca2f58c2dfea xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c     Mon Jul 18 21:40:28 2011 +0800
+++ b/xen/arch/x86/cpu/mcheck/mce.c     Fri Jul 22 17:02:02 2011 +0800
@@ -919,6 +919,28 @@ void *x86_mcinfo_add(struct mc_info *mi,
     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 @@ void x86_mcinfo_dump(struct mc_info *mi)
             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 ca2f58c2dfea xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h     Mon Jul 18 21:40:28 2011 +0800
+++ b/xen/arch/x86/cpu/mcheck/mce.h     Fri Jul 22 17:02:02 2011 +0800
@@ -210,4 +210,6 @@ struct mce {
     __u64 mcgcap;   /* MCGCAP MSR: machine check capabilities of CPU */
 };
 
+extern int apei_write_mce(struct mce *m);
+
 #endif /* _MCE_H */
diff -r ca2f58c2dfea xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c       Mon Jul 18 21:40:28 2011 +0800
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c       Fri Jul 22 17:02:02 2011 +0800
@@ -283,6 +283,7 @@ static int mce_delayed_action(mctelem_co
     {
     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;

Attachment: mce_erst_2.patch
Description: mce_erst_2.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Dump mce log by ERST when mc panic, Liu, Jinsong <=