diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-20 15:47:44 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-20 15:47:44 -0500 |
commit | 60c906bab124a0627fba04c9ca5e61bba4747c0c (patch) | |
tree | 1680b243575b7184d3e06ae739bffbdfc3e3f943 | |
parent | 7f4eb0a6d5a76ee054acd7255c05b8d5ca31c5d9 (diff) | |
parent | 9026cc82b632ed1a859935c82ed8ad65f27f2781 (diff) |
Merge branch 'ras-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull RAS updates from Ingo Molnar:
"The main changes in this cycle were:
- Assign notifier chain priorities for all RAS related handlers to
make the ordering explicit (Borislav Petkov)
- Improve the AMD MCA banks sysfs output (Yazen Ghannam)
- Various cleanups and restructuring of the x86 RAS code (Borislav
Petkov)"
* 'ras-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/ras, EDAC, acpi: Assign MCE notifier handlers a priority
x86/ras: Get rid of mce_process_work()
EDAC/mce/amd: Dump TSC value
EDAC/mce/amd: Unexport amd_decode_mce()
x86/ras/amd/inj: Change dependency
x86/ras: Flip the TSC-adding logic
x86/ras/amd: Make sysfs names of banks more user-friendly
x86/ras/therm_throt: Do not log a fake MCE for thermal events
x86/ras/inject: Make it depend on X86_LOCAL_APIC=y
-rw-r--r-- | arch/x86/Kconfig | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/mce.h | 20 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce-apei.c | 5 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce-genpool.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce-inject.c | 5 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce-internal.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.c | 57 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce_amd.c | 9 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/therm_throt.c | 30 | ||||
-rw-r--r-- | arch/x86/ras/Kconfig | 2 | ||||
-rw-r--r-- | drivers/acpi/acpi_extlog.c | 1 | ||||
-rw-r--r-- | drivers/acpi/nfit/mce.c | 1 | ||||
-rw-r--r-- | drivers/edac/i7core_edac.c | 1 | ||||
-rw-r--r-- | drivers/edac/mce_amd.c | 8 | ||||
-rw-r--r-- | drivers/edac/mce_amd.h | 1 | ||||
-rw-r--r-- | drivers/edac/sb_edac.c | 3 | ||||
-rw-r--r-- | drivers/edac/skx_edac.c | 3 |
17 files changed, 59 insertions, 93 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index e487493bbd47..7b6fd68b4715 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -1070,7 +1070,7 @@ config X86_MCE_THRESHOLD | |||
1070 | def_bool y | 1070 | def_bool y |
1071 | 1071 | ||
1072 | config X86_MCE_INJECT | 1072 | config X86_MCE_INJECT |
1073 | depends on X86_MCE | 1073 | depends on X86_MCE && X86_LOCAL_APIC |
1074 | tristate "Machine check injector support" | 1074 | tristate "Machine check injector support" |
1075 | ---help--- | 1075 | ---help--- |
1076 | Provide support for injecting machine checks for testing purposes. | 1076 | Provide support for injecting machine checks for testing purposes. |
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h index 5132f2a6c0a2..e63873683d4a 100644 --- a/arch/x86/include/asm/mce.h +++ b/arch/x86/include/asm/mce.h | |||
@@ -97,10 +97,6 @@ | |||
97 | 97 | ||
98 | #define MCE_OVERFLOW 0 /* bit 0 in flags means overflow */ | 98 | #define MCE_OVERFLOW 0 /* bit 0 in flags means overflow */ |
99 | 99 | ||
100 | /* Software defined banks */ | ||
101 | #define MCE_EXTENDED_BANK 128 | ||
102 | #define MCE_THERMAL_BANK (MCE_EXTENDED_BANK + 0) | ||
103 | |||
104 | #define MCE_LOG_LEN 32 | 100 | #define MCE_LOG_LEN 32 |
105 | #define MCE_LOG_SIGNATURE "MACHINECHECK" | 101 | #define MCE_LOG_SIGNATURE "MACHINECHECK" |
106 | 102 | ||
@@ -193,6 +189,15 @@ extern struct mce_vendor_flags mce_flags; | |||
193 | 189 | ||
194 | extern struct mca_config mca_cfg; | 190 | extern struct mca_config mca_cfg; |
195 | extern struct mca_msr_regs msr_ops; | 191 | extern struct mca_msr_regs msr_ops; |
192 | |||
193 | enum mce_notifier_prios { | ||
194 | MCE_PRIO_SRAO = INT_MAX, | ||
195 | MCE_PRIO_EXTLOG = INT_MAX - 1, | ||
196 | MCE_PRIO_NFIT = INT_MAX - 2, | ||
197 | MCE_PRIO_EDAC = INT_MAX - 3, | ||
198 | MCE_PRIO_LOWEST = 0, | ||
199 | }; | ||
200 | |||
196 | extern void mce_register_decode_chain(struct notifier_block *nb); | 201 | extern void mce_register_decode_chain(struct notifier_block *nb); |
197 | extern void mce_unregister_decode_chain(struct notifier_block *nb); | 202 | extern void mce_unregister_decode_chain(struct notifier_block *nb); |
198 | 203 | ||
@@ -306,8 +311,6 @@ extern void (*deferred_error_int_vector)(void); | |||
306 | 311 | ||
307 | void intel_init_thermal(struct cpuinfo_x86 *c); | 312 | void intel_init_thermal(struct cpuinfo_x86 *c); |
308 | 313 | ||
309 | void mce_log_therm_throt_event(__u64 status); | ||
310 | |||
311 | /* Interrupt Handler for core thermal thresholds */ | 314 | /* Interrupt Handler for core thermal thresholds */ |
312 | extern int (*platform_thermal_notify)(__u64 msr_val); | 315 | extern int (*platform_thermal_notify)(__u64 msr_val); |
313 | 316 | ||
@@ -362,12 +365,13 @@ struct smca_hwid { | |||
362 | unsigned int bank_type; /* Use with smca_bank_types for easy indexing. */ | 365 | unsigned int bank_type; /* Use with smca_bank_types for easy indexing. */ |
363 | u32 hwid_mcatype; /* (hwid,mcatype) tuple */ | 366 | u32 hwid_mcatype; /* (hwid,mcatype) tuple */ |
364 | u32 xec_bitmap; /* Bitmap of valid ExtErrorCodes; current max is 21. */ | 367 | u32 xec_bitmap; /* Bitmap of valid ExtErrorCodes; current max is 21. */ |
368 | u8 count; /* Number of instances. */ | ||
365 | }; | 369 | }; |
366 | 370 | ||
367 | struct smca_bank { | 371 | struct smca_bank { |
368 | struct smca_hwid *hwid; | 372 | struct smca_hwid *hwid; |
369 | /* Instance ID */ | 373 | u32 id; /* Value of MCA_IPID[InstanceId]. */ |
370 | u32 id; | 374 | u8 sysfs_id; /* Value used for sysfs name. */ |
371 | }; | 375 | }; |
372 | 376 | ||
373 | extern struct smca_bank smca_banks[MAX_NR_BANKS]; | 377 | extern struct smca_bank smca_banks[MAX_NR_BANKS]; |
diff --git a/arch/x86/kernel/cpu/mcheck/mce-apei.c b/arch/x86/kernel/cpu/mcheck/mce-apei.c index 83f1a98d37db..2eee85379689 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-apei.c +++ b/arch/x86/kernel/cpu/mcheck/mce-apei.c | |||
@@ -52,8 +52,11 @@ void apei_mce_report_mem_error(int severity, struct cper_sec_mem_err *mem_err) | |||
52 | 52 | ||
53 | if (severity >= GHES_SEV_RECOVERABLE) | 53 | if (severity >= GHES_SEV_RECOVERABLE) |
54 | m.status |= MCI_STATUS_UC; | 54 | m.status |= MCI_STATUS_UC; |
55 | if (severity >= GHES_SEV_PANIC) | 55 | |
56 | if (severity >= GHES_SEV_PANIC) { | ||
56 | m.status |= MCI_STATUS_PCC; | 57 | m.status |= MCI_STATUS_PCC; |
58 | m.tsc = rdtsc(); | ||
59 | } | ||
57 | 60 | ||
58 | m.addr = mem_err->physical_addr; | 61 | m.addr = mem_err->physical_addr; |
59 | mce_log(&m); | 62 | mce_log(&m); |
diff --git a/arch/x86/kernel/cpu/mcheck/mce-genpool.c b/arch/x86/kernel/cpu/mcheck/mce-genpool.c index 93d824ec3120..1e5a50c11d3c 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-genpool.c +++ b/arch/x86/kernel/cpu/mcheck/mce-genpool.c | |||
@@ -72,7 +72,7 @@ struct llist_node *mce_gen_pool_prepare_records(void) | |||
72 | return new_head.first; | 72 | return new_head.first; |
73 | } | 73 | } |
74 | 74 | ||
75 | void mce_gen_pool_process(void) | 75 | void mce_gen_pool_process(struct work_struct *__unused) |
76 | { | 76 | { |
77 | struct llist_node *head; | 77 | struct llist_node *head; |
78 | struct mce_evt_llist *node, *tmp; | 78 | struct mce_evt_llist *node, *tmp; |
diff --git a/arch/x86/kernel/cpu/mcheck/mce-inject.c b/arch/x86/kernel/cpu/mcheck/mce-inject.c index 517619ea6498..99165b206df3 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-inject.c +++ b/arch/x86/kernel/cpu/mcheck/mce-inject.c | |||
@@ -152,7 +152,6 @@ static void raise_mce(struct mce *m) | |||
152 | if (context == MCJ_CTX_RANDOM) | 152 | if (context == MCJ_CTX_RANDOM) |
153 | return; | 153 | return; |
154 | 154 | ||
155 | #ifdef CONFIG_X86_LOCAL_APIC | ||
156 | if (m->inject_flags & (MCJ_IRQ_BROADCAST | MCJ_NMI_BROADCAST)) { | 155 | if (m->inject_flags & (MCJ_IRQ_BROADCAST | MCJ_NMI_BROADCAST)) { |
157 | unsigned long start; | 156 | unsigned long start; |
158 | int cpu; | 157 | int cpu; |
@@ -192,9 +191,7 @@ static void raise_mce(struct mce *m) | |||
192 | raise_local(); | 191 | raise_local(); |
193 | put_cpu(); | 192 | put_cpu(); |
194 | put_online_cpus(); | 193 | put_online_cpus(); |
195 | } else | 194 | } else { |
196 | #endif | ||
197 | { | ||
198 | preempt_disable(); | 195 | preempt_disable(); |
199 | raise_local(); | 196 | raise_local(); |
200 | preempt_enable(); | 197 | preempt_enable(); |
diff --git a/arch/x86/kernel/cpu/mcheck/mce-internal.h b/arch/x86/kernel/cpu/mcheck/mce-internal.h index cd74a3f00aea..903043e6a62b 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-internal.h +++ b/arch/x86/kernel/cpu/mcheck/mce-internal.h | |||
@@ -31,7 +31,7 @@ struct mce_evt_llist { | |||
31 | struct mce mce; | 31 | struct mce mce; |
32 | }; | 32 | }; |
33 | 33 | ||
34 | void mce_gen_pool_process(void); | 34 | void mce_gen_pool_process(struct work_struct *__unused); |
35 | bool mce_gen_pool_empty(void); | 35 | bool mce_gen_pool_empty(void); |
36 | int mce_gen_pool_add(struct mce *mce); | 36 | int mce_gen_pool_add(struct mce *mce); |
37 | int mce_gen_pool_init(void); | 37 | int mce_gen_pool_init(void); |
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 537c6647d84c..8e9725c607ea 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c | |||
@@ -128,7 +128,6 @@ void mce_setup(struct mce *m) | |||
128 | { | 128 | { |
129 | memset(m, 0, sizeof(struct mce)); | 129 | memset(m, 0, sizeof(struct mce)); |
130 | m->cpu = m->extcpu = smp_processor_id(); | 130 | m->cpu = m->extcpu = smp_processor_id(); |
131 | m->tsc = rdtsc(); | ||
132 | /* We hope get_seconds stays lockless */ | 131 | /* We hope get_seconds stays lockless */ |
133 | m->time = get_seconds(); | 132 | m->time = get_seconds(); |
134 | m->cpuvendor = boot_cpu_data.x86_vendor; | 133 | m->cpuvendor = boot_cpu_data.x86_vendor; |
@@ -217,9 +216,7 @@ void mce_register_decode_chain(struct notifier_block *nb) | |||
217 | { | 216 | { |
218 | atomic_inc(&num_notifiers); | 217 | atomic_inc(&num_notifiers); |
219 | 218 | ||
220 | /* Ensure SRAO notifier has the highest priority in the decode chain. */ | 219 | WARN_ON(nb->priority > MCE_PRIO_LOWEST && nb->priority < MCE_PRIO_EDAC); |
221 | if (nb != &mce_srao_nb && nb->priority == INT_MAX) | ||
222 | nb->priority -= 1; | ||
223 | 220 | ||
224 | atomic_notifier_chain_register(&x86_mce_decoder_chain, nb); | 221 | atomic_notifier_chain_register(&x86_mce_decoder_chain, nb); |
225 | } | 222 | } |
@@ -583,7 +580,7 @@ static int srao_decode_notifier(struct notifier_block *nb, unsigned long val, | |||
583 | } | 580 | } |
584 | static struct notifier_block mce_srao_nb = { | 581 | static struct notifier_block mce_srao_nb = { |
585 | .notifier_call = srao_decode_notifier, | 582 | .notifier_call = srao_decode_notifier, |
586 | .priority = INT_MAX, | 583 | .priority = MCE_PRIO_SRAO, |
587 | }; | 584 | }; |
588 | 585 | ||
589 | static int mce_default_notifier(struct notifier_block *nb, unsigned long val, | 586 | static int mce_default_notifier(struct notifier_block *nb, unsigned long val, |
@@ -609,7 +606,7 @@ static int mce_default_notifier(struct notifier_block *nb, unsigned long val, | |||
609 | static struct notifier_block mce_default_nb = { | 606 | static struct notifier_block mce_default_nb = { |
610 | .notifier_call = mce_default_notifier, | 607 | .notifier_call = mce_default_notifier, |
611 | /* lowest prio, we want it to run last. */ | 608 | /* lowest prio, we want it to run last. */ |
612 | .priority = 0, | 609 | .priority = MCE_PRIO_LOWEST, |
613 | }; | 610 | }; |
614 | 611 | ||
615 | /* | 612 | /* |
@@ -710,14 +707,8 @@ bool machine_check_poll(enum mcp_flags flags, mce_banks_t *b) | |||
710 | 707 | ||
711 | mce_gather_info(&m, NULL); | 708 | mce_gather_info(&m, NULL); |
712 | 709 | ||
713 | /* | 710 | if (flags & MCP_TIMESTAMP) |
714 | * m.tsc was set in mce_setup(). Clear it if not requested. | 711 | m.tsc = rdtsc(); |
715 | * | ||
716 | * FIXME: Propagate @flags to mce_gather_info/mce_setup() to avoid | ||
717 | * that dance. | ||
718 | */ | ||
719 | if (!(flags & MCP_TIMESTAMP)) | ||
720 | m.tsc = 0; | ||
721 | 712 | ||
722 | for (i = 0; i < mca_cfg.banks; i++) { | 713 | for (i = 0; i < mca_cfg.banks; i++) { |
723 | if (!mce_banks[i].ctl || !test_bit(i, *b)) | 714 | if (!mce_banks[i].ctl || !test_bit(i, *b)) |
@@ -1156,6 +1147,7 @@ void do_machine_check(struct pt_regs *regs, long error_code) | |||
1156 | goto out; | 1147 | goto out; |
1157 | 1148 | ||
1158 | mce_gather_info(&m, regs); | 1149 | mce_gather_info(&m, regs); |
1150 | m.tsc = rdtsc(); | ||
1159 | 1151 | ||
1160 | final = this_cpu_ptr(&mces_seen); | 1152 | final = this_cpu_ptr(&mces_seen); |
1161 | *final = m; | 1153 | *final = m; |
@@ -1322,41 +1314,6 @@ int memory_failure(unsigned long pfn, int vector, int flags) | |||
1322 | #endif | 1314 | #endif |
1323 | 1315 | ||
1324 | /* | 1316 | /* |
1325 | * Action optional processing happens here (picking up | ||
1326 | * from the list of faulting pages that do_machine_check() | ||
1327 | * placed into the genpool). | ||
1328 | */ | ||
1329 | static void mce_process_work(struct work_struct *dummy) | ||
1330 | { | ||
1331 | mce_gen_pool_process(); | ||
1332 | } | ||
1333 | |||
1334 | #ifdef CONFIG_X86_MCE_INTEL | ||
1335 | /*** | ||
1336 | * mce_log_therm_throt_event - Logs the thermal throttling event to mcelog | ||
1337 | * @cpu: The CPU on which the event occurred. | ||
1338 | * @status: Event status information | ||
1339 | * | ||
1340 | * This function should be called by the thermal interrupt after the | ||
1341 | * event has been processed and the decision was made to log the event | ||
1342 | * further. | ||
1343 | * | ||
1344 | * The status parameter will be saved to the 'status' field of 'struct mce' | ||
1345 | * and historically has been the register value of the | ||
1346 | * MSR_IA32_THERMAL_STATUS (Intel) msr. | ||
1347 | */ | ||
1348 | void mce_log_therm_throt_event(__u64 status) | ||
1349 | { | ||
1350 | struct mce m; | ||
1351 | |||
1352 | mce_setup(&m); | ||
1353 | m.bank = MCE_THERMAL_BANK; | ||
1354 | m.status = status; | ||
1355 | mce_log(&m); | ||
1356 | } | ||
1357 | #endif /* CONFIG_X86_MCE_INTEL */ | ||
1358 | |||
1359 | /* | ||
1360 | * Periodic polling timer for "silent" machine check errors. If the | 1317 | * Periodic polling timer for "silent" machine check errors. If the |
1361 | * poller finds an MCE, poll 2x faster. When the poller finds no more | 1318 | * poller finds an MCE, poll 2x faster. When the poller finds no more |
1362 | * errors, poll 2x slower (up to check_interval seconds). | 1319 | * errors, poll 2x slower (up to check_interval seconds). |
@@ -2189,7 +2146,7 @@ int __init mcheck_init(void) | |||
2189 | mce_register_decode_chain(&mce_default_nb); | 2146 | mce_register_decode_chain(&mce_default_nb); |
2190 | mcheck_vendor_init_severity(); | 2147 | mcheck_vendor_init_severity(); |
2191 | 2148 | ||
2192 | INIT_WORK(&mce_work, mce_process_work); | 2149 | INIT_WORK(&mce_work, mce_gen_pool_process); |
2193 | init_irq_work(&mce_irq_work, mce_irq_work_cb); | 2150 | init_irq_work(&mce_irq_work, mce_irq_work_cb); |
2194 | 2151 | ||
2195 | return 0; | 2152 | return 0; |
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c index a5fd137417a2..9e5427df3243 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c | |||
@@ -192,6 +192,7 @@ static void get_smca_bank_info(unsigned int bank) | |||
192 | 192 | ||
193 | smca_banks[bank].hwid = s_hwid; | 193 | smca_banks[bank].hwid = s_hwid; |
194 | smca_banks[bank].id = instance_id; | 194 | smca_banks[bank].id = instance_id; |
195 | smca_banks[bank].sysfs_id = s_hwid->count++; | ||
195 | break; | 196 | break; |
196 | } | 197 | } |
197 | } | 198 | } |
@@ -777,7 +778,8 @@ __log_error(unsigned int bank, bool deferred_err, bool threshold_err, u64 misc) | |||
777 | mce_setup(&m); | 778 | mce_setup(&m); |
778 | 779 | ||
779 | m.status = status; | 780 | m.status = status; |
780 | m.bank = bank; | 781 | m.bank = bank; |
782 | m.tsc = rdtsc(); | ||
781 | 783 | ||
782 | if (threshold_err) | 784 | if (threshold_err) |
783 | m.misc = misc; | 785 | m.misc = misc; |
@@ -1064,9 +1066,12 @@ static const char *get_name(unsigned int bank, struct threshold_block *b) | |||
1064 | return NULL; | 1066 | return NULL; |
1065 | } | 1067 | } |
1066 | 1068 | ||
1069 | if (smca_banks[bank].hwid->count == 1) | ||
1070 | return smca_get_name(bank_type); | ||
1071 | |||
1067 | snprintf(buf_mcatype, MAX_MCATYPE_NAME_LEN, | 1072 | snprintf(buf_mcatype, MAX_MCATYPE_NAME_LEN, |
1068 | "%s_%x", smca_get_name(bank_type), | 1073 | "%s_%x", smca_get_name(bank_type), |
1069 | smca_banks[bank].id); | 1074 | smca_banks[bank].sysfs_id); |
1070 | return buf_mcatype; | 1075 | return buf_mcatype; |
1071 | } | 1076 | } |
1072 | 1077 | ||
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c index 465aca8be009..85469f84c921 100644 --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * | 6 | * |
7 | * Maintains a counter in /sys that keeps track of the number of thermal | 7 | * Maintains a counter in /sys that keeps track of the number of thermal |
8 | * events, such that the user knows how bad the thermal problem might be | 8 | * events, such that the user knows how bad the thermal problem might be |
9 | * (since the logging to syslog and mcelog is rate limited). | 9 | * (since the logging to syslog is rate limited). |
10 | * | 10 | * |
11 | * Author: Dmitriy Zavin (dmitriyz@google.com) | 11 | * Author: Dmitriy Zavin (dmitriyz@google.com) |
12 | * | 12 | * |
@@ -141,13 +141,8 @@ static struct attribute_group thermal_attr_group = { | |||
141 | * IRQ has been acknowledged. | 141 | * IRQ has been acknowledged. |
142 | * | 142 | * |
143 | * It will take care of rate limiting and printing messages to the syslog. | 143 | * It will take care of rate limiting and printing messages to the syslog. |
144 | * | ||
145 | * Returns: 0 : Event should NOT be further logged, i.e. still in | ||
146 | * "timeout" from previous log message. | ||
147 | * 1 : Event should be logged further, and a message has been | ||
148 | * printed to the syslog. | ||
149 | */ | 144 | */ |
150 | static int therm_throt_process(bool new_event, int event, int level) | 145 | static void therm_throt_process(bool new_event, int event, int level) |
151 | { | 146 | { |
152 | struct _thermal_state *state; | 147 | struct _thermal_state *state; |
153 | unsigned int this_cpu = smp_processor_id(); | 148 | unsigned int this_cpu = smp_processor_id(); |
@@ -162,16 +157,16 @@ static int therm_throt_process(bool new_event, int event, int level) | |||
162 | else if (event == POWER_LIMIT_EVENT) | 157 | else if (event == POWER_LIMIT_EVENT) |
163 | state = &pstate->core_power_limit; | 158 | state = &pstate->core_power_limit; |
164 | else | 159 | else |
165 | return 0; | 160 | return; |
166 | } else if (level == PACKAGE_LEVEL) { | 161 | } else if (level == PACKAGE_LEVEL) { |
167 | if (event == THERMAL_THROTTLING_EVENT) | 162 | if (event == THERMAL_THROTTLING_EVENT) |
168 | state = &pstate->package_throttle; | 163 | state = &pstate->package_throttle; |
169 | else if (event == POWER_LIMIT_EVENT) | 164 | else if (event == POWER_LIMIT_EVENT) |
170 | state = &pstate->package_power_limit; | 165 | state = &pstate->package_power_limit; |
171 | else | 166 | else |
172 | return 0; | 167 | return; |
173 | } else | 168 | } else |
174 | return 0; | 169 | return; |
175 | 170 | ||
176 | old_event = state->new_event; | 171 | old_event = state->new_event; |
177 | state->new_event = new_event; | 172 | state->new_event = new_event; |
@@ -181,7 +176,7 @@ static int therm_throt_process(bool new_event, int event, int level) | |||
181 | 176 | ||
182 | if (time_before64(now, state->next_check) && | 177 | if (time_before64(now, state->next_check) && |
183 | state->count != state->last_count) | 178 | state->count != state->last_count) |
184 | return 0; | 179 | return; |
185 | 180 | ||
186 | state->next_check = now + CHECK_INTERVAL; | 181 | state->next_check = now + CHECK_INTERVAL; |
187 | state->last_count = state->count; | 182 | state->last_count = state->count; |
@@ -193,16 +188,14 @@ static int therm_throt_process(bool new_event, int event, int level) | |||
193 | this_cpu, | 188 | this_cpu, |
194 | level == CORE_LEVEL ? "Core" : "Package", | 189 | level == CORE_LEVEL ? "Core" : "Package", |
195 | state->count); | 190 | state->count); |
196 | return 1; | 191 | return; |
197 | } | 192 | } |
198 | if (old_event) { | 193 | if (old_event) { |
199 | if (event == THERMAL_THROTTLING_EVENT) | 194 | if (event == THERMAL_THROTTLING_EVENT) |
200 | pr_info("CPU%d: %s temperature/speed normal\n", this_cpu, | 195 | pr_info("CPU%d: %s temperature/speed normal\n", this_cpu, |
201 | level == CORE_LEVEL ? "Core" : "Package"); | 196 | level == CORE_LEVEL ? "Core" : "Package"); |
202 | return 1; | 197 | return; |
203 | } | 198 | } |
204 | |||
205 | return 0; | ||
206 | } | 199 | } |
207 | 200 | ||
208 | static int thresh_event_valid(int level, int event) | 201 | static int thresh_event_valid(int level, int event) |
@@ -365,10 +358,9 @@ static void intel_thermal_interrupt(void) | |||
365 | /* Check for violation of core thermal thresholds*/ | 358 | /* Check for violation of core thermal thresholds*/ |
366 | notify_thresholds(msr_val); | 359 | notify_thresholds(msr_val); |
367 | 360 | ||
368 | if (therm_throt_process(msr_val & THERM_STATUS_PROCHOT, | 361 | therm_throt_process(msr_val & THERM_STATUS_PROCHOT, |
369 | THERMAL_THROTTLING_EVENT, | 362 | THERMAL_THROTTLING_EVENT, |
370 | CORE_LEVEL) != 0) | 363 | CORE_LEVEL); |
371 | mce_log_therm_throt_event(msr_val); | ||
372 | 364 | ||
373 | if (this_cpu_has(X86_FEATURE_PLN) && int_pln_enable) | 365 | if (this_cpu_has(X86_FEATURE_PLN) && int_pln_enable) |
374 | therm_throt_process(msr_val & THERM_STATUS_POWER_LIMIT, | 366 | therm_throt_process(msr_val & THERM_STATUS_POWER_LIMIT, |
diff --git a/arch/x86/ras/Kconfig b/arch/x86/ras/Kconfig index d957d5f21a86..0bc60a308730 100644 --- a/arch/x86/ras/Kconfig +++ b/arch/x86/ras/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config MCE_AMD_INJ | 1 | config MCE_AMD_INJ |
2 | tristate "Simple MCE injection interface for AMD processors" | 2 | tristate "Simple MCE injection interface for AMD processors" |
3 | depends on RAS && EDAC_DECODE_MCE && DEBUG_FS && AMD_NB | 3 | depends on RAS && X86_MCE && DEBUG_FS && AMD_NB |
4 | default n | 4 | default n |
5 | help | 5 | help |
6 | This is a simple debugfs interface to inject MCEs and test different | 6 | This is a simple debugfs interface to inject MCEs and test different |
diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c index b3842ffc19ba..a15270a806fc 100644 --- a/drivers/acpi/acpi_extlog.c +++ b/drivers/acpi/acpi_extlog.c | |||
@@ -212,6 +212,7 @@ static bool __init extlog_get_l1addr(void) | |||
212 | } | 212 | } |
213 | static struct notifier_block extlog_mce_dec = { | 213 | static struct notifier_block extlog_mce_dec = { |
214 | .notifier_call = extlog_print, | 214 | .notifier_call = extlog_print, |
215 | .priority = MCE_PRIO_EXTLOG, | ||
215 | }; | 216 | }; |
216 | 217 | ||
217 | static int __init extlog_init(void) | 218 | static int __init extlog_init(void) |
diff --git a/drivers/acpi/nfit/mce.c b/drivers/acpi/nfit/mce.c index e5ce81c38eed..3ba1c3472cf9 100644 --- a/drivers/acpi/nfit/mce.c +++ b/drivers/acpi/nfit/mce.c | |||
@@ -90,6 +90,7 @@ static int nfit_handle_mce(struct notifier_block *nb, unsigned long val, | |||
90 | 90 | ||
91 | static struct notifier_block nfit_mce_dec = { | 91 | static struct notifier_block nfit_mce_dec = { |
92 | .notifier_call = nfit_handle_mce, | 92 | .notifier_call = nfit_handle_mce, |
93 | .priority = MCE_PRIO_NFIT, | ||
93 | }; | 94 | }; |
94 | 95 | ||
95 | void nfit_mce_register(void) | 96 | void nfit_mce_register(void) |
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 69b5adead0ad..75ad847593b7 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -1835,6 +1835,7 @@ static int i7core_mce_check_error(struct notifier_block *nb, unsigned long val, | |||
1835 | 1835 | ||
1836 | static struct notifier_block i7_mce_dec = { | 1836 | static struct notifier_block i7_mce_dec = { |
1837 | .notifier_call = i7core_mce_check_error, | 1837 | .notifier_call = i7core_mce_check_error, |
1838 | .priority = MCE_PRIO_EDAC, | ||
1838 | }; | 1839 | }; |
1839 | 1840 | ||
1840 | struct memdev_dmi_entry { | 1841 | struct memdev_dmi_entry { |
diff --git a/drivers/edac/mce_amd.c b/drivers/edac/mce_amd.c index 27513dca8009..ba35b7ea3686 100644 --- a/drivers/edac/mce_amd.c +++ b/drivers/edac/mce_amd.c | |||
@@ -942,7 +942,8 @@ static const char *decode_error_status(struct mce *m) | |||
942 | return "Corrected error, no action required."; | 942 | return "Corrected error, no action required."; |
943 | } | 943 | } |
944 | 944 | ||
945 | int amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data) | 945 | static int |
946 | amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data) | ||
946 | { | 947 | { |
947 | struct mce *m = (struct mce *)data; | 948 | struct mce *m = (struct mce *)data; |
948 | struct cpuinfo_x86 *c = &cpu_data(m->extcpu); | 949 | struct cpuinfo_x86 *c = &cpu_data(m->extcpu); |
@@ -1005,6 +1006,9 @@ int amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data) | |||
1005 | goto err_code; | 1006 | goto err_code; |
1006 | } | 1007 | } |
1007 | 1008 | ||
1009 | if (m->tsc) | ||
1010 | pr_emerg(HW_ERR "TSC: %llu\n", m->tsc); | ||
1011 | |||
1008 | if (!fam_ops) | 1012 | if (!fam_ops) |
1009 | goto err_code; | 1013 | goto err_code; |
1010 | 1014 | ||
@@ -1046,10 +1050,10 @@ int amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data) | |||
1046 | 1050 | ||
1047 | return NOTIFY_STOP; | 1051 | return NOTIFY_STOP; |
1048 | } | 1052 | } |
1049 | EXPORT_SYMBOL_GPL(amd_decode_mce); | ||
1050 | 1053 | ||
1051 | static struct notifier_block amd_mce_dec_nb = { | 1054 | static struct notifier_block amd_mce_dec_nb = { |
1052 | .notifier_call = amd_decode_mce, | 1055 | .notifier_call = amd_decode_mce, |
1056 | .priority = MCE_PRIO_EDAC, | ||
1053 | }; | 1057 | }; |
1054 | 1058 | ||
1055 | static int __init mce_amd_init(void) | 1059 | static int __init mce_amd_init(void) |
diff --git a/drivers/edac/mce_amd.h b/drivers/edac/mce_amd.h index c2359a1ea6b3..0b6a68673e0e 100644 --- a/drivers/edac/mce_amd.h +++ b/drivers/edac/mce_amd.h | |||
@@ -79,6 +79,5 @@ struct amd_decoder_ops { | |||
79 | void amd_report_gart_errors(bool); | 79 | void amd_report_gart_errors(bool); |
80 | void amd_register_ecc_decoder(void (*f)(int, struct mce *)); | 80 | void amd_register_ecc_decoder(void (*f)(int, struct mce *)); |
81 | void amd_unregister_ecc_decoder(void (*f)(int, struct mce *)); | 81 | void amd_unregister_ecc_decoder(void (*f)(int, struct mce *)); |
82 | int amd_decode_mce(struct notifier_block *nb, unsigned long val, void *data); | ||
83 | 82 | ||
84 | #endif /* _EDAC_MCE_AMD_H */ | 83 | #endif /* _EDAC_MCE_AMD_H */ |
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c index 573be9c0ffb8..a65ea44e3b0b 100644 --- a/drivers/edac/sb_edac.c +++ b/drivers/edac/sb_edac.c | |||
@@ -3117,7 +3117,8 @@ static int sbridge_mce_check_error(struct notifier_block *nb, unsigned long val, | |||
3117 | } | 3117 | } |
3118 | 3118 | ||
3119 | static struct notifier_block sbridge_mce_dec = { | 3119 | static struct notifier_block sbridge_mce_dec = { |
3120 | .notifier_call = sbridge_mce_check_error, | 3120 | .notifier_call = sbridge_mce_check_error, |
3121 | .priority = MCE_PRIO_EDAC, | ||
3121 | }; | 3122 | }; |
3122 | 3123 | ||
3123 | /**************************************************************************** | 3124 | /**************************************************************************** |
diff --git a/drivers/edac/skx_edac.c b/drivers/edac/skx_edac.c index 79ef675e4d6f..1159dba4671f 100644 --- a/drivers/edac/skx_edac.c +++ b/drivers/edac/skx_edac.c | |||
@@ -1007,7 +1007,8 @@ static int skx_mce_check_error(struct notifier_block *nb, unsigned long val, | |||
1007 | } | 1007 | } |
1008 | 1008 | ||
1009 | static struct notifier_block skx_mce_dec = { | 1009 | static struct notifier_block skx_mce_dec = { |
1010 | .notifier_call = skx_mce_check_error, | 1010 | .notifier_call = skx_mce_check_error, |
1011 | .priority = MCE_PRIO_EDAC, | ||
1011 | }; | 1012 | }; |
1012 | 1013 | ||
1013 | static void skx_remove(void) | 1014 | static void skx_remove(void) |