/kernel/bpf/ |
D | disasm.c | 17 const struct bpf_insn *insn, in __func_get_name() argument 22 if (insn->src_reg != BPF_PSEUDO_CALL && in __func_get_name() 23 insn->imm >= 0 && insn->imm < __BPF_FUNC_MAX_ID && in __func_get_name() 24 func_id_str[insn->imm]) in __func_get_name() 25 return func_id_str[insn->imm]; in __func_get_name() 28 return cbs->cb_call(cbs->private_data, insn); in __func_get_name() 30 if (insn->src_reg == BPF_PSEUDO_CALL) in __func_get_name() 31 snprintf(buff, len, "%+d", insn->imm); in __func_get_name() 37 const struct bpf_insn *insn, in __func_imm_name() argument 41 return cbs->cb_imm(cbs->private_data, insn, full_imm); in __func_imm_name() [all …]
|
D | verifier.c | 1137 struct bpf_insn *insn = env->prog->insnsi; in check_subprogs() local 1147 if (insn[i].code != (BPF_JMP | BPF_CALL)) in check_subprogs() 1149 if (insn[i].src_reg != BPF_PSEUDO_CALL) in check_subprogs() 1155 ret = add_subprog(env, i + insn[i].imm + 1); in check_subprogs() 1173 u8 code = insn[i].code; in check_subprogs() 1179 off = i + insn[i].off + 1; in check_subprogs() 1259 static bool is_reg64(struct bpf_verifier_env *env, struct bpf_insn *insn, in is_reg64() argument 1264 code = insn->code; in is_reg64() 1279 if (insn->src_reg == BPF_PSEUDO_CALL) in is_reg64() 1293 (class == BPF_ALU && op == BPF_END && insn->imm == 64)) in is_reg64() [all …]
|
D | core.c | 50 #define DST regs[insn->dst_reg] 51 #define SRC regs[insn->src_reg] 56 #define IMM insn->imm 336 static int bpf_adj_delta_to_imm(struct bpf_insn *insn, u32 pos, s32 end_old, in bpf_adj_delta_to_imm() argument 341 s64 imm = insn->imm; in bpf_adj_delta_to_imm() 350 insn->imm = imm; in bpf_adj_delta_to_imm() 354 static int bpf_adj_delta_to_off(struct bpf_insn *insn, u32 pos, s32 end_old, in bpf_adj_delta_to_off() argument 359 s32 off = insn->off; in bpf_adj_delta_to_off() 368 insn->off = off; in bpf_adj_delta_to_off() 376 struct bpf_insn *insn = prog->insnsi; in bpf_adj_branches() local [all …]
|
D | arraymap.c | 188 struct bpf_insn *insn = insn_buf; in array_map_gen_lookup() local 194 *insn++ = BPF_ALU64_IMM(BPF_ADD, map_ptr, offsetof(struct bpf_array, value)); in array_map_gen_lookup() 195 *insn++ = BPF_LDX_MEM(BPF_W, ret, index, 0); in array_map_gen_lookup() 197 *insn++ = BPF_JMP_IMM(BPF_JGE, ret, map->max_entries, 4); in array_map_gen_lookup() 198 *insn++ = BPF_ALU32_IMM(BPF_AND, ret, array->index_mask); in array_map_gen_lookup() 200 *insn++ = BPF_JMP_IMM(BPF_JGE, ret, map->max_entries, 3); in array_map_gen_lookup() 204 *insn++ = BPF_ALU64_IMM(BPF_LSH, ret, ilog2(elem_size)); in array_map_gen_lookup() 206 *insn++ = BPF_ALU64_IMM(BPF_MUL, ret, elem_size); in array_map_gen_lookup() 208 *insn++ = BPF_ALU64_REG(BPF_ADD, ret, map_ptr); in array_map_gen_lookup() 209 *insn++ = BPF_JMP_IMM(BPF_JA, 0, 0, 1); in array_map_gen_lookup() [all …]
|
D | cgroup.c | 1343 struct bpf_insn *insn = insn_buf; in sysctl_convert_ctx_access() local 1348 *insn++ = BPF_LDX_MEM( in sysctl_convert_ctx_access() 1368 *insn++ = BPF_STX_MEM( in sysctl_convert_ctx_access() 1371 *insn++ = BPF_LDX_MEM( in sysctl_convert_ctx_access() 1375 *insn++ = BPF_STX_MEM( in sysctl_convert_ctx_access() 1379 *insn++ = BPF_LDX_MEM( in sysctl_convert_ctx_access() 1383 *insn++ = BPF_LDX_MEM( in sysctl_convert_ctx_access() 1388 *insn++ = BPF_LDX_MEM( in sysctl_convert_ctx_access() 1397 return insn - insn_buf; in sysctl_convert_ctx_access() 1501 struct bpf_insn *insn = insn_buf; in cg_sockopt_convert_ctx_access() local [all …]
|
D | disasm.h | 25 const struct bpf_insn *insn); 27 const struct bpf_insn *insn, 38 const struct bpf_insn *insn,
|
D | hashtab.c | 505 struct bpf_insn *insn = insn_buf; in htab_map_gen_lookup() local 510 *insn++ = BPF_EMIT_CALL(BPF_CAST_CALL(__htab_map_lookup_elem)); in htab_map_gen_lookup() 511 *insn++ = BPF_JMP_IMM(BPF_JEQ, ret, 0, 1); in htab_map_gen_lookup() 512 *insn++ = BPF_ALU64_IMM(BPF_ADD, ret, in htab_map_gen_lookup() 515 return insn - insn_buf; in htab_map_gen_lookup() 545 struct bpf_insn *insn = insn_buf; in htab_lru_map_gen_lookup() local 551 *insn++ = BPF_EMIT_CALL(BPF_CAST_CALL(__htab_map_lookup_elem)); in htab_lru_map_gen_lookup() 552 *insn++ = BPF_JMP_IMM(BPF_JEQ, ret, 0, 4); in htab_lru_map_gen_lookup() 553 *insn++ = BPF_LDX_MEM(BPF_B, ref_reg, ret, in htab_lru_map_gen_lookup() 556 *insn++ = BPF_JMP_IMM(BPF_JNE, ref_reg, 0, 1); in htab_lru_map_gen_lookup() [all …]
|
D | offload.c | 179 struct bpf_insn *insn) in bpf_prog_offload_replace_insn() argument 190 ret = ops->replace_insn(env, off, insn); in bpf_prog_offload_replace_insn() 250 const struct bpf_insn *insn) in bpf_prog_warn_on_exec() argument
|
/kernel/events/ |
D | uprobes.c | 231 bool __weak is_swbp_insn(uprobe_opcode_t *insn) in is_swbp_insn() argument 233 return *insn == UPROBE_SWBP_INSN; in is_swbp_insn() 245 bool __weak is_trap_insn(uprobe_opcode_t *insn) in is_trap_insn() argument 247 return is_swbp_insn(insn); in is_trap_insn() 598 *(uprobe_opcode_t *)&auprobe->insn); in set_orig_insn() 798 void *insn, int nbytes, loff_t offset) in __copy_insn() argument 813 copy_from_page(page, offset, insn, nbytes); in __copy_insn() 823 void *insn = &uprobe->arch.insn; in copy_insn() local 824 int size = sizeof(uprobe->arch.insn); in copy_insn() 833 err = __copy_insn(mapping, filp, insn, len, offs); in copy_insn() [all …]
|
/kernel/trace/ |
D | bpf_trace.c | 1150 struct bpf_insn *insn = insn_buf; in pe_prog_convert_ctx_access() local 1154 *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct bpf_perf_event_data_kern, in pe_prog_convert_ctx_access() 1157 *insn++ = BPF_LDX_MEM(BPF_DW, si->dst_reg, si->dst_reg, in pe_prog_convert_ctx_access() 1162 *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct bpf_perf_event_data_kern, in pe_prog_convert_ctx_access() 1165 *insn++ = BPF_LDX_MEM(BPF_DW, si->dst_reg, si->dst_reg, in pe_prog_convert_ctx_access() 1170 *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct bpf_perf_event_data_kern, in pe_prog_convert_ctx_access() 1173 *insn++ = BPF_LDX_MEM(BPF_SIZEOF(long), si->dst_reg, si->dst_reg, in pe_prog_convert_ctx_access() 1178 return insn - insn_buf; in pe_prog_convert_ctx_access()
|
/kernel/ |
D | signal.c | 1249 unsigned char insn; in print_fatal_signal() local 1251 if (get_user(insn, (unsigned char *)(regs->ip + i))) in print_fatal_signal() 1253 pr_cont("%02x ", insn); in print_fatal_signal()
|