Skip to contentSkip to conversation

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

PATCH New Borislav Petkov 2 participants 2 messages Mar 30, 2017 – Mar 31, 2017 x86

lore
Share & tools
lore

Borislav Petkov

author maintainer
#0 lore raw

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

From: Yazen Ghannam <[email protected]>

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:
   dump_stack
   warn_slowpath_common
   warn_slowpath_fmt
   ? kobject_add_internal
   ? kfree_const
   kobject_add_internal
   ? kfree_const
   kobject_add
   kobject_create_and_add
   threshold_create_device
   ? mcheck_vendor_init_severity
   threshold_init_device
   do_one_initcall
   kernel_init_freeable
   ? rest_init
   kernel_init
   ret_from_fork
   ? rest_init

---

To tip/ras/urgent pls.

 arch/x86/kernel/cpu/mcheck/mce_amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/mcheck/mce_amd.c +1 -1
index 524cc5780a77..6e4a047e4b68 100644
@@ -60,7 +60,7 @@ static const char * const th_names[] = {
 	"load_store",
 	"insn_fetch",
 	"combined_unit",
-	"",
+	"decode_unit",
 	"northbridge",
 	"execution_unit",
 };
Signature · 8 lines
2.11.0


-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.
#1 lore raw
x86/mce/AMD: Give a name to MCA bank 3 when accessed with legacy MSRs
Commit-ID:  7cc5ad0d4aec505bee7f49696867668aa3889195
Gitweb:     http://git.kernel.org/tip/7cc5ad0d4aec505bee7f49696867668aa3889195
Author:     Yazen Ghannam <[email protected]>
AuthorDate: Thu, 30 Mar 2017 13:17:14 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 31 Mar 2017 08:10:09 +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:

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

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.

---
 arch/x86/kernel/cpu/mcheck/mce_amd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/mcheck/mce_amd.c +1 -1
index 524cc57..6e4a047 100644
@@ -60,7 +60,7 @@ static const char * const th_names[] = {
 	"load_store",
 	"insn_fetch",
 	"combined_unit",
-	"",
+	"decode_unit",
 	"northbridge",
 	"execution_unit",
 };