Lines Matching +full:llp +full:- +full:based
1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Copyright (C) 1996-2005 Paul Mackerras.
54 #include <asm/code-patching.h>
65 #include "dis-asm.h"
119 #define BP_NUM(bp) ((bp) - bpts + 1)
208 static const char *xmon_ro_msg = "Operation disabled: xmon in read-only mode\n";
312 printf("xmon: Read-only due to kernel lockdown\n"); in xmon_is_locked_down()
342 * write_ciabr() - write the CIABR SPR
363 * set_ciabr() - set the CIABR
383 * XXX we should re-enable it when we leave. :)
432 if (--timeout > 0) { in get_output_lock()
461 for (timeout = 20000; timeout != 0; --timeout) { in wait_for_other_cpus()
481 return ((regs->msr & MSR_RI) == 0); in unrecoverable_excp()
515 bp = in_breakpoint_table(regs->nip, &offset); in xmon_core()
517 regs->nip = bp->address + offset; in xmon_core()
518 atomic_dec(&bp->ref_count); in xmon_core()
536 cpu, regs->trap, getvecname(TRAP(regs))); in xmon_core()
556 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT)) in xmon_core()
557 bp = at_breakpoint(regs->nip); in xmon_core()
568 xmon_print_symbol(regs->nip, " ", ")\n"); in xmon_core()
620 ppc_inst_dump(regs->nip, 1, 0); in xmon_core()
668 regs->trap, getvecname(TRAP(regs))); in xmon_core()
676 bp = at_breakpoint(regs->nip); in xmon_core()
679 xmon_print_symbol(regs->nip, " ", ")\n"); in xmon_core()
689 ppc_inst_dump(regs->nip, 1, 0); in xmon_core()
702 if (regs->msr & MSR_DE) { in xmon_core()
703 bp = at_breakpoint(regs->nip); in xmon_core()
705 regs->nip = (unsigned long) &bp->instr[0]; in xmon_core()
706 atomic_inc(&bp->ref_count); in xmon_core()
710 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT)) { in xmon_core()
711 bp = at_breakpoint(regs->nip); in xmon_core()
713 int stepped = emulate_step(regs, ppc_inst_read(bp->instr)); in xmon_core()
715 regs->nip = (unsigned long) &bp->instr[0]; in xmon_core()
716 atomic_inc(&bp->ref_count); in xmon_core()
718 printf("Couldn't single-step %s instruction\n", in xmon_core()
719 IS_RFID(ppc_inst_read(bp->instr))? "rfid": "mtmsrd"); in xmon_core()
763 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) != (MSR_IR|MSR_64BIT)) in xmon_bpt()
766 /* Are we at the trap at bp->instr[1] for some bp? */ in xmon_bpt()
767 bp = in_breakpoint_table(regs->nip, &offset); in xmon_bpt()
769 regs->nip = bp->address + offset; in xmon_bpt()
770 atomic_dec(&bp->ref_count); in xmon_bpt()
775 bp = at_breakpoint(regs->nip); in xmon_bpt()
796 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) != (MSR_IR|MSR_64BIT)) in xmon_break_match()
811 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) != (MSR_IR|MSR_64BIT)) in xmon_iabr_match()
836 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT)) { in xmon_fault_handler()
837 bp = in_breakpoint_table(regs->nip, &offset); in xmon_fault_handler()
839 regs->nip = bp->address + offset; in xmon_fault_handler()
840 atomic_dec(&bp->ref_count); in xmon_fault_handler()
864 if (bp->enabled && pc == bp->address) in at_breakpoint()
873 off = nip - (unsigned long)bpt_table; in in_breakpoint_table()
876 *offp = off & (BPT_SIZE - 1); in in_breakpoint_table()
892 if (!bp->enabled && atomic_read(&bp->ref_count) == 0) { in new_breakpoint()
893 bp->address = a; in new_breakpoint()
894 bp->instr = (void *)(bpt_table + ((bp - bpts) * BPT_WORDS)); in new_breakpoint()
911 if ((bp->enabled & (BP_TRAP|BP_CIABR)) == 0) in insert_bpts()
913 if (!mread_instr(bp->address, &instr)) { in insert_bpts()
915 "disabling breakpoint there\n", bp->address); in insert_bpts()
916 bp->enabled = 0; in insert_bpts()
921 "instruction, disabling it\n", bp->address); in insert_bpts()
922 bp->enabled = 0; in insert_bpts()
929 if (mread_instr(bp->address - 4, &instr2) == 8) { in insert_bpts()
931 bp->address); in insert_bpts()
932 bp->enabled = 0; in insert_bpts()
936 * We might still be a suffix - if the prefix has already been in insert_bpts()
940 bp2 = at_breakpoint(bp->address - 4); in insert_bpts()
941 if (bp2 && ppc_inst_prefixed(ppc_inst_read(bp2->instr))) { in insert_bpts()
943 bp->address); in insert_bpts()
944 bp->enabled = 0; in insert_bpts()
948 patch_instruction(bp->instr, instr); in insert_bpts()
949 patch_instruction(ppc_inst_next(bp->instr, &instr), in insert_bpts()
951 if (bp->enabled & BP_CIABR) in insert_bpts()
953 if (patch_instruction((struct ppc_inst *)bp->address, in insert_bpts()
956 "disabling breakpoint there\n", bp->address); in insert_bpts()
957 bp->enabled &= ~BP_TRAP; in insert_bpts()
979 set_ciabr(iabr->address); in insert_cpu_bpts()
990 if ((bp->enabled & (BP_TRAP|BP_CIABR)) != BP_TRAP) in remove_bpts()
992 if (mread_instr(bp->address, &instr) in remove_bpts()
995 (struct ppc_inst *)bp->address, ppc_inst_read(bp->instr)) != 0) in remove_bpts()
997 bp->address); in remove_bpts()
1007 /* Based on uptime_proc_show(). */
1048 xmon_show_stack(excp->gpr[1], excp->link, excp->nip); in cmds()
1191 regs->msr |= MSR_DE; in do_step()
1206 /* check we are in 64-bit kernel mode, translation enabled */ in do_step()
1207 if ((regs->msr & (MSR_64BIT|MSR_PR|MSR_IR)) == (MSR_64BIT|MSR_IR)) { in do_step()
1208 if (mread_instr(regs->nip, &instr)) { in do_step()
1211 printf("Couldn't single-step %s instruction\n", in do_step()
1218 xmon_print_symbol(regs->nip, " ", "\n"); in do_step()
1219 ppc_inst_dump(regs->nip, 1, 0); in do_step()
1224 regs->msr |= MSR_SE; in do_step()
1262 printf("-0x%lx", last_cpu); in cpu_cmd()
1269 printf("-0x%lx", last_cpu); in cpu_cmd()
1278 xmon_show_stack(paca_ptrs[cpu]->saved_r1, 0, 0); in cpu_cmd()
1287 if (--timeout == 0) { in cpu_cmd()
1396 return -1; in find_free_data_bpt()
1437 case 'd': { /* bd - hardware data breakpoint */ in bpt_cmds()
1474 case 'i': /* bi - hardware instr breakpoint */ in bpt_cmds()
1485 iabr->enabled &= ~BP_CIABR; in bpt_cmds()
1494 bp->enabled |= BP_CIABR; in bpt_cmds()
1515 bp = &bpts[a-1]; /* bp nums are 1 based */ in bpt_cmds()
1526 xmon_print_symbol(bp->address, " ", ")\n"); in bpt_cmds()
1527 bp->enabled = 0; in bpt_cmds()
1544 if (!bp->enabled) in bpt_cmds()
1547 (bp->enabled & BP_CIABR) ? "inst": "trap"); in bpt_cmds()
1548 xmon_print_symbol(bp->address, " ", "\n"); in bpt_cmds()
1557 bp->enabled |= BP_TRAP; in bpt_cmds()
1624 *startp = pc - offset; in get_function_bounds()
1625 *endp = pc - offset + size; in get_function_bounds()
1644 while (max_to_print--) { in xmon_show_stack()
1704 printf("--- Exception: %lx %s at ", regs.trap, in xmon_show_stack()
1725 xmon_show_stack(excp->gpr[1], excp->link, excp->nip); in backtrace()
1735 if (regs->msr & MSR_PR) in print_bug_trap()
1737 addr = regs->nip; /* address of trap instruction */ in print_bug_trap()
1740 bug = find_bug(regs->nip); in print_bug_trap()
1748 bug->file, bug->line); in print_bug_trap()
1750 printf("kernel BUG at %px!\n", (void *)bug->bug_addr); in print_bug_trap()
1764 printf("Vector: %lx %s at [%px]\n", fp->trap, getvecname(trap), fp); in excprint()
1766 xmon_print_symbol(fp->nip, ": ", "\n"); in excprint()
1769 xmon_print_symbol(fp->link, ": ", "\n"); in excprint()
1771 printf(" sp: %lx\n", fp->gpr[1]); in excprint()
1772 printf(" msr: %lx\n", fp->msr); in excprint()
1775 printf(" dar: %lx\n", fp->dar); in excprint()
1777 printf(" dsisr: %lx\n", fp->dsisr); in excprint()
1783 local_paca, local_paca->irq_soft_mask, local_paca->irq_happened); in excprint()
1787 current->pid, current->comm); in excprint()
1823 n, fp->gpr[n], n+16, fp->gpr[n+16]); in prregs()
1827 n, fp->gpr[n], n+7, fp->gpr[n+7]); in prregs()
1831 printf("R%.2d = %.8lx%s", n, fp->gpr[n], in prregs()
1840 xmon_print_symbol(fp->nip, " ", "\n"); in prregs()
1843 xmon_print_symbol(fp->orig_gpr3, " ", "\n"); in prregs()
1846 xmon_print_symbol(fp->link, " ", "\n"); in prregs()
1847 printf("msr = "REG" cr = %.8lx\n", fp->msr, fp->ccr); in prregs()
1849 fp->ctr, fp->xer, fp->trap); in prregs()
1852 printf("dar = "REG" dsisr = %.8lx\n", fp->dar, fp->dsisr); in prregs()
1868 nflush = (nflush + L1_CACHE_BYTES - 1) / L1_CACHE_BYTES; in cacheflush()
1874 for (; nflush > 0; --nflush, adrs += L1_CACHE_BYTES) in cacheflush()
1877 for (; nflush > 0; --nflush, adrs += L1_CACHE_BYTES) in cacheflush()
1893 unsigned long ret = -1UL; in read_spr()
1938 /* Actually some of these pre-date 2.06, but whatevs */ in dump_206_sprs()
2234 static char *fault_chars[] = { "--", "**", "##" };
2306 " ` clear no-read flag\n"
2313 " n toggle no-read flag\n"
2395 adrs -= size; in memex()
2424 adrs -= size; in memex()
2428 adrs -= 1 << nslash; in memex()
2436 adrs += 1 << -nslash; in memex()
2439 nslash -= 4; in memex()
2440 adrs -= 1 << -nslash; in memex()
2454 adrs -= n; in memex()
2500 n -= r; in xmon_rawdump()
2538 printf(" %-*s = %s\n", 25, "possible", cpu_possible(cpu) ? "yes" : "no"); in dump_one_paca()
2539 printf(" %-*s = %s\n", 25, "present", cpu_present(cpu) ? "yes" : "no"); in dump_one_paca()
2540 printf(" %-*s = %s\n", 25, "online", cpu_online(cpu) ? "yes" : "no"); in dump_one_paca()
2543 printf(" %-*s = "format"\t(0x%lx)\n", 25, #name, 18, paca->name, \ in dump_one_paca()
2546 DUMP(p, lock_token, "%#-*x"); in dump_one_paca()
2547 DUMP(p, paca_index, "%#-*x"); in dump_one_paca()
2548 DUMP(p, kernel_toc, "%#-*llx"); in dump_one_paca()
2549 DUMP(p, kernelbase, "%#-*llx"); in dump_one_paca()
2550 DUMP(p, kernel_msr, "%#-*llx"); in dump_one_paca()
2551 DUMP(p, emergency_sp, "%-*px"); in dump_one_paca()
2553 DUMP(p, nmi_emergency_sp, "%-*px"); in dump_one_paca()
2554 DUMP(p, mc_emergency_sp, "%-*px"); in dump_one_paca()
2555 DUMP(p, in_nmi, "%#-*x"); in dump_one_paca()
2556 DUMP(p, in_mce, "%#-*x"); in dump_one_paca()
2557 DUMP(p, hmi_event_available, "%#-*x"); in dump_one_paca()
2559 DUMP(p, data_offset, "%#-*llx"); in dump_one_paca()
2560 DUMP(p, hw_cpu_id, "%#-*x"); in dump_one_paca()
2561 DUMP(p, cpu_start, "%#-*x"); in dump_one_paca()
2562 DUMP(p, kexec_state, "%#-*x"); in dump_one_paca()
2568 if (!p->slb_shadow_ptr) in dump_one_paca()
2571 esid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].esid); in dump_one_paca()
2572 vsid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].vsid); in dump_one_paca()
2575 printf(" %-*s[%d] = 0x%016llx 0x%016llx\n", in dump_one_paca()
2579 DUMP(p, vmalloc_sllp, "%#-*x"); in dump_one_paca()
2580 DUMP(p, stab_rr, "%#-*x"); in dump_one_paca()
2581 DUMP(p, slb_used_bitmap, "%#-*x"); in dump_one_paca()
2582 DUMP(p, slb_kern_bitmap, "%#-*x"); in dump_one_paca()
2585 DUMP(p, slb_cache_ptr, "%#-*x"); in dump_one_paca()
2587 printf(" %-*s[%d] = 0x%016x\n", in dump_one_paca()
2588 22, "slb_cache", i, p->slb_cache[i]); in dump_one_paca()
2592 DUMP(p, rfi_flush_fallback_area, "%-*px"); in dump_one_paca()
2594 DUMP(p, dscr_default, "%#-*llx"); in dump_one_paca()
2596 DUMP(p, pgd, "%-*px"); in dump_one_paca()
2597 DUMP(p, kernel_pgd, "%-*px"); in dump_one_paca()
2598 DUMP(p, tcd_ptr, "%-*px"); in dump_one_paca()
2599 DUMP(p, mc_kstack, "%-*px"); in dump_one_paca()
2600 DUMP(p, crit_kstack, "%-*px"); in dump_one_paca()
2601 DUMP(p, dbg_kstack, "%-*px"); in dump_one_paca()
2603 DUMP(p, __current, "%-*px"); in dump_one_paca()
2604 DUMP(p, kstack, "%#-*llx"); in dump_one_paca()
2605 printf(" %-*s = 0x%016llx\n", 25, "kstack_base", p->kstack & ~(THREAD_SIZE - 1)); in dump_one_paca()
2607 DUMP(p, canary, "%#-*lx"); in dump_one_paca()
2609 DUMP(p, saved_r1, "%#-*llx"); in dump_one_paca()
2611 DUMP(p, trap_save, "%#-*x"); in dump_one_paca()
2613 DUMP(p, irq_soft_mask, "%#-*x"); in dump_one_paca()
2614 DUMP(p, irq_happened, "%#-*x"); in dump_one_paca()
2616 DUMP(p, mmiowb_state.nesting_count, "%#-*x"); in dump_one_paca()
2617 DUMP(p, mmiowb_state.mmiowb_pending, "%#-*x"); in dump_one_paca()
2619 DUMP(p, irq_work_pending, "%#-*x"); in dump_one_paca()
2620 DUMP(p, sprg_vdso, "%#-*llx"); in dump_one_paca()
2623 DUMP(p, tm_scratch, "%#-*llx"); in dump_one_paca()
2627 DUMP(p, idle_state, "%#-*lx"); in dump_one_paca()
2629 DUMP(p, thread_idle_state, "%#-*x"); in dump_one_paca()
2630 DUMP(p, subcore_sibling_mask, "%#-*x"); in dump_one_paca()
2633 DUMP(p, requested_psscr, "%#-*llx"); in dump_one_paca()
2634 DUMP(p, dont_stop.counter, "%#-*x"); in dump_one_paca()
2639 DUMP(p, accounting.utime, "%#-*lx"); in dump_one_paca()
2640 DUMP(p, accounting.stime, "%#-*lx"); in dump_one_paca()
2642 DUMP(p, accounting.utime_scaled, "%#-*lx"); in dump_one_paca()
2644 DUMP(p, accounting.starttime, "%#-*lx"); in dump_one_paca()
2645 DUMP(p, accounting.starttime_user, "%#-*lx"); in dump_one_paca()
2647 DUMP(p, accounting.startspurr, "%#-*lx"); in dump_one_paca()
2648 DUMP(p, accounting.utime_sspurr, "%#-*lx"); in dump_one_paca()
2650 DUMP(p, accounting.steal_time, "%#-*lx"); in dump_one_paca()
2895 dump_by_size(adrs, ndump, c - '0'); in dump()
2921 if ((m & (sizeof(long) - 1)) == 0 && m > 0) in prdump()
2929 if ((m & (sizeof(long) - 1)) == 0) in prdump()
2941 n -= r; in prdump()
2961 for (first_adr = adr; count > 0; --count, adr += ppc_inst_len(inst)) { in generic_inst_dump()
2988 return adr - first_adr; in generic_inst_dump()
3053 while ((res = opal_msglog_copy(buf, pos, sizeof(buf) - 1))) { in dump_opal_msglog()
3072 * Memory operations - move, set, print differences
3120 for( n = nb; n > 0; --n ) in memdiffs()
3123 printf("%px %.2x # %px %.2x\n", p1 - 1, in memdiffs()
3124 p1[-1], p2 - 1, p2[-1]); in memdiffs()
3183 printf("%.8lx\n", a - mskip); in memzcan()
3189 printf("%.8lx\n", a - mskip); in memzcan()
3201 state = (tsk->state == 0) ? 'R' : in show_task()
3202 (tsk->state < 0) ? 'U' : in show_task()
3203 (tsk->state & TASK_UNINTERRUPTIBLE) ? 'D' : in show_task()
3204 (tsk->state & TASK_STOPPED) ? 'T' : in show_task()
3205 (tsk->state & TASK_TRACED) ? 'C' : in show_task()
3206 (tsk->exit_state & EXIT_ZOMBIE) ? 'Z' : in show_task()
3207 (tsk->exit_state & EXIT_DEAD) ? 'E' : in show_task()
3208 (tsk->state & TASK_INTERRUPTIBLE) ? 'S' : '?'; in show_task()
3211 tsk->thread.ksp, tsk->thread.regs, in show_task()
3212 tsk->pid, rcu_dereference(tsk->parent)->pid, in show_task()
3214 tsk->comm); in show_task()
3252 mm = tsk->active_mm; in show_pte()
3333 printf(" task_struct ->thread.ksp ->thread.regs PID PPID S P CMD\n"); in show_tasks()
3437 for (i = 0; i < sizeof(regname) - 1; ++i) { in scanhex()
3529 return c - '0'; in hexdigit()
3531 return c - ('A' - 10); in hexdigit()
3533 return c - ('a' - 10); in hexdigit()
3551 --size; in getstring()
3683 unsigned long llp; in dump_segments() local
3701 llp = vsid & SLB_VSID_LLP; in dump_segments()
3703 printf(" 1T ESID=%9lx VSID=%13lx LLP:%3lx \n", in dump_segments()
3706 llp); in dump_segments()
3708 printf(" 256M ESID=%9lx VSID=%13lx LLP:%3lx \n", in dump_segments()
3711 llp); in dump_segments()
3722 printf("sr0-15 ="); in dump_segments()
3741 printf("V %08lx -> %01lx%08lx %c%c%c%c%c", in dump_tlb_44x()
3807 printf("Book3E MMU MAV=%d.0,%d TLBs,%d-bit PID,%d-bit LPID,%d-bit RA\n", in dump_tlb_book3e()
3809 pidmask = (1ul << pidsz) - 1; in dump_tlb_book3e()
3810 lpidmask = (1ul << lpidsz) - 1; in dump_tlb_book3e()
3811 ramask = (1ull << rasz) - 1; in dump_tlb_book3e()
3816 printf("TLB %d:\n------\n", tlb); in dump_tlb_book3e()
3862 printf("%04x- ", i); in dump_tlb_book3e()
3864 printf("%04x-%c", cc, 'A' + esel); in dump_tlb_book3e()
3916 set_indicator_token = rtas_token("set-indicator"); in xmon_init()
4071 if (spu->number >= XMON_NUM_SPUS) { in xmon_register_spus()
4076 spu_info[spu->number].spu = spu; in xmon_register_spus()
4077 spu_info[spu->number].stopped_ok = 0; in xmon_register_spus()
4078 spu_info[spu->number].dump_addr = (unsigned long) in xmon_register_spus()
4079 spu_info[spu->number].spu->local_store; in xmon_register_spus()
4100 in_be32(&spu->problem->spu_runcntl_RW); in stop_spus()
4145 out_be32(&spu->problem->spu_runcntl_RW, in restart_spus()
4166 printf(" %-*s = "format"\n", DUMP_WIDTH, \
4172 printf(" %-*s = *** Error reading field.\n", \
4179 DUMP_VALUE(format, field, obj->field)
4207 DUMP_VALUE("0x%x", problem->spu_runcntl_RW, in dump_spu_fields()
4208 in_be32(&spu->problem->spu_runcntl_RW)); in dump_spu_fields()
4209 DUMP_VALUE("0x%x", problem->spu_status_R, in dump_spu_fields()
4210 in_be32(&spu->problem->spu_status_R)); in dump_spu_fields()
4211 DUMP_VALUE("0x%x", problem->spu_npc_RW, in dump_spu_fields()
4212 in_be32(&spu->problem->spu_npc_RW)); in dump_spu_fields()
4230 ls_addr = (unsigned long)spu_info[num].spu->local_store; in dump_spu_ls()
4301 return -1; in do_spu_cmd()
4309 return -1; in do_spu_cmd()