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>
64 #include "dis-asm.h"
118 #define BP_NUM(bp) ((bp) - bpts + 1)
207 static const char *xmon_ro_msg = "Operation disabled: xmon in read-only mode\n";
311 printf("xmon: Read-only due to kernel lockdown\n"); in xmon_is_locked_down()
341 * write_ciabr() - write the CIABR SPR
362 * set_ciabr() - set the CIABR
382 * XXX we should re-enable it when we leave. :)
431 if (--timeout > 0) { in get_output_lock()
460 for (timeout = 20000; timeout != 0; --timeout) { in wait_for_other_cpus()
480 return ((regs->msr & MSR_RI) == 0); in unrecoverable_excp()
514 bp = in_breakpoint_table(regs->nip, &offset); in xmon_core()
516 regs->nip = bp->address + offset; in xmon_core()
517 atomic_dec(&bp->ref_count); in xmon_core()
535 cpu, regs->trap, getvecname(TRAP(regs))); in xmon_core()
555 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT)) in xmon_core()
556 bp = at_breakpoint(regs->nip); in xmon_core()
567 xmon_print_symbol(regs->nip, " ", ")\n"); in xmon_core()
619 ppc_inst_dump(regs->nip, 1, 0); in xmon_core()
667 regs->trap, getvecname(TRAP(regs))); in xmon_core()
675 bp = at_breakpoint(regs->nip); in xmon_core()
678 xmon_print_symbol(regs->nip, " ", ")\n"); in xmon_core()
688 ppc_inst_dump(regs->nip, 1, 0); in xmon_core()
701 if (regs->msr & MSR_DE) { in xmon_core()
702 bp = at_breakpoint(regs->nip); in xmon_core()
704 regs->nip = (unsigned long) &bp->instr[0]; in xmon_core()
705 atomic_inc(&bp->ref_count); in xmon_core()
709 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT)) { in xmon_core()
710 bp = at_breakpoint(regs->nip); in xmon_core()
712 int stepped = emulate_step(regs, ppc_inst_read(bp->instr)); in xmon_core()
714 regs->nip = (unsigned long) &bp->instr[0]; in xmon_core()
715 atomic_inc(&bp->ref_count); in xmon_core()
717 printf("Couldn't single-step %s instruction\n", in xmon_core()
718 IS_RFID(ppc_inst_read(bp->instr))? "rfid": "mtmsrd"); in xmon_core()
762 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) != (MSR_IR|MSR_64BIT)) in xmon_bpt()
765 /* Are we at the trap at bp->instr[1] for some bp? */ in xmon_bpt()
766 bp = in_breakpoint_table(regs->nip, &offset); in xmon_bpt()
768 regs->nip = bp->address + offset; in xmon_bpt()
769 atomic_dec(&bp->ref_count); in xmon_bpt()
774 bp = at_breakpoint(regs->nip); in xmon_bpt()
795 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) != (MSR_IR|MSR_64BIT)) in xmon_break_match()
810 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) != (MSR_IR|MSR_64BIT)) in xmon_iabr_match()
835 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT)) { in xmon_fault_handler()
836 bp = in_breakpoint_table(regs->nip, &offset); in xmon_fault_handler()
838 regs->nip = bp->address + offset; in xmon_fault_handler()
839 atomic_dec(&bp->ref_count); in xmon_fault_handler()
863 if (bp->enabled && pc == bp->address) in at_breakpoint()
872 off = nip - (unsigned long)bpt_table; in in_breakpoint_table()
875 *offp = off & (BPT_SIZE - 1); in in_breakpoint_table()
891 if (!bp->enabled && atomic_read(&bp->ref_count) == 0) { in new_breakpoint()
892 bp->address = a; in new_breakpoint()
893 bp->instr = (void *)(bpt_table + ((bp - bpts) * BPT_WORDS)); in new_breakpoint()
910 if ((bp->enabled & (BP_TRAP|BP_CIABR)) == 0) in insert_bpts()
912 if (!mread_instr(bp->address, &instr)) { in insert_bpts()
914 "disabling breakpoint there\n", bp->address); in insert_bpts()
915 bp->enabled = 0; in insert_bpts()
920 "instruction, disabling it\n", bp->address); in insert_bpts()
921 bp->enabled = 0; in insert_bpts()
928 if (mread_instr(bp->address - 4, &instr2) == 8) { in insert_bpts()
930 bp->address); in insert_bpts()
931 bp->enabled = 0; in insert_bpts()
935 * We might still be a suffix - if the prefix has already been in insert_bpts()
939 bp2 = at_breakpoint(bp->address - 4); in insert_bpts()
940 if (bp2 && ppc_inst_prefixed(ppc_inst_read(bp2->instr))) { in insert_bpts()
942 bp->address); in insert_bpts()
943 bp->enabled = 0; in insert_bpts()
947 patch_instruction(bp->instr, instr); in insert_bpts()
948 patch_instruction(ppc_inst_next(bp->instr, &instr), in insert_bpts()
950 if (bp->enabled & BP_CIABR) in insert_bpts()
952 if (patch_instruction((struct ppc_inst *)bp->address, in insert_bpts()
955 "disabling breakpoint there\n", bp->address); in insert_bpts()
956 bp->enabled &= ~BP_TRAP; in insert_bpts()
978 set_ciabr(iabr->address); in insert_cpu_bpts()
989 if ((bp->enabled & (BP_TRAP|BP_CIABR)) != BP_TRAP) in remove_bpts()
991 if (mread_instr(bp->address, &instr) in remove_bpts()
994 (struct ppc_inst *)bp->address, ppc_inst_read(bp->instr)) != 0) in remove_bpts()
996 bp->address); in remove_bpts()
1006 /* Based on uptime_proc_show(). */
1047 xmon_show_stack(excp->gpr[1], excp->link, excp->nip); in cmds()
1190 regs->msr |= MSR_DE; in do_step()
1205 /* check we are in 64-bit kernel mode, translation enabled */ in do_step()
1206 if ((regs->msr & (MSR_64BIT|MSR_PR|MSR_IR)) == (MSR_64BIT|MSR_IR)) { in do_step()
1207 if (mread_instr(regs->nip, &instr)) { in do_step()
1210 printf("Couldn't single-step %s instruction\n", in do_step()
1217 xmon_print_symbol(regs->nip, " ", "\n"); in do_step()
1218 ppc_inst_dump(regs->nip, 1, 0); in do_step()
1223 regs->msr |= MSR_SE; in do_step()
1261 printf("-0x%lx", last_cpu); in cpu_cmd()
1268 printf("-0x%lx", last_cpu); in cpu_cmd()
1277 xmon_show_stack(paca_ptrs[cpu]->saved_r1, 0, 0); in cpu_cmd()
1286 if (--timeout == 0) { in cpu_cmd()
1396 return -1; in find_free_data_bpt()
1441 case 'd': /* bd - hardware data breakpoint */ in bpt_cmds()
1475 case 'i': /* bi - hardware instr breakpoint */ in bpt_cmds()
1486 iabr->enabled &= ~BP_CIABR; in bpt_cmds()
1495 bp->enabled |= BP_CIABR; in bpt_cmds()
1517 bp = &bpts[a-1]; /* bp nums are 1 based */ in bpt_cmds()
1528 xmon_print_symbol(bp->address, " ", ")\n"); in bpt_cmds()
1529 bp->enabled = 0; in bpt_cmds()
1546 if (!bp->enabled) in bpt_cmds()
1549 (bp->enabled & BP_CIABR) ? "inst": "trap"); in bpt_cmds()
1550 xmon_print_symbol(bp->address, " ", "\n"); in bpt_cmds()
1559 bp->enabled |= BP_TRAP; in bpt_cmds()
1626 *startp = pc - offset; in get_function_bounds()
1627 *endp = pc - offset + size; in get_function_bounds()
1646 while (max_to_print--) { in xmon_show_stack()
1706 printf("--- Exception: %lx %s at ", regs.trap, in xmon_show_stack()
1727 xmon_show_stack(excp->gpr[1], excp->link, excp->nip); in backtrace()
1737 if (regs->msr & MSR_PR) in print_bug_trap()
1739 addr = regs->nip; /* address of trap instruction */ in print_bug_trap()
1742 bug = find_bug(regs->nip); in print_bug_trap()
1750 bug->file, bug->line); in print_bug_trap()
1752 printf("kernel BUG at %px!\n", (void *)bug->bug_addr); in print_bug_trap()
1766 printf("Vector: %lx %s at [%px]\n", fp->trap, getvecname(trap), fp); in excprint()
1768 xmon_print_symbol(fp->nip, ": ", "\n"); in excprint()
1771 xmon_print_symbol(fp->link, ": ", "\n"); in excprint()
1773 printf(" sp: %lx\n", fp->gpr[1]); in excprint()
1774 printf(" msr: %lx\n", fp->msr); in excprint()
1777 printf(" dar: %lx\n", fp->dar); in excprint()
1779 printf(" dsisr: %lx\n", fp->dsisr); in excprint()
1785 local_paca, local_paca->irq_soft_mask, local_paca->irq_happened); in excprint()
1789 current->pid, current->comm); in excprint()
1825 n, fp->gpr[n], n+16, fp->gpr[n+16]); in prregs()
1829 n, fp->gpr[n], n+7, fp->gpr[n+7]); in prregs()
1833 printf("R%.2d = %.8lx%s", n, fp->gpr[n], in prregs()
1842 xmon_print_symbol(fp->nip, " ", "\n"); in prregs()
1845 xmon_print_symbol(fp->orig_gpr3, " ", "\n"); in prregs()
1848 xmon_print_symbol(fp->link, " ", "\n"); in prregs()
1849 printf("msr = "REG" cr = %.8lx\n", fp->msr, fp->ccr); in prregs()
1851 fp->ctr, fp->xer, fp->trap); in prregs()
1854 printf("dar = "REG" dsisr = %.8lx\n", fp->dar, fp->dsisr); in prregs()
1870 nflush = (nflush + L1_CACHE_BYTES - 1) / L1_CACHE_BYTES; in cacheflush()
1876 for (; nflush > 0; --nflush, adrs += L1_CACHE_BYTES) in cacheflush()
1879 for (; nflush > 0; --nflush, adrs += L1_CACHE_BYTES) in cacheflush()
1895 unsigned long ret = -1UL; in read_spr()
1940 /* Actually some of these pre-date 2.06, but whatevs */ in dump_206_sprs()
2236 static char *fault_chars[] = { "--", "**", "##" };
2308 " ` clear no-read flag\n"
2315 " n toggle no-read flag\n"
2397 adrs -= size; in memex()
2426 adrs -= size; in memex()
2430 adrs -= 1 << nslash; in memex()
2438 adrs += 1 << -nslash; in memex()
2441 nslash -= 4; in memex()
2442 adrs -= 1 << -nslash; in memex()
2456 adrs -= n; in memex()
2502 n -= r; in xmon_rawdump()
2540 printf(" %-*s = %s\n", 25, "possible", cpu_possible(cpu) ? "yes" : "no"); in dump_one_paca()
2541 printf(" %-*s = %s\n", 25, "present", cpu_present(cpu) ? "yes" : "no"); in dump_one_paca()
2542 printf(" %-*s = %s\n", 25, "online", cpu_online(cpu) ? "yes" : "no"); in dump_one_paca()
2545 printf(" %-*s = "format"\t(0x%lx)\n", 25, #name, 18, paca->name, \ in dump_one_paca()
2548 DUMP(p, lock_token, "%#-*x"); in dump_one_paca()
2549 DUMP(p, paca_index, "%#-*x"); in dump_one_paca()
2550 DUMP(p, kernel_toc, "%#-*llx"); in dump_one_paca()
2551 DUMP(p, kernelbase, "%#-*llx"); in dump_one_paca()
2552 DUMP(p, kernel_msr, "%#-*llx"); in dump_one_paca()
2553 DUMP(p, emergency_sp, "%-*px"); in dump_one_paca()
2555 DUMP(p, nmi_emergency_sp, "%-*px"); in dump_one_paca()
2556 DUMP(p, mc_emergency_sp, "%-*px"); in dump_one_paca()
2557 DUMP(p, in_nmi, "%#-*x"); in dump_one_paca()
2558 DUMP(p, in_mce, "%#-*x"); in dump_one_paca()
2559 DUMP(p, hmi_event_available, "%#-*x"); in dump_one_paca()
2561 DUMP(p, data_offset, "%#-*llx"); in dump_one_paca()
2562 DUMP(p, hw_cpu_id, "%#-*x"); in dump_one_paca()
2563 DUMP(p, cpu_start, "%#-*x"); in dump_one_paca()
2564 DUMP(p, kexec_state, "%#-*x"); in dump_one_paca()
2570 if (!p->slb_shadow_ptr) in dump_one_paca()
2573 esid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].esid); in dump_one_paca()
2574 vsid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].vsid); in dump_one_paca()
2577 printf(" %-*s[%d] = 0x%016llx 0x%016llx\n", in dump_one_paca()
2581 DUMP(p, vmalloc_sllp, "%#-*x"); in dump_one_paca()
2582 DUMP(p, stab_rr, "%#-*x"); in dump_one_paca()
2583 DUMP(p, slb_used_bitmap, "%#-*x"); in dump_one_paca()
2584 DUMP(p, slb_kern_bitmap, "%#-*x"); in dump_one_paca()
2587 DUMP(p, slb_cache_ptr, "%#-*x"); in dump_one_paca()
2589 printf(" %-*s[%d] = 0x%016x\n", in dump_one_paca()
2590 22, "slb_cache", i, p->slb_cache[i]); in dump_one_paca()
2594 DUMP(p, rfi_flush_fallback_area, "%-*px"); in dump_one_paca()
2596 DUMP(p, dscr_default, "%#-*llx"); in dump_one_paca()
2598 DUMP(p, pgd, "%-*px"); in dump_one_paca()
2599 DUMP(p, kernel_pgd, "%-*px"); in dump_one_paca()
2600 DUMP(p, tcd_ptr, "%-*px"); in dump_one_paca()
2601 DUMP(p, mc_kstack, "%-*px"); in dump_one_paca()
2602 DUMP(p, crit_kstack, "%-*px"); in dump_one_paca()
2603 DUMP(p, dbg_kstack, "%-*px"); in dump_one_paca()
2605 DUMP(p, __current, "%-*px"); in dump_one_paca()
2606 DUMP(p, kstack, "%#-*llx"); in dump_one_paca()
2607 printf(" %-*s = 0x%016llx\n", 25, "kstack_base", p->kstack & ~(THREAD_SIZE - 1)); in dump_one_paca()
2609 DUMP(p, canary, "%#-*lx"); in dump_one_paca()
2611 DUMP(p, saved_r1, "%#-*llx"); in dump_one_paca()
2613 DUMP(p, trap_save, "%#-*x"); in dump_one_paca()
2615 DUMP(p, irq_soft_mask, "%#-*x"); in dump_one_paca()
2616 DUMP(p, irq_happened, "%#-*x"); in dump_one_paca()
2618 DUMP(p, mmiowb_state.nesting_count, "%#-*x"); in dump_one_paca()
2619 DUMP(p, mmiowb_state.mmiowb_pending, "%#-*x"); in dump_one_paca()
2621 DUMP(p, irq_work_pending, "%#-*x"); in dump_one_paca()
2622 DUMP(p, sprg_vdso, "%#-*llx"); in dump_one_paca()
2625 DUMP(p, tm_scratch, "%#-*llx"); in dump_one_paca()
2629 DUMP(p, idle_state, "%#-*lx"); in dump_one_paca()
2631 DUMP(p, thread_idle_state, "%#-*x"); in dump_one_paca()
2632 DUMP(p, subcore_sibling_mask, "%#-*x"); in dump_one_paca()
2635 DUMP(p, requested_psscr, "%#-*llx"); in dump_one_paca()
2636 DUMP(p, dont_stop.counter, "%#-*x"); in dump_one_paca()
2641 DUMP(p, accounting.utime, "%#-*lx"); in dump_one_paca()
2642 DUMP(p, accounting.stime, "%#-*lx"); in dump_one_paca()
2644 DUMP(p, accounting.utime_scaled, "%#-*lx"); in dump_one_paca()
2646 DUMP(p, accounting.starttime, "%#-*lx"); in dump_one_paca()
2647 DUMP(p, accounting.starttime_user, "%#-*lx"); in dump_one_paca()
2649 DUMP(p, accounting.startspurr, "%#-*lx"); in dump_one_paca()
2650 DUMP(p, accounting.utime_sspurr, "%#-*lx"); in dump_one_paca()
2652 DUMP(p, accounting.steal_time, "%#-*lx"); in dump_one_paca()
2897 dump_by_size(adrs, ndump, c - '0'); in dump()
2923 if ((m & (sizeof(long) - 1)) == 0 && m > 0) in prdump()
2931 if ((m & (sizeof(long) - 1)) == 0) in prdump()
2943 n -= r; in prdump()
2963 for (first_adr = adr; count > 0; --count, adr += ppc_inst_len(inst)) { in generic_inst_dump()
2990 return adr - first_adr; in generic_inst_dump()
3055 while ((res = opal_msglog_copy(buf, pos, sizeof(buf) - 1))) { in dump_opal_msglog()
3074 * Memory operations - move, set, print differences
3122 for( n = nb; n > 0; --n ) in memdiffs()
3125 printf("%px %.2x # %px %.2x\n", p1 - 1, in memdiffs()
3126 p1[-1], p2 - 1, p2[-1]); in memdiffs()
3185 printf("%.8lx\n", a - mskip); in memzcan()
3191 printf("%.8lx\n", a - mskip); in memzcan()
3203 state = (tsk->state == 0) ? 'R' : in show_task()
3204 (tsk->state < 0) ? 'U' : in show_task()
3205 (tsk->state & TASK_UNINTERRUPTIBLE) ? 'D' : in show_task()
3206 (tsk->state & TASK_STOPPED) ? 'T' : in show_task()
3207 (tsk->state & TASK_TRACED) ? 'C' : in show_task()
3208 (tsk->exit_state & EXIT_ZOMBIE) ? 'Z' : in show_task()
3209 (tsk->exit_state & EXIT_DEAD) ? 'E' : in show_task()
3210 (tsk->state & TASK_INTERRUPTIBLE) ? 'S' : '?'; in show_task()
3213 tsk->thread.ksp, tsk->thread.regs, in show_task()
3214 tsk->pid, rcu_dereference(tsk->parent)->pid, in show_task()
3216 tsk->comm); in show_task()
3254 mm = tsk->active_mm; in show_pte()
3335 printf(" task_struct ->thread.ksp ->thread.regs PID PPID S P CMD\n"); in show_tasks()
3439 for (i = 0; i < sizeof(regname) - 1; ++i) { in scanhex()
3531 return c - '0'; in hexdigit()
3533 return c - ('A' - 10); in hexdigit()
3535 return c - ('a' - 10); in hexdigit()
3553 --size; in getstring()
3685 unsigned long llp; in dump_segments() local
3703 llp = vsid & SLB_VSID_LLP; in dump_segments()
3705 printf(" 1T ESID=%9lx VSID=%13lx LLP:%3lx \n", in dump_segments()
3708 llp); in dump_segments()
3710 printf(" 256M ESID=%9lx VSID=%13lx LLP:%3lx \n", in dump_segments()
3713 llp); in dump_segments()
3724 printf("sr0-15 ="); in dump_segments()
3743 printf("V %08lx -> %01lx%08lx %c%c%c%c%c", in dump_tlb_44x()
3809 printf("Book3E MMU MAV=%d.0,%d TLBs,%d-bit PID,%d-bit LPID,%d-bit RA\n", in dump_tlb_book3e()
3811 pidmask = (1ul << pidsz) - 1; in dump_tlb_book3e()
3812 lpidmask = (1ul << lpidsz) - 1; in dump_tlb_book3e()
3813 ramask = (1ull << rasz) - 1; in dump_tlb_book3e()
3818 printf("TLB %d:\n------\n", tlb); in dump_tlb_book3e()
3864 printf("%04x- ", i); in dump_tlb_book3e()
3866 printf("%04x-%c", cc, 'A' + esel); in dump_tlb_book3e()
3918 set_indicator_token = rtas_token("set-indicator"); in xmon_init()
4073 if (spu->number >= XMON_NUM_SPUS) { in xmon_register_spus()
4078 spu_info[spu->number].spu = spu; in xmon_register_spus()
4079 spu_info[spu->number].stopped_ok = 0; in xmon_register_spus()
4080 spu_info[spu->number].dump_addr = (unsigned long) in xmon_register_spus()
4081 spu_info[spu->number].spu->local_store; in xmon_register_spus()
4102 in_be32(&spu->problem->spu_runcntl_RW); in stop_spus()
4147 out_be32(&spu->problem->spu_runcntl_RW, in restart_spus()
4168 printf(" %-*s = "format"\n", DUMP_WIDTH, \
4174 printf(" %-*s = *** Error reading field.\n", \
4181 DUMP_VALUE(format, field, obj->field)
4209 DUMP_VALUE("0x%x", problem->spu_runcntl_RW, in dump_spu_fields()
4210 in_be32(&spu->problem->spu_runcntl_RW)); in dump_spu_fields()
4211 DUMP_VALUE("0x%x", problem->spu_status_R, in dump_spu_fields()
4212 in_be32(&spu->problem->spu_status_R)); in dump_spu_fields()
4213 DUMP_VALUE("0x%x", problem->spu_npc_RW, in dump_spu_fields()
4214 in_be32(&spu->problem->spu_npc_RW)); in dump_spu_fields()
4232 ls_addr = (unsigned long)spu_info[num].spu->local_store; in dump_spu_ls()
4303 return -1; in do_spu_cmd()
4311 return -1; in do_spu_cmd()