Lines Matching refs:p
44 static void __kprobes arch_prepare_ss_slot(struct kprobe *p) in arch_prepare_ss_slot() argument
46 kprobe_opcode_t *addr = p->ainsn.api.insn; in arch_prepare_ss_slot()
67 aarch64_insn_patch_text_nosync(addr, p->opcode); in arch_prepare_ss_slot()
73 p->ainsn.api.restore = (unsigned long) p->addr + in arch_prepare_ss_slot()
77 static void __kprobes arch_prepare_simulate(struct kprobe *p) in arch_prepare_simulate() argument
80 p->ainsn.api.restore = 0; in arch_prepare_simulate()
83 static void __kprobes arch_simulate_insn(struct kprobe *p, struct pt_regs *regs) in arch_simulate_insn() argument
87 if (p->ainsn.api.handler) in arch_simulate_insn()
88 p->ainsn.api.handler((u32)p->opcode, (long)p->addr, regs); in arch_simulate_insn()
91 post_kprobe_handler(p, kcb, regs); in arch_simulate_insn()
94 int __kprobes arch_prepare_kprobe(struct kprobe *p) in arch_prepare_kprobe() argument
96 unsigned long probe_addr = (unsigned long)p->addr; in arch_prepare_kprobe()
102 p->opcode = le32_to_cpu(*p->addr); in arch_prepare_kprobe()
108 switch (arm_kprobe_decode_insn(p->addr, &p->ainsn)) { in arch_prepare_kprobe()
113 p->ainsn.api.insn = NULL; in arch_prepare_kprobe()
117 p->ainsn.api.insn = get_insn_slot(); in arch_prepare_kprobe()
118 if (!p->ainsn.api.insn) in arch_prepare_kprobe()
124 if (p->ainsn.api.insn) in arch_prepare_kprobe()
125 arch_prepare_ss_slot(p); in arch_prepare_kprobe()
127 arch_prepare_simulate(p); in arch_prepare_kprobe()
140 void __kprobes arch_arm_kprobe(struct kprobe *p) in arch_arm_kprobe() argument
142 void *addr = p->addr; in arch_arm_kprobe()
149 void __kprobes arch_disarm_kprobe(struct kprobe *p) in arch_disarm_kprobe() argument
151 void *addr = p->addr; in arch_disarm_kprobe()
153 aarch64_insn_patch_text(&addr, &p->opcode, 1); in arch_disarm_kprobe()
156 void __kprobes arch_remove_kprobe(struct kprobe *p) in arch_remove_kprobe() argument
158 if (p->ainsn.api.insn) { in arch_remove_kprobe()
159 free_insn_slot(p->ainsn.api.insn, 0); in arch_remove_kprobe()
160 p->ainsn.api.insn = NULL; in arch_remove_kprobe()
176 static void __kprobes set_current_kprobe(struct kprobe *p) in set_current_kprobe() argument
178 __this_cpu_write(current_kprobe, p); in set_current_kprobe()
200 static void __kprobes setup_singlestep(struct kprobe *p, in setup_singlestep() argument
208 set_current_kprobe(p); in setup_singlestep()
215 if (p->ainsn.api.insn) { in setup_singlestep()
217 slot = (unsigned long)p->ainsn.api.insn; in setup_singlestep()
223 arch_simulate_insn(p, regs); in setup_singlestep()
227 static int __kprobes reenter_kprobe(struct kprobe *p, in reenter_kprobe() argument
234 kprobes_inc_nmissed_count(p); in reenter_kprobe()
235 setup_singlestep(p, regs, kcb, 1); in reenter_kprobe()
240 dump_kprobe(p); in reenter_kprobe()
304 struct kprobe *p, *cur_kprobe; in kprobe_breakpoint_handler() local
311 p = get_kprobe((kprobe_opcode_t *) addr); in kprobe_breakpoint_handler()
312 if (WARN_ON_ONCE(!p)) { in kprobe_breakpoint_handler()
322 if (!reenter_kprobe(p, regs, kcb)) in kprobe_breakpoint_handler()
326 set_current_kprobe(p); in kprobe_breakpoint_handler()
336 if (!p->pre_handler || !p->pre_handler(p, regs)) in kprobe_breakpoint_handler()
337 setup_singlestep(p, regs, kcb, 0); in kprobe_breakpoint_handler()
414 int __kprobes arch_trampoline_kprobe(struct kprobe *p) in arch_trampoline_kprobe() argument