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()
669 regs->trap, getvecname(TRAP(regs))); in xmon_core()
677 bp = at_breakpoint(regs->nip); in xmon_core()
680 xmon_print_symbol(regs->nip, " ", ")\n"); in xmon_core()
690 ppc_inst_dump(regs->nip, 1, 0); in xmon_core()
703 if (regs->msr & MSR_DE) { in xmon_core()
704 bp = at_breakpoint(regs->nip); in xmon_core()
706 regs_set_return_ip(regs, (unsigned long) &bp->instr[0]); in xmon_core()
707 atomic_inc(&bp->ref_count); in xmon_core()
711 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT)) { in xmon_core()
712 bp = at_breakpoint(regs->nip); in xmon_core()
714 int stepped = emulate_step(regs, ppc_inst_read(bp->instr)); in xmon_core()
716 regs_set_return_ip(regs, (unsigned long) &bp->instr[0]); in xmon_core()
717 atomic_inc(&bp->ref_count); in xmon_core()
719 printf("Couldn't single-step %s instruction\n", in xmon_core()
720 IS_RFID(ppc_inst_read(bp->instr))? "rfid": "mtmsrd"); in xmon_core()
764 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) != (MSR_IR|MSR_64BIT)) in xmon_bpt()
767 /* Are we at the trap at bp->instr[1] for some bp? */ in xmon_bpt()
768 bp = in_breakpoint_table(regs->nip, &offset); in xmon_bpt()
770 regs_set_return_ip(regs, bp->address + offset); in xmon_bpt()
771 atomic_dec(&bp->ref_count); in xmon_bpt()
776 bp = at_breakpoint(regs->nip); in xmon_bpt()
797 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) != (MSR_IR|MSR_64BIT)) in xmon_break_match()
812 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) != (MSR_IR|MSR_64BIT)) in xmon_iabr_match()
837 if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT)) { in xmon_fault_handler()
838 bp = in_breakpoint_table(regs->nip, &offset); in xmon_fault_handler()
840 regs_set_return_ip(regs, bp->address + offset); in xmon_fault_handler()
841 atomic_dec(&bp->ref_count); in xmon_fault_handler()
865 if (bp->enabled && pc == bp->address) in at_breakpoint()
874 off = nip - (unsigned long)bpt_table; in in_breakpoint_table()
877 *offp = off & (BPT_SIZE - 1); in in_breakpoint_table()
893 if (!bp->enabled && atomic_read(&bp->ref_count) == 0) { in new_breakpoint()
894 bp->address = a; in new_breakpoint()
895 bp->instr = (void *)(bpt_table + ((bp - bpts) * BPT_WORDS)); in new_breakpoint()
912 if ((bp->enabled & (BP_TRAP|BP_CIABR)) == 0) in insert_bpts()
914 if (!mread_instr(bp->address, &instr)) { in insert_bpts()
916 "disabling breakpoint there\n", bp->address); in insert_bpts()
917 bp->enabled = 0; in insert_bpts()
922 bp->address); in insert_bpts()
923 bp->enabled = 0; in insert_bpts()
930 if (mread_instr(bp->address - 4, &instr2) == 8) { in insert_bpts()
932 bp->address); in insert_bpts()
933 bp->enabled = 0; in insert_bpts()
937 * We might still be a suffix - if the prefix has already been in insert_bpts()
941 bp2 = at_breakpoint(bp->address - 4); in insert_bpts()
942 if (bp2 && ppc_inst_prefixed(ppc_inst_read(bp2->instr))) { in insert_bpts()
944 bp->address); in insert_bpts()
945 bp->enabled = 0; in insert_bpts()
949 patch_instruction(bp->instr, instr); in insert_bpts()
950 patch_instruction(ppc_inst_next(bp->instr, bp->instr), in insert_bpts()
952 if (bp->enabled & BP_CIABR) in insert_bpts()
954 if (patch_instruction((u32 *)bp->address, in insert_bpts()
957 "disabling breakpoint there\n", bp->address); in insert_bpts()
958 bp->enabled &= ~BP_TRAP; in insert_bpts()
980 set_ciabr(iabr->address); in insert_cpu_bpts()
991 if ((bp->enabled & (BP_TRAP|BP_CIABR)) != BP_TRAP) in remove_bpts()
993 if (mread_instr(bp->address, &instr) in remove_bpts()
996 (u32 *)bp->address, ppc_inst_read(bp->instr)) != 0) in remove_bpts()
998 bp->address); in remove_bpts()
1008 /* Based on uptime_proc_show(). */
1049 xmon_show_stack(excp->gpr[1], excp->link, excp->nip); in cmds()
1192 regs_set_return_msr(regs, regs->msr | MSR_DE); in do_step()
1207 /* check we are in 64-bit kernel mode, translation enabled */ in do_step()
1208 if ((regs->msr & (MSR_64BIT|MSR_PR|MSR_IR)) == (MSR_64BIT|MSR_IR)) { in do_step()
1209 if (mread_instr(regs->nip, &instr)) { in do_step()
1212 printf("Couldn't single-step %s instruction\n", in do_step()
1219 xmon_print_symbol(regs->nip, " ", "\n"); in do_step()
1220 ppc_inst_dump(regs->nip, 1, 0); in do_step()
1225 regs_set_return_msr(regs, regs->msr | MSR_SE); in do_step()
1256 if (--timeout == 0) { in xmon_switch_cpu()
1279 if (xmon_batch_start_cpu == -1) in xmon_batch_next_cpu()
1340 xmon_batch_start_cpu = -1; in cpu_cmd()
1363 printf("-0x%lx", last_cpu); in cpu_cmd()
1370 printf("-0x%lx", last_cpu); in cpu_cmd()
1379 xmon_show_stack(paca_ptrs[cpu]->saved_r1, 0, 0); in cpu_cmd()
1484 return -1; in find_free_data_bpt()
1525 case 'd': { /* bd - hardware data breakpoint */ in bpt_cmds()
1562 case 'i': /* bi - hardware instr breakpoint */ in bpt_cmds()
1573 iabr->enabled &= ~BP_CIABR; in bpt_cmds()
1582 bp->enabled |= BP_CIABR; in bpt_cmds()
1603 bp = &bpts[a-1]; /* bp nums are 1 based */ in bpt_cmds()
1614 xmon_print_symbol(bp->address, " ", ")\n"); in bpt_cmds()
1615 bp->enabled = 0; in bpt_cmds()
1632 if (!bp->enabled) in bpt_cmds()
1635 (bp->enabled & BP_CIABR) ? "inst": "trap"); in bpt_cmds()
1636 xmon_print_symbol(bp->address, " ", "\n"); in bpt_cmds()
1645 bp->enabled |= BP_TRAP; in bpt_cmds()
1712 *startp = pc - offset; in get_function_bounds()
1713 *endp = pc - offset + size; in get_function_bounds()
1731 while (max_to_print--) { in xmon_show_stack()
1790 printf("--- Exception: %lx %s at ", regs.trap, in xmon_show_stack()
1811 xmon_show_stack(excp->gpr[1], excp->link, excp->nip); in backtrace()
1823 addr = regs->nip; /* address of trap instruction */ in print_bug_trap()
1826 bug = find_bug(regs->nip); in print_bug_trap()
1834 (char *)bug + bug->file_disp, bug->line); in print_bug_trap()
1836 printf("kernel BUG at %px!\n", (void *)bug + bug->bug_addr_disp); in print_bug_trap()
1850 printf("Vector: %lx %s at [%px]\n", fp->trap, getvecname(trap), fp); in excprint()
1852 xmon_print_symbol(fp->nip, ": ", "\n"); in excprint()
1855 xmon_print_symbol(fp->link, ": ", "\n"); in excprint()
1857 printf(" sp: %lx\n", fp->gpr[1]); in excprint()
1858 printf(" msr: %lx\n", fp->msr); in excprint()
1864 printf(" dar: %lx\n", fp->dar); in excprint()
1866 printf(" dsisr: %lx\n", fp->dsisr); in excprint()
1872 local_paca, local_paca->irq_soft_mask, local_paca->irq_happened); in excprint()
1876 current->pid, current->comm); in excprint()
1915 printf("R%.2d = "REG"%s", n, fp->gpr[n], in prregs()
1916 (n % R_PER_LINE) == R_PER_LINE - 1 ? "\n" : " "); in prregs()
1920 xmon_print_symbol(fp->nip, " ", "\n"); in prregs()
1923 xmon_print_symbol(fp->orig_gpr3, " ", "\n"); in prregs()
1926 xmon_print_symbol(fp->link, " ", "\n"); in prregs()
1927 printf("msr = "REG" cr = %.8lx\n", fp->msr, fp->ccr); in prregs()
1929 fp->ctr, fp->xer, fp->trap); in prregs()
1934 printf("dar = "REG" dsisr = %.8lx\n", fp->dar, fp->dsisr); in prregs()
1950 nflush = (nflush + L1_CACHE_BYTES - 1) / L1_CACHE_BYTES; in cacheflush()
1956 for (; nflush > 0; --nflush, adrs += L1_CACHE_BYTES) in cacheflush()
1959 for (; nflush > 0; --nflush, adrs += L1_CACHE_BYTES) in cacheflush()
1975 unsigned long ret = -1UL; in read_spr()
2020 /* Actually some of these pre-date 2.06, but whatever */ in dump_206_sprs()
2322 static char *fault_chars[] = { "--", "**", "##" };
2394 " ` clear no-read flag\n"
2401 " n toggle no-read flag\n"
2483 adrs -= size; in memex()
2512 adrs -= size; in memex()
2516 adrs -= 1 << nslash; in memex()
2524 adrs += 1 << -nslash; in memex()
2527 nslash -= 4; in memex()
2528 adrs -= 1 << -nslash; in memex()
2542 adrs -= n; in memex()
2588 n -= r; in xmon_rawdump()
2626 printf(" %-*s = %s\n", 25, "possible", cpu_possible(cpu) ? "yes" : "no"); in dump_one_paca()
2627 printf(" %-*s = %s\n", 25, "present", cpu_present(cpu) ? "yes" : "no"); in dump_one_paca()
2628 printf(" %-*s = %s\n", 25, "online", cpu_online(cpu) ? "yes" : "no"); in dump_one_paca()
2631 printf(" %-*s = "format"\t(0x%lx)\n", 25, #name, 18, paca->name, \ in dump_one_paca()
2634 DUMP(p, lock_token, "%#-*x"); in dump_one_paca()
2635 DUMP(p, paca_index, "%#-*x"); in dump_one_paca()
2637 DUMP(p, kernel_toc, "%#-*llx"); in dump_one_paca()
2639 DUMP(p, kernelbase, "%#-*llx"); in dump_one_paca()
2640 DUMP(p, kernel_msr, "%#-*llx"); in dump_one_paca()
2641 DUMP(p, emergency_sp, "%-*px"); in dump_one_paca()
2643 DUMP(p, nmi_emergency_sp, "%-*px"); in dump_one_paca()
2644 DUMP(p, mc_emergency_sp, "%-*px"); in dump_one_paca()
2645 DUMP(p, in_nmi, "%#-*x"); in dump_one_paca()
2646 DUMP(p, in_mce, "%#-*x"); in dump_one_paca()
2647 DUMP(p, hmi_event_available, "%#-*x"); in dump_one_paca()
2649 DUMP(p, data_offset, "%#-*llx"); in dump_one_paca()
2650 DUMP(p, hw_cpu_id, "%#-*x"); in dump_one_paca()
2651 DUMP(p, cpu_start, "%#-*x"); in dump_one_paca()
2652 DUMP(p, kexec_state, "%#-*x"); in dump_one_paca()
2659 if (!p->slb_shadow_ptr) in dump_one_paca()
2662 esid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].esid); in dump_one_paca()
2663 vsid = be64_to_cpu(p->slb_shadow_ptr->save_area[i].vsid); in dump_one_paca()
2666 printf(" %-*s[%d] = 0x%016llx 0x%016llx\n", in dump_one_paca()
2670 DUMP(p, vmalloc_sllp, "%#-*x"); in dump_one_paca()
2671 DUMP(p, stab_rr, "%#-*x"); in dump_one_paca()
2672 DUMP(p, slb_used_bitmap, "%#-*x"); in dump_one_paca()
2673 DUMP(p, slb_kern_bitmap, "%#-*x"); in dump_one_paca()
2676 DUMP(p, slb_cache_ptr, "%#-*x"); in dump_one_paca()
2678 printf(" %-*s[%d] = 0x%016x\n", in dump_one_paca()
2679 22, "slb_cache", i, p->slb_cache[i]); in dump_one_paca()
2684 DUMP(p, rfi_flush_fallback_area, "%-*px"); in dump_one_paca()
2686 DUMP(p, dscr_default, "%#-*llx"); in dump_one_paca()
2688 DUMP(p, pgd, "%-*px"); in dump_one_paca()
2689 DUMP(p, kernel_pgd, "%-*px"); in dump_one_paca()
2690 DUMP(p, tcd_ptr, "%-*px"); in dump_one_paca()
2691 DUMP(p, mc_kstack, "%-*px"); in dump_one_paca()
2692 DUMP(p, crit_kstack, "%-*px"); in dump_one_paca()
2693 DUMP(p, dbg_kstack, "%-*px"); in dump_one_paca()
2695 DUMP(p, __current, "%-*px"); in dump_one_paca()
2696 DUMP(p, kstack, "%#-*llx"); in dump_one_paca()
2697 printf(" %-*s = 0x%016llx\n", 25, "kstack_base", p->kstack & ~(THREAD_SIZE - 1)); in dump_one_paca()
2699 DUMP(p, canary, "%#-*lx"); in dump_one_paca()
2701 DUMP(p, saved_r1, "%#-*llx"); in dump_one_paca()
2703 DUMP(p, trap_save, "%#-*x"); in dump_one_paca()
2705 DUMP(p, irq_soft_mask, "%#-*x"); in dump_one_paca()
2706 DUMP(p, irq_happened, "%#-*x"); in dump_one_paca()
2708 DUMP(p, mmiowb_state.nesting_count, "%#-*x"); in dump_one_paca()
2709 DUMP(p, mmiowb_state.mmiowb_pending, "%#-*x"); in dump_one_paca()
2711 DUMP(p, irq_work_pending, "%#-*x"); in dump_one_paca()
2712 DUMP(p, sprg_vdso, "%#-*llx"); in dump_one_paca()
2715 DUMP(p, tm_scratch, "%#-*llx"); in dump_one_paca()
2719 DUMP(p, idle_state, "%#-*lx"); in dump_one_paca()
2721 DUMP(p, thread_idle_state, "%#-*x"); in dump_one_paca()
2722 DUMP(p, subcore_sibling_mask, "%#-*x"); in dump_one_paca()
2725 DUMP(p, requested_psscr, "%#-*llx"); in dump_one_paca()
2726 DUMP(p, dont_stop.counter, "%#-*x"); in dump_one_paca()
2731 DUMP(p, accounting.utime, "%#-*lx"); in dump_one_paca()
2732 DUMP(p, accounting.stime, "%#-*lx"); in dump_one_paca()
2734 DUMP(p, accounting.utime_scaled, "%#-*lx"); in dump_one_paca()
2736 DUMP(p, accounting.starttime, "%#-*lx"); in dump_one_paca()
2737 DUMP(p, accounting.starttime_user, "%#-*lx"); in dump_one_paca()
2739 DUMP(p, accounting.startspurr, "%#-*lx"); in dump_one_paca()
2740 DUMP(p, accounting.utime_sspurr, "%#-*lx"); in dump_one_paca()
2742 DUMP(p, accounting.steal_time, "%#-*lx"); in dump_one_paca()
2963 dump_by_size(adrs, ndump, c - '0'); in dump()
2989 if ((m & (sizeof(long) - 1)) == 0 && m > 0) in prdump()
2997 if ((m & (sizeof(long) - 1)) == 0) in prdump()
3009 n -= r; in prdump()
3029 for (first_adr = adr; count > 0; --count, adr += ppc_inst_len(inst)) { in generic_inst_dump()
3056 return adr - first_adr; in generic_inst_dump()
3121 while ((res = opal_msglog_copy(buf, pos, sizeof(buf) - 1))) { in dump_opal_msglog()
3140 * Memory operations - move, set, print differences
3188 for( n = nb; n > 0; --n ) in memdiffs()
3191 printf("%px %.2x # %px %.2x\n", p1 - 1, in memdiffs()
3192 p1[-1], p2 - 1, p2[-1]); in memdiffs()
3251 printf("%.8lx\n", a - mskip); in memzcan()
3257 printf("%.8lx\n", a - mskip); in memzcan()
3262 unsigned int p_state = READ_ONCE(tsk->__state); in show_task()
3274 (tsk->exit_state & EXIT_ZOMBIE) ? 'Z' : in show_task()
3275 (tsk->exit_state & EXIT_DEAD) ? 'E' : in show_task()
3279 tsk->thread.ksp, tsk->thread.regs, in show_task()
3280 tsk->pid, rcu_dereference(tsk->parent)->pid, in show_task()
3282 tsk->comm); in show_task()
3320 mm = tsk->active_mm; in show_pte()
3404 printf(" task_struct ->thread.ksp ->thread.regs PID PPID S P CMD\n"); in show_tasks()
3508 for (i = 0; i < sizeof(regname) - 1; ++i) { in scanhex()
3546 for (i = 0; i < (KSYM_NAME_LEN - 1); i++) { in scanhex()
3600 return c - '0'; in hexdigit()
3602 return c - ('A' - 10); in hexdigit()
3604 return c - ('a' - 10); in hexdigit()
3622 --size; in getstring()
3754 unsigned long llp; in dump_segments() local
3772 llp = vsid & SLB_VSID_LLP; in dump_segments()
3774 printf(" 1T ESID=%9lx VSID=%13lx LLP:%3lx \n", in dump_segments()
3777 llp); in dump_segments()
3779 printf(" 256M ESID=%9lx VSID=%13lx LLP:%3lx \n", in dump_segments()
3782 llp); in dump_segments()
3793 printf("sr0-15 ="); in dump_segments()
3812 printf("V %08lx -> %01lx%08lx %c%c%c%c%c", in dump_tlb_44x()
3876 printf("Book3E MMU MAV=%d.0,%d TLBs,%d-bit PID,%d-bit LPID,%d-bit RA\n", in dump_tlb_book3e()
3878 ramask = (1ull << rasz) - 1; in dump_tlb_book3e()
3883 printf("TLB %d:\n------\n", tlb); in dump_tlb_book3e()
3929 printf("%04x- ", i); in dump_tlb_book3e()
3931 printf("%04x-%c", cc, 'A' + esel); in dump_tlb_book3e()
4130 if (spu->number >= XMON_NUM_SPUS) { in xmon_register_spus()
4135 spu_info[spu->number].spu = spu; in xmon_register_spus()
4136 spu_info[spu->number].stopped_ok = 0; in xmon_register_spus()
4137 spu_info[spu->number].dump_addr = (unsigned long) in xmon_register_spus()
4138 spu_info[spu->number].spu->local_store; in xmon_register_spus()
4159 in_be32(&spu->problem->spu_runcntl_RW); in stop_spus()
4204 out_be32(&spu->problem->spu_runcntl_RW, in restart_spus()
4225 printf(" %-*s = "format"\n", DUMP_WIDTH, \
4231 printf(" %-*s = *** Error reading field.\n", \
4238 DUMP_VALUE(format, field, obj->field)
4266 DUMP_VALUE("0x%x", problem->spu_runcntl_RW, in dump_spu_fields()
4267 in_be32(&spu->problem->spu_runcntl_RW)); in dump_spu_fields()
4268 DUMP_VALUE("0x%x", problem->spu_status_R, in dump_spu_fields()
4269 in_be32(&spu->problem->spu_status_R)); in dump_spu_fields()
4270 DUMP_VALUE("0x%x", problem->spu_npc_RW, in dump_spu_fields()
4271 in_be32(&spu->problem->spu_npc_RW)); in dump_spu_fields()
4288 ls_addr = (unsigned long)spu_info[num].spu->local_store; in dump_spu_ls()
4359 return -1; in do_spu_cmd()
4367 return -1; in do_spu_cmd()