Lines Matching +full:cpu +full:- +full:release +full:- +full:addr

1 // SPDX-License-Identifier: GPL-2.0-or-later
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
94 uint64_t nip, uint64_t addr, uint64_t phys_addr) in save_mce_event() argument
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()
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()
134 if (!addr) in save_mce_event()
137 if (mce->error_type == MCE_ERROR_TYPE_TLB) { in save_mce_event()
138 mce->u.tlb_error.effective_address_provided = true; in save_mce_event()
139 mce->u.tlb_error.effective_address = addr; in save_mce_event()
140 } else if (mce->error_type == MCE_ERROR_TYPE_SLB) { in save_mce_event()
141 mce->u.slb_error.effective_address_provided = true; in save_mce_event()
142 mce->u.slb_error.effective_address = addr; in save_mce_event()
143 } else if (mce->error_type == MCE_ERROR_TYPE_ERAT) { in save_mce_event()
144 mce->u.erat_error.effective_address_provided = true; in save_mce_event()
145 mce->u.erat_error.effective_address = addr; in save_mce_event()
146 } else if (mce->error_type == MCE_ERROR_TYPE_USER) { in save_mce_event()
147 mce->u.user_error.effective_address_provided = true; in save_mce_event()
148 mce->u.user_error.effective_address = addr; in save_mce_event()
149 } else if (mce->error_type == MCE_ERROR_TYPE_RA) { in save_mce_event()
150 mce->u.ra_error.effective_address_provided = true; in save_mce_event()
151 mce->u.ra_error.effective_address = addr; in save_mce_event()
152 } else if (mce->error_type == MCE_ERROR_TYPE_LINK) { in save_mce_event()
153 mce->u.link_error.effective_address_provided = true; in save_mce_event()
154 mce->u.link_error.effective_address = addr; in save_mce_event()
155 } else if (mce->error_type == MCE_ERROR_TYPE_UE) { in save_mce_event()
156 mce->u.ue_error.effective_address_provided = true; in save_mce_event()
157 mce->u.ue_error.effective_address = addr; in save_mce_event()
159 mce->u.ue_error.physical_address_provided = true; in save_mce_event()
160 mce->u.ue_error.physical_address = phys_addr; in save_mce_event()
170 * release Flag to indicate whether to free the event slot or not.
171 * 0 <= do not release the mce event. Caller will invoke
173 * 1 <= release the slot.
184 int get_mce_event(struct machine_check_event *mce, bool release) in get_mce_event() argument
186 int index = local_paca->mce_info->mce_nest_count - 1; in get_mce_event()
196 mc_evt = &local_paca->mce_info->mce_event[index]; in get_mce_event()
197 /* Copy the event structure and release the original */ in get_mce_event()
200 if (release) in get_mce_event()
201 mc_evt->in_use = 0; in get_mce_event()
205 if (release) in get_mce_event()
206 local_paca->mce_info->mce_nest_count--; in get_mce_event()
228 index = local_paca->mce_info->mce_ue_count++; in machine_check_ue_event()
231 local_paca->mce_info->mce_ue_count--; in machine_check_ue_event()
234 memcpy(&local_paca->mce_info->mce_ue_event_queue[index], in machine_check_ue_event()
252 index = local_paca->mce_info->mce_queue_count++; in machine_check_queue_event()
255 local_paca->mce_info->mce_queue_count--; in machine_check_queue_event()
258 memcpy(&local_paca->mce_info->mce_event_queue[index], in machine_check_queue_event()
269 entry = search_kernel_exception_table(regs->nip); in mce_common_process_ue()
271 mce_err->ignore_event = true; in mce_common_process_ue()
285 while (local_paca->mce_info->mce_ue_count > 0) { in machine_process_ue_event()
286 index = local_paca->mce_info->mce_ue_count - 1; in machine_process_ue_event()
287 evt = &local_paca->mce_info->mce_ue_event_queue[index]; in machine_process_ue_event()
298 if (evt->error_type == MCE_ERROR_TYPE_UE) { in machine_process_ue_event()
299 if (evt->u.ue_error.ignore_event) { in machine_process_ue_event()
300 local_paca->mce_info->mce_ue_count--; in machine_process_ue_event()
304 if (evt->u.ue_error.physical_address_provided) { in machine_process_ue_event()
307 pfn = evt->u.ue_error.physical_address >> in machine_process_ue_event()
316 local_paca->mce_info->mce_ue_count--; in machine_process_ue_event()
334 while (local_paca->mce_info->mce_queue_count > 0) { in machine_check_process_queued_event()
335 index = local_paca->mce_info->mce_queue_count - 1; in machine_check_process_queued_event()
336 evt = &local_paca->mce_info->mce_event_queue[index]; in machine_check_process_queued_event()
338 if (evt->error_type == MCE_ERROR_TYPE_UE && in machine_check_process_queued_event()
339 evt->u.ue_error.ignore_event) { in machine_check_process_queued_event()
340 local_paca->mce_info->mce_queue_count--; in machine_check_process_queued_event()
344 local_paca->mce_info->mce_queue_count--; in machine_check_process_queued_event()
350 local_paca->mce_pending_irq_work = 1; in set_mce_pending_irq_work()
355 local_paca->mce_pending_irq_work = 0; in clear_mce_pending_irq_work()
360 if (unlikely(local_paca->mce_pending_irq_work)) { in mce_run_irq_context_handlers()
433 if (evt->version != MCE_V1) { in machine_check_print_event_info()
435 evt->version); in machine_check_print_event_info()
438 switch (evt->severity) { in machine_check_print_event_info()
458 switch(evt->initiator) { in machine_check_print_event_info()
460 initiator = "CPU"; in machine_check_print_event_info()
480 switch (evt->error_type) { in machine_check_print_event_info()
483 subtype = evt->u.ue_error.ue_error_type < in machine_check_print_event_info()
485 mc_ue_types[evt->u.ue_error.ue_error_type] in machine_check_print_event_info()
487 if (evt->u.ue_error.effective_address_provided) in machine_check_print_event_info()
488 ea = evt->u.ue_error.effective_address; in machine_check_print_event_info()
489 if (evt->u.ue_error.physical_address_provided) in machine_check_print_event_info()
490 pa = evt->u.ue_error.physical_address; in machine_check_print_event_info()
494 subtype = evt->u.slb_error.slb_error_type < in machine_check_print_event_info()
496 mc_slb_types[evt->u.slb_error.slb_error_type] in machine_check_print_event_info()
498 if (evt->u.slb_error.effective_address_provided) in machine_check_print_event_info()
499 ea = evt->u.slb_error.effective_address; in machine_check_print_event_info()
503 subtype = evt->u.erat_error.erat_error_type < in machine_check_print_event_info()
505 mc_erat_types[evt->u.erat_error.erat_error_type] in machine_check_print_event_info()
507 if (evt->u.erat_error.effective_address_provided) in machine_check_print_event_info()
508 ea = evt->u.erat_error.effective_address; in machine_check_print_event_info()
512 subtype = evt->u.tlb_error.tlb_error_type < in machine_check_print_event_info()
514 mc_tlb_types[evt->u.tlb_error.tlb_error_type] in machine_check_print_event_info()
516 if (evt->u.tlb_error.effective_address_provided) in machine_check_print_event_info()
517 ea = evt->u.tlb_error.effective_address; in machine_check_print_event_info()
521 subtype = evt->u.user_error.user_error_type < in machine_check_print_event_info()
523 mc_user_types[evt->u.user_error.user_error_type] in machine_check_print_event_info()
525 if (evt->u.user_error.effective_address_provided) in machine_check_print_event_info()
526 ea = evt->u.user_error.effective_address; in machine_check_print_event_info()
530 subtype = evt->u.ra_error.ra_error_type < in machine_check_print_event_info()
532 mc_ra_types[evt->u.ra_error.ra_error_type] in machine_check_print_event_info()
534 if (evt->u.ra_error.effective_address_provided) in machine_check_print_event_info()
535 ea = evt->u.ra_error.effective_address; in machine_check_print_event_info()
539 subtype = evt->u.link_error.link_error_type < in machine_check_print_event_info()
541 mc_link_types[evt->u.link_error.link_error_type] in machine_check_print_event_info()
543 if (evt->u.link_error.effective_address_provided) in machine_check_print_event_info()
544 ea = evt->u.link_error.effective_address; in machine_check_print_event_info()
547 err_type = "D-Cache"; in machine_check_print_event_info()
551 err_type = "I-Cache"; in machine_check_print_event_info()
562 if (ea && evt->srr0 != ea) { in machine_check_print_event_info()
571 printk("%sMCE: CPU%d: machine check (%s) %s %s %s %s[%s]\n", in machine_check_print_event_info()
572 level, evt->cpu, sevstr, in_guest ? "Guest" : "", in machine_check_print_event_info()
574 evt->disposition == MCE_DISPOSITION_RECOVERED ? in machine_check_print_event_info()
578 printk("%sMCE: CPU%d: PID: %d Comm: %s %sNIP: [%016llx]%s\n", in machine_check_print_event_info()
579 level, evt->cpu, current->pid, current->comm, in machine_check_print_event_info()
580 in_guest ? "Guest " : "", evt->srr0, pa_str); in machine_check_print_event_info()
582 printk("%sMCE: CPU%d: NIP: [%016llx] %pS%s\n", in machine_check_print_event_info()
583 level, evt->cpu, evt->srr0, (void *)evt->srr0, pa_str); in machine_check_print_event_info()
586 printk("%sMCE: CPU%d: Initiator %s\n", level, evt->cpu, initiator); in machine_check_print_event_info()
588 subtype = evt->error_class < ARRAY_SIZE(mc_error_class) ? in machine_check_print_event_info()
589 mc_error_class[evt->error_class] : "Unknown"; in machine_check_print_event_info()
590 printk("%sMCE: CPU%d: %s\n", level, evt->cpu, subtype); in machine_check_print_event_info()
594 if (evt->error_type == MCE_ERROR_TYPE_SLB && !in_guest) in machine_check_print_event_info()
595 slb_dump_contents(local_paca->mce_faulty_slbs); in machine_check_print_event_info()
603 * regs->nip and regs->msr contains srr0 and ssr1.
638 of_property_for_each_string(cpun, "ibm,hmi-special-triggers", in init_debug_trig_function()
640 if (strcmp(str, "bit17-vector-ci-load") == 0) in init_debug_trig_function()
642 else if (strcmp(str, "bit17-tm-suspend-escape") == 0) in init_debug_trig_function()
654 /* Check for POWER9 Nimbus (scale-out) */ in init_debug_trig_function()
659 /* DD2.0 and DD2.1 - used for vector CI load emulation */ in init_debug_trig_function()
682 * -1 means this is not a HMI cause that we know about
694 return -1; in hmi_handle_debugtrig()
697 /* HMER is a write-AND register */ in hmi_handle_debugtrig()
703 * Now to avoid problems with soft-disable we in hmi_handle_debugtrig()
708 ret = local_paca->hmi_p9_special_emu = 1; in hmi_handle_debugtrig()
720 return -1; in hmi_handle_debugtrig()
732 local_paca->hmi_irqs++; in DEFINE_INTERRUPT_HANDLER_NMI()
762 paca_ptrs[i]->mce_info = mce_info; in mce_init()