Lines Matching +full:machine +full:- +full:level
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Machine check exception handling.
52 mce->error_type = mce_err->error_type; in mce_set_error_info()
53 switch (mce_err->error_type) { in mce_set_error_info()
55 mce->u.ue_error.ue_error_type = mce_err->u.ue_error_type; in mce_set_error_info()
58 mce->u.slb_error.slb_error_type = mce_err->u.slb_error_type; in mce_set_error_info()
61 mce->u.erat_error.erat_error_type = mce_err->u.erat_error_type; in mce_set_error_info()
64 mce->u.tlb_error.tlb_error_type = mce_err->u.tlb_error_type; in mce_set_error_info()
67 mce->u.user_error.user_error_type = mce_err->u.user_error_type; in mce_set_error_info()
70 mce->u.ra_error.ra_error_type = mce_err->u.ra_error_type; in mce_set_error_info()
73 mce->u.link_error.link_error_type = mce_err->u.link_error_type; in mce_set_error_info()
89 * Decode and save high level MCE information into per cpu buffer which
96 int index = local_paca->mce_info->mce_nest_count++; in save_mce_event()
99 mce = &local_paca->mce_info->mce_event[index]; in save_mce_event()
108 /* Populate generic machine check info */ in save_mce_event()
109 mce->version = MCE_V1; in save_mce_event()
110 mce->srr0 = nip; in save_mce_event()
111 mce->srr1 = regs->msr; in save_mce_event()
112 mce->gpr3 = regs->gpr[3]; in save_mce_event()
113 mce->in_use = 1; in save_mce_event()
114 mce->cpu = get_paca()->paca_index; in save_mce_event()
117 if (handled && (regs->msr & MSR_RI)) in save_mce_event()
118 mce->disposition = MCE_DISPOSITION_RECOVERED; in save_mce_event()
120 mce->disposition = MCE_DISPOSITION_NOT_RECOVERED; in save_mce_event()
122 mce->initiator = mce_err->initiator; in save_mce_event()
123 mce->severity = mce_err->severity; in save_mce_event()
124 mce->sync_error = mce_err->sync_error; in save_mce_event()
125 mce->error_class = mce_err->error_class; in save_mce_event()
128 * Populate the mce error_type and type-specific error_type. in save_mce_event()
131 if (mce->error_type == MCE_ERROR_TYPE_UE) in save_mce_event()
132 mce->u.ue_error.ignore_event = mce_err->ignore_event; in save_mce_event()
138 if (mce->disposition == MCE_DISPOSITION_NOT_RECOVERED) in save_mce_event()
144 if (mce->error_type == MCE_ERROR_TYPE_TLB) { in save_mce_event()
145 mce->u.tlb_error.effective_address_provided = true; in save_mce_event()
146 mce->u.tlb_error.effective_address = addr; in save_mce_event()
147 } else if (mce->error_type == MCE_ERROR_TYPE_SLB) { in save_mce_event()
148 mce->u.slb_error.effective_address_provided = true; in save_mce_event()
149 mce->u.slb_error.effective_address = addr; in save_mce_event()
150 } else if (mce->error_type == MCE_ERROR_TYPE_ERAT) { in save_mce_event()
151 mce->u.erat_error.effective_address_provided = true; in save_mce_event()
152 mce->u.erat_error.effective_address = addr; in save_mce_event()
153 } else if (mce->error_type == MCE_ERROR_TYPE_USER) { in save_mce_event()
154 mce->u.user_error.effective_address_provided = true; in save_mce_event()
155 mce->u.user_error.effective_address = addr; in save_mce_event()
156 } else if (mce->error_type == MCE_ERROR_TYPE_RA) { in save_mce_event()
157 mce->u.ra_error.effective_address_provided = true; in save_mce_event()
158 mce->u.ra_error.effective_address = addr; in save_mce_event()
159 } else if (mce->error_type == MCE_ERROR_TYPE_LINK) { in save_mce_event()
160 mce->u.link_error.effective_address_provided = true; in save_mce_event()
161 mce->u.link_error.effective_address = addr; in save_mce_event()
162 } else if (mce->error_type == MCE_ERROR_TYPE_UE) { in save_mce_event()
163 mce->u.ue_error.effective_address_provided = true; in save_mce_event()
164 mce->u.ue_error.effective_address = addr; in save_mce_event()
166 mce->u.ue_error.physical_address_provided = true; in save_mce_event()
167 mce->u.ue_error.physical_address = phys_addr; in save_mce_event()
185 * get_mce_event() will be called by platform specific machine check
193 int index = local_paca->mce_info->mce_nest_count - 1; in get_mce_event()
203 mc_evt = &local_paca->mce_info->mce_event[index]; in get_mce_event()
208 mc_evt->in_use = 0; in get_mce_event()
213 local_paca->mce_info->mce_nest_count--; in get_mce_event()
235 index = local_paca->mce_info->mce_ue_count++; in machine_check_ue_event()
238 local_paca->mce_info->mce_ue_count--; in machine_check_ue_event()
241 memcpy(&local_paca->mce_info->mce_ue_event_queue[index], in machine_check_ue_event()
256 index = local_paca->mce_info->mce_queue_count++; in machine_check_queue_event()
259 local_paca->mce_info->mce_queue_count--; in machine_check_queue_event()
262 memcpy(&local_paca->mce_info->mce_event_queue[index], in machine_check_queue_event()
273 entry = search_kernel_exception_table(regs->nip); in mce_common_process_ue()
275 mce_err->ignore_event = true; in mce_common_process_ue()
289 while (local_paca->mce_info->mce_ue_count > 0) { in machine_process_ue_event()
290 index = local_paca->mce_info->mce_ue_count - 1; in machine_process_ue_event()
291 evt = &local_paca->mce_info->mce_ue_event_queue[index]; in machine_process_ue_event()
298 * Don't report this machine check because the caller has a in machine_process_ue_event()
302 if (evt->error_type == MCE_ERROR_TYPE_UE) { in machine_process_ue_event()
303 if (evt->u.ue_error.ignore_event) { in machine_process_ue_event()
304 local_paca->mce_info->mce_ue_count--; in machine_process_ue_event()
308 if (evt->u.ue_error.physical_address_provided) { in machine_process_ue_event()
311 pfn = evt->u.ue_error.physical_address >> in machine_process_ue_event()
320 local_paca->mce_info->mce_ue_count--; in machine_process_ue_event()
338 while (local_paca->mce_info->mce_queue_count > 0) { in machine_check_process_queued_event()
339 index = local_paca->mce_info->mce_queue_count - 1; in machine_check_process_queued_event()
340 evt = &local_paca->mce_info->mce_event_queue[index]; in machine_check_process_queued_event()
342 if (evt->error_type == MCE_ERROR_TYPE_UE && in machine_check_process_queued_event()
343 evt->u.ue_error.ignore_event) { in machine_check_process_queued_event()
344 local_paca->mce_info->mce_queue_count--; in machine_check_process_queued_event()
348 local_paca->mce_info->mce_queue_count--; in machine_check_process_queued_event()
354 local_paca->mce_pending_irq_work = 1; in set_mce_pending_irq_work()
359 local_paca->mce_pending_irq_work = 0; in clear_mce_pending_irq_work()
364 if (unlikely(local_paca->mce_pending_irq_work)) { in mce_run_irq_context_handlers()
376 const char *level, *sevstr, *subtype, *err_type, *initiator; in machine_check_print_event_info() local
437 if (evt->version != MCE_V1) { in machine_check_print_event_info()
438 pr_err("Machine Check Exception, Unknown event version %d !\n", in machine_check_print_event_info()
439 evt->version); in machine_check_print_event_info()
442 switch (evt->severity) { in machine_check_print_event_info()
444 level = KERN_INFO; in machine_check_print_event_info()
448 level = KERN_WARNING; in machine_check_print_event_info()
452 level = KERN_ERR; in machine_check_print_event_info()
457 level = KERN_ERR; in machine_check_print_event_info()
462 switch(evt->initiator) { in machine_check_print_event_info()
484 switch (evt->error_type) { in machine_check_print_event_info()
487 subtype = evt->u.ue_error.ue_error_type < in machine_check_print_event_info()
489 mc_ue_types[evt->u.ue_error.ue_error_type] in machine_check_print_event_info()
491 if (evt->u.ue_error.effective_address_provided) in machine_check_print_event_info()
492 ea = evt->u.ue_error.effective_address; in machine_check_print_event_info()
493 if (evt->u.ue_error.physical_address_provided) in machine_check_print_event_info()
494 pa = evt->u.ue_error.physical_address; in machine_check_print_event_info()
498 subtype = evt->u.slb_error.slb_error_type < in machine_check_print_event_info()
500 mc_slb_types[evt->u.slb_error.slb_error_type] in machine_check_print_event_info()
502 if (evt->u.slb_error.effective_address_provided) in machine_check_print_event_info()
503 ea = evt->u.slb_error.effective_address; in machine_check_print_event_info()
507 subtype = evt->u.erat_error.erat_error_type < in machine_check_print_event_info()
509 mc_erat_types[evt->u.erat_error.erat_error_type] in machine_check_print_event_info()
511 if (evt->u.erat_error.effective_address_provided) in machine_check_print_event_info()
512 ea = evt->u.erat_error.effective_address; in machine_check_print_event_info()
516 subtype = evt->u.tlb_error.tlb_error_type < in machine_check_print_event_info()
518 mc_tlb_types[evt->u.tlb_error.tlb_error_type] in machine_check_print_event_info()
520 if (evt->u.tlb_error.effective_address_provided) in machine_check_print_event_info()
521 ea = evt->u.tlb_error.effective_address; in machine_check_print_event_info()
525 subtype = evt->u.user_error.user_error_type < in machine_check_print_event_info()
527 mc_user_types[evt->u.user_error.user_error_type] in machine_check_print_event_info()
529 if (evt->u.user_error.effective_address_provided) in machine_check_print_event_info()
530 ea = evt->u.user_error.effective_address; in machine_check_print_event_info()
534 subtype = evt->u.ra_error.ra_error_type < in machine_check_print_event_info()
536 mc_ra_types[evt->u.ra_error.ra_error_type] in machine_check_print_event_info()
538 if (evt->u.ra_error.effective_address_provided) in machine_check_print_event_info()
539 ea = evt->u.ra_error.effective_address; in machine_check_print_event_info()
543 subtype = evt->u.link_error.link_error_type < in machine_check_print_event_info()
545 mc_link_types[evt->u.link_error.link_error_type] in machine_check_print_event_info()
547 if (evt->u.link_error.effective_address_provided) in machine_check_print_event_info()
548 ea = evt->u.link_error.effective_address; in machine_check_print_event_info()
551 err_type = "D-Cache"; in machine_check_print_event_info()
555 err_type = "I-Cache"; in machine_check_print_event_info()
566 if (ea && evt->srr0 != ea) { in machine_check_print_event_info()
575 printk("%sMCE: CPU%d: machine check (%s) %s %s %s %s[%s]\n", in machine_check_print_event_info()
576 level, evt->cpu, sevstr, in_guest ? "Guest" : "", in machine_check_print_event_info()
578 evt->disposition == MCE_DISPOSITION_RECOVERED ? in machine_check_print_event_info()
583 level, evt->cpu, current->pid, current->comm, in machine_check_print_event_info()
584 in_guest ? "Guest " : "", evt->srr0, pa_str); in machine_check_print_event_info()
587 level, evt->cpu, evt->srr0, (void *)evt->srr0, pa_str); in machine_check_print_event_info()
590 printk("%sMCE: CPU%d: Initiator %s\n", level, evt->cpu, initiator); in machine_check_print_event_info()
592 subtype = evt->error_class < ARRAY_SIZE(mc_error_class) ? in machine_check_print_event_info()
593 mc_error_class[evt->error_class] : "Unknown"; in machine_check_print_event_info()
594 printk("%sMCE: CPU%d: %s\n", level, evt->cpu, subtype); in machine_check_print_event_info()
598 if (evt->error_type == MCE_ERROR_TYPE_SLB && !in_guest) in machine_check_print_event_info()
599 slb_dump_contents(local_paca->mce_faulty_slbs); in machine_check_print_event_info()
607 * regs->nip and regs->msr contains srr0 and ssr1.
616 * See if platform is capable of handling machine check. in DEFINE_INTERRUPT_HANDLER_NMI()
642 of_property_for_each_string(cpun, "ibm,hmi-special-triggers", in init_debug_trig_function()
644 if (strcmp(str, "bit17-vector-ci-load") == 0) in init_debug_trig_function()
646 else if (strcmp(str, "bit17-tm-suspend-escape") == 0) in init_debug_trig_function()
658 /* Check for POWER9 Nimbus (scale-out) */ in init_debug_trig_function()
663 /* DD2.0 and DD2.1 - used for vector CI load emulation */ in init_debug_trig_function()
686 * -1 means this is not a HMI cause that we know about
698 return -1; in hmi_handle_debugtrig()
701 /* HMER is a write-AND register */ in hmi_handle_debugtrig()
707 * Now to avoid problems with soft-disable we in hmi_handle_debugtrig()
712 ret = local_paca->hmi_p9_special_emu = 1; in hmi_handle_debugtrig()
724 return -1; in hmi_handle_debugtrig()
736 local_paca->hmi_irqs++; in DEFINE_INTERRUPT_HANDLER_NMI()
766 paca_ptrs[i]->mce_info = mce_info; in mce_init()