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 1] MCA bank extension

To: Keir Fraser <keir.xen@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 1] MCA bank extension
From: "Liu, Jinsong" <jinsong.liu@xxxxxxxxx>
Date: Sun, 8 May 2011 04:24:16 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>, "Li, Xin" <xin.li@xxxxxxxxx>
Delivery-date: Sat, 07 May 2011 13:25:57 -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: AcwM9LyfQhvataQrSLCjZce5pHiheg==
Thread-topic: [PATCH 1] MCA bank extension
MCA bank extension

Current mca_summay use uint32_t as bitmask of bank uc/pcc/recoverable.
It's not extensible, support no more than 32 mca banks, 
while according to Intel SDM, bank number could be as much as 256.

This patch use bool_t flag since it only need to record and indicate the most 
severity case.

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

diff -r eb4505f8dd97 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c     Wed Apr 20 12:02:51 2011 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.c     Wed Apr 27 15:29:31 2011 +0800
@@ -246,7 +246,8 @@ mctelem_cookie_t mcheck_mca_logout(enum 
     uint64_t gstatus, status;
     struct mcinfo_global *mig = NULL; /* on stack */
     mctelem_cookie_t mctc = NULL;
-    uint32_t uc = 0, pcc = 0, recover, need_clear = 1, mc_flags = 0;
+    bool_t uc = 0, pcc = 0, recover = 1, need_clear = 1;
+    uint32_t mc_flags = 0;
     struct mc_info *mci = NULL;
     mctelem_class_t which = MC_URGENT; /* XXXgcc */
     int errcnt = 0;
@@ -280,7 +281,7 @@ mctelem_cookie_t mcheck_mca_logout(enum 
      */
     recover = (mc_recoverable_scan)? 1: 0;
 
-    for (i = 0; i < 32 && i < nr_mce_banks; i++) {
+    for (i = 0; i < nr_mce_banks; i++) {
         struct mcinfo_bank *mib;  /* on stack */
 
         /* Skip bank if corresponding bit in bankmask is clear */
@@ -324,13 +325,13 @@ mctelem_cookie_t mcheck_mca_logout(enum 
             }
         }
 
-        /* form a mask of which banks have logged uncorrected errors */
-        if ((status & MCi_STATUS_UC) != 0)
-            uc |= (1 << i);
+        /* flag for uncorrected errors */
+        if (!uc && ((status & MCi_STATUS_UC) != 0))
+            uc = 1;
 
-        /* likewise for those with processor context corrupt */
-        if ((status & MCi_STATUS_PCC) != 0)
-            pcc |= (1 << i);
+        /* flag processor context corrupt */
+        if (!pcc && ((status & MCi_STATUS_PCC) != 0))
+            pcc = 1;
 
         if (recover && uc)
             /* uc = 1, recover = 1, we need not panic.
diff -r eb4505f8dd97 xen/arch/x86/cpu/mcheck/mce.h
--- a/xen/arch/x86/cpu/mcheck/mce.h     Wed Apr 20 12:02:51 2011 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce.h     Wed Apr 27 15:29:31 2011 +0800
@@ -119,10 +119,9 @@ struct mca_summary {
        uint32_t        errcnt; /* number of banks with valid errors */
        int             ripv;   /* meaningful on #MC */
        int             eipv;   /* meaningful on #MC */
-       uint32_t        uc;     /* bitmask of banks with UC */
-       uint32_t        pcc;    /* bitmask of banks with PCC */
-       /* bitmask of banks with software error recovery ability*/
-       uint32_t        recoverable; 
+       bool_t          uc;     /* UC flag */
+       bool_t          pcc;    /* PCC flag */
+       bool_t          recoverable; /* software error recoverable flag */
 };
 
 DECLARE_PER_CPU(struct mca_banks *, poll_bankmask);

Attachment: mca-cleanup-1.patch
Description: mca-cleanup-1.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 1] MCA bank extension, Liu, Jinsong <=