Lines Matching refs:op
110 static void __kprobes __synthesize_relative_insn(void *from, void *to, u8 op)
113 u8 op;
119 insn->op = op;
1185 static void __kprobes optimized_callback(struct optimized_kprobe *op,
1192 kprobes_inc_nmissed_count(&op->kp);
1201 regs->ip = (unsigned long)op->kp.addr + INT3_SIZE;
1204 __get_cpu_var(current_kprobe) = &op->kp;
1206 opt_pre_handler(&op->kp, regs);
1316 int __kprobes arch_check_optimized_kprobe(struct optimized_kprobe *op)
1321 for (i = 1; i < op->optinsn.size; i++) {
1322 p = get_kprobe(op->kp.addr + i);
1331 int __kprobes arch_within_optimized_kprobe(struct optimized_kprobe *op,
1334 return ((unsigned long)op->kp.addr <= addr &&
1335 (unsigned long)op->kp.addr + op->optinsn.size > addr);
1340 void __arch_remove_optimized_kprobe(struct optimized_kprobe *op, int dirty)
1342 if (op->optinsn.insn) {
1343 free_optinsn_slot(op->optinsn.insn, dirty);
1344 op->optinsn.insn = NULL;
1345 op->optinsn.size = 0;
1349 void __kprobes arch_remove_optimized_kprobe(struct optimized_kprobe *op)
1351 __arch_remove_optimized_kprobe(op, 1);
1358 int __kprobes arch_prepare_optimized_kprobe(struct optimized_kprobe *op)
1364 if (!can_optimize((unsigned long)op->kp.addr))
1367 op->optinsn.insn = get_optinsn_slot();
1368 if (!op->optinsn.insn)
1375 rel = (long)op->optinsn.insn - (long)op->kp.addr + RELATIVEJUMP_SIZE;
1379 buf = (u8 *)op->optinsn.insn;
1382 ret = copy_optimized_instructions(buf + TMPL_END_IDX, op->kp.addr);
1384 __arch_remove_optimized_kprobe(op, 0);
1387 op->optinsn.size = ret;
1393 synthesize_set_arg1(buf + TMPL_MOVE_IDX, (unsigned long)op);
1399 synthesize_reljump(buf + TMPL_END_IDX + op->optinsn.size,
1400 (u8 *)op->kp.addr + op->optinsn.size);
1404 op->optinsn.size + RELATIVEJUMP_SIZE);
1409 int __kprobes arch_optimize_kprobe(struct optimized_kprobe *op)
1412 s32 rel = (s32)((long)op->optinsn.insn -
1413 ((long)op->kp.addr + RELATIVEJUMP_SIZE));
1416 memcpy(op->optinsn.copied_insn, op->kp.addr + INT3_SIZE,
1427 text_poke_smp(op->kp.addr, jmp_code, RELATIVEJUMP_SIZE);
1432 void __kprobes arch_unoptimize_kprobe(struct optimized_kprobe *op)
1438 memcpy(buf + 1, op->optinsn.copied_insn, RELATIVE_ADDR_SIZE);
1439 text_poke_smp(op->kp.addr, buf, RELATIVEJUMP_SIZE);
1446 struct optimized_kprobe *op;
1450 op = container_of(p, struct optimized_kprobe, kp);
1452 regs->ip = (unsigned long)op->optinsn.insn + TMPL_END_IDX;