Skip to contentSkip to conversation

x86/MCE/AMD, EDAC/mce_amd: Remove struct smca_hwid.xec_bitmap

PATCH Applied Yazen Ghannam 3 participants 6 messages Jul 20, 2020 – Aug 20, 2020

Subsystems (4)
lore
Share & tools
lore

Yazen Ghannam

author maintainer
#0 lore raw

PATCH 1/1 x86/MCE/AMD, EDAC/mce_amd: Remove struct smca_hwid.xec_bitmap

From: Yazen Ghannam <[email protected]>

The Extended Error Code Bitmap (xec_bitmap) for a Scalable MCA bank type was intended to be used by the kernel to filter out invalid error codes on a system. However, this is unnecessary because the hardware will only report valid error codes.

Remove the xec_bitmap field and all references to it.

---
 arch/x86/include/asm/mce.h    |  1 -
 arch/x86/kernel/cpu/mce/amd.c | 44 +++++++++++++++++------------------
 drivers/edac/mce_amd.c        |  4 +---
 3 files changed, 23 insertions(+), 26 deletions(-)
arch/x86/include/asm/mce.h +0 -1
index 734ffe78a3d6..c18e87aeeccc 100644
@@ -327,7 +327,6 @@ enum smca_bank_types {
 struct smca_hwid {
 	unsigned int bank_type;	/* Use with smca_bank_types for easy indexing. */
 	u32 hwid_mcatype;	/* (hwid,mcatype) tuple */
-	u32 xec_bitmap;		/* Bitmap of valid ExtErrorCodes; current max is 21. */
 	u8 count;		/* Number of instances. */
 };
 
arch/x86/kernel/cpu/mce/amd.c +22 -22

71 lines not on this page · raw message

drivers/edac/mce_amd.c +1 -3
index 4fd06a3dc6fe..7f28edb070bd 100644
@@ -999,10 +999,8 @@ static void decode_smca_error(struct mce *m)
 	pr_emerg(HW_ERR "%s Ext. Error Code: %d", ip_name, xec);
 
 	/* Only print the decode of valid error codes */
-	if (xec < smca_mce_descs[bank_type].num_descs &&
-			(hwid->xec_bitmap & BIT_ULL(xec))) {
+	if (xec < smca_mce_descs[bank_type].num_descs)
 		pr_cont(", %s.\n", smca_mce_descs[bank_type].descs[xec]);
-	}
 
 	if (bank_type == SMCA_UMC && xec == 0 && decode_dram_ecc)
 		decode_dram_ecc(cpu_to_node(m->extcpu), m);
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 6 lines · Yazen Ghannam

From: Yazen Ghannam <[email protected]>

The Extended Error Code Bitmap (xec_bitmap) for a Scalable MCA bank type was intended to be used by the kernel to filter out invalid error codes on a system. However, this is unnecessary because the hardware will only report valid error codes.

That's a kinda bold statement. :)

Are you saying, you wanna trust verification and that check is totally useless?

Or is there another reason for removing it?

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
author maintainer
#2 lore raw
Quoted 10 lines · Borislav Petkov
Quoted 6 lines · Yazen Ghannam

From: Yazen Ghannam <[email protected]>

The Extended Error Code Bitmap (xec_bitmap) for a Scalable MCA bank type was intended to be used by the kernel to filter out invalid error codes on a system. However, this is unnecessary because the hardware will only report valid error codes.

That's a kinda bold statement. :)

Yeah, I'm trying to keep "may" out of my vocabulary. :)

Quoted 3 lines

Are you saying, you wanna trust verification and that check is totally useless?

I do. This check was added because I wasn't sure what to expect with this new architecural extension. But after a few product releases, it has been unnecessary. And I don't see a need for it with future systems.

Thanks,
Yazen

maintainer
#3 lore raw
Quoted 1 line · Yazen Ghannam

Yeah, I'm trying to keep "may" out of my vocabulary. :)

Hahha, you never know with hardware :-)

Quoted 3 lines

I do. This check was added because I wasn't sure what to expect with this new architecural extension. But after a few product releases, it has been unnecessary. And I don't see a need for it with future systems.

Ok, will add that to the commit message.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
merge bot Applied
#4 lore raw
In reply to Yazen Ghannam
The following commit has been merged into the ras/core branch of tip:

The following commit has been merged into the ras/core branch of tip:

Commit-ID:     5f2c67bd0f8a470a12c38a8786c42c043e100014
Gitweb:        https://git.kernel.org/tip/5f2c67bd0f8a470a12c38a8786c42c043e100014
Author:        Yazen Ghannam <[email protected]>
AuthorDate:    Mon, 20 Jul 2020 14:53:53 
Committer:     Borislav Petkov <[email protected]>
CommitterDate: Tue, 18 Aug 2020 12:15:43 +02:00

x86/MCE/AMD, EDAC/mce_amd: Remove struct smca_hwid.xec_bitmap

The Extended Error Code Bitmap (xec_bitmap) for a Scalable MCA bank type was intended to be used by the kernel to filter out invalid error codes on a system. However, this is unnecessary after a few product releases because the hardware will only report valid error codes. Thus, there's no need for it with future systems.

Remove the xec_bitmap field and all references to it.

---
 arch/x86/include/asm/mce.h    |  1 +-
 arch/x86/kernel/cpu/mce/amd.c | 44 +++++++++++++++++-----------------
 drivers/edac/mce_amd.c        |  4 +---
 3 files changed, 23 insertions(+), 26 deletions(-)
arch/x86/include/asm/mce.h +0 -1
index cf50382..6adced6 100644
@@ -328,7 +328,6 @@ enum smca_bank_types {
 struct smca_hwid {
 	unsigned int bank_type;	/* Use with smca_bank_types for easy indexing. */
 	u32 hwid_mcatype;	/* (hwid,mcatype) tuple */
-	u32 xec_bitmap;		/* Bitmap of valid ExtErrorCodes; current max is 21. */
 	u8 count;		/* Number of instances. */
 };
 
arch/x86/kernel/cpu/mce/amd.c +22 -22

71 lines not on this page · raw message

drivers/edac/mce_amd.c +1 -3
index 325aedf..d4168c4 100644
@@ -990,10 +990,8 @@ static void decode_smca_error(struct mce *m)
 	pr_emerg(HW_ERR "%s Ext. Error Code: %d", ip_name, xec);
 
 	/* Only print the decode of valid error codes */
-	if (xec < smca_mce_descs[bank_type].num_descs &&
-			(hwid->xec_bitmap & BIT_ULL(xec))) {
+	if (xec < smca_mce_descs[bank_type].num_descs)
 		pr_cont(", %s.\n", smca_mce_descs[bank_type].descs[xec]);
-	}
 
 	if (bank_type == SMCA_UMC && xec == 0 && decode_dram_ecc)
 		decode_dram_ecc(cpu_to_node(m->extcpu), m);
merge bot Applied
#5 lore raw
In reply to Yazen Ghannam
The following commit has been merged into the ras/core branch of tip:

The following commit has been merged into the ras/core branch of tip:

Commit-ID:     368d1887200d68075c064a62a9aa191168cf1eed
Gitweb:        https://git.kernel.org/tip/368d1887200d68075c064a62a9aa191168cf1eed
Author:        Yazen Ghannam <[email protected]>
AuthorDate:    Mon, 20 Jul 2020 14:53:53 
Committer:     Borislav Petkov <[email protected]>
CommitterDate: Thu, 20 Aug 2020 10:34:38 +02:00

x86/MCE/AMD, EDAC/mce_amd: Remove struct smca_hwid.xec_bitmap

The Extended Error Code Bitmap (xec_bitmap) for a Scalable MCA bank type was intended to be used by the kernel to filter out invalid error codes on a system. However, this is unnecessary after a few product releases because the hardware will only report valid error codes. Thus, there's no need for it with future systems.

Remove the xec_bitmap field and all references to it.

---
 arch/x86/include/asm/mce.h    |  1 +-
 arch/x86/kernel/cpu/mce/amd.c | 44 +++++++++++++++++-----------------
 drivers/edac/mce_amd.c        |  4 +---
 3 files changed, 23 insertions(+), 26 deletions(-)
arch/x86/include/asm/mce.h +0 -1
index cf50382..6adced6 100644
@@ -328,7 +328,6 @@ enum smca_bank_types {
 struct smca_hwid {
 	unsigned int bank_type;	/* Use with smca_bank_types for easy indexing. */
 	u32 hwid_mcatype;	/* (hwid,mcatype) tuple */
-	u32 xec_bitmap;		/* Bitmap of valid ExtErrorCodes; current max is 21. */
 	u8 count;		/* Number of instances. */
 };
 
arch/x86/kernel/cpu/mce/amd.c +22 -22

71 lines not on this page · raw message

drivers/edac/mce_amd.c +1 -3
index 325aedf..d4168c4 100644
@@ -990,10 +990,8 @@ static void decode_smca_error(struct mce *m)
 	pr_emerg(HW_ERR "%s Ext. Error Code: %d", ip_name, xec);
 
 	/* Only print the decode of valid error codes */
-	if (xec < smca_mce_descs[bank_type].num_descs &&
-			(hwid->xec_bitmap & BIT_ULL(xec))) {
+	if (xec < smca_mce_descs[bank_type].num_descs)
 		pr_cont(", %s.\n", smca_mce_descs[bank_type].descs[xec]);
-	}
 
 	if (bank_type == SMCA_UMC && xec == 0 && decode_dram_ecc)
 		decode_dram_ecc(cpu_to_node(m->extcpu), m);