Lines Matching +full:inter +full:- +full:ic

1 // SPDX-License-Identifier: GPL-2.0-only
6 * Copyright (C) 2003 Hewlett-Packard Co
7 * David Mosberger-Tang <davidm@hpl.hp.com>
21 * Copyright (C) 1999, 2004-2008 Silicon Graphics, Inc.
27 * 2000-03-29 Chuck Fleckenstein <cfleck@co.intel.com>
31 * 2001-01-03 Fred Lewis <frederick.v.lewis@intel.com>
37 * 2002-01-04 Jenna Hall <jenna.s.hall@intel.com>
42 * 2002-03-25 Matt Domsch <Matt_Domsch@dell.com>
45 * 2003-04-15 David Mosberger-Tang <davidm@hpl.hp.com>
48 * 2003-12-08 Keith Owens <kaos@sgi.com>
53 * 2004-02-01 Keith Owens <kaos@sgi.com>
60 * 2005-08-12 Keith Owens <kaos@sgi.com>
64 * 2005-10-07 Keith Owens <kaos@sgi.com>
67 * 2006-09-15 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
70 * 2007-04-27 Russ Anderson <rja@sgi.com>
133 DEFINE_PER_CPU(u64, ia64_mca_per_cpu_pte); /* PTE to map per-CPU area */
144 static int monarch_cpu = -1;
191 static int loglevel_save = -1;
201 loglevel_save = -1; \
269 if (++printed_len >= MLOGBUF_MSGMAX - 1) in ia64_mlogbuf_dump()
286 * invoked, long-wait rendezvous etc.)
349 #define IA64_MAX_LOGS 2 /* Double-buffering for nested MCAs */
366 #define IA64_LOG_CURR_INDEX(it) 1 - ia64_state_log[it].isl_index
368 {ia64_state_log[it].isl_index = 1 - ia64_state_log[it].isl_index; \
371 ia64_state_log[it].isl_index = 1 - ia64_state_log[it].isl_index
406 /* alloc_bootmem() doesn't like zero-sized allocations! */ in ia64_log_init()
484 /* Clear logs from corrected errors in case there's no user-level logger */ in ia64_mca_log_sal_error_record()
486 if (rh->severity == sal_log_severity_corrected) in ia64_mca_log_sal_error_record()
513 curr_start = (u64) &curr->start_addr + curr->start_addr; in search_mca_table()
514 curr_end = (u64) &curr->end_addr + curr->end_addr; in search_mca_table()
530 return search_mca_table(__start___mca_table, __stop___mca_table-1, addr); in mca_recover_range()
534 int cpe_vector = -1;
535 int ia64_cpe_irq = -1;
557 if (now - cpe_history[i] <= HZ) in ia64_mca_cpe_int_handler()
628 * This function is invoked on a per-processor basis.
657 * This function is invoked on a per-processor basis.
683 * This function is invoked on a per-processor basis.
732 * Send an inter-cpu interrupt to wake-up a particular cpu.
799 while (monarch_cpu != -1) in ia64_mca_rendez_int_handler()
813 * The interrupt handler for processing the inter-cpu interrupt to the
816 * polling on the wakeup-interrupt bit in the IRR, there is
819 * Inputs : wakeup_irq (Wakeup-interrupt bit)
877 char *p, comm[sizeof(current->comm)]; in ia64_mca_modify_comm()
878 if (previous_current->pid) in ia64_mca_modify_comm()
880 current->comm, previous_current->pid); in ia64_mca_modify_comm()
883 if ((p = strchr(previous_current->comm, ' '))) in ia64_mca_modify_comm()
884 l = p - previous_current->comm; in ia64_mca_modify_comm()
886 l = strlen(previous_current->comm); in ia64_mca_modify_comm()
888 current->comm, l, previous_current->comm, in ia64_mca_modify_comm()
889 task_thread_info(previous_current)->cpu); in ia64_mca_modify_comm()
891 memcpy(current->comm, comm, sizeof(current->comm)); in ia64_mca_modify_comm()
898 const struct pal_min_state_area *ms = sos->pal_min_state; in finish_pt_regs()
901 /* If ipsr.ic then use pmsa_{iip,ipsr,ifs}, else use in finish_pt_regs()
904 if (ia64_psr(regs)->ic) { in finish_pt_regs()
905 regs->cr_iip = ms->pmsa_iip; in finish_pt_regs()
906 regs->cr_ipsr = ms->pmsa_ipsr; in finish_pt_regs()
907 regs->cr_ifs = ms->pmsa_ifs; in finish_pt_regs()
909 regs->cr_iip = ms->pmsa_xip; in finish_pt_regs()
910 regs->cr_ipsr = ms->pmsa_xpsr; in finish_pt_regs()
911 regs->cr_ifs = ms->pmsa_xfs; in finish_pt_regs()
913 sos->iip = ms->pmsa_iip; in finish_pt_regs()
914 sos->ipsr = ms->pmsa_ipsr; in finish_pt_regs()
915 sos->ifs = ms->pmsa_ifs; in finish_pt_regs()
917 regs->pr = ms->pmsa_pr; in finish_pt_regs()
918 regs->b0 = ms->pmsa_br0; in finish_pt_regs()
919 regs->ar_rsc = ms->pmsa_rsc; in finish_pt_regs()
920 copy_reg(&ms->pmsa_gr[1-1], ms->pmsa_nat_bits, &regs->r1, nat); in finish_pt_regs()
921 copy_reg(&ms->pmsa_gr[2-1], ms->pmsa_nat_bits, &regs->r2, nat); in finish_pt_regs()
922 copy_reg(&ms->pmsa_gr[3-1], ms->pmsa_nat_bits, &regs->r3, nat); in finish_pt_regs()
923 copy_reg(&ms->pmsa_gr[8-1], ms->pmsa_nat_bits, &regs->r8, nat); in finish_pt_regs()
924 copy_reg(&ms->pmsa_gr[9-1], ms->pmsa_nat_bits, &regs->r9, nat); in finish_pt_regs()
925 copy_reg(&ms->pmsa_gr[10-1], ms->pmsa_nat_bits, &regs->r10, nat); in finish_pt_regs()
926 copy_reg(&ms->pmsa_gr[11-1], ms->pmsa_nat_bits, &regs->r11, nat); in finish_pt_regs()
927 copy_reg(&ms->pmsa_gr[12-1], ms->pmsa_nat_bits, &regs->r12, nat); in finish_pt_regs()
928 copy_reg(&ms->pmsa_gr[13-1], ms->pmsa_nat_bits, &regs->r13, nat); in finish_pt_regs()
929 copy_reg(&ms->pmsa_gr[14-1], ms->pmsa_nat_bits, &regs->r14, nat); in finish_pt_regs()
930 copy_reg(&ms->pmsa_gr[15-1], ms->pmsa_nat_bits, &regs->r15, nat); in finish_pt_regs()
931 if (ia64_psr(regs)->bn) in finish_pt_regs()
932 bank = ms->pmsa_bank1_gr; in finish_pt_regs()
934 bank = ms->pmsa_bank0_gr; in finish_pt_regs()
935 copy_reg(&bank[16-16], ms->pmsa_nat_bits, &regs->r16, nat); in finish_pt_regs()
936 copy_reg(&bank[17-16], ms->pmsa_nat_bits, &regs->r17, nat); in finish_pt_regs()
937 copy_reg(&bank[18-16], ms->pmsa_nat_bits, &regs->r18, nat); in finish_pt_regs()
938 copy_reg(&bank[19-16], ms->pmsa_nat_bits, &regs->r19, nat); in finish_pt_regs()
939 copy_reg(&bank[20-16], ms->pmsa_nat_bits, &regs->r20, nat); in finish_pt_regs()
940 copy_reg(&bank[21-16], ms->pmsa_nat_bits, &regs->r21, nat); in finish_pt_regs()
941 copy_reg(&bank[22-16], ms->pmsa_nat_bits, &regs->r22, nat); in finish_pt_regs()
942 copy_reg(&bank[23-16], ms->pmsa_nat_bits, &regs->r23, nat); in finish_pt_regs()
943 copy_reg(&bank[24-16], ms->pmsa_nat_bits, &regs->r24, nat); in finish_pt_regs()
944 copy_reg(&bank[25-16], ms->pmsa_nat_bits, &regs->r25, nat); in finish_pt_regs()
945 copy_reg(&bank[26-16], ms->pmsa_nat_bits, &regs->r26, nat); in finish_pt_regs()
946 copy_reg(&bank[27-16], ms->pmsa_nat_bits, &regs->r27, nat); in finish_pt_regs()
947 copy_reg(&bank[28-16], ms->pmsa_nat_bits, &regs->r28, nat); in finish_pt_regs()
948 copy_reg(&bank[29-16], ms->pmsa_nat_bits, &regs->r29, nat); in finish_pt_regs()
949 copy_reg(&bank[30-16], ms->pmsa_nat_bits, &regs->r30, nat); in finish_pt_regs()
950 copy_reg(&bank[31-16], ms->pmsa_nat_bits, &regs->r31, nat); in finish_pt_regs()
974 const struct pal_min_state_area *ms = sos->pal_min_state; in ia64_mca_modify_original_stack()
983 u64 slots, loadrs = regs->loadrs; in ia64_mca_modify_original_stack()
984 u64 r12 = ms->pmsa_gr[12-1], r13 = ms->pmsa_gr[13-1]; in ia64_mca_modify_original_stack()
985 u64 ar_bspstore = regs->ar_bspstore; in ia64_mca_modify_original_stack()
986 u64 ar_bsp = regs->ar_bspstore + (loadrs >> 16); in ia64_mca_modify_original_stack()
992 if ((p = strchr(current->comm, ' '))) in ia64_mca_modify_original_stack()
998 regs->cr_ipsr = ms->pmsa_ipsr; in ia64_mca_modify_original_stack()
999 if (ia64_psr(regs)->dt == 0) { in ia64_mca_modify_original_stack()
1011 if (ia64_psr(regs)->rt == 0) { in ia64_mca_modify_original_stack()
1038 regs->loadrs = (new_bsp - new_bspstore) * 8 << 16; in ia64_mca_modify_original_stack()
1050 if (r13 != sos->prev_IA64_KR_CURRENT) { in ia64_mca_modify_original_stack()
1055 if (!mca_recover_range(ms->pmsa_iip)) { in ia64_mca_modify_original_stack()
1056 if ((r12 - r13) >= KERNEL_STACK_SIZE) { in ia64_mca_modify_original_stack()
1060 if ((ar_bspstore - r13) >= KERNEL_STACK_SIZE) { in ia64_mca_modify_original_stack()
1069 if ((ar_bsp - r13) >= KERNEL_STACK_SIZE) { in ia64_mca_modify_original_stack()
1073 size += (ia64_rse_skip_regs(old_bspstore, slots) - old_bspstore) * 8; in ia64_mca_modify_original_stack()
1086 p = (char *)r12 - sizeof(*regs); in ia64_mca_modify_original_stack()
1089 old_regs->loadrs = loadrs; in ia64_mca_modify_original_stack()
1090 old_unat = old_regs->ar_unat; in ia64_mca_modify_original_stack()
1109 p -= sizeof(struct switch_stack); in ia64_mca_modify_original_stack()
1112 old_sw->caller_unat = old_unat; in ia64_mca_modify_original_stack()
1113 old_sw->ar_fpsr = old_regs->ar_fpsr; in ia64_mca_modify_original_stack()
1114 copy_reg(&ms->pmsa_gr[4-1], ms->pmsa_nat_bits, &old_sw->r4, &old_unat); in ia64_mca_modify_original_stack()
1115 copy_reg(&ms->pmsa_gr[5-1], ms->pmsa_nat_bits, &old_sw->r5, &old_unat); in ia64_mca_modify_original_stack()
1116 copy_reg(&ms->pmsa_gr[6-1], ms->pmsa_nat_bits, &old_sw->r6, &old_unat); in ia64_mca_modify_original_stack()
1117 copy_reg(&ms->pmsa_gr[7-1], ms->pmsa_nat_bits, &old_sw->r7, &old_unat); in ia64_mca_modify_original_stack()
1118 old_sw->b0 = (u64)ia64_leave_kernel; in ia64_mca_modify_original_stack()
1119 old_sw->b1 = ms->pmsa_br1; in ia64_mca_modify_original_stack()
1120 old_sw->ar_pfs = 0; in ia64_mca_modify_original_stack()
1121 old_sw->ar_unat = old_unat; in ia64_mca_modify_original_stack()
1122 old_sw->pr = old_regs->pr | (1UL << PRED_NON_SYSCALL); in ia64_mca_modify_original_stack()
1123 previous_current->thread.ksp = (u64)p - 16; in ia64_mca_modify_original_stack()
1138 old_rnat = regs->ar_rnat; in ia64_mca_modify_original_stack()
1139 while (slots--) { in ia64_mca_modify_original_stack()
1152 old_sw->ar_bspstore = (unsigned long)old_bspstore; in ia64_mca_modify_original_stack()
1153 old_sw->ar_rnat = old_rnat; in ia64_mca_modify_original_stack()
1155 sos->prev_task = previous_current; in ia64_mca_modify_original_stack()
1161 old_unat = regs->ar_unat; in ia64_mca_modify_original_stack()
1237 p = ia64_idtrs[cpu] + (iord - 1) * IA64_TR_ALLOC_MAX; in mca_insert_tr()
1238 if (p->pte & 0x1) { in mca_insert_tr()
1239 old_rr = ia64_get_rr(p->ifa); in mca_insert_tr()
1240 if (old_rr != p->rr) { in mca_insert_tr()
1241 ia64_set_rr(p->ifa, p->rr); in mca_insert_tr()
1244 ia64_ptr(iord, p->ifa, p->itir >> 2); in mca_insert_tr()
1247 ia64_itr(0x1, i, p->ifa, p->pte, p->itir >> 2); in mca_insert_tr()
1251 ia64_itr(0x2, i, p->ifa, p->pte, p->itir >> 2); in mca_insert_tr()
1254 if (old_rr != p->rr) { in mca_insert_tr()
1255 ia64_set_rr(p->ifa, old_rr); in mca_insert_tr()
1269 * Right now the logs are extracted and displayed in a well-defined
1273 * Monarch also has the duty of sending wakeup-IPIs to pull the
1296 sos->monarch = 1; in ia64_mca_handler()
1299 sos->monarch = 0; in ia64_mca_handler()
1302 "monarch=%ld\n", sos->proc_state_param, cpu, sos->monarch); in ia64_mca_handler()
1309 if (sos->monarch) { in ia64_mca_handler()
1338 rh->severity = sal_log_severity_corrected; in ia64_mca_handler()
1340 sos->os_status = IA64_MCA_CORRECTED; in ia64_mca_handler()
1363 while (monarch_cpu != -1) in ia64_mca_handler()
1374 monarch_cpu = -1; /* This frees the slaves and previous monarchs */ in ia64_mca_handler()
1384 * Right now the logs are extracted and displayed in a well-defined
1413 if (now - cmc_history[i] <= HZ) in ia64_mca_cmc_int_handler()
1472 static int start_count = -1; in ia64_mca_cmc_int_caller()
1478 if (start_count == -1) in ia64_mca_cmc_int_caller()
1500 start_count = -1; in ia64_mca_cmc_int_caller()
1539 static int start_count = -1; in ia64_mca_cpe_int_caller()
1546 if (start_count == -1) in ia64_mca_cpe_int_caller()
1574 start_count = -1; in ia64_mca_cpe_int_caller()
1618 printk(KERN_ERR "Processes interrupted by INIT -"); in default_monarch_init_process()
1623 g = s->prev_task; in default_monarch_init_process()
1625 if (g->pid) in default_monarch_init_process()
1626 printk(" %d", g->pid); in default_monarch_init_process()
1628 printk(" %d (cpu %d task 0x%p)", g->pid, task_cpu(g), g); in default_monarch_init_process()
1634 printk("\nBacktrace of pid %d (%s)\n", t->pid, t->comm); in default_monarch_init_process()
1651 * sos->monarch.
1675 sos->proc_state_param, cpu, sos->monarch); in ia64_init_handler()
1679 sos->os_status = IA64_INIT_RESUME; in ia64_init_handler()
1686 if (!sos->monarch && atomic_add_return(1, &slaves) == num_online_cpus()) { in ia64_init_handler()
1690 sos->monarch = 1; in ia64_init_handler()
1698 if (sos->monarch && atomic_add_return(1, &monarchs) > 1) { in ia64_init_handler()
1702 sos->monarch = 0; in ia64_init_handler()
1705 if (!sos->monarch) { in ia64_init_handler()
1709 while (monarch_cpu == -1 && !atomic_read(&kdump_in_progress)) in ia64_init_handler()
1712 while (monarch_cpu == -1) in ia64_init_handler()
1720 while (monarch_cpu != -1 && !atomic_read(&kdump_in_progress)) in ia64_init_handler()
1723 while (monarch_cpu != -1) in ia64_init_handler()
1741 * generated via the BMC's command-line interface, but since the console is on the in ia64_init_handler()
1758 monarch_cpu = -1; in ia64_init_handler()
1785 ti->flags = _TIF_MCA_INIT; in format_mca_init_stack()
1786 ti->preempt_count = 1; in format_mca_init_stack()
1787 ti->task = p; in format_mca_init_stack()
1788 ti->cpu = cpu; in format_mca_init_stack()
1789 p->stack = ti; in format_mca_init_stack()
1790 p->__state = TASK_UNINTERRUPTIBLE; in format_mca_init_stack()
1791 cpumask_set_cpu(cpu, &p->cpus_mask); in format_mca_init_stack()
1792 INIT_LIST_HEAD(&p->tasks); in format_mca_init_stack()
1793 p->parent = p->real_parent = p->group_leader = p; in format_mca_init_stack()
1794 INIT_LIST_HEAD(&p->children); in format_mca_init_stack()
1795 INIT_LIST_HEAD(&p->sibling); in format_mca_init_stack()
1796 strscpy(p->comm, type, sizeof(p->comm)-1); in format_mca_init_stack()
1805 /* Do per-CPU MCA-related initialization. */
1839 * Stash away a copy of the PTE needed to map the per-CPU page. in ia64_mca_cpu_init()
1924 if (rc == -2) { in ia64_mca_init()
1950 ia64_mc_info.imi_mca_handler = ia64_tpa(mca_hldlr_ptr->fp); in ia64_mca_init()
1952 * XXX - disable SAL checksum by setting size to 0; should be in ia64_mca_init()
1953 * ia64_tpa(ia64_os_mca_dispatch_end) - ia64_tpa(ia64_os_mca_dispatch); in ia64_mca_init()
1960 ia64_tpa(mca_hldlr_ptr->gp), in ia64_mca_init()
1970 ia64_mc_info.imi_mca_handler, ia64_tpa(mca_hldlr_ptr->gp)); in ia64_mca_init()
1973 * XXX - disable SAL checksum by setting size to 0, should be in ia64_mca_init()
1976 ia64_mc_info.imi_monarch_init_handler = ia64_tpa(init_hldlr_ptr_monarch->fp); in ia64_mca_init()
1978 ia64_mc_info.imi_slave_init_handler = ia64_tpa(init_hldlr_ptr_slave->fp); in ia64_mca_init()
2023 * point at a non-existant action. Called from arch_early_irq_init().
2029 * per-processor, so AP CMC interrupts are setup in smp_callin() (smpboot.c). in ia64_mca_irq_init()