[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1524652420-17330-2-git-send-email-davidwang@zhaoxin.com>
Date: Wed, 25 Apr 2018 18:33:39 +0800
From: David Wang <davidwang@...oxin.com>
To: <bp@...en8.de>, <tony.luck@...el.com>, <tglx@...utronix.de>,
<mingo@...hat.com>, <hpa@...or.com>, <gregkh@...uxfoundation.org>,
<x86@...nel.org>, <linux-kernel@...r.kernel.org>,
<linux-edac@...r.kernel.org>
CC: <brucechang@...-alliance.com>, <cooperyan@...oxin.com>,
<qiyuanwang@...oxin.com>, <benjaminpan@...tech.com>,
<lukelin@...cpu.com>, <timguo@...oxin.com>,
David Wang <davidwang@...oxin.com>
Subject: [PATCH v3 1/2] x86/mce: new Centaur CPU support MCE broadcasting
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 <davidwang@...oxin.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
Powered by blists - more mailing lists