aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 17:20:10 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-10 17:20:10 -0500
commitc9f861c77269bc9950c16c6404a9476062241671 (patch)
tree5f1fd6cf839eab1fa11b4fd03b5db1e65e2a0cd5
parenta023748d53c10850650fe86b1c4a7d421d576451 (diff)
parentc7c9b3929b6a57ad47ab4021c77e46f7ff21c007 (diff)
Merge branch 'x86-ras-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 RAS update from Ingo Molnar: "The biggest change in this cycle is better support for UCNA (UnCorrected No Action) events: "Handle all uncorrected error reports in the same way (soft offline the page). We used to only do that for SRAO (software recoverable action optional) machine checks, but it makes sense to also do it for UCNA (UnCorrected No Action) logs found by CMCI or polling." plus various x86 MCE handling updates and fixes" * 'x86-ras-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mce: Spell "panicked" correctly x86, mce: Support memory error recovery for both UCNA and Deferred error in machine_check_poll x86, mce, severity: Extend the the mce_severity mechanism to handle UCNA/DEFERRED error x86, MCE, AMD: Assign interrupt handler only when bank supports it x86, MCE, AMD: Drop software-defined bank in error thresholding x86, MCE, AMD: Move invariant code out from loop body x86, MCE, AMD: Correct thresholding error logging x86, MCE, AMD: Use macros to compute bank MSRs RAS, HWPOISON: Fix wrong error recovery status GHES: Make ghes_estatus_caches static APEI, GHES: Cleanup unnecessary function for lockless list
-rw-r--r--arch/x86/include/asm/mce.h5
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce-internal.h4
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce-severity.c23
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c72
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_amd.c54
-rw-r--r--drivers/acpi/apei/ghes.c20
-rw-r--r--drivers/edac/mce_amd.h3
-rw-r--r--mm/memory-failure.c2
8 files changed, 116 insertions, 67 deletions
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index 958b90f761e5..51b26e895933 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -34,6 +34,10 @@
34#define MCI_STATUS_S (1ULL<<56) /* Signaled machine check */ 34#define MCI_STATUS_S (1ULL<<56) /* Signaled machine check */
35#define MCI_STATUS_AR (1ULL<<55) /* Action required */ 35#define MCI_STATUS_AR (1ULL<<55) /* Action required */
36 36
37/* AMD-specific bits */
38#define MCI_STATUS_DEFERRED (1ULL<<44) /* declare an uncorrected error */
39#define MCI_STATUS_POISON (1ULL<<43) /* access poisonous data */
40
37/* 41/*
38 * Note that the full MCACOD field of IA32_MCi_STATUS MSR is 42 * Note that the full MCACOD field of IA32_MCi_STATUS MSR is
39 * bits 15:0. But bit 12 is the 'F' bit, defined for corrected 43 * bits 15:0. But bit 12 is the 'F' bit, defined for corrected
@@ -78,7 +82,6 @@
78/* Software defined banks */ 82/* Software defined banks */
79#define MCE_EXTENDED_BANK 128 83#define MCE_EXTENDED_BANK 128
80#define MCE_THERMAL_BANK (MCE_EXTENDED_BANK + 0) 84#define MCE_THERMAL_BANK (MCE_EXTENDED_BANK + 0)
81#define K8_MCE_THRESHOLD_BASE (MCE_EXTENDED_BANK + 1)
82 85
83#define MCE_LOG_LEN 32 86#define MCE_LOG_LEN 32
84#define MCE_LOG_SIGNATURE "MACHINECHECK" 87#define MCE_LOG_SIGNATURE "MACHINECHECK"
diff --git a/arch/x86/kernel/cpu/mcheck/mce-internal.h b/arch/x86/kernel/cpu/mcheck/mce-internal.h
index 09edd0b65fef..10b46906767f 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-internal.h
+++ b/arch/x86/kernel/cpu/mcheck/mce-internal.h
@@ -3,6 +3,8 @@
3 3
4enum severity_level { 4enum severity_level {
5 MCE_NO_SEVERITY, 5 MCE_NO_SEVERITY,
6 MCE_DEFERRED_SEVERITY,
7 MCE_UCNA_SEVERITY = MCE_DEFERRED_SEVERITY,
6 MCE_KEEP_SEVERITY, 8 MCE_KEEP_SEVERITY,
7 MCE_SOME_SEVERITY, 9 MCE_SOME_SEVERITY,
8 MCE_AO_SEVERITY, 10 MCE_AO_SEVERITY,
@@ -21,7 +23,7 @@ struct mce_bank {
21 char attrname[ATTR_LEN]; /* attribute name */ 23 char attrname[ATTR_LEN]; /* attribute name */
22}; 24};
23 25
24int mce_severity(struct mce *a, int tolerant, char **msg); 26int mce_severity(struct mce *a, int tolerant, char **msg, bool is_excp);
25struct dentry *mce_get_debugfs_dir(void); 27struct dentry *mce_get_debugfs_dir(void);
26 28
27extern struct mce_bank *mce_banks; 29extern struct mce_bank *mce_banks;
diff --git a/arch/x86/kernel/cpu/mcheck/mce-severity.c b/arch/x86/kernel/cpu/mcheck/mce-severity.c
index c370e1c4468b..8bb433043a7f 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-severity.c
+++ b/arch/x86/kernel/cpu/mcheck/mce-severity.c
@@ -31,6 +31,7 @@
31 31
32enum context { IN_KERNEL = 1, IN_USER = 2 }; 32enum context { IN_KERNEL = 1, IN_USER = 2 };
33enum ser { SER_REQUIRED = 1, NO_SER = 2 }; 33enum ser { SER_REQUIRED = 1, NO_SER = 2 };
34enum exception { EXCP_CONTEXT = 1, NO_EXCP = 2 };
34 35
35static struct severity { 36static struct severity {
36 u64 mask; 37 u64 mask;
@@ -40,6 +41,7 @@ static struct severity {
40 unsigned char mcgres; 41 unsigned char mcgres;
41 unsigned char ser; 42 unsigned char ser;
42 unsigned char context; 43 unsigned char context;
44 unsigned char excp;
43 unsigned char covered; 45 unsigned char covered;
44 char *msg; 46 char *msg;
45} severities[] = { 47} severities[] = {
@@ -48,6 +50,8 @@ static struct severity {
48#define USER .context = IN_USER 50#define USER .context = IN_USER
49#define SER .ser = SER_REQUIRED 51#define SER .ser = SER_REQUIRED
50#define NOSER .ser = NO_SER 52#define NOSER .ser = NO_SER
53#define EXCP .excp = EXCP_CONTEXT
54#define NOEXCP .excp = NO_EXCP
51#define BITCLR(x) .mask = x, .result = 0 55#define BITCLR(x) .mask = x, .result = 0
52#define BITSET(x) .mask = x, .result = x 56#define BITSET(x) .mask = x, .result = x
53#define MCGMASK(x, y) .mcgmask = x, .mcgres = y 57#define MCGMASK(x, y) .mcgmask = x, .mcgres = y
@@ -62,7 +66,7 @@ static struct severity {
62 ), 66 ),
63 MCESEV( 67 MCESEV(
64 NO, "Not enabled", 68 NO, "Not enabled",
65 BITCLR(MCI_STATUS_EN) 69 EXCP, BITCLR(MCI_STATUS_EN)
66 ), 70 ),
67 MCESEV( 71 MCESEV(
68 PANIC, "Processor context corrupt", 72 PANIC, "Processor context corrupt",
@@ -71,16 +75,20 @@ static struct severity {
71 /* When MCIP is not set something is very confused */ 75 /* When MCIP is not set something is very confused */
72 MCESEV( 76 MCESEV(
73 PANIC, "MCIP not set in MCA handler", 77 PANIC, "MCIP not set in MCA handler",
74 MCGMASK(MCG_STATUS_MCIP, 0) 78 EXCP, MCGMASK(MCG_STATUS_MCIP, 0)
75 ), 79 ),
76 /* Neither return not error IP -- no chance to recover -> PANIC */ 80 /* Neither return not error IP -- no chance to recover -> PANIC */
77 MCESEV( 81 MCESEV(
78 PANIC, "Neither restart nor error IP", 82 PANIC, "Neither restart nor error IP",
79 MCGMASK(MCG_STATUS_RIPV|MCG_STATUS_EIPV, 0) 83 EXCP, MCGMASK(MCG_STATUS_RIPV|MCG_STATUS_EIPV, 0)
80 ), 84 ),
81 MCESEV( 85 MCESEV(
82 PANIC, "In kernel and no restart IP", 86 PANIC, "In kernel and no restart IP",
83 KERNEL, MCGMASK(MCG_STATUS_RIPV, 0) 87 EXCP, KERNEL, MCGMASK(MCG_STATUS_RIPV, 0)
88 ),
89 MCESEV(
90 DEFERRED, "Deferred error",
91 NOSER, MASK(MCI_STATUS_UC|MCI_STATUS_DEFERRED|MCI_STATUS_POISON, MCI_STATUS_DEFERRED)
84 ), 92 ),
85 MCESEV( 93 MCESEV(
86 KEEP, "Corrected error", 94 KEEP, "Corrected error",
@@ -89,7 +97,7 @@ static struct severity {
89 97
90 /* ignore OVER for UCNA */ 98 /* ignore OVER for UCNA */
91 MCESEV( 99 MCESEV(
92 KEEP, "Uncorrected no action required", 100 UCNA, "Uncorrected no action required",
93 SER, MASK(MCI_UC_SAR, MCI_STATUS_UC) 101 SER, MASK(MCI_UC_SAR, MCI_STATUS_UC)
94 ), 102 ),
95 MCESEV( 103 MCESEV(
@@ -178,8 +186,9 @@ static int error_context(struct mce *m)
178 return ((m->cs & 3) == 3) ? IN_USER : IN_KERNEL; 186 return ((m->cs & 3) == 3) ? IN_USER : IN_KERNEL;
179} 187}
180 188
181int mce_severity(struct mce *m, int tolerant, char **msg) 189int mce_severity(struct mce *m, int tolerant, char **msg, bool is_excp)
182{ 190{
191 enum exception excp = (is_excp ? EXCP_CONTEXT : NO_EXCP);
183 enum context ctx = error_context(m); 192 enum context ctx = error_context(m);
184 struct severity *s; 193 struct severity *s;
185 194
@@ -194,6 +203,8 @@ int mce_severity(struct mce *m, int tolerant, char **msg)
194 continue; 203 continue;
195 if (s->context && ctx != s->context) 204 if (s->context && ctx != s->context)
196 continue; 205 continue;
206 if (s->excp && excp != s->excp)
207 continue;
197 if (msg) 208 if (msg)
198 *msg = s->msg; 209 *msg = s->msg;
199 s->covered = 1; 210 s->covered = 1;
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 61a9668cebfd..d2c611699cd9 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -292,10 +292,10 @@ static void print_mce(struct mce *m)
292 292
293#define PANIC_TIMEOUT 5 /* 5 seconds */ 293#define PANIC_TIMEOUT 5 /* 5 seconds */
294 294
295static atomic_t mce_paniced; 295static atomic_t mce_panicked;
296 296
297static int fake_panic; 297static int fake_panic;
298static atomic_t mce_fake_paniced; 298static atomic_t mce_fake_panicked;
299 299
300/* Panic in progress. Enable interrupts and wait for final IPI */ 300/* Panic in progress. Enable interrupts and wait for final IPI */
301static void wait_for_panic(void) 301static void wait_for_panic(void)
@@ -319,7 +319,7 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
319 /* 319 /*
320 * Make sure only one CPU runs in machine check panic 320 * Make sure only one CPU runs in machine check panic
321 */ 321 */
322 if (atomic_inc_return(&mce_paniced) > 1) 322 if (atomic_inc_return(&mce_panicked) > 1)
323 wait_for_panic(); 323 wait_for_panic();
324 barrier(); 324 barrier();
325 325
@@ -327,7 +327,7 @@ static void mce_panic(char *msg, struct mce *final, char *exp)
327 console_verbose(); 327 console_verbose();
328 } else { 328 } else {
329 /* Don't log too much for fake panic */ 329 /* Don't log too much for fake panic */
330 if (atomic_inc_return(&mce_fake_paniced) > 1) 330 if (atomic_inc_return(&mce_fake_panicked) > 1)
331 return; 331 return;
332 } 332 }
333 /* First print corrected ones that are still unlogged */ 333 /* First print corrected ones that are still unlogged */
@@ -575,6 +575,37 @@ static void mce_read_aux(struct mce *m, int i)
575 } 575 }
576} 576}
577 577
578static bool memory_error(struct mce *m)
579{
580 struct cpuinfo_x86 *c = &boot_cpu_data;
581
582 if (c->x86_vendor == X86_VENDOR_AMD) {
583 /*
584 * coming soon
585 */
586 return false;
587 } else if (c->x86_vendor == X86_VENDOR_INTEL) {
588 /*
589 * Intel SDM Volume 3B - 15.9.2 Compound Error Codes
590 *
591 * Bit 7 of the MCACOD field of IA32_MCi_STATUS is used for
592 * indicating a memory error. Bit 8 is used for indicating a
593 * cache hierarchy error. The combination of bit 2 and bit 3
594 * is used for indicating a `generic' cache hierarchy error
595 * But we can't just blindly check the above bits, because if
596 * bit 11 is set, then it is a bus/interconnect error - and
597 * either way the above bits just gives more detail on what
598 * bus/interconnect error happened. Note that bit 12 can be
599 * ignored, as it's the "filter" bit.
600 */
601 return (m->status & 0xef80) == BIT(7) ||
602 (m->status & 0xef00) == BIT(8) ||
603 (m->status & 0xeffc) == 0xc;
604 }
605
606 return false;
607}
608
578DEFINE_PER_CPU(unsigned, mce_poll_count); 609DEFINE_PER_CPU(unsigned, mce_poll_count);
579 610
580/* 611/*
@@ -595,6 +626,7 @@ DEFINE_PER_CPU(unsigned, mce_poll_count);
595void machine_check_poll(enum mcp_flags flags, mce_banks_t *b) 626void machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
596{ 627{
597 struct mce m; 628 struct mce m;
629 int severity;
598 int i; 630 int i;
599 631
600 this_cpu_inc(mce_poll_count); 632 this_cpu_inc(mce_poll_count);
@@ -630,6 +662,20 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
630 662
631 if (!(flags & MCP_TIMESTAMP)) 663 if (!(flags & MCP_TIMESTAMP))
632 m.tsc = 0; 664 m.tsc = 0;
665
666 severity = mce_severity(&m, mca_cfg.tolerant, NULL, false);
667
668 /*
669 * In the cases where we don't have a valid address after all,
670 * do not add it into the ring buffer.
671 */
672 if (severity == MCE_DEFERRED_SEVERITY && memory_error(&m)) {
673 if (m.status & MCI_STATUS_ADDRV) {
674 mce_ring_add(m.addr >> PAGE_SHIFT);
675 mce_schedule_work();
676 }
677 }
678
633 /* 679 /*
634 * Don't get the IP here because it's unlikely to 680 * Don't get the IP here because it's unlikely to
635 * have anything to do with the actual error location. 681 * have anything to do with the actual error location.
@@ -668,7 +714,8 @@ static int mce_no_way_out(struct mce *m, char **msg, unsigned long *validp,
668 if (quirk_no_way_out) 714 if (quirk_no_way_out)
669 quirk_no_way_out(i, m, regs); 715 quirk_no_way_out(i, m, regs);
670 } 716 }
671 if (mce_severity(m, mca_cfg.tolerant, msg) >= MCE_PANIC_SEVERITY) 717 if (mce_severity(m, mca_cfg.tolerant, msg, true) >=
718 MCE_PANIC_SEVERITY)
672 ret = 1; 719 ret = 1;
673 } 720 }
674 return ret; 721 return ret;
@@ -697,7 +744,7 @@ static int mce_timed_out(u64 *t)
697 * might have been modified by someone else. 744 * might have been modified by someone else.
698 */ 745 */
699 rmb(); 746 rmb();
700 if (atomic_read(&mce_paniced)) 747 if (atomic_read(&mce_panicked))
701 wait_for_panic(); 748 wait_for_panic();
702 if (!mca_cfg.monarch_timeout) 749 if (!mca_cfg.monarch_timeout)
703 goto out; 750 goto out;
@@ -754,7 +801,7 @@ static void mce_reign(void)
754 for_each_possible_cpu(cpu) { 801 for_each_possible_cpu(cpu) {
755 int severity = mce_severity(&per_cpu(mces_seen, cpu), 802 int severity = mce_severity(&per_cpu(mces_seen, cpu),
756 mca_cfg.tolerant, 803 mca_cfg.tolerant,
757 &nmsg); 804 &nmsg, true);
758 if (severity > global_worst) { 805 if (severity > global_worst) {
759 msg = nmsg; 806 msg = nmsg;
760 global_worst = severity; 807 global_worst = severity;
@@ -1095,13 +1142,14 @@ void do_machine_check(struct pt_regs *regs, long error_code)
1095 */ 1142 */
1096 add_taint(TAINT_MACHINE_CHECK, LOCKDEP_NOW_UNRELIABLE); 1143 add_taint(TAINT_MACHINE_CHECK, LOCKDEP_NOW_UNRELIABLE);
1097 1144
1098 severity = mce_severity(&m, cfg->tolerant, NULL); 1145 severity = mce_severity(&m, cfg->tolerant, NULL, true);
1099 1146
1100 /* 1147 /*
1101 * When machine check was for corrected handler don't touch, 1148 * When machine check was for corrected/deferred handler don't
1102 * unless we're panicing. 1149 * touch, unless we're panicing.
1103 */ 1150 */
1104 if (severity == MCE_KEEP_SEVERITY && !no_way_out) 1151 if ((severity == MCE_KEEP_SEVERITY ||
1152 severity == MCE_UCNA_SEVERITY) && !no_way_out)
1105 continue; 1153 continue;
1106 __set_bit(i, toclear); 1154 __set_bit(i, toclear);
1107 if (severity == MCE_NO_SEVERITY) { 1155 if (severity == MCE_NO_SEVERITY) {
@@ -2520,7 +2568,7 @@ struct dentry *mce_get_debugfs_dir(void)
2520static void mce_reset(void) 2568static void mce_reset(void)
2521{ 2569{
2522 cpu_missing = 0; 2570 cpu_missing = 0;
2523 atomic_set(&mce_fake_paniced, 0); 2571 atomic_set(&mce_fake_panicked, 0);
2524 atomic_set(&mce_executing, 0); 2572 atomic_set(&mce_executing, 0);
2525 atomic_set(&mce_callin, 0); 2573 atomic_set(&mce_callin, 0);
2526 atomic_set(&global_nwo, 0); 2574 atomic_set(&global_nwo, 0);
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index 5d4999f95aec..f1c3769bbd64 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -212,12 +212,12 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
212 unsigned int cpu = smp_processor_id(); 212 unsigned int cpu = smp_processor_id();
213 u32 low = 0, high = 0, address = 0; 213 u32 low = 0, high = 0, address = 0;
214 unsigned int bank, block; 214 unsigned int bank, block;
215 int offset = -1; 215 int offset = -1, new;
216 216
217 for (bank = 0; bank < mca_cfg.banks; ++bank) { 217 for (bank = 0; bank < mca_cfg.banks; ++bank) {
218 for (block = 0; block < NR_BLOCKS; ++block) { 218 for (block = 0; block < NR_BLOCKS; ++block) {
219 if (block == 0) 219 if (block == 0)
220 address = MSR_IA32_MC0_MISC + bank * 4; 220 address = MSR_IA32_MCx_MISC(bank);
221 else if (block == 1) { 221 else if (block == 1) {
222 address = (low & MASK_BLKPTR_LO) >> 21; 222 address = (low & MASK_BLKPTR_LO) >> 21;
223 if (!address) 223 if (!address)
@@ -247,13 +247,18 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
247 b.address = address; 247 b.address = address;
248 b.interrupt_capable = lvt_interrupt_supported(bank, high); 248 b.interrupt_capable = lvt_interrupt_supported(bank, high);
249 249
250 if (b.interrupt_capable) { 250 if (!b.interrupt_capable)
251 int new = (high & MASK_LVTOFF_HI) >> 20; 251 goto init;
252 offset = setup_APIC_mce(offset, new); 252
253 } 253 new = (high & MASK_LVTOFF_HI) >> 20;
254 offset = setup_APIC_mce(offset, new);
255
256 if ((offset == new) &&
257 (mce_threshold_vector != amd_threshold_interrupt))
258 mce_threshold_vector = amd_threshold_interrupt;
254 259
260init:
255 mce_threshold_block_init(&b, offset); 261 mce_threshold_block_init(&b, offset);
256 mce_threshold_vector = amd_threshold_interrupt;
257 } 262 }
258 } 263 }
259} 264}
@@ -270,18 +275,17 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
270static void amd_threshold_interrupt(void) 275static void amd_threshold_interrupt(void)
271{ 276{
272 u32 low = 0, high = 0, address = 0; 277 u32 low = 0, high = 0, address = 0;
278 int cpu = smp_processor_id();
273 unsigned int bank, block; 279 unsigned int bank, block;
274 struct mce m; 280 struct mce m;
275 281
276 mce_setup(&m);
277
278 /* assume first bank caused it */ 282 /* assume first bank caused it */
279 for (bank = 0; bank < mca_cfg.banks; ++bank) { 283 for (bank = 0; bank < mca_cfg.banks; ++bank) {
280 if (!(per_cpu(bank_map, m.cpu) & (1 << bank))) 284 if (!(per_cpu(bank_map, cpu) & (1 << bank)))
281 continue; 285 continue;
282 for (block = 0; block < NR_BLOCKS; ++block) { 286 for (block = 0; block < NR_BLOCKS; ++block) {
283 if (block == 0) { 287 if (block == 0) {
284 address = MSR_IA32_MC0_MISC + bank * 4; 288 address = MSR_IA32_MCx_MISC(bank);
285 } else if (block == 1) { 289 } else if (block == 1) {
286 address = (low & MASK_BLKPTR_LO) >> 21; 290 address = (low & MASK_BLKPTR_LO) >> 21;
287 if (!address) 291 if (!address)
@@ -309,21 +313,20 @@ static void amd_threshold_interrupt(void)
309 * Log the machine check that caused the threshold 313 * Log the machine check that caused the threshold
310 * event. 314 * event.
311 */ 315 */
312 machine_check_poll(MCP_TIMESTAMP, 316 if (high & MASK_OVERFLOW_HI)
313 this_cpu_ptr(&mce_poll_banks)); 317 goto log;
314
315 if (high & MASK_OVERFLOW_HI) {
316 rdmsrl(address, m.misc);
317 rdmsrl(MSR_IA32_MC0_STATUS + bank * 4,
318 m.status);
319 m.bank = K8_MCE_THRESHOLD_BASE
320 + bank * NR_BLOCKS
321 + block;
322 mce_log(&m);
323 return;
324 }
325 } 318 }
326 } 319 }
320 return;
321
322log:
323 mce_setup(&m);
324 rdmsrl(MSR_IA32_MCx_STATUS(bank), m.status);
325 m.misc = ((u64)high << 32) | low;
326 m.bank = bank;
327 mce_log(&m);
328
329 wrmsrl(MSR_IA32_MCx_STATUS(bank), 0);
327} 330}
328 331
329/* 332/*
@@ -617,8 +620,7 @@ static int threshold_create_bank(unsigned int cpu, unsigned int bank)
617 } 620 }
618 } 621 }
619 622
620 err = allocate_threshold_blocks(cpu, bank, 0, 623 err = allocate_threshold_blocks(cpu, bank, 0, MSR_IA32_MCx_MISC(bank));
621 MSR_IA32_MC0_MISC + bank * 4);
622 if (!err) 624 if (!err)
623 goto out; 625 goto out;
624 626
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index fc5f780bb61d..1b6aa514848f 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -128,7 +128,7 @@ static DEFINE_SPINLOCK(ghes_ioremap_lock_irq);
128static struct gen_pool *ghes_estatus_pool; 128static struct gen_pool *ghes_estatus_pool;
129static unsigned long ghes_estatus_pool_size_request; 129static unsigned long ghes_estatus_pool_size_request;
130 130
131struct ghes_estatus_cache *ghes_estatus_caches[GHES_ESTATUS_CACHES_SIZE]; 131static struct ghes_estatus_cache *ghes_estatus_caches[GHES_ESTATUS_CACHES_SIZE];
132static atomic_t ghes_estatus_cache_alloced; 132static atomic_t ghes_estatus_cache_alloced;
133 133
134static int ghes_ioremap_init(void) 134static int ghes_ioremap_init(void)
@@ -738,20 +738,6 @@ static LIST_HEAD(ghes_nmi);
738 738
739static int ghes_panic_timeout __read_mostly = 30; 739static int ghes_panic_timeout __read_mostly = 30;
740 740
741static struct llist_node *llist_nodes_reverse(struct llist_node *llnode)
742{
743 struct llist_node *next, *tail = NULL;
744
745 while (llnode) {
746 next = llnode->next;
747 llnode->next = tail;
748 tail = llnode;
749 llnode = next;
750 }
751
752 return tail;
753}
754
755static void ghes_proc_in_irq(struct irq_work *irq_work) 741static void ghes_proc_in_irq(struct irq_work *irq_work)
756{ 742{
757 struct llist_node *llnode, *next; 743 struct llist_node *llnode, *next;
@@ -765,7 +751,7 @@ static void ghes_proc_in_irq(struct irq_work *irq_work)
765 * Because the time order of estatus in list is reversed, 751 * Because the time order of estatus in list is reversed,
766 * revert it back to proper order. 752 * revert it back to proper order.
767 */ 753 */
768 llnode = llist_nodes_reverse(llnode); 754 llnode = llist_reverse_order(llnode);
769 while (llnode) { 755 while (llnode) {
770 next = llnode->next; 756 next = llnode->next;
771 estatus_node = llist_entry(llnode, struct ghes_estatus_node, 757 estatus_node = llist_entry(llnode, struct ghes_estatus_node,
@@ -798,7 +784,7 @@ static void ghes_print_queued_estatus(void)
798 * Because the time order of estatus in list is reversed, 784 * Because the time order of estatus in list is reversed,
799 * revert it back to proper order. 785 * revert it back to proper order.
800 */ 786 */
801 llnode = llist_nodes_reverse(llnode); 787 llnode = llist_reverse_order(llnode);
802 while (llnode) { 788 while (llnode) {
803 estatus_node = llist_entry(llnode, struct ghes_estatus_node, 789 estatus_node = llist_entry(llnode, struct ghes_estatus_node,
804 llnode); 790 llnode);
diff --git a/drivers/edac/mce_amd.h b/drivers/edac/mce_amd.h
index 51b7e3a36e37..c2359a1ea6b3 100644
--- a/drivers/edac/mce_amd.h
+++ b/drivers/edac/mce_amd.h
@@ -32,9 +32,6 @@
32#define R4(x) (((x) >> 4) & 0xf) 32#define R4(x) (((x) >> 4) & 0xf)
33#define R4_MSG(x) ((R4(x) < 9) ? rrrr_msgs[R4(x)] : "Wrong R4!") 33#define R4_MSG(x) ((R4(x) < 9) ? rrrr_msgs[R4(x)] : "Wrong R4!")
34 34
35#define MCI_STATUS_DEFERRED BIT_64(44)
36#define MCI_STATUS_POISON BIT_64(43)
37
38extern const char * const pp_msgs[]; 35extern const char * const pp_msgs[];
39 36
40enum tt_ids { 37enum tt_ids {
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index 8639f6b28746..b852b10ec76d 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -860,7 +860,6 @@ static int page_action(struct page_state *ps, struct page *p,
860 int count; 860 int count;
861 861
862 result = ps->action(p, pfn); 862 result = ps->action(p, pfn);
863 action_result(pfn, ps->msg, result);
864 863
865 count = page_count(p) - 1; 864 count = page_count(p) - 1;
866 if (ps->action == me_swapcache_dirty && result == DELAYED) 865 if (ps->action == me_swapcache_dirty && result == DELAYED)
@@ -871,6 +870,7 @@ static int page_action(struct page_state *ps, struct page *p,
871 pfn, ps->msg, count); 870 pfn, ps->msg, count);
872 result = FAILED; 871 result = FAILED;
873 } 872 }
873 action_result(pfn, ps->msg, result);
874 874
875 /* Could do more checks here if page looks ok */ 875 /* Could do more checks here if page looks ok */
876 /* 876 /*