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

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()

+8 -8
+1
arch/x86/include/asm/mce.h
··· 266 266 #endif 267 267 268 268 int mce_available(struct cpuinfo_x86 *c); 269 + bool mce_is_memory_error(struct mce *m); 269 270 270 271 DECLARE_PER_CPU(unsigned, mce_exception_count); 271 272 DECLARE_PER_CPU(unsigned, mce_poll_count);
+6 -7
arch/x86/kernel/cpu/mcheck/mce.c
··· 499 499 return 1; 500 500 } 501 501 502 - static bool memory_error(struct mce *m) 502 + bool mce_is_memory_error(struct mce *m) 503 503 { 504 - struct cpuinfo_x86 *c = &boot_cpu_data; 505 - 506 - if (c->x86_vendor == X86_VENDOR_AMD) { 504 + if (m->cpuvendor == X86_VENDOR_AMD) { 507 505 /* ErrCodeExt[20:16] */ 508 506 u8 xec = (m->status >> 16) & 0x1f; 509 507 510 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 511 * Intel SDM Volume 3B - 15.9.2 Compound Error Codes 514 512 * ··· 527 529 528 530 return false; 529 531 } 532 + EXPORT_SYMBOL_GPL(mce_is_memory_error); 530 533 531 534 static bool cec_add_mce(struct mce *m) 532 535 { ··· 535 536 return false; 536 537 537 538 /* We eat only correctable DRAM errors with usable addresses. */ 538 - if (memory_error(m) && 539 + if (mce_is_memory_error(m) && 539 540 !(m->status & MCI_STATUS_UC) && 540 541 mce_usable_address(m)) 541 542 if (!cec_add_elem(m->addr >> PAGE_SHIFT)) ··· 712 713 713 714 severity = mce_severity(&m, mca_cfg.tolerant, NULL, false); 714 715 715 - if (severity == MCE_DEFERRED_SEVERITY && memory_error(&m)) 716 + if (severity == MCE_DEFERRED_SEVERITY && mce_is_memory_error(&m)) 716 717 if (m.status & MCI_STATUS_ADDRV) 717 718 m.severity = severity; 718 719
+1 -1
drivers/acpi/nfit/mce.c
··· 26 26 struct nfit_spa *nfit_spa; 27 27 28 28 /* We only care about memory errors */ 29 - if (!(mce->status & MCACOD)) 29 + if (!mce_is_memory_error(mce)) 30 30 return NOTIFY_DONE; 31 31 32 32 /*