Lines Matching refs:kcb
74 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); in arch_simulate_insn() local
80 post_kprobe_handler(kcb, regs); in arch_simulate_insn()
154 static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) in save_previous_kprobe() argument
156 kcb->prev_kprobe.kp = kprobe_running(); in save_previous_kprobe()
157 kcb->prev_kprobe.status = kcb->kprobe_status; in save_previous_kprobe()
160 static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) in restore_previous_kprobe() argument
162 __this_cpu_write(current_kprobe, kcb->prev_kprobe.kp); in restore_previous_kprobe()
163 kcb->kprobe_status = kcb->prev_kprobe.status; in restore_previous_kprobe()
179 static void __kprobes kprobes_save_local_irqflag(struct kprobe_ctlblk *kcb, in kprobes_save_local_irqflag() argument
182 kcb->saved_irqflag = regs->pstate & DAIF_MASK; in kprobes_save_local_irqflag()
188 static void __kprobes kprobes_restore_local_irqflag(struct kprobe_ctlblk *kcb, in kprobes_restore_local_irqflag() argument
192 regs->pstate |= kcb->saved_irqflag; in kprobes_restore_local_irqflag()
196 set_ss_context(struct kprobe_ctlblk *kcb, unsigned long addr) in set_ss_context() argument
198 kcb->ss_ctx.ss_pending = true; in set_ss_context()
199 kcb->ss_ctx.match_addr = addr + sizeof(kprobe_opcode_t); in set_ss_context()
202 static void __kprobes clear_ss_context(struct kprobe_ctlblk *kcb) in clear_ss_context() argument
204 kcb->ss_ctx.ss_pending = false; in clear_ss_context()
205 kcb->ss_ctx.match_addr = 0; in clear_ss_context()
210 struct kprobe_ctlblk *kcb, int reenter) in setup_singlestep() argument
215 save_previous_kprobe(kcb); in setup_singlestep()
217 kcb->kprobe_status = KPROBE_REENTER; in setup_singlestep()
219 kcb->kprobe_status = KPROBE_HIT_SS; in setup_singlestep()
227 set_ss_context(kcb, slot); /* mark pending ss */ in setup_singlestep()
230 kprobes_save_local_irqflag(kcb, regs); in setup_singlestep()
241 struct kprobe_ctlblk *kcb) in reenter_kprobe() argument
243 switch (kcb->kprobe_status) { in reenter_kprobe()
247 setup_singlestep(p, regs, kcb, 1); in reenter_kprobe()
264 post_kprobe_handler(struct kprobe_ctlblk *kcb, struct pt_regs *regs) in post_kprobe_handler() argument
276 if (kcb->kprobe_status == KPROBE_REENTER) { in post_kprobe_handler()
277 restore_previous_kprobe(kcb); in post_kprobe_handler()
281 kcb->kprobe_status = KPROBE_HIT_SSDONE; in post_kprobe_handler()
295 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); in kprobe_fault_handler() local
297 switch (kcb->kprobe_status) { in kprobe_fault_handler()
313 if (kcb->kprobe_status == KPROBE_REENTER) in kprobe_fault_handler()
314 restore_previous_kprobe(kcb); in kprobe_fault_handler()
351 struct kprobe_ctlblk *kcb; in kprobe_handler() local
354 kcb = get_kprobe_ctlblk(); in kprobe_handler()
361 if (reenter_kprobe(p, regs, kcb)) in kprobe_handler()
366 kcb->kprobe_status = KPROBE_HIT_ACTIVE; in kprobe_handler()
380 setup_singlestep(p, regs, kcb, 0); in kprobe_handler()
396 kprobe_ss_hit(struct kprobe_ctlblk *kcb, unsigned long addr) in kprobe_ss_hit() argument
398 if ((kcb->ss_ctx.ss_pending) in kprobe_ss_hit()
399 && (kcb->ss_ctx.match_addr == addr)) { in kprobe_ss_hit()
400 clear_ss_context(kcb); /* clear pending ss */ in kprobe_ss_hit()
410 struct kprobe_ctlblk *kcb = get_kprobe_ctlblk(); in kprobe_single_step_handler() local
414 retval = kprobe_ss_hit(kcb, instruction_pointer(regs)); in kprobe_single_step_handler()
417 kprobes_restore_local_irqflag(kcb, regs); in kprobe_single_step_handler()
420 post_kprobe_handler(kcb, regs); in kprobe_single_step_handler()