History

Merge branch 'ras-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull RAS fixes from Thomas Gleixner: "Two fixlets for RAS: - Export memory_error() so the NFIT module can utilize it - Handle memory errors in NFIT correctly" * 'ras-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: acpi, nfit: Fix the memory error check in nfit_handle_mce() x86/MCE: Export memory_error()

Linus Torvalds committed 9 years ago

Commit de0b9d72 parents fac3fca fc08a473 files · +8 −8Browse files

Unified · Split

3 files
  1. arch/x86/include/asm/mce.h +1 −0
  2. arch/x86/kernel/cpu/mcheck/mce.c +6 −7
  3. drivers/acpi/nfit/mce.c +1 −1
arch/x86/include/asm/mce.h+1−0
@@ -266,6 +266,7 @@ static inline int umc_normaddr_to_sysaddr(u64 norm_addr, u16 nid, u8 umc, u64 *s · 265 unmodified lines
266#endif266#endif
267 267
268int mce_available(struct cpuinfo_x86 *c);268int mce_available(struct cpuinfo_x86 *c);
269bool mce_is_memory_error(struct mce *m);
269 270
270DECLARE_PER_CPU(unsigned, mce_exception_count);271DECLARE_PER_CPU(unsigned, mce_exception_count);
271DECLARE_PER_CPU(unsigned, mce_poll_count);272DECLARE_PER_CPU(unsigned, mce_poll_count);
arch/x86/kernel/cpu/mcheck/mce.c+6−7
@@ -499,16 +499,14 @@ static int mce_usable_address(struct mce *m) · 498 unmodified lines
499 return 1;499 return 1;
500}500}
501 501
502static bool memory_error(struct mce *m)502bool mce_is_memory_error(struct mce *m)
503{503{
504 struct cpuinfo_x86 *c = &boot_cpu_data;504 if (m->cpuvendor == X86_VENDOR_AMD) {
505
506 if (c->x86_vendor == X86_VENDOR_AMD) {
507 /* ErrCodeExt[20:16] */505 /* ErrCodeExt[20:16] */
508 u8 xec = (m->status >> 16) & 0x1f;506 u8 xec = (m->status >> 16) & 0x1f;
509 507
510 return (xec == 0x0 || xec == 0x8);508 return (xec == 0x0 || xec == 0x8);
511 } else if (c->x86_vendor == X86_VENDOR_INTEL) {509 } else if (m->cpuvendor == X86_VENDOR_INTEL) {
512 /*510 /*
513 * Intel SDM Volume 3B - 15.9.2 Compound Error Codes511 * Intel SDM Volume 3B - 15.9.2 Compound Error Codes
514 *512 *
@@ -529,6 +527,7 @@ static bool memory_error(struct mce *m) · 14 unmodified lines
529 527
530 return false;528 return false;
531}529}
530EXPORT_SYMBOL_GPL(mce_is_memory_error);
532 531
533static bool cec_add_mce(struct mce *m)532static bool cec_add_mce(struct mce *m)
534{533{
@@ -536,7 +535,7 @@ static bool cec_add_mce(struct mce *m) · 1 unmodified line
536 return false;535 return false;
537 536
538 /* We eat only correctable DRAM errors with usable addresses. */537 /* We eat only correctable DRAM errors with usable addresses. */
539 if (memory_error(m) &&538 if (mce_is_memory_error(m) &&
540 !(m->status & MCI_STATUS_UC) &&539 !(m->status & MCI_STATUS_UC) &&
541 mce_usable_address(m))540 mce_usable_address(m))
542 if (!cec_add_elem(m->addr >> PAGE_SHIFT))541 if (!cec_add_elem(m->addr >> PAGE_SHIFT))
@@ -713,7 +712,7 @@ bool machine_check_poll(enum mcp_flags flags, mce_banks_t *b) · 170 unmodified lines
713 712
714 severity = mce_severity(&m, mca_cfg.tolerant, NULL, false);713 severity = mce_severity(&m, mca_cfg.tolerant, NULL, false);
715 714
716 if (severity == MCE_DEFERRED_SEVERITY && memory_error(&m))715 if (severity == MCE_DEFERRED_SEVERITY && mce_is_memory_error(&m))
717 if (m.status & MCI_STATUS_ADDRV)716 if (m.status & MCI_STATUS_ADDRV)
718 m.severity = severity;717 m.severity = severity;
719 718
drivers/acpi/nfit/mce.c+1−1
@@ -26,7 +26,7 @@ static int nfit_handle_mce(struct notifier_block *nb, unsigned long val, · 25 unmodified lines
26 struct nfit_spa *nfit_spa;26 struct nfit_spa *nfit_spa;
27 27
28 /* We only care about memory errors */28 /* We only care about memory errors */
29 if (!(mce->status & MCACOD))29 if (!mce_is_memory_error(mce))
30 return NOTIFY_DONE;30 return NOTIFY_DONE;
31 31
32 /*32 /*