Lines Matching refs:p

13 static void arch_prepare_ss_slot(struct kprobe *p)  in arch_prepare_ss_slot()  argument
15 p->ainsn.insn[0] = *p->addr; in arch_prepare_ss_slot()
16 p->ainsn.insn[1] = KPROBE_SSTEPBP_INSN; in arch_prepare_ss_slot()
17 p->ainsn.restore = (unsigned long)p->addr + LOONGARCH_INSN_SIZE; in arch_prepare_ss_slot()
21 static void arch_prepare_simulate(struct kprobe *p) in arch_prepare_simulate() argument
23 p->ainsn.restore = 0; in arch_prepare_simulate()
27 int arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() argument
31 if ((unsigned long)p->addr & 0x3) in arch_prepare_kprobe()
35 p->opcode = *p->addr; in arch_prepare_kprobe()
36 insn.word = p->opcode; in arch_prepare_kprobe()
43 p->ainsn.insn = NULL; in arch_prepare_kprobe()
45 p->ainsn.insn = get_insn_slot(); in arch_prepare_kprobe()
46 if (!p->ainsn.insn) in arch_prepare_kprobe()
51 if (p->ainsn.insn) in arch_prepare_kprobe()
52 arch_prepare_ss_slot(p); in arch_prepare_kprobe()
54 arch_prepare_simulate(p); in arch_prepare_kprobe()
61 void arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() argument
63 *p->addr = KPROBE_BP_INSN; in arch_arm_kprobe()
64 flush_insn_slot(p); in arch_arm_kprobe()
69 void arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() argument
71 *p->addr = p->opcode; in arch_disarm_kprobe()
72 flush_insn_slot(p); in arch_disarm_kprobe()
76 void arch_remove_kprobe(struct kprobe *p) in arch_remove_kprobe() argument
78 if (p->ainsn.insn) { in arch_remove_kprobe()
79 free_insn_slot(p->ainsn.insn, 0); in arch_remove_kprobe()
80 p->ainsn.insn = NULL; in arch_remove_kprobe()
99 static void set_current_kprobe(struct kprobe *p) in set_current_kprobe() argument
101 __this_cpu_write(current_kprobe, p); in set_current_kprobe()
155 static void setup_singlestep(struct kprobe *p, struct pt_regs *regs, in setup_singlestep() argument
162 set_current_kprobe(p); in setup_singlestep()
168 if (p->ainsn.insn) { in setup_singlestep()
172 regs->csr_era = (unsigned long)p->ainsn.insn; in setup_singlestep()
175 insn.word = p->opcode; in setup_singlestep()
178 post_kprobe_handler(p, kcb, regs); in setup_singlestep()
183 static bool reenter_kprobe(struct kprobe *p, struct pt_regs *regs, in reenter_kprobe() argument
190 kprobes_inc_nmissed_count(p); in reenter_kprobe()
191 setup_singlestep(p, regs, kcb, 1); in reenter_kprobe()
195 dump_kprobe(p); in reenter_kprobe()
210 struct kprobe *p, *cur_kprobe; in kprobe_breakpoint_handler() local
221 p = get_kprobe(addr); in kprobe_breakpoint_handler()
222 if (p) { in kprobe_breakpoint_handler()
224 if (reenter_kprobe(p, regs, kcb)) in kprobe_breakpoint_handler()
228 set_current_kprobe(p); in kprobe_breakpoint_handler()
241 if (!p->pre_handler || !p->pre_handler(p, regs)) { in kprobe_breakpoint_handler()
242 setup_singlestep(p, regs, kcb, 0); in kprobe_breakpoint_handler()
334 int arch_trampoline_kprobe(struct kprobe *p) in arch_trampoline_kprobe() argument