Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <bp@suse.de>
Tested-by: Tony Luck <tony.luck@intel.com>
Link: https://lkml.kernel.org/r/20200407163414.18058-2-bp@alien8.de

+9 -37
+2 -1
arch/x86/include/asm/mce.h
··· 127 127 #define MSR_AMD64_SMCA_MCx_DEADDR(x) (MSR_AMD64_SMCA_MC0_DEADDR + 0x10*(x)) 128 128 #define MSR_AMD64_SMCA_MCx_MISCy(x, y) ((MSR_AMD64_SMCA_MC0_MISC1 + y) + (0x10*(x))) 129 129 130 + #define XEC(x, mask) (((x) >> 16) & mask) 131 + 130 132 /* 131 133 * This structure contains all data related to the MCE log. Also 132 134 * carries a signature to make it easier to find from external ··· 349 347 #endif 350 348 351 349 static inline void mce_hygon_feature_init(struct cpuinfo_x86 *c) { return mce_amd_feature_init(c); } 352 - 353 350 #endif /* _ASM_X86_MCE_H */
+7 -2
arch/x86/kernel/cpu/mce/amd.c
··· 577 577 { 578 578 enum smca_bank_types bank_type = smca_get_bank_type(m->bank); 579 579 struct cpuinfo_x86 *c = &boot_cpu_data; 580 - u8 xec = (m->status >> 16) & 0x3F; 581 580 582 581 /* See Family 17h Models 10h-2Fh Erratum #1114. */ 583 582 if (c->x86 == 0x17 && 584 583 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) 586 585 return true; 586 + 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 + } 587 592 588 593 return false; 589 594 }
-8
drivers/edac/amd64_edac.c
··· 4 4 5 5 static struct edac_pci_ctl_info *pci_ctl; 6 6 7 - static int report_gart_errors; 8 - module_param(report_gart_errors, int, 0644); 9 - 10 7 /* 11 8 * Set by command line parameter. If BIOS has enabled the ECC, this override is 12 9 * cleared to prevent re-enabling the hardware by this driver. ··· 3678 3681 } 3679 3682 3680 3683 /* register stuff with EDAC MCE */ 3681 - if (report_gart_errors) 3682 - amd_report_gart_errors(true); 3683 - 3684 3684 if (boot_cpu_data.x86 >= 0x17) 3685 3685 amd_register_ecc_decoder(decode_umc_error); 3686 3686 else ··· 3712 3718 edac_pci_release_generic_ctl(pci_ctl); 3713 3719 3714 3720 /* unregister from EDAC MCE */ 3715 - amd_report_gart_errors(false); 3716 - 3717 3721 if (boot_cpu_data.x86 >= 0x17) 3718 3722 amd_unregister_ecc_decoder(decode_umc_error); 3719 3723 else
-24
drivers/edac/mce_amd.c
··· 10 10 11 11 static u8 xec_mask = 0xf; 12 12 13 - static bool report_gart_errors; 14 13 static void (*decode_dram_ecc)(int node_id, struct mce *m); 15 - 16 - void amd_report_gart_errors(bool v) 17 - { 18 - report_gart_errors = v; 19 - } 20 - EXPORT_SYMBOL_GPL(amd_report_gart_errors); 21 14 22 15 void amd_register_ecc_decoder(void (*f)(int, struct mce *)) 23 16 { ··· 1023 1030 pr_cont("\n"); 1024 1031 } 1025 1032 1026 - /* 1027 - * Filter out unwanted MCE signatures here. 1028 - */ 1029 - static bool ignore_mce(struct mce *m) 1030 - { 1031 - /* 1032 - * NB GART TLB error reporting is disabled by default. 1033 - */ 1034 - if (m->bank == 4 && XEC(m->status, 0x1f) == 0x5 && !report_gart_errors) 1035 - return true; 1036 - 1037 - return false; 1038 - } 1039 - 1040 1033 static const char *decode_error_status(struct mce *m) 1041 1034 { 1042 1035 if (m->status & MCI_STATUS_UC) { ··· 1045 1066 struct mce *m = (struct mce *)data; 1046 1067 unsigned int fam = x86_family(m->cpuid); 1047 1068 int ecc; 1048 - 1049 - if (ignore_mce(m)) 1050 - return NOTIFY_STOP; 1051 1069 1052 1070 pr_emerg(HW_ERR "%s\n", decode_error_status(m)); 1053 1071
-2
drivers/edac/mce_amd.h
··· 7 7 #include <asm/mce.h> 8 8 9 9 #define EC(x) ((x) & 0xffff) 10 - #define XEC(x, mask) (((x) >> 16) & mask) 11 10 12 11 #define LOW_SYNDROME(x) (((x) >> 15) & 0xff) 13 12 #define HIGH_SYNDROME(x) (((x) >> 24) & 0xff) ··· 76 77 bool (*mc2_mce)(u16, u8); 77 78 }; 78 79 79 - void amd_report_gart_errors(bool); 80 80 void amd_register_ecc_decoder(void (*f)(int, struct mce *)); 81 81 void amd_unregister_ecc_decoder(void (*f)(int, struct mce *)); 82 82