Skip to content

Commit 3e0fdec

Browse files
committed
x86/mce/amd, edac: Remove report_gart_errors
... because no one should be interested in spurious MCEs anyway. Make the filtering unconditional and move it to amd_filter_mce(). Signed-off-by: Borislav Petkov <[email protected]> Tested-by: Tony Luck <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent a037f3c commit 3e0fdec

File tree

5 files changed

+9
-37
lines changed

5 files changed

+9
-37
lines changed

arch/x86/include/asm/mce.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@
127127
#define MSR_AMD64_SMCA_MCx_DEADDR(x) (MSR_AMD64_SMCA_MC0_DEADDR + 0x10*(x))
128128
#define MSR_AMD64_SMCA_MCx_MISCy(x, y) ((MSR_AMD64_SMCA_MC0_MISC1 + y) + (0x10*(x)))
129129

130+
#define XEC(x, mask) (((x) >> 16) & mask)
131+
130132
/*
131133
* This structure contains all data related to the MCE log. Also
132134
* carries a signature to make it easier to find from external
@@ -347,5 +349,4 @@ umc_normaddr_to_sysaddr(u64 norm_addr, u16 nid, u8 umc, u64 *sys_addr) { return
347349
#endif
348350

349351
static inline void mce_hygon_feature_init(struct cpuinfo_x86 *c) { return mce_amd_feature_init(c); }
350-
351352
#endif /* _ASM_X86_MCE_H */

arch/x86/kernel/cpu/mce/amd.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -577,14 +577,19 @@ bool amd_filter_mce(struct mce *m)
577577
{
578578
enum smca_bank_types bank_type = smca_get_bank_type(m->bank);
579579
struct cpuinfo_x86 *c = &boot_cpu_data;
580-
u8 xec = (m->status >> 16) & 0x3F;
581580

582581
/* See Family 17h Models 10h-2Fh Erratum #1114. */
583582
if (c->x86 == 0x17 &&
584583
c->x86_model >= 0x10 && c->x86_model <= 0x2F &&
585-
bank_type == SMCA_IF && xec == 10)
584+
bank_type == SMCA_IF && XEC(m->status, 0x3f) == 10)
586585
return true;
587586

587+
/* NB GART TLB error reporting is disabled by default. */
588+
if (c->x86 < 0x17) {
589+
if (m->bank == 4 && XEC(m->status, 0x1f) == 0x5)
590+
return true;
591+
}
592+
588593
return false;
589594
}
590595

drivers/edac/amd64_edac.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44

55
static struct edac_pci_ctl_info *pci_ctl;
66

7-
static int report_gart_errors;
8-
module_param(report_gart_errors, int, 0644);
9-
107
/*
118
* Set by command line parameter. If BIOS has enabled the ECC, this override is
129
* cleared to prevent re-enabling the hardware by this driver.
@@ -3681,9 +3678,6 @@ static int __init amd64_edac_init(void)
36813678
}
36823679

36833680
/* register stuff with EDAC MCE */
3684-
if (report_gart_errors)
3685-
amd_report_gart_errors(true);
3686-
36873681
if (boot_cpu_data.x86 >= 0x17)
36883682
amd_register_ecc_decoder(decode_umc_error);
36893683
else
@@ -3718,8 +3712,6 @@ static void __exit amd64_edac_exit(void)
37183712
edac_pci_release_generic_ctl(pci_ctl);
37193713

37203714
/* unregister from EDAC MCE */
3721-
amd_report_gart_errors(false);
3722-
37233715
if (boot_cpu_data.x86 >= 0x17)
37243716
amd_unregister_ecc_decoder(decode_umc_error);
37253717
else

drivers/edac/mce_amd.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,8 @@ static struct amd_decoder_ops fam_ops;
1010

1111
static u8 xec_mask = 0xf;
1212

13-
static bool report_gart_errors;
1413
static void (*decode_dram_ecc)(int node_id, struct mce *m);
1514

16-
void amd_report_gart_errors(bool v)
17-
{
18-
report_gart_errors = v;
19-
}
20-
EXPORT_SYMBOL_GPL(amd_report_gart_errors);
21-
2215
void amd_register_ecc_decoder(void (*f)(int, struct mce *))
2316
{
2417
decode_dram_ecc = f;
@@ -1030,20 +1023,6 @@ static inline void amd_decode_err_code(u16 ec)
10301023
pr_cont("\n");
10311024
}
10321025

1033-
/*
1034-
* Filter out unwanted MCE signatures here.
1035-
*/
1036-
static bool ignore_mce(struct mce *m)
1037-
{
1038-
/*
1039-
* NB GART TLB error reporting is disabled by default.
1040-
*/
1041-
if (m->bank == 4 && XEC(m->status, 0x1f) == 0x5 && !report_gart_errors)
1042-
return true;
1043-
1044-
return false;
1045-
}
1046-
10471026
static const char *decode_error_status(struct mce *m)
10481027
{
10491028
if (m->status & MCI_STATUS_UC) {
@@ -1067,9 +1046,6 @@ amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data)
10671046
unsigned int fam = x86_family(m->cpuid);
10681047
int ecc;
10691048

1070-
if (ignore_mce(m))
1071-
return NOTIFY_STOP;
1072-
10731049
pr_emerg(HW_ERR "%s\n", decode_error_status(m));
10741050

10751051
pr_emerg(HW_ERR "CPU:%d (%x:%x:%x) MC%d_STATUS[%s|%s|%s|%s|%s",

drivers/edac/mce_amd.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include <asm/mce.h>
88

99
#define EC(x) ((x) & 0xffff)
10-
#define XEC(x, mask) (((x) >> 16) & mask)
1110

1211
#define LOW_SYNDROME(x) (((x) >> 15) & 0xff)
1312
#define HIGH_SYNDROME(x) (((x) >> 24) & 0xff)
@@ -77,7 +76,6 @@ struct amd_decoder_ops {
7776
bool (*mc2_mce)(u16, u8);
7877
};
7978

80-
void amd_report_gart_errors(bool);
8179
void amd_register_ecc_decoder(void (*f)(int, struct mce *));
8280
void amd_unregister_ecc_decoder(void (*f)(int, struct mce *));
8381

0 commit comments

Comments
 (0)