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
266266 #endif
267267
268268 int mce_available(struct cpuinfo_x86 *c);
269+bool mce_is_memory_error(struct mce *m);
269270
270271 DECLARE_PER_CPU(unsigned, mce_exception_count);
271272 DECLARE_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
499499 return 1;
500500 }
501501
502−static bool memory_error(struct mce *m)
502+bool mce_is_memory_error(struct mce *m)
503503 {
504− struct cpuinfo_x86 *c = &boot_cpu_data;
505−
506− if (c->x86_vendor == X86_VENDOR_AMD) {
504+ if (m->cpuvendor == X86_VENDOR_AMD) {
507505 /* ErrCodeExt[20:16] */
508506 u8 xec = (m->status >> 16) & 0x1f;
509507
510508 return (xec == 0x0 || xec == 0x8);
511− } else if (c->x86_vendor == X86_VENDOR_INTEL) {
509+ } else if (m->cpuvendor == X86_VENDOR_INTEL) {
512510 /*
513511 * Intel SDM Volume 3B - 15.9.2 Compound Error Codes
514512 *
@@ -529,6 +527,7 @@ static bool memory_error(struct mce *m) · 14 unmodified lines
529527
530528 return false;
531529 }
530+EXPORT_SYMBOL_GPL(mce_is_memory_error);
532531
533532 static bool cec_add_mce(struct mce *m)
534533 {
@@ -536,7 +535,7 @@ static bool cec_add_mce(struct mce *m) · 1 unmodified line
536535 return false;
537536
538537 /* We eat only correctable DRAM errors with usable addresses. */
539− if (memory_error(m) &&
538+ if (mce_is_memory_error(m) &&
540539 !(m->status & MCI_STATUS_UC) &&
541540 mce_usable_address(m))
542541 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
713712
714713 severity = mce_severity(&m, mca_cfg.tolerant, NULL, false);
715714
716− if (severity == MCE_DEFERRED_SEVERITY && memory_error(&m))
715+ if (severity == MCE_DEFERRED_SEVERITY && mce_is_memory_error(&m))
717716 if (m.status & MCI_STATUS_ADDRV)
718717 m.severity = severity;
719718
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
2626 struct nfit_spa *nfit_spa;
2727
2828 /* We only care about memory errors */
29− if (!(mce->status & MCACOD))
29+ if (!mce_is_memory_error(mce))
3030 return NOTIFY_DONE;
3131
3232 /*