/linux-6.6.21/arch/arc/kernel/ |
D | kprobes.c | 31 p->ainsn.is_short = is_short_instr((unsigned long)p->addr); in arch_prepare_kprobe() 58 if (p->ainsn.t1_addr) { in arch_remove_kprobe() 59 *(p->ainsn.t1_addr) = p->ainsn.t1_opcode; in arch_remove_kprobe() 61 flush_icache_range((unsigned long)p->ainsn.t1_addr, in arch_remove_kprobe() 62 (unsigned long)p->ainsn.t1_addr + in arch_remove_kprobe() 65 p->ainsn.t1_addr = NULL; in arch_remove_kprobe() 68 if (p->ainsn.t2_addr) { in arch_remove_kprobe() 69 *(p->ainsn.t2_addr) = p->ainsn.t2_opcode; in arch_remove_kprobe() 71 flush_icache_range((unsigned long)p->ainsn.t2_addr, in arch_remove_kprobe() 72 (unsigned long)p->ainsn.t2_addr + in arch_remove_kprobe() [all …]
|
/linux-6.6.21/arch/x86/kernel/kprobes/ |
D | core.c | 430 synthesize_reljump(buf + len, p->ainsn.insn + len, in prepare_singlestep() 433 p->ainsn.boostable = 1; in prepare_singlestep() 468 switch (p->ainsn.opcode) { in kprobe_emulate_ifmodifiers() 482 regs->ip = regs->ip - INT3_INSN_SIZE + p->ainsn.size; in kprobe_emulate_ifmodifiers() 494 unsigned long func = regs->ip - INT3_INSN_SIZE + p->ainsn.size; in kprobe_emulate_call() 496 func += p->ainsn.rel32; in kprobe_emulate_call() 503 unsigned long ip = regs->ip - INT3_INSN_SIZE + p->ainsn.size; in kprobe_emulate_jmp() 505 ip += p->ainsn.rel32; in kprobe_emulate_jmp() 512 unsigned long ip = regs->ip - INT3_INSN_SIZE + p->ainsn.size; in kprobe_emulate_jcc() 514 int3_emulate_jcc(regs, p->ainsn.jcc.type, ip, p->ainsn.rel32); in kprobe_emulate_jcc() [all …]
|
D | ftrace.c | 67 p->ainsn.insn = NULL; in arch_prepare_kprobe_ftrace() 68 p->ainsn.boostable = false; in arch_prepare_kprobe_ftrace()
|
/linux-6.6.21/arch/ia64/kernel/ |
D | kprobes.c | 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() [all …]
|
/linux-6.6.21/arch/loongarch/kernel/ |
D | kprobes.c | 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() 23 p->ainsn.restore = 0; in arch_prepare_simulate() 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() 78 if (p->ainsn.insn) { in arch_remove_kprobe() 79 free_insn_slot(p->ainsn.insn, 0); in arch_remove_kprobe() [all …]
|
D | ftrace_dyn.c | 338 p->ainsn.insn = NULL; in arch_prepare_kprobe_ftrace()
|
/linux-6.6.21/arch/arm64/kernel/probes/ |
D | kprobes.c | 46 kprobe_opcode_t *addr = p->ainsn.api.insn; in arch_prepare_ss_slot() 73 p->ainsn.api.restore = (unsigned long) p->addr + in arch_prepare_ss_slot() 80 p->ainsn.api.restore = 0; in arch_prepare_simulate() 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() 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() [all …]
|
/linux-6.6.21/arch/arm/probes/kprobes/ |
D | core.c | 85 p->ainsn.insn = tmp_insn; in arch_prepare_kprobe() 87 switch ((*decode_insn)(insn, &p->ainsn, true, actions, checkers)) { in arch_prepare_kprobe() 92 p->ainsn.insn = get_insn_slot(); in arch_prepare_kprobe() 93 if (!p->ainsn.insn) in arch_prepare_kprobe() 96 p->ainsn.insn[is] = tmp_insn[is]; in arch_prepare_kprobe() 97 flush_insns(p->ainsn.insn, in arch_prepare_kprobe() 98 sizeof(p->ainsn.insn[0]) * MAX_INSN_SIZE); in arch_prepare_kprobe() 99 p->ainsn.insn_fn = (probes_insn_fn_t *) in arch_prepare_kprobe() 100 ((uintptr_t)p->ainsn.insn | thumb); in arch_prepare_kprobe() 104 p->ainsn.insn = NULL; in arch_prepare_kprobe() [all …]
|
D | opt-arm.c | 127 if (kp->ainsn.stack_space < 0) in can_optimize() 133 if (kp->ainsn.stack_space > 255 - sizeof(struct pt_regs)) in can_optimize() 175 if (!p->ainsn.kprobe_direct_exec) in optimized_callback() 176 op->kp.ainsn.insn_singlestep(p->opcode, &p->ainsn, regs); in optimized_callback() 239 BUG_ON(orig->ainsn.stack_space < 0); in NOKPROBE_SYMBOL() 241 stack_protect += orig->ainsn.stack_space; in NOKPROBE_SYMBOL() 260 orig->ainsn.kprobe_direct_exec = false; in NOKPROBE_SYMBOL() 261 if (can_kprobe_direct_exec(orig->ainsn.register_usage_flags)) { in NOKPROBE_SYMBOL() 277 orig->ainsn.kprobe_direct_exec = true; in NOKPROBE_SYMBOL()
|
/linux-6.6.21/arch/powerpc/kernel/ |
D | kprobes.c | 167 ppc_inst_prefixed(ppc_inst_read(prev->ainsn.insn))) { in arch_prepare_kprobe() 175 p->ainsn.insn = get_insn_slot(); in arch_prepare_kprobe() 176 if (!p->ainsn.insn) in arch_prepare_kprobe() 181 patch_instruction(p->ainsn.insn, insn); in arch_prepare_kprobe() 185 p->ainsn.boostable = 0; in arch_prepare_kprobe() 204 if (p->ainsn.insn) { in arch_remove_kprobe() 205 free_insn_slot(p->ainsn.insn, 0); in arch_remove_kprobe() 206 p->ainsn.insn = NULL; in arch_remove_kprobe() 221 regs_set_return_ip(regs, (unsigned long)p->ainsn.insn); in prepare_singlestep() 258 ppc_inst_t insn = ppc_inst_read(p->ainsn.insn); in try_to_emulate() [all …]
|
D | kprobes-ftrace.c | 69 p->ainsn.insn = NULL; in arch_prepare_kprobe_ftrace() 70 p->ainsn.boostable = -1; in arch_prepare_kprobe_ftrace()
|
D | optprobes.c | 87 if (!is_conditional_branch(ppc_inst_read(p->ainsn.insn)) && in can_optimize() 88 analyse_instr(&op, ®s, ppc_inst_read(p->ainsn.insn)) == 1) { in can_optimize() 231 temp = ppc_inst_read(p->ainsn.insn); in arch_prepare_optimized_kprobe()
|
/linux-6.6.21/arch/riscv/kernel/probes/ |
D | kprobes.c | 29 p->ainsn.api.restore = (unsigned long)p->addr + offset; in arch_prepare_ss_slot() 31 patch_text(p->ainsn.api.insn, &p->opcode, 1); in arch_prepare_ss_slot() 32 patch_text((void *)((unsigned long)(p->ainsn.api.insn) + offset), in arch_prepare_ss_slot() 38 p->ainsn.api.restore = 0; in arch_prepare_simulate() 45 if (p->ainsn.api.handler) in arch_simulate_insn() 46 p->ainsn.api.handler((u32)p->opcode, in arch_simulate_insn() 83 switch (riscv_probe_decode_insn(p->addr, &p->ainsn.api)) { in arch_prepare_kprobe() 88 p->ainsn.api.insn = NULL; in arch_prepare_kprobe() 92 p->ainsn.api.insn = get_insn_slot(); in arch_prepare_kprobe() 93 if (!p->ainsn.api.insn) in arch_prepare_kprobe() [all …]
|
D | ftrace.c | 60 p->ainsn.api.insn = NULL; in arch_prepare_kprobe_ftrace()
|
/linux-6.6.21/arch/csky/kernel/probes/ |
D | kprobes.c | 58 p->ainsn.api.restore = (unsigned long)p->addr + offset; in arch_prepare_ss_slot() 60 patch_text(p->ainsn.api.insn, p->opcode); in arch_prepare_ss_slot() 65 p->ainsn.api.restore = 0; in arch_prepare_simulate() 72 if (p->ainsn.api.handler) in arch_simulate_insn() 73 p->ainsn.api.handler((u32)p->opcode, (long)p->addr, regs); in arch_simulate_insn() 89 switch (csky_probe_decode_insn(p->addr, &p->ainsn.api)) { in arch_prepare_kprobe() 94 p->ainsn.api.insn = NULL; in arch_prepare_kprobe() 98 p->ainsn.api.insn = get_insn_slot(); in arch_prepare_kprobe() 99 if (!p->ainsn.api.insn) in arch_prepare_kprobe() 105 if (p->ainsn.api.insn) in arch_prepare_kprobe() [all …]
|
D | ftrace.c | 65 p->ainsn.api.insn = NULL; in arch_prepare_kprobe_ftrace()
|
/linux-6.6.21/arch/s390/kernel/ |
D | kprobes.c | 88 new_addr = (u64)(unsigned long)p->ainsn.insn; in copy_instruction() 92 s390_kernel_write(p->ainsn.insn, &insn, len); in copy_instruction() 103 p->ainsn.insn = NULL; in s390_get_insn_slot() 105 p->ainsn.insn = get_s390_insn_slot(); in s390_get_insn_slot() 107 p->ainsn.insn = get_insn_slot(); in s390_get_insn_slot() 108 return p->ainsn.insn ? 0 : -ENOMEM; in s390_get_insn_slot() 114 if (!p->ainsn.insn) in s390_free_insn_slot() 117 free_s390_insn_slot(p->ainsn.insn, 0); in s390_free_insn_slot() 119 free_insn_slot(p->ainsn.insn, 0); in s390_free_insn_slot() 120 p->ainsn.insn = NULL; in s390_free_insn_slot() [all …]
|
D | ftrace.c | 337 p->ainsn.insn = NULL; in arch_prepare_kprobe_ftrace()
|
/linux-6.6.21/arch/parisc/kernel/ |
D | kprobes.c | 25 p->ainsn.insn = get_insn_slot(); in arch_prepare_kprobe() 26 if (!p->ainsn.insn) in arch_prepare_kprobe() 34 p->ainsn.insn[0] = p->opcode; in arch_prepare_kprobe() 35 p->ainsn.insn[1] = PARISC_KPROBES_BREAK_INSN2; in arch_prepare_kprobe() 43 if (!p->ainsn.insn) in arch_remove_kprobe() 46 free_insn_slot(p->ainsn.insn, 0); in arch_remove_kprobe() 47 p->ainsn.insn = NULL; in arch_remove_kprobe() 82 instruction_pointer_set(regs, (unsigned long)p->ainsn.insn); in setup_singlestep() 143 if (regs->iaoq[0] != (unsigned long)p->ainsn.insn+4) in parisc_kprobe_ss_handler()
|
D | ftrace.c | 248 p->ainsn.insn = NULL; in arch_prepare_kprobe_ftrace()
|
/linux-6.6.21/arch/mips/kernel/ |
D | kprobes.c | 107 p->ainsn.insn = get_insn_slot(); in arch_prepare_kprobe() 108 if (!p->ainsn.insn) { in arch_prepare_kprobe() 127 memcpy(&p->ainsn.insn[0], p->addr + 1, sizeof(kprobe_opcode_t)); in arch_prepare_kprobe() 129 memcpy(&p->ainsn.insn[0], p->addr, sizeof(kprobe_opcode_t)); in arch_prepare_kprobe() 131 p->ainsn.insn[1] = breakpoint2_insn; in arch_prepare_kprobe() 155 if (p->ainsn.insn) { in arch_remove_kprobe() 156 free_insn_slot(p->ainsn.insn, 0); in arch_remove_kprobe() 157 p->ainsn.insn = NULL; in arch_remove_kprobe() 212 if (p->ainsn.insn->word == 0) in evaluate_branch_instruction() 251 regs->cp0_epc = (unsigned long)&p->ainsn.insn[0]; in prepare_singlestep() [all …]
|
/linux-6.6.21/arch/sparc/kernel/ |
D | kprobes.c | 55 p->ainsn.insn[0] = *p->addr; in arch_prepare_kprobe() 56 flushi(&p->ainsn.insn[0]); in arch_prepare_kprobe() 58 p->ainsn.insn[1] = BREAKPOINT_INSTRUCTION_2; in arch_prepare_kprobe() 59 flushi(&p->ainsn.insn[1]); in arch_prepare_kprobe() 111 regs->tpc = (unsigned long) &p->ainsn.insn[0]; in prepare_singlestep() 112 regs->tnpc = (unsigned long) &p->ainsn.insn[1]; in prepare_singlestep() 218 ainsn_addr = (unsigned long) &p->ainsn.insn[0]; in relbranch_fixup() 280 u32 insn = p->ainsn.insn[0]; in resume_execution()
|
/linux-6.6.21/arch/parisc/include/asm/ |
D | kprobes.h | 31 flush_icache_range((unsigned long)&(p)->ainsn.insn[0], \ 32 (unsigned long)&(p)->ainsn.insn[0] + \
|
/linux-6.6.21/arch/sparc/include/asm/ |
D | kprobes.h | 23 do { flushi(&(p)->ainsn.insn[0]); \ 24 flushi(&(p)->ainsn.insn[1]); \
|
/linux-6.6.21/arch/sh/kernel/ |
D | kprobes.c | 54 memcpy(p->ainsn.insn, p->addr, MAX_INSN_SIZE * sizeof(kprobe_opcode_t)); in arch_copy_kprobe() 234 *p->ainsn.insn == BREAKPOINT_INSTRUCTION) { in kprobe_handler()
|