Lines Matching +full:llp +full:- +full:based

1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Copyright (C) 1996-2005 Paul Mackerras.
53 #include <asm/code-patching.h>
65 #include "dis-asm.h"
119 #define BP_NUM(bp) ((bp) - bpts + 1)
214 static const char *xmon_ro_msg = "Operation disabled: xmon in read-only mode\n";
319 printf("xmon: Read-only due to kernel lockdown\n"); in xmon_is_locked_down()
349 * write_ciabr() - write the CIABR SPR
370 * set_ciabr() - set the CIABR
390 * XXX we should re-enable it when we leave. :)
440 if (--timeout > 0) { in get_output_lock()
469 for (timeout = 20000; timeout != 0; --timeout) { in wait_for_other_cpus()
513 bp = in_breakpoint_table(regs->nip, &offset); in xmon_core()
515 regs_set_return_ip(regs, bp->address + offset); in xmon_core()
516 atomic_dec(&bp->ref_count); in xmon_core()
534 cpu, regs->trap, getvecname(TRAP(regs))); in xmon_core()
554 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT)) in xmon_core()
555 bp = at_breakpoint(regs->nip); in xmon_core()
566 xmon_print_symbol(regs->nip, " ", ")\n"); in xmon_core()
618 ppc_inst_dump(regs->nip, 1, 0); in xmon_core()
671 regs->trap, getvecname(TRAP(regs))); in xmon_core()
679 bp = at_breakpoint(regs->nip); in xmon_core()
682 xmon_print_symbol(regs->nip, " ", ")\n"); in xmon_core()
692 ppc_inst_dump(regs->nip, 1, 0); in xmon_core()
705 if (regs->msr & MSR_DE) { in xmon_core()
706 bp = at_breakpoint(regs->nip); in xmon_core()
708 regs_set_return_ip(regs, (unsigned long) &bp->instr[0]); in xmon_core()
709 atomic_inc(&bp->ref_count); in xmon_core()
713 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT)) { in xmon_core()
714 bp = at_breakpoint(regs->nip); in xmon_core()
716 int stepped = emulate_step(regs, ppc_inst_read(bp->instr)); in xmon_core()
718 regs_set_return_ip(regs, (unsigned long) &bp->instr[0]); in xmon_core()
719 atomic_inc(&bp->ref_count); in xmon_core()
721 printf("Couldn't single-step %s instruction\n", in xmon_core()
722 IS_RFID(ppc_inst_read(bp->instr))? "rfid": "mtmsrd"); in xmon_core()
766 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) != (MSR_IR|MSR_64BIT)) in xmon_bpt()
769 /* Are we at the trap at bp->instr[1] for some bp? */ in xmon_bpt()
770 bp = in_breakpoint_table(regs->nip, &offset); in xmon_bpt()
772 regs_set_return_ip(regs, bp->address + offset); in xmon_bpt()
773 atomic_dec(&bp->ref_count); in xmon_bpt()
778 bp = at_breakpoint(regs->nip); in xmon_bpt()
799 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) != (MSR_IR|MSR_64BIT)) in xmon_break_match()
814 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) != (MSR_IR|MSR_64BIT)) in xmon_iabr_match()
839 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT)) { in xmon_fault_handler()
840 bp = in_breakpoint_table(regs->nip, &offset); in xmon_fault_handler()
842 regs_set_return_ip(regs, bp->address + offset); in xmon_fault_handler()
843 atomic_dec(&bp->ref_count); in xmon_fault_handler()
867 if (bp->enabled && pc == bp->address) in at_breakpoint()
876 off = nip - (unsigned long)bpt_table; in in_breakpoint_table()
879 *offp = off & (BPT_SIZE - 1); in in_breakpoint_table()
895 if (!bp->enabled && atomic_read(&bp->ref_count) == 0) { in new_breakpoint()
896 bp->address = a; in new_breakpoint()
897 bp->instr = (void *)(bpt_table + ((bp - bpts) * BPT_WORDS)); in new_breakpoint()
914 if ((bp->enabled & (BP_TRAP|BP_CIABR)) == 0) in insert_bpts()
916 if (!mread_instr(bp->address, &instr)) { in insert_bpts()
918 "disabling breakpoint there\n", bp->address); in insert_bpts()
919 bp->enabled = 0; in insert_bpts()
924 bp->address); in insert_bpts()
925 bp->enabled = 0; in insert_bpts()
932 if (mread_instr(bp->address - 4, &instr2) == 8) { in insert_bpts()
934 bp->address); in insert_bpts()
935 bp->enabled = 0; in insert_bpts()
939 * We might still be a suffix - if the prefix has already been in insert_bpts()
943 bp2 = at_breakpoint(bp->address - 4); in insert_bpts()
944 if (bp2 && ppc_inst_prefixed(ppc_inst_read(bp2->instr))) { in insert_bpts()
946 bp->address); in insert_bpts()
947 bp->enabled = 0; in insert_bpts()
951 patch_instruction(bp->instr, instr); in insert_bpts()
952 patch_instruction(ppc_inst_next(bp->instr, bp->instr), in insert_bpts()
954 if (bp->enabled & BP_CIABR) in insert_bpts()
956 if (patch_instruction((u32 *)bp->address, in insert_bpts()
959 "disabling breakpoint there\n", bp->address); in insert_bpts()
960 bp->enabled &= ~BP_TRAP; in insert_bpts()
982 set_ciabr(iabr->address); in insert_cpu_bpts()
993 if ((bp->enabled & (BP_TRAP|BP_CIABR)) != BP_TRAP) in remove_bpts()
995 if (mread_instr(bp->address, &instr) in remove_bpts()
998 (u32 *)bp->address, ppc_inst_read(bp->instr)) != 0) in remove_bpts()
1000 bp->address); in remove_bpts()
1010 /* Based on uptime_proc_show(). */
1051 xmon_show_stack(excp->gpr[1], excp->link, excp->nip); in cmds()
1194 regs_set_return_msr(regs, regs->msr | MSR_DE); in do_step()
1209 /* check we are in 64-bit kernel mode, translation enabled */ in do_step()
1210 if ((regs->msr & (MSR_64BIT|MSR_PR|MSR_IR)) == (MSR_64BIT|MSR_IR)) { in do_step()
1211 if (mread_instr(regs->nip, &instr)) { in do_step()
1214 printf("Couldn't single-step %s instruction\n", in do_step()
1221 xmon_print_symbol(regs->nip, " ", "\n"); in do_step()
1222 ppc_inst_dump(regs->nip, 1, 0); in do_step()
1227 regs_set_return_msr(regs, regs->msr | MSR_SE); in do_step()
1258 if (--timeout == 0) { in xmon_switch_cpu()
1281 if (xmon_batch_start_cpu == -1) in xmon_batch_next_cpu()
1342 xmon_batch_start_cpu = -1; in cpu_cmd()
1365 printf("-0x%lx", last_cpu); in cpu_cmd()
1372 printf("-0x%lx", last_cpu); in cpu_cmd()
1381 xmon_show_stack(paca_ptrs[cpu]->saved_r1, 0, 0); in cpu_cmd()
1486 return -1; in find_free_data_bpt()
1527 case 'd': { /* bd - hardware data breakpoint */ in bpt_cmds()
1564 case 'i': /* bi - hardware instr breakpoint */ in bpt_cmds()
1575 iabr->enabled &= ~BP_CIABR; in bpt_cmds()
1584 bp->enabled |= BP_CIABR; in bpt_cmds()
1605 bp = &bpts[a-1]; /* bp nums are 1 based */ in bpt_cmds()
1616 xmon_print_symbol(bp->address, " ", ")\n"); in bpt_cmds()
1617 bp->enabled = 0; in bpt_cmds()
1634 if (!bp->enabled) in bpt_cmds()
1637 (bp->enabled & BP_CIABR) ? "inst": "trap"); in bpt_cmds()
1638 xmon_print_symbol(bp->address, " ", "\n"); in bpt_cmds()
1647 bp->enabled |= BP_TRAP; in bpt_cmds()
1714 *startp = pc - offset; in get_function_bounds()
1715 *endp = pc - offset + size; in get_function_bounds()
1733 while (max_to_print--) { in xmon_show_stack()
1792 printf("--- Exception: %lx %s at ", regs.trap, in xmon_show_stack()
1813 xmon_show_stack(excp->gpr[1], excp->link, excp->nip); in backtrace()
1823 if (regs->msr & MSR_PR) in print_bug_trap()
1825 addr = regs->nip; /* address of trap instruction */ in print_bug_trap()
1828 bug = find_bug(regs->nip); in print_bug_trap()
1836 (char *)bug + bug->file_disp, bug->line); in print_bug_trap()
1838 printf("kernel BUG at %px!\n", (void *)bug + bug->bug_addr_disp); in print_bug_trap()
1852 printf("Vector: %lx %s at [%px]\n", fp->trap, getvecname(trap), fp); in excprint()
1854 xmon_print_symbol(fp->nip, ": ", "\n"); in excprint()
1857 xmon_print_symbol(fp->link, ": ", "\n"); in excprint()
1859 printf(" sp: %lx\n", fp->gpr[1]); in excprint()
1860 printf(" msr: %lx\n", fp->msr); in excprint()
1866 printf(" dar: %lx\n", fp->dar); in excprint()
1868 printf(" dsisr: %lx\n", fp->dsisr); in excprint()
1874 local_paca, local_paca->irq_soft_mask, local_paca->irq_happened); in excprint()
1878 current->pid, current->comm); in excprint()
1917 printf("R%.2d = "REG"%s", n, fp->gpr[n], in prregs()
1918 (n % R_PER_LINE) == R_PER_LINE - 1 ? "\n" : " "); in prregs()
1922 xmon_print_symbol(fp->nip, " ", "\n"); in prregs()
1925 xmon_print_symbol(fp->orig_gpr3, " ", "\n"); in prregs()
1928 xmon_print_symbol(fp->link, " ", "\n"); in prregs()
1929 printf("msr = "REG" cr = %.8lx\n", fp->msr, fp->ccr); in prregs()
1931 fp->ctr, fp->xer, fp->trap); in prregs()
1936 printf("dar = "REG" dsisr = %.8lx\n", fp->dar, fp->dsisr); in prregs()
1952 nflush = (nflush + L1_CACHE_BYTES - 1) / L1_CACHE_BYTES; in cacheflush()
1958 for (; nflush > 0; --nflush, adrs += L1_CACHE_BYTES) in cacheflush()
1961 for (; nflush > 0; --nflush, adrs += L1_CACHE_BYTES) in cacheflush()
1977 unsigned long ret = -1UL; in read_spr()
2022 /* Actually some of these pre-date 2.06, but whatever */ in dump_206_sprs()
2324 static char *fault_chars[] = { "--", "**", "##" };
2396 " ` clear no-read flag\n"
2403 " n toggle no-read flag\n"
2485 adrs -= size; in memex()
2514 adrs -= size; in memex()
2518 adrs -= 1 << nslash; in memex()
2526 adrs += 1 << -nslash; in memex()
2529 nslash -= 4; in memex()
2530 adrs -= 1 << -nslash; in memex()
2544 adrs -= n; in memex()
2590 n -= r; in xmon_rawdump()
2628 printf(" %-*s = %s\n", 25, "possible", cpu_possible(cpu) ? "yes" : "no"); in dump_one_paca()
2629 printf(" %-*s = %s\n", 25, "present", cpu_present(cpu) ? "yes" : "no"); in dump_one_paca()
2630 printf(" %-*s = %s\n", 25, "online", cpu_online(cpu) ? "yes" : "no"); in dump_one_paca()
2633 printf(" %-*s = "format"\t(0x%lx)\n", 25, #name, 18, paca->name, \ in dump_one_paca()
2636 DUMP(p, lock_token, "%#-*x"); in dump_one_paca()
2637 DUMP(p, paca_index, "%#-*x"); in dump_one_paca()
2639 DUMP(p, kernel_toc, "%#-*llx"); in dump_one_paca()
2641 DUMP(p, kernelbase, "%#-*llx"); in dump_one_paca()
2642 DUMP(p, kernel_msr, "%#-*llx"); in dump_one_paca()
2643 DUMP(p, emergency_sp, "%-*px"); in dump_one_paca()
2645 DUMP(p, nmi_emergency_sp, "%-*px"); in dump_one_paca()
2646 DUMP(p, mc_emergency_sp, "%-*px"); in dump_one_paca()
2647 DUMP(p, in_nmi, "%#-*x"); in dump_one_paca()
2648 DUMP(p, in_mce, "%#-*x"); in dump_one_paca()
2649 DUMP(p, hmi_event_available, "%#-*x"); in dump_one_paca()
2651 DUMP(p, data_offset, "%#-*llx"); in dump_one_paca()
2652 DUMP(p, hw_cpu_id, "%#-*x"); in dump_one_paca()
2653 DUMP(p, cpu_start, "%#-*x"); in dump_one_paca()
2654 DUMP(p, kexec_state, "%#-*x"); in dump_one_paca()
2661 if (!p->slb_shadow_ptr) in dump_one_paca()
2664 esid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].esid); in dump_one_paca()
2665 vsid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].vsid); in dump_one_paca()
2668 printf(" %-*s[%d] = 0x%016llx 0x%016llx\n", in dump_one_paca()
2672 DUMP(p, vmalloc_sllp, "%#-*x"); in dump_one_paca()
2673 DUMP(p, stab_rr, "%#-*x"); in dump_one_paca()
2674 DUMP(p, slb_used_bitmap, "%#-*x"); in dump_one_paca()
2675 DUMP(p, slb_kern_bitmap, "%#-*x"); in dump_one_paca()
2678 DUMP(p, slb_cache_ptr, "%#-*x"); in dump_one_paca()
2680 printf(" %-*s[%d] = 0x%016x\n", in dump_one_paca()
2681 22, "slb_cache", i, p->slb_cache[i]); in dump_one_paca()
2686 DUMP(p, rfi_flush_fallback_area, "%-*px"); in dump_one_paca()
2688 DUMP(p, dscr_default, "%#-*llx"); in dump_one_paca()
2690 DUMP(p, pgd, "%-*px"); in dump_one_paca()
2691 DUMP(p, kernel_pgd, "%-*px"); in dump_one_paca()
2692 DUMP(p, tcd_ptr, "%-*px"); in dump_one_paca()
2693 DUMP(p, mc_kstack, "%-*px"); in dump_one_paca()
2694 DUMP(p, crit_kstack, "%-*px"); in dump_one_paca()
2695 DUMP(p, dbg_kstack, "%-*px"); in dump_one_paca()
2697 DUMP(p, __current, "%-*px"); in dump_one_paca()
2698 DUMP(p, kstack, "%#-*llx"); in dump_one_paca()
2699 printf(" %-*s = 0x%016llx\n", 25, "kstack_base", p->kstack & ~(THREAD_SIZE - 1)); in dump_one_paca()
2701 DUMP(p, canary, "%#-*lx"); in dump_one_paca()
2703 DUMP(p, saved_r1, "%#-*llx"); in dump_one_paca()
2705 DUMP(p, trap_save, "%#-*x"); in dump_one_paca()
2707 DUMP(p, irq_soft_mask, "%#-*x"); in dump_one_paca()
2708 DUMP(p, irq_happened, "%#-*x"); in dump_one_paca()
2710 DUMP(p, mmiowb_state.nesting_count, "%#-*x"); in dump_one_paca()
2711 DUMP(p, mmiowb_state.mmiowb_pending, "%#-*x"); in dump_one_paca()
2713 DUMP(p, irq_work_pending, "%#-*x"); in dump_one_paca()
2714 DUMP(p, sprg_vdso, "%#-*llx"); in dump_one_paca()
2717 DUMP(p, tm_scratch, "%#-*llx"); in dump_one_paca()
2721 DUMP(p, idle_state, "%#-*lx"); in dump_one_paca()
2723 DUMP(p, thread_idle_state, "%#-*x"); in dump_one_paca()
2724 DUMP(p, subcore_sibling_mask, "%#-*x"); in dump_one_paca()
2727 DUMP(p, requested_psscr, "%#-*llx"); in dump_one_paca()
2728 DUMP(p, dont_stop.counter, "%#-*x"); in dump_one_paca()
2733 DUMP(p, accounting.utime, "%#-*lx"); in dump_one_paca()
2734 DUMP(p, accounting.stime, "%#-*lx"); in dump_one_paca()
2736 DUMP(p, accounting.utime_scaled, "%#-*lx"); in dump_one_paca()
2738 DUMP(p, accounting.starttime, "%#-*lx"); in dump_one_paca()
2739 DUMP(p, accounting.starttime_user, "%#-*lx"); in dump_one_paca()
2741 DUMP(p, accounting.startspurr, "%#-*lx"); in dump_one_paca()
2742 DUMP(p, accounting.utime_sspurr, "%#-*lx"); in dump_one_paca()
2744 DUMP(p, accounting.steal_time, "%#-*lx"); in dump_one_paca()
2965 dump_by_size(adrs, ndump, c - '0'); in dump()
2991 if ((m & (sizeof(long) - 1)) == 0 && m > 0) in prdump()
2999 if ((m & (sizeof(long) - 1)) == 0) in prdump()
3011 n -= r; in prdump()
3031 for (first_adr = adr; count > 0; --count, adr += ppc_inst_len(inst)) { in generic_inst_dump()
3058 return adr - first_adr; in generic_inst_dump()
3123 while ((res = opal_msglog_copy(buf, pos, sizeof(buf) - 1))) { in dump_opal_msglog()
3142 * Memory operations - move, set, print differences
3190 for( n = nb; n > 0; --n ) in memdiffs()
3193 printf("%px %.2x # %px %.2x\n", p1 - 1, in memdiffs()
3194 p1[-1], p2 - 1, p2[-1]); in memdiffs()
3253 printf("%.8lx\n", a - mskip); in memzcan()
3259 printf("%.8lx\n", a - mskip); in memzcan()
3264 unsigned int p_state = READ_ONCE(tsk->__state); in show_task()
3276 (tsk->exit_state & EXIT_ZOMBIE) ? 'Z' : in show_task()
3277 (tsk->exit_state & EXIT_DEAD) ? 'E' : in show_task()
3281 tsk->thread.ksp, tsk->thread.regs, in show_task()
3282 tsk->pid, rcu_dereference(tsk->parent)->pid, in show_task()
3284 tsk->comm); in show_task()
3322 mm = tsk->active_mm; in show_pte()
3406 printf(" task_struct ->thread.ksp ->thread.regs PID PPID S P CMD\n"); in show_tasks()
3510 for (i = 0; i < sizeof(regname) - 1; ++i) { in scanhex()
3602 return c - '0'; in hexdigit()
3604 return c - ('A' - 10); in hexdigit()
3606 return c - ('a' - 10); in hexdigit()
3624 --size; in getstring()
3756 unsigned long llp; in dump_segments() local
3774 llp = vsid & SLB_VSID_LLP; in dump_segments()
3776 printf(" 1T ESID=%9lx VSID=%13lx LLP:%3lx \n", in dump_segments()
3779 llp); in dump_segments()
3781 printf(" 256M ESID=%9lx VSID=%13lx LLP:%3lx \n", in dump_segments()
3784 llp); in dump_segments()
3795 printf("sr0-15 ="); in dump_segments()
3814 printf("V %08lx -> %01lx%08lx %c%c%c%c%c", in dump_tlb_44x()
3878 printf("Book3E MMU MAV=%d.0,%d TLBs,%d-bit PID,%d-bit LPID,%d-bit RA\n", in dump_tlb_book3e()
3880 ramask = (1ull << rasz) - 1; in dump_tlb_book3e()
3885 printf("TLB %d:\n------\n", tlb); in dump_tlb_book3e()
3931 printf("%04x- ", i); in dump_tlb_book3e()
3933 printf("%04x-%c", cc, 'A' + esel); in dump_tlb_book3e()
4132 if (spu->number >= XMON_NUM_SPUS) { in xmon_register_spus()
4137 spu_info[spu->number].spu = spu; in xmon_register_spus()
4138 spu_info[spu->number].stopped_ok = 0; in xmon_register_spus()
4139 spu_info[spu->number].dump_addr = (unsigned long) in xmon_register_spus()
4140 spu_info[spu->number].spu->local_store; in xmon_register_spus()
4161 in_be32(&spu->problem->spu_runcntl_RW); in stop_spus()
4206 out_be32(&spu->problem->spu_runcntl_RW, in restart_spus()
4227 printf(" %-*s = "format"\n", DUMP_WIDTH, \
4233 printf(" %-*s = *** Error reading field.\n", \
4240 DUMP_VALUE(format, field, obj->field)
4268 DUMP_VALUE("0x%x", problem->spu_runcntl_RW, in dump_spu_fields()
4269 in_be32(&spu->problem->spu_runcntl_RW)); in dump_spu_fields()
4270 DUMP_VALUE("0x%x", problem->spu_status_R, in dump_spu_fields()
4271 in_be32(&spu->problem->spu_status_R)); in dump_spu_fields()
4272 DUMP_VALUE("0x%x", problem->spu_npc_RW, in dump_spu_fields()
4273 in_be32(&spu->problem->spu_npc_RW)); in dump_spu_fields()
4290 ls_addr = (unsigned long)spu_info[num].spu->local_store; in dump_spu_ls()
4361 return -1; in do_spu_cmd()
4369 return -1; in do_spu_cmd()