mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/mce/AMD: Give a name to MCA bank 3 to use with legacy MSRs
@ 2017-03-21 13:18 Yazen Ghannam
  2017-03-29 19:06 ` Borislav Petkov
  2017-03-31  8:13 ` [tip:x86/urgent] x86/mce/AMD: Give a name to MCA bank 3 when accessed " tip-bot for Yazen Ghannam
  0 siblings, 2 replies; 3+ messages in thread
From: Yazen Ghannam @ 2017-03-21 13:18 UTC (permalink / raw)
  To: linux-edac; +Cc: Yazen Ghannam, Tony Luck, Borislav Petkov, x86, linux-kernel

From: Yazen Ghannam <yazen.ghannam@amd.com>

MCA bank 3 is reserved on systems pre-Fam17h, so it didn't have a name.
However, MCA bank 3 is defined on Fam17h systems and can be accessed using
legacy MSRs. Without a name we get a stack trace on Fam17h systems when
trying to register sysfs files for bank 3 on kernels that don't recognize
Scalable MCA.

Call MCA bank 3 "decode_unit" since this is what it represents on Fam17h.
This will allow kernels without SMCA support to see this bank on Fam17h+
and prevent the stack trace. This will not affect older systems since this
bank is reserved on them, i.e. it'll be ignored.

Tested on AMD Fam15h and Fam17h systems.

 WARNING: CPU: 26 PID: 1 at lib/kobject.c:210 kobject_add_internal+0x23e/0x340()
 kobject: (ffff88085bb256c0): attempted to be registered with empty name!
 ...
 Call Trace:
  [<ffffffff8138fc83>] dump_stack+0x63/0x90
  [<ffffffff810769b6>] warn_slowpath_common+0x86/0xc0
  [<ffffffff81076a3c>] warn_slowpath_fmt+0x4c/0x50
  [<ffffffff8139290e>] ? kobject_add_internal+0x18e/0x340
  [<ffffffff81187f82>] ? kfree_const+0x22/0x30
  [<ffffffff813929be>] kobject_add_internal+0x23e/0x340
  [<ffffffff81187f82>] ? kfree_const+0x22/0x30
  [<ffffffff81392cb8>] kobject_add+0x68/0xb0
  [<ffffffff81392d33>] kobject_create_and_add+0x33/0x70
  [<ffffffff81043c27>] threshold_create_device+0x107/0x350
  [<ffffffff81d7e7aa>] ? mcheck_vendor_init_severity+0x1a/0x1a
  [<ffffffff81d7e7df>] threshold_init_device+0x35/0x4d
  [<ffffffff81002123>] do_one_initcall+0xb3/0x1d0
  [<ffffffff81d6e0f0>] kernel_init_freeable+0x163/0x1f0
  [<ffffffff8176e0f0>] ? rest_init+0x80/0x80
  [<ffffffff8176e0fe>] kernel_init+0xe/0xe0
  [<ffffffff8177a7cf>] ret_from_fork+0x3f/0x70
  [<ffffffff8176e0f0>] ? rest_init+0x80/0x80

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Cc: <stable@vger.kernel.org> # 3.10..
---
 arch/x86/kernel/cpu/mcheck/mce_amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index d3e5be8..c82befc 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -62,7 +62,7 @@ static const char * const th_names[] = {
 	"load_store",
 	"insn_fetch",
 	"combined_unit",
-	"",
+	"decode_unit",
 	"northbridge",
 	"execution_unit",
 };
-- 
2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/mce/AMD: Give a name to MCA bank 3 to use with legacy MSRs
  2017-03-21 13:18 [PATCH] x86/mce/AMD: Give a name to MCA bank 3 to use with legacy MSRs Yazen Ghannam
@ 2017-03-29 19:06 ` Borislav Petkov
  2017-03-31  8:13 ` [tip:x86/urgent] x86/mce/AMD: Give a name to MCA bank 3 when accessed " tip-bot for Yazen Ghannam
  1 sibling, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2017-03-29 19:06 UTC (permalink / raw)
  To: Yazen Ghannam; +Cc: linux-edac, Tony Luck, x86, linux-kernel

On Tue, Mar 21, 2017 at 08:18:05AM -0500, Yazen Ghannam wrote:
> From: Yazen Ghannam <yazen.ghannam@amd.com>
> 
> MCA bank 3 is reserved on systems pre-Fam17h, so it didn't have a name.
> However, MCA bank 3 is defined on Fam17h systems and can be accessed using
> legacy MSRs. Without a name we get a stack trace on Fam17h systems when
> trying to register sysfs files for bank 3 on kernels that don't recognize
> Scalable MCA.
> 
> Call MCA bank 3 "decode_unit" since this is what it represents on Fam17h.
> This will allow kernels without SMCA support to see this bank on Fam17h+
> and prevent the stack trace. This will not affect older systems since this
> bank is reserved on them, i.e. it'll be ignored.
> 
> Tested on AMD Fam15h and Fam17h systems.
> 
>  WARNING: CPU: 26 PID: 1 at lib/kobject.c:210 kobject_add_internal+0x23e/0x340()
>  kobject: (ffff88085bb256c0): attempted to be registered with empty name!
>  ...
>  Call Trace:
>   [<ffffffff8138fc83>] dump_stack+0x63/0x90
>   [<ffffffff810769b6>] warn_slowpath_common+0x86/0xc0
>   [<ffffffff81076a3c>] warn_slowpath_fmt+0x4c/0x50
>   [<ffffffff8139290e>] ? kobject_add_internal+0x18e/0x340
>   [<ffffffff81187f82>] ? kfree_const+0x22/0x30
>   [<ffffffff813929be>] kobject_add_internal+0x23e/0x340
>   [<ffffffff81187f82>] ? kfree_const+0x22/0x30
>   [<ffffffff81392cb8>] kobject_add+0x68/0xb0
>   [<ffffffff81392d33>] kobject_create_and_add+0x33/0x70
>   [<ffffffff81043c27>] threshold_create_device+0x107/0x350
>   [<ffffffff81d7e7aa>] ? mcheck_vendor_init_severity+0x1a/0x1a
>   [<ffffffff81d7e7df>] threshold_init_device+0x35/0x4d
>   [<ffffffff81002123>] do_one_initcall+0xb3/0x1d0
>   [<ffffffff81d6e0f0>] kernel_init_freeable+0x163/0x1f0
>   [<ffffffff8176e0f0>] ? rest_init+0x80/0x80
>   [<ffffffff8176e0fe>] kernel_init+0xe/0xe0
>   [<ffffffff8177a7cf>] ret_from_fork+0x3f/0x70
>   [<ffffffff8176e0f0>] ? rest_init+0x80/0x80
> 
> Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
> Cc: <stable@vger.kernel.org> # 3.10..
> ---
>  arch/x86/kernel/cpu/mcheck/mce_amd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
> index d3e5be8..c82befc 100644
> --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
> +++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
> @@ -62,7 +62,7 @@ static const char * const th_names[] = {
>  	"load_store",
>  	"insn_fetch",
>  	"combined_unit",
> -	"",
> +	"decode_unit",
>  	"northbridge",
>  	"execution_unit",
>  };
> -- 

Applied, thanks.

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/urgent] x86/mce/AMD: Give a name to MCA bank 3 when accessed with legacy MSRs
  2017-03-21 13:18 [PATCH] x86/mce/AMD: Give a name to MCA bank 3 to use with legacy MSRs Yazen Ghannam
  2017-03-29 19:06 ` Borislav Petkov
@ 2017-03-31  8:13 ` tip-bot for Yazen Ghannam
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Yazen Ghannam @ 2017-03-31  8:13 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: hpa, linux-kernel, bp, mingo, yazen.ghannam, tglx

Commit-ID:  29f72ce3e4d18066ec75c79c857bee0618a3504b
Gitweb:     http://git.kernel.org/tip/29f72ce3e4d18066ec75c79c857bee0618a3504b
Author:     Yazen Ghannam <yazen.ghannam@amd.com>
AuthorDate: Thu, 30 Mar 2017 13:17:14 +0200
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 31 Mar 2017 10:09:44 +0200

x86/mce/AMD: Give a name to MCA bank 3 when accessed with legacy MSRs

MCA bank 3 is reserved on systems pre-Fam17h, so it didn't have a name.
However, MCA bank 3 is defined on Fam17h systems and can be accessed
using legacy MSRs. Without a name we get a stack trace on Fam17h systems
when trying to register sysfs files for bank 3 on kernels that don't
recognize Scalable MCA.

Call MCA bank 3 "decode_unit" since this is what it represents on
Fam17h. This will allow kernels without SMCA support to see this bank on
Fam17h+ and prevent the stack trace. This will not affect older systems
since this bank is reserved on them, i.e. it'll be ignored.

Tested on AMD Fam15h and Fam17h systems.

  WARNING: CPU: 26 PID: 1 at lib/kobject.c:210 kobject_add_internal
  kobject: (ffff88085bb256c0): attempted to be registered with empty name!
  ...
  Call Trace:
   kobject_add_internal
   kobject_add
   kobject_create_and_add
   threshold_create_device
   threshold_init_device

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: http://lkml.kernel.org/r/1490102285-3659-1-git-send-email-Yazen.Ghannam@amd.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

---
 arch/x86/kernel/cpu/mcheck/mce_amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index 524cc57..6e4a047 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -60,7 +60,7 @@ static const char * const th_names[] = {
 	"load_store",
 	"insn_fetch",
 	"combined_unit",
-	"",
+	"decode_unit",
 	"northbridge",
 	"execution_unit",
 };

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-31  8:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-21 13:18 [PATCH] x86/mce/AMD: Give a name to MCA bank 3 to use with legacy MSRs Yazen Ghannam
2017-03-29 19:06 ` Borislav Petkov
2017-03-31  8:13 ` [tip:x86/urgent] x86/mce/AMD: Give a name to MCA bank 3 when accessed " tip-bot for Yazen Ghannam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome