Newer Centaur multi-core CPU also support MCE broadcasting to all cores. But
no Centaur special code tell this truth to kernel.  

Signed-off-by: David Wang <davidw...@zhaoxin.com>
---
 arch/x86/kernel/cpu/mcheck/mce.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 42cf288..38ccab8 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1727,6 +1727,22 @@ static void __mcheck_cpu_init_early(struct cpuinfo_x86 
*c)
        }
 }
 
+void mce_centaur_feature_init(struct cpuinfo_x86 *c)
+{
+       struct mca_config *cfg = &mca_cfg;
+
+        /*
+         * All newer Centaur CPUs support MCE broadcasting. Enable
+         * synchronization with a one second timeout.
+         */
+       if (cfg->monarch_timeout < 0) {
+               if ((c->x86 == 6 && c->x86_model == 0xf &&
+                       c->x86_stepping >= 0xe) || c->x86 > 6)
+                       cfg->monarch_timeout = USEC_PER_SEC;
+       }
+}
+
+
 static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c)
 {
        switch (c->x86_vendor) {
@@ -1739,6 +1755,9 @@ static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 
*c)
                mce_amd_feature_init(c);
                break;
                }
+       case X86_VENDOR_CENTAUR:
+               mce_centaur_feature_init(c);
+               break;
 
        default:
                break;
-- 
1.9.1

Reply via email to