2018-03-30 09:56:07

by David Wang

[permalink] [raw]
Subject: [PATCH 0/2] MCA support on Centaur CPU

This patch set is to provide MCA support on new Centaur CPU.

The first patch is used to tell the kernel that newer Centaur CPU support
MCE broadcasting.

The second patch is used to tell the kernel that newer Centaur CPU support
CMCI.

David Wang (2):
x86/mce: new centaur CPUs support MCE broadcasting
x86/mce: add CMCI support for centaur CPUs

arch/x86/kernel/cpu/mcheck/mce.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

--
1.9.1



2018-03-30 09:56:22

by David Wang

[permalink] [raw]
Subject: [PATCH 2/2] x86/mce: add CMCI support for centaur CPUs

This patch is used to tell the kernel that centaur CPUs support CMCI
mechanism which is compatible with INTEL CMCI.

Signed-off-by: David Wang <[email protected]>
---
arch/x86/kernel/cpu/mcheck/mce.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 82b25e1..62aa85c 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1751,6 +1751,7 @@ static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c)
{
switch (c->x86_vendor) {
case X86_VENDOR_INTEL:
+ case X86_VENDOR_CENTAUR:
mce_intel_feature_init(c);
mce_adjust_timer = cmci_intel_adjust_timer;
break;
--
1.9.1


2018-03-30 09:56:32

by David Wang

[permalink] [raw]
Subject: [PATCH 1/2] x86/mce: new centaur CPUs support MCE broadcasting

This patch is used to tell the kernel that newer Centaur CPU support MCE
broadcasting.

Signed-off-by: David Wang <[email protected]>
---
arch/x86/kernel/cpu/mcheck/mce.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 7065846..82b25e1 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -1688,6 +1688,17 @@ static int __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c)
if (c->x86 == 6 && c->x86_model == 45)
quirk_no_way_out = quirk_sandybridge_ifu;
}
+
+ if (c->x86_vendor == X86_VENDOR_CENTAUR) {
+ /*
+ * All newer centaur CPUs support MCE broadcasting. Enable
+ * synchronization with a one second timeout.
+ */
+ if ((c->x86 > 6 || (c->x86 == 6 && c->x86_model == 0xf && c->x86_mask >=0xe)) &&
+ cfg->monarch_timeout < 0)
+ cfg->monarch_timeout = USEC_PER_SEC;
+ }
+
if (cfg->monarch_timeout < 0)
cfg->monarch_timeout = 0;
if (cfg->bootlog != 0)
--
1.9.1


2018-03-30 10:28:50

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH 1/2] x86/mce: new centaur CPUs support MCE broadcasting

On Fri, Mar 30, 2018 at 05:53:41PM +0800, David Wang wrote:
> This patch is used to tell the kernel that newer Centaur CPU support MCE
> broadcasting.
>
> Signed-off-by: David Wang <[email protected]>
> ---
> arch/x86/kernel/cpu/mcheck/mce.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
> index 7065846..82b25e1 100644
> --- a/arch/x86/kernel/cpu/mcheck/mce.c
> +++ b/arch/x86/kernel/cpu/mcheck/mce.c
> @@ -1688,6 +1688,17 @@ static int __mcheck_cpu_apply_quirks(struct cpuinfo_x86 *c)
> if (c->x86 == 6 && c->x86_model == 45)
> quirk_no_way_out = quirk_sandybridge_ifu;
> }
> +
> + if (c->x86_vendor == X86_VENDOR_CENTAUR) {
> + /*
> + * All newer centaur CPUs support MCE broadcasting. Enable
> + * synchronization with a one second timeout.
> + */
> + if ((c->x86 > 6 || (c->x86 == 6 && c->x86_model == 0xf && c->x86_mask >=0xe)) &&

Are some specs or manuals available somewhere on the web for those?

Thx.

--
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

2018-03-30 10:42:52

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH 0/2] MCA support on Centaur CPU


* David Wang <[email protected]> wrote:

> This patch set is to provide MCA support on new Centaur CPU.
>
> The first patch is used to tell the kernel that newer Centaur CPU support
> MCE broadcasting.
>
> The second patch is used to tell the kernel that newer Centaur CPU support
> CMCI.
>
> David Wang (2):
> x86/mce: new centaur CPUs support MCE broadcasting
> x86/mce: add CMCI support for centaur CPUs
>
> arch/x86/kernel/cpu/mcheck/mce.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)

Please capitalize 'Centaur' properly in the changelogs and in comments.

Thanks,

Ingo