Skip to content

Commit 2976908

Browse files
praritsuryasaimadhu
authored andcommitted
x86/mce: Do not log spurious corrected mce errors
A user has reported that they are seeing spurious corrected errors on their hardware. Intel Errata HSD131, HSM142, HSW131, and BDM48 report that "spurious corrected errors may be logged in the IA32_MC0_STATUS register with the valid field (bit 63) set, the uncorrected error field (bit 61) not set, a Model Specific Error Code (bits [31:16]) of 0x000F, and an MCA Error Code (bits [15:0]) of 0x0005." The Errata PDFs are linked in the bugzilla below. Block these spurious errors from the console and logs. [ bp: Move the intel_filter_mce() header declarations into the already existing CONFIG_X86_MCE_INTEL ifdeffery. ] Co-developed-by: Alexander Krupp <[email protected]> Signed-off-by: Alexander Krupp <[email protected]> Signed-off-by: Prarit Bhargava <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://bugzilla.kernel.org/show_bug.cgi?id=206587 Link: https://lkml.kernel.org/r/[email protected]
1 parent 11a48a5 commit 2976908

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,6 +1877,8 @@ bool filter_mce(struct mce *m)
18771877
{
18781878
if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
18791879
return amd_filter_mce(m);
1880+
if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)
1881+
return intel_filter_mce(m);
18801882

18811883
return false;
18821884
}

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,3 +520,20 @@ void mce_intel_feature_clear(struct cpuinfo_x86 *c)
520520
{
521521
intel_clear_lmce();
522522
}
523+
524+
bool intel_filter_mce(struct mce *m)
525+
{
526+
struct cpuinfo_x86 *c = &boot_cpu_data;
527+
528+
/* MCE errata HSD131, HSM142, HSW131, BDM48, and HSM142 */
529+
if ((c->x86 == 6) &&
530+
((c->x86_model == INTEL_FAM6_HASWELL) ||
531+
(c->x86_model == INTEL_FAM6_HASWELL_L) ||
532+
(c->x86_model == INTEL_FAM6_BROADWELL) ||
533+
(c->x86_model == INTEL_FAM6_HASWELL_G)) &&
534+
(m->bank == 0) &&
535+
((m->status & 0xa0000000ffffffff) == 0x80000000000f0005))
536+
return true;
537+
538+
return false;
539+
}

arch/x86/kernel/cpu/mce/internal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ void cmci_disable_bank(int bank);
4848
void intel_init_cmci(void);
4949
void intel_init_lmce(void);
5050
void intel_clear_lmce(void);
51+
bool intel_filter_mce(struct mce *m);
5152
#else
5253
# define cmci_intel_adjust_timer mce_adjust_timer_default
5354
static inline bool mce_intel_cmci_poll(void) { return false; }
@@ -56,6 +57,7 @@ static inline void cmci_disable_bank(int bank) { }
5657
static inline void intel_init_cmci(void) { }
5758
static inline void intel_init_lmce(void) { }
5859
static inline void intel_clear_lmce(void) { }
60+
static inline bool intel_filter_mce(struct mce *m) { return false; };
5961
#endif
6062

6163
void mce_timer_kick(unsigned long interval);

0 commit comments

Comments
 (0)