/linux-4.4.14/arch/arm/probes/uprobes/ |
H A D | core.c | 32 int set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm, set_swbp() argument 36 __opcode_to_mem_arm(auprobe->bpinsn)); set_swbp() 39 bool arch_uprobe_ignore(struct arch_uprobe *auprobe, struct pt_regs *regs) arch_uprobe_ignore() argument 41 if (!auprobe->asi.insn_check_cc(regs->ARM_cpsr)) { arch_uprobe_ignore() 49 bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs) arch_uprobe_skip_sstep() argument 53 if (!auprobe->simulate) arch_uprobe_skip_sstep() 56 opcode = __mem_to_opcode_arm(*(unsigned int *) auprobe->insn); arch_uprobe_skip_sstep() 58 auprobe->asi.insn_singlestep(opcode, &auprobe->asi, regs); arch_uprobe_skip_sstep() 75 int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, arch_uprobe_analyze_insn() argument 86 insn = __mem_to_opcode_arm(*(unsigned int *)auprobe->insn); arch_uprobe_analyze_insn() 87 auprobe->ixol[0] = __opcode_to_mem_arm(insn); arch_uprobe_analyze_insn() 88 auprobe->ixol[1] = __opcode_to_mem_arm(UPROBE_SS_ARM_INSN); arch_uprobe_analyze_insn() 90 ret = arm_probes_decode_insn(insn, &auprobe->asi, false, arch_uprobe_analyze_insn() 97 auprobe->simulate = true; arch_uprobe_analyze_insn() 111 auprobe->bpinsn = bpinsn; arch_uprobe_analyze_insn() 136 int arch_uprobe_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) arch_uprobe_pre_xol() argument 140 if (auprobe->prehandler) arch_uprobe_pre_xol() 141 auprobe->prehandler(auprobe, &utask->autask, regs); arch_uprobe_pre_xol() 150 int arch_uprobe_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) arch_uprobe_post_xol() argument 159 if (auprobe->posthandler) arch_uprobe_post_xol() 160 auprobe->posthandler(auprobe, &utask->autask, regs); arch_uprobe_post_xol() 173 void arch_uprobe_abort_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) arch_uprobe_abort_xol() argument
|
H A D | actions-arm.c | 69 static void uprobe_set_pc(struct arch_uprobe *auprobe, uprobe_set_pc() argument 73 u32 pcreg = auprobe->pcreg; uprobe_set_pc() 79 static void uprobe_unset_pc(struct arch_uprobe *auprobe, uprobe_unset_pc() argument 84 regs->uregs[auprobe->pcreg] = autask->backup; uprobe_unset_pc() 87 static void uprobe_aluwrite_pc(struct arch_uprobe *auprobe, uprobe_aluwrite_pc() argument 91 u32 pcreg = auprobe->pcreg; uprobe_aluwrite_pc() 97 static void uprobe_write_pc(struct arch_uprobe *auprobe, uprobe_write_pc() argument 101 u32 pcreg = auprobe->pcreg; uprobe_write_pc() 111 struct arch_uprobe *auprobe = container_of(asi, struct arch_uprobe, decode_pc_ro() local 117 reg = uprobes_substitute_pc(&auprobe->ixol[0], regs); decode_pc_ro() 124 auprobe->pcreg = reg; decode_pc_ro() 125 auprobe->prehandler = uprobe_set_pc; decode_pc_ro() 126 auprobe->posthandler = uprobe_unset_pc; decode_pc_ro() 135 struct arch_uprobe *auprobe = container_of(asi, struct arch_uprobe, decode_wb_pc() local 140 auprobe->posthandler = alu ? uprobe_aluwrite_pc decode_wb_pc() 166 struct arch_uprobe *auprobe = container_of(asi, struct arch_uprobe, uprobe_decode_ldmstm() local 185 auprobe->pcreg = 14; uprobe_decode_ldmstm() 186 auprobe->ixol[0] = __opcode_to_mem_arm(insn); uprobe_decode_ldmstm() 188 auprobe->prehandler = uprobe_set_pc; uprobe_decode_ldmstm() 190 auprobe->posthandler = uprobe_write_pc; uprobe_decode_ldmstm() 192 auprobe->posthandler = uprobe_unset_pc; uprobe_decode_ldmstm()
|
/linux-4.4.14/arch/x86/kernel/ |
H A D | uprobes.c | 286 static int uprobe_init_insn(struct arch_uprobe *auprobe, struct insn *insn, bool x86_64) uprobe_init_insn() argument 290 insn_init(insn, auprobe->insn, sizeof(auprobe->insn), x86_64); uprobe_init_insn() 340 static void riprel_analyze(struct arch_uprobe *auprobe, struct insn *insn) riprel_analyze() argument 355 cursor = auprobe->insn + insn_offset_rex_prefix(insn); riprel_analyze() 372 cursor = auprobe->insn + insn_offset_vex_prefix(insn) + 1; riprel_analyze() 438 auprobe->defparam.fixups |= UPROBE_FIX_RIP_SI; riprel_analyze() 441 auprobe->defparam.fixups |= UPROBE_FIX_RIP_DI; riprel_analyze() 445 auprobe->defparam.fixups |= UPROBE_FIX_RIP_BX; riprel_analyze() 452 cursor = auprobe->insn + insn_offset_modrm(insn); riprel_analyze() 462 scratch_reg(struct arch_uprobe *auprobe, struct pt_regs *regs) scratch_reg() argument 464 if (auprobe->defparam.fixups & UPROBE_FIX_RIP_SI) scratch_reg() 466 if (auprobe->defparam.fixups & UPROBE_FIX_RIP_DI) scratch_reg() 475 static void riprel_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) riprel_pre_xol() argument 477 if (auprobe->defparam.fixups & UPROBE_FIX_RIP_MASK) { riprel_pre_xol() 479 unsigned long *sr = scratch_reg(auprobe, regs); riprel_pre_xol() 482 *sr = utask->vaddr + auprobe->defparam.ilen; riprel_pre_xol() 486 static void riprel_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) riprel_post_xol() argument 488 if (auprobe->defparam.fixups & UPROBE_FIX_RIP_MASK) { riprel_post_xol() 490 unsigned long *sr = scratch_reg(auprobe, regs); riprel_post_xol() 499 static void riprel_analyze(struct arch_uprobe *auprobe, struct insn *insn) riprel_analyze() argument 502 static void riprel_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) riprel_pre_xol() argument 505 static void riprel_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) riprel_post_xol() argument 522 static int default_pre_xol_op(struct arch_uprobe *auprobe, struct pt_regs *regs) default_pre_xol_op() argument 524 riprel_pre_xol(auprobe, regs); default_pre_xol_op() 556 static int default_post_xol_op(struct arch_uprobe *auprobe, struct pt_regs *regs) default_post_xol_op() argument 560 riprel_post_xol(auprobe, regs); default_post_xol_op() 561 if (auprobe->defparam.fixups & UPROBE_FIX_IP) { default_post_xol_op() 564 } else if (auprobe->defparam.fixups & UPROBE_FIX_CALL) { default_post_xol_op() 566 if (push_ret_address(regs, utask->vaddr + auprobe->defparam.ilen)) default_post_xol_op() 570 if (auprobe->defparam.fixups & UPROBE_FIX_SETF) default_post_xol_op() 576 static void default_abort_op(struct arch_uprobe *auprobe, struct pt_regs *regs) default_abort_op() argument 578 riprel_post_xol(auprobe, regs); default_abort_op() 587 static bool branch_is_call(struct arch_uprobe *auprobe) branch_is_call() argument 589 return auprobe->branch.opc1 == 0xe8; branch_is_call() 621 static bool check_jmp_cond(struct arch_uprobe *auprobe, struct pt_regs *regs) check_jmp_cond() argument 625 switch (auprobe->branch.opc1) { check_jmp_cond() 640 static bool branch_emulate_op(struct arch_uprobe *auprobe, struct pt_regs *regs) branch_emulate_op() argument 642 unsigned long new_ip = regs->ip += auprobe->branch.ilen; branch_emulate_op() 643 unsigned long offs = (long)auprobe->branch.offs; branch_emulate_op() 645 if (branch_is_call(auprobe)) { branch_emulate_op() 657 } else if (!check_jmp_cond(auprobe, regs)) { branch_emulate_op() 665 static int branch_post_xol_op(struct arch_uprobe *auprobe, struct pt_regs *regs) branch_post_xol_op() argument 667 BUG_ON(!branch_is_call(auprobe)); branch_post_xol_op() 678 static void branch_clear_offset(struct arch_uprobe *auprobe, struct insn *insn) branch_clear_offset() argument 694 memset(auprobe->insn + insn_offset_immediate(insn), branch_clear_offset() 704 static int branch_setup_xol_ops(struct arch_uprobe *auprobe, struct insn *insn) branch_setup_xol_ops() argument 716 branch_clear_offset(auprobe, insn); branch_setup_xol_ops() 742 auprobe->branch.opc1 = opc1; branch_setup_xol_ops() 743 auprobe->branch.ilen = insn->length; branch_setup_xol_ops() 744 auprobe->branch.offs = insn->immediate.value; branch_setup_xol_ops() 746 auprobe->ops = &branch_xol_ops; branch_setup_xol_ops() 757 int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long addr) arch_uprobe_analyze_insn() argument 763 ret = uprobe_init_insn(auprobe, &insn, is_64bit_mm(mm)); arch_uprobe_analyze_insn() 767 ret = branch_setup_xol_ops(auprobe, &insn); arch_uprobe_analyze_insn() 777 auprobe->defparam.fixups |= UPROBE_FIX_SETF; arch_uprobe_analyze_insn() 800 riprel_analyze(auprobe, &insn); arch_uprobe_analyze_insn() 803 auprobe->defparam.ilen = insn.length; arch_uprobe_analyze_insn() 804 auprobe->defparam.fixups |= fix_ip_or_call; arch_uprobe_analyze_insn() 806 auprobe->ops = &default_xol_ops; arch_uprobe_analyze_insn() 812 * @auprobe: the probepoint information. 815 int arch_uprobe_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) arch_uprobe_pre_xol() argument 819 if (auprobe->ops->pre_xol) { arch_uprobe_pre_xol() 820 int err = auprobe->ops->pre_xol(auprobe, regs); arch_uprobe_pre_xol() 862 int arch_uprobe_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) arch_uprobe_post_xol() argument 871 if (auprobe->ops->post_xol) { arch_uprobe_post_xol() 872 err = auprobe->ops->post_xol(auprobe, regs); arch_uprobe_post_xol() 933 void arch_uprobe_abort_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) arch_uprobe_abort_xol() argument 937 if (auprobe->ops->abort) arch_uprobe_abort_xol() 938 auprobe->ops->abort(auprobe, regs); arch_uprobe_abort_xol() 947 static bool __skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs) __skip_sstep() argument 949 if (auprobe->ops->emulate) __skip_sstep() 950 return auprobe->ops->emulate(auprobe, regs); __skip_sstep() 954 bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs) arch_uprobe_skip_sstep() argument 956 bool ret = __skip_sstep(auprobe, regs); arch_uprobe_skip_sstep()
|
/linux-4.4.14/arch/arm/include/asm/ |
H A D | uprobes.h | 36 void (*prehandler)(struct arch_uprobe *auprobe, 39 void (*posthandler)(struct arch_uprobe *auprobe,
|
/linux-4.4.14/arch/s390/kernel/ |
H A D | uprobes.c | 20 int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, arch_uprobe_analyze_insn() argument 23 return probe_is_prohibited_opcode(auprobe->insn); arch_uprobe_analyze_insn() 26 int arch_uprobe_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) arch_uprobe_pre_xol() argument 33 auprobe->saved_per = psw_bits(regs->psw).r; arch_uprobe_pre_xol() 34 auprobe->saved_int_code = regs->int_code; arch_uprobe_pre_xol() 75 int arch_uprobe_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) arch_uprobe_post_xol() argument 77 int fixup = probe_get_fixup_type(auprobe->insn); arch_uprobe_post_xol() 82 psw_bits(regs->psw).r = auprobe->saved_per; arch_uprobe_post_xol() 83 regs->int_code = auprobe->saved_int_code; arch_uprobe_post_xol() 88 int reg = (auprobe->insn[0] & 0xf0) >> 4; arch_uprobe_post_xol() 93 int ilen = insn_length(auprobe->insn[0] >> 8); arch_uprobe_post_xol() 132 void arch_uprobe_abort_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) arch_uprobe_abort_xol() argument 135 regs->int_code = auprobe->saved_int_code; arch_uprobe_abort_xol() 257 static void handle_insn_ril(struct arch_uprobe *auprobe, struct pt_regs *regs) handle_insn_ril() argument 265 insn = (struct insn_ril *) &auprobe->insn; handle_insn_ril() 371 bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs) arch_uprobe_skip_sstep() argument 380 if (probe_is_insn_relative_long(auprobe->insn)) { arch_uprobe_skip_sstep() 381 handle_insn_ril(auprobe, regs); arch_uprobe_skip_sstep()
|
/linux-4.4.14/arch/powerpc/kernel/ |
H A D | uprobes.c | 50 int arch_uprobe_analyze_insn(struct arch_uprobe *auprobe, arch_uprobe_analyze_insn() argument 61 * @auprobe: the probepoint information. 64 int arch_uprobe_pre_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) arch_uprobe_pre_xol() argument 112 int arch_uprobe_post_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) arch_uprobe_post_xol() argument 167 void arch_uprobe_abort_xol(struct arch_uprobe *auprobe, struct pt_regs *regs) arch_uprobe_abort_xol() argument 181 bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs) arch_uprobe_skip_sstep() argument 189 ret = emulate_step(regs, auprobe->insn); arch_uprobe_skip_sstep()
|
/linux-4.4.14/arch/mips/kernel/ |
H A D | uprobes.c | 154 * @auprobe: the probepoint information. 267 * @auprobe: arch specific probepoint information. 277 int __weak set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm, set_swbp() argument 286 * @auprobe: arch specific probepoint information. 294 int set_orig_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, set_orig_insn() argument 298 *(uprobe_opcode_t *)&auprobe->orig_inst[0].word); set_orig_insn() 338 bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs) arch_uprobe_skip_sstep() argument
|
/linux-4.4.14/kernel/events/ |
H A D | uprobes.c | 334 * @auprobe: arch specific probepoint information. 341 int __weak set_swbp(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long vaddr) set_swbp() argument 349 * @auprobe: arch specific probepoint information. 356 set_orig_insn(struct arch_uprobe *auprobe, struct mm_struct *mm, unsigned long vaddr) set_orig_insn() argument 358 return uprobe_write_opcode(mm, vaddr, *(uprobe_opcode_t *)&auprobe->insn); set_orig_insn()
|