Lines Matching refs:p
88 struct kprobe *p) in update_kprobe_inst_flag() argument
90 p->ainsn.inst_flag = 0; in update_kprobe_inst_flag()
91 p->ainsn.target_br_reg = 0; in update_kprobe_inst_flag()
92 p->ainsn.slot = slot; in update_kprobe_inst_flag()
101 p->ainsn.inst_flag |= INST_FLAG_BREAK_INST; in update_kprobe_inst_flag()
108 p->ainsn.inst_flag |= INST_FLAG_FIX_BRANCH_REG; in update_kprobe_inst_flag()
109 p->ainsn.target_br_reg = ((kprobe_inst >> 6) & 0x7); in update_kprobe_inst_flag()
113 p->ainsn.inst_flag |= INST_FLAG_FIX_RELATIVE_IP_ADDR; in update_kprobe_inst_flag()
116 p->ainsn.inst_flag |= INST_FLAG_FIX_RELATIVE_IP_ADDR; in update_kprobe_inst_flag()
117 p->ainsn.inst_flag |= INST_FLAG_FIX_BRANCH_REG; in update_kprobe_inst_flag()
118 p->ainsn.target_br_reg = ((kprobe_inst >> 6) & 0x7); in update_kprobe_inst_flag()
124 p->ainsn.inst_flag |= INST_FLAG_FIX_BRANCH_REG; in update_kprobe_inst_flag()
125 p->ainsn.target_br_reg = ((kprobe_inst >> 6) & 0x7); in update_kprobe_inst_flag()
288 struct kprobe *p, in prepare_break_inst() argument
292 bundle_t *bundle = &p->opcode.bundle; in prepare_break_inst()
318 update_kprobe_inst_flag(template, slot, major_opcode, kprobe_inst, p); in prepare_break_inst()
389 static void __kprobes set_current_kprobe(struct kprobe *p, in set_current_kprobe() argument
392 __this_cpu_write(current_kprobe, p); in set_current_kprobe()
399 int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs) in trampoline_probe_handler() argument
472 static void __kprobes prepare_booster(struct kprobe *p) in prepare_booster() argument
474 unsigned long addr = (unsigned long)p->addr & ~0xFULL; in prepare_booster()
475 unsigned int slot = (unsigned long)p->addr & 0xf; in prepare_booster()
478 if (can_boost(&p->ainsn.insn[0].bundle, slot, addr)) { in prepare_booster()
479 set_brl_inst(&p->ainsn.insn[1].bundle, (bundle_t *)addr + 1); in prepare_booster()
480 p->ainsn.inst_flag |= INST_FLAG_BOOSTABLE; in prepare_booster()
484 for (; addr < (unsigned long)p->addr; addr++) { in prepare_booster()
491 int __kprobes arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() argument
493 unsigned long addr = (unsigned long) p->addr; in arch_prepare_kprobe()
517 p->ainsn.insn = get_insn_slot(); in arch_prepare_kprobe()
518 if (!p->ainsn.insn) in arch_prepare_kprobe()
520 memcpy(&p->opcode, kprobe_addr, sizeof(kprobe_opcode_t)); in arch_prepare_kprobe()
521 memcpy(p->ainsn.insn, kprobe_addr, sizeof(kprobe_opcode_t)); in arch_prepare_kprobe()
523 prepare_break_inst(template, slot, major_opcode, kprobe_inst, p, qp); in arch_prepare_kprobe()
525 prepare_booster(p); in arch_prepare_kprobe()
530 void __kprobes arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() argument
535 arm_addr = ((unsigned long)p->addr) & ~0xFUL; in arch_arm_kprobe()
537 src = &p->opcode.bundle; in arch_arm_kprobe()
539 flush_icache_range((unsigned long)p->ainsn.insn, in arch_arm_kprobe()
540 (unsigned long)p->ainsn.insn + in arch_arm_kprobe()
543 switch (p->ainsn.slot) { in arch_arm_kprobe()
557 void __kprobes arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() argument
562 arm_addr = ((unsigned long)p->addr) & ~0xFUL; in arch_disarm_kprobe()
565 src = &p->ainsn.insn->bundle; in arch_disarm_kprobe()
566 switch (p->ainsn.slot) { in arch_disarm_kprobe()
580 void __kprobes arch_remove_kprobe(struct kprobe *p) in arch_remove_kprobe() argument
582 if (p->ainsn.insn) { in arch_remove_kprobe()
583 free_insn_slot(p->ainsn.insn, in arch_remove_kprobe()
584 p->ainsn.inst_flag & INST_FLAG_BOOSTABLE); in arch_remove_kprobe()
585 p->ainsn.insn = NULL; in arch_remove_kprobe()
596 static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs) in resume_execution() argument
598 unsigned long bundle_addr = (unsigned long) (&p->ainsn.insn->bundle); in resume_execution()
599 unsigned long resume_addr = (unsigned long)p->addr & ~0xFULL; in resume_execution()
601 int slot = ((unsigned long)p->addr & 0xf); in resume_execution()
603 template = p->ainsn.insn->bundle.quad0.template; in resume_execution()
608 if (p->ainsn.inst_flag & ~INST_FLAG_BOOSTABLE) { in resume_execution()
610 if (p->ainsn.inst_flag & INST_FLAG_FIX_RELATIVE_IP_ADDR) { in resume_execution()
616 if (p->ainsn.inst_flag & INST_FLAG_FIX_BRANCH_REG) { in resume_execution()
622 switch (p->ainsn.target_br_reg) { in resume_execution()
664 static void __kprobes prepare_ss(struct kprobe *p, struct pt_regs *regs) in prepare_ss() argument
666 unsigned long bundle_addr = (unsigned long) &p->ainsn.insn->bundle; in prepare_ss()
667 unsigned long slot = (unsigned long)p->addr & 0xf; in prepare_ss()
670 if (p->ainsn.inst_flag == INST_FLAG_BREAK_INST) in prepare_ss()
671 regs->cr_iip = (unsigned long)p->addr & ~0xFULL; in prepare_ss()
697 struct kprobe *p; in pre_kprobes_handler() local
712 p = get_kprobe(addr); in pre_kprobes_handler()
713 if (p) { in pre_kprobes_handler()
715 (p->ainsn.inst_flag == INST_FLAG_BREAK_INST)) { in pre_kprobes_handler()
726 set_current_kprobe(p, kcb); in pre_kprobes_handler()
727 kprobes_inc_nmissed_count(p); in pre_kprobes_handler()
728 prepare_ss(p, regs); in pre_kprobes_handler()
744 p = get_kprobe(addr); in pre_kprobes_handler()
745 if (!p) { in pre_kprobes_handler()
762 set_current_kprobe(p, kcb); in pre_kprobes_handler()
765 if (p->pre_handler && p->pre_handler(p, regs)) { in pre_kprobes_handler()
772 if (p->ainsn.inst_flag == INST_FLAG_BOOSTABLE && !p->post_handler) { in pre_kprobes_handler()
774 ia64_psr(regs)->ri = p->ainsn.slot; in pre_kprobes_handler()
775 regs->cr_iip = (unsigned long)&p->ainsn.insn->bundle & ~0xFULL; in pre_kprobes_handler()
784 prepare_ss(p, regs); in pre_kprobes_handler()
904 int __kprobes arch_trampoline_kprobe(struct kprobe *p) in arch_trampoline_kprobe() argument
906 if (p->addr == in arch_trampoline_kprobe()