Skip to contentSkip to conversation

x86/MCE/AMD, EDAC: Handle reserved bank 4 on Fam17h properly

tip:ras/core tip-bot for Yazen Ghannam 1 participant 1 message Sep 13, 2016 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

tip-bot for Yazen Ghannam

author merge bot
#2 lore raw
Commit-ID:  a884675b873a0185d2626d1f304987c94cef6d74
Gitweb:     http://git.kernel.org/tip/a884675b873a0185d2626d1f304987c94cef6d74
Author:     Yazen Ghannam <[email protected]>
AuthorDate: Mon, 12 Sep 2016 09:59:40 +0200
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Tue, 13 Sep 2016 15:23:14 +0200

x86/MCE/AMD, EDAC: Handle reserved bank 4 on Fam17h properly

Bank 4 is reserved on family 0x17 and shouldn't generate any MCE records. However, broken hardware and software is not something unheard of so warn about bank 4 errors. They shouldn't be coming from bank 4 naturally but users can still use mce_amd_inj to simulate errors from it for testing purposed.

Also, avoid special handling in the injector mce_amd_inj like it is being done on the older families.

[ bp: Rewrite commit message and merge into one patch. Use boot_cpu_data. ]

---
 arch/x86/ras/mce_amd_inj.c | 4 +++-
 drivers/edac/mce_amd.c     | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)
arch/x86/ras/mce_amd_inj.c +3 -1
index ff8eb1a..f4b442c 100644
@@ -308,7 +308,9 @@ static void do_inject(void)
 	 * only on the node base core. Refer to D18F3x44[NbMcaToMstCpuEn] for
 	 * Fam10h and later BKDGs.
 	 */
-	if (static_cpu_has(X86_FEATURE_AMD_DCM) && b == 4) {
+	if (static_cpu_has(X86_FEATURE_AMD_DCM) &&
+	    b == 4 &&
+	    boot_cpu_data.x86 < 0x17) {
 		toggle_nb_mca_mst_cpu(amd_get_nb_id(cpu));
 		cpu = get_nbc_for_node(amd_get_nb_id(cpu));
 	}
drivers/edac/mce_amd.c +3 -0
index e8855a4..daaac2c 100644
@@ -859,6 +859,9 @@ static void decode_smca_errors(struct mce *m)
 	if (m->bank >= ARRAY_SIZE(smca_banks))
 		return;
 
+	if (boot_cpu_data.x86 >= 0x17 && m->bank == 4)
+		pr_emerg(HW_ERR "Bank 4 is reserved on Fam17h.\n");
+
 	type = smca_banks[m->bank].type;
 	if (!type)
 		return;