Home
last modified time | relevance | path

Searched refs:insn (Results 1 – 13 of 13) sorted by relevance

/kernel/bpf/
Ddisasm.c17 const struct bpf_insn *insn, in __func_get_name() argument
22 if (!insn->src_reg && 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()
30 res = cbs->cb_call(cbs->private_data, insn); in __func_get_name()
35 if (insn->src_reg == BPF_PSEUDO_CALL) in __func_get_name()
36 snprintf(buff, len, "%+d", insn->imm); in __func_get_name()
37 else if (insn->src_reg == BPF_PSEUDO_KFUNC_CALL) in __func_get_name()
44 const struct bpf_insn *insn, in __func_imm_name() argument
[all …]
Dverifier.c236 static bool bpf_pseudo_call(const struct bpf_insn *insn) in bpf_pseudo_call() argument
238 return insn->code == (BPF_JMP | BPF_CALL) && in bpf_pseudo_call()
239 insn->src_reg == BPF_PSEUDO_CALL; in bpf_pseudo_call()
242 static bool bpf_pseudo_kfunc_call(const struct bpf_insn *insn) in bpf_pseudo_kfunc_call() argument
244 return insn->code == (BPF_JMP | BPF_CALL) && in bpf_pseudo_kfunc_call()
245 insn->src_reg == BPF_PSEUDO_KFUNC_CALL; in bpf_pseudo_kfunc_call()
538 static bool is_cmpxchg_insn(const struct bpf_insn *insn) in is_cmpxchg_insn() argument
540 return BPF_CLASS(insn->code) == BPF_STX && in is_cmpxchg_insn()
541 BPF_MODE(insn->code) == BPF_ATOMIC && in is_cmpxchg_insn()
542 insn->imm == BPF_CMPXCHG; in is_cmpxchg_insn()
[all …]
Dcore.c56 #define DST regs[insn->dst_reg]
57 #define SRC regs[insn->src_reg]
62 #define IMM insn->imm
347 static int bpf_adj_delta_to_imm(struct bpf_insn *insn, u32 pos, s32 end_old, in bpf_adj_delta_to_imm() argument
352 s64 imm = insn->imm; in bpf_adj_delta_to_imm()
361 insn->imm = imm; in bpf_adj_delta_to_imm()
365 static int bpf_adj_delta_to_off(struct bpf_insn *insn, u32 pos, s32 end_old, in bpf_adj_delta_to_off() argument
370 s32 off = insn->off; in bpf_adj_delta_to_off()
379 insn->off = off; in bpf_adj_delta_to_off()
387 struct bpf_insn *insn = prog->insnsi; in bpf_adj_branches() local
[all …]
Darraymap.c208 struct bpf_insn *insn = insn_buf; in array_map_gen_lookup() local
217 *insn++ = BPF_ALU64_IMM(BPF_ADD, map_ptr, offsetof(struct bpf_array, value)); in array_map_gen_lookup()
218 *insn++ = BPF_LDX_MEM(BPF_W, ret, index, 0); in array_map_gen_lookup()
220 *insn++ = BPF_JMP_IMM(BPF_JGE, ret, map->max_entries, 4); in array_map_gen_lookup()
221 *insn++ = BPF_ALU32_IMM(BPF_AND, ret, array->index_mask); in array_map_gen_lookup()
223 *insn++ = BPF_JMP_IMM(BPF_JGE, ret, map->max_entries, 3); in array_map_gen_lookup()
227 *insn++ = BPF_ALU64_IMM(BPF_LSH, ret, ilog2(elem_size)); in array_map_gen_lookup()
229 *insn++ = BPF_ALU64_IMM(BPF_MUL, ret, elem_size); in array_map_gen_lookup()
231 *insn++ = BPF_ALU64_REG(BPF_ADD, ret, map_ptr); in array_map_gen_lookup()
232 *insn++ = BPF_JMP_IMM(BPF_JA, 0, 0, 1); in array_map_gen_lookup()
[all …]
Ddisasm.h25 const struct bpf_insn *insn);
27 const struct bpf_insn *insn,
38 const struct bpf_insn *insn,
Dcgroup.c67 const struct bpf_insn *insn) in __cgroup_bpf_run_lsm_sock() argument
78 shim_prog = (const struct bpf_prog *)((void *)insn - offsetof(struct bpf_prog, insnsi)); in __cgroup_bpf_run_lsm_sock()
89 const struct bpf_insn *insn) in __cgroup_bpf_run_lsm_socket() argument
100 shim_prog = (const struct bpf_prog *)((void *)insn - offsetof(struct bpf_prog, insnsi)); in __cgroup_bpf_run_lsm_socket()
111 const struct bpf_insn *insn) in __cgroup_bpf_run_lsm_current() argument
118 shim_prog = (const struct bpf_prog *)((void *)insn - offsetof(struct bpf_prog, insnsi)); in __cgroup_bpf_run_lsm_current()
2212 struct bpf_insn *insn = insn_buf; in sysctl_convert_ctx_access() local
2217 *insn++ = BPF_LDX_MEM( in sysctl_convert_ctx_access()
2237 *insn++ = BPF_STX_MEM( in sysctl_convert_ctx_access()
2240 *insn++ = BPF_LDX_MEM( in sysctl_convert_ctx_access()
[all …]
Dhashtab.c703 struct bpf_insn *insn = insn_buf; in htab_map_gen_lookup() local
708 *insn++ = BPF_EMIT_CALL(__htab_map_lookup_elem); in htab_map_gen_lookup()
709 *insn++ = BPF_JMP_IMM(BPF_JEQ, ret, 0, 1); in htab_map_gen_lookup()
710 *insn++ = BPF_ALU64_IMM(BPF_ADD, ret, in htab_map_gen_lookup()
713 return insn - insn_buf; in htab_map_gen_lookup()
743 struct bpf_insn *insn = insn_buf; in htab_lru_map_gen_lookup() local
749 *insn++ = BPF_EMIT_CALL(__htab_map_lookup_elem); in htab_lru_map_gen_lookup()
750 *insn++ = BPF_JMP_IMM(BPF_JEQ, ret, 0, 4); in htab_lru_map_gen_lookup()
751 *insn++ = BPF_LDX_MEM(BPF_B, ref_reg, ret, in htab_lru_map_gen_lookup()
754 *insn++ = BPF_JMP_IMM(BPF_JNE, ref_reg, 0, 1); in htab_lru_map_gen_lookup()
[all …]
Doffload.c179 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()
247 const struct bpf_insn *insn) in bpf_prog_warn_on_exec() argument
Dbtf.c7986 int relo_idx, void *insn) in bpf_core_apply() argument
8040 err = bpf_core_patch_insn((void *)ctx->log, insn, relo->insn_off / 8, relo, relo_idx, in bpf_core_apply()
/kernel/events/
Duprobes.c221 bool __weak is_swbp_insn(uprobe_opcode_t *insn) in is_swbp_insn() argument
223 return *insn == UPROBE_SWBP_INSN; in is_swbp_insn()
235 bool __weak is_trap_insn(uprobe_opcode_t *insn) in is_trap_insn() argument
237 return is_swbp_insn(insn); in is_trap_insn()
590 *(uprobe_opcode_t *)&auprobe->insn); in set_orig_insn()
788 void *insn, int nbytes, loff_t offset) in __copy_insn() argument
803 copy_from_page(page, offset, insn, nbytes); in __copy_insn()
813 void *insn = &uprobe->arch.insn; in copy_insn() local
814 int size = sizeof(uprobe->arch.insn); in copy_insn()
823 err = __copy_insn(mapping, filp, insn, len, offs); in copy_insn()
[all …]
/kernel/
Dseccomp.c731 struct sock_filter *insn = &fprog->filter[pc]; in seccomp_is_const_allow() local
732 u16 code = insn->code; in seccomp_is_const_allow()
733 u32 k = insn->k; in seccomp_is_const_allow()
753 pc += insn->k; in seccomp_is_const_allow()
777 pc += op_res ? insn->jt : insn->jf; in seccomp_is_const_allow()
Dsignal.c1279 unsigned char insn; in print_fatal_signal() local
1281 if (get_user(insn, (unsigned char *)(regs->ip + i))) in print_fatal_signal()
1283 pr_cont("%02x ", insn); in print_fatal_signal()
/kernel/trace/
Dbpf_trace.c2081 struct bpf_insn *insn = insn_buf; in pe_prog_convert_ctx_access() local
2085 *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct bpf_perf_event_data_kern, in pe_prog_convert_ctx_access()
2088 *insn++ = BPF_LDX_MEM(BPF_DW, si->dst_reg, si->dst_reg, in pe_prog_convert_ctx_access()
2093 *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct bpf_perf_event_data_kern, in pe_prog_convert_ctx_access()
2096 *insn++ = BPF_LDX_MEM(BPF_DW, si->dst_reg, si->dst_reg, in pe_prog_convert_ctx_access()
2101 *insn++ = BPF_LDX_MEM(BPF_FIELD_SIZEOF(struct bpf_perf_event_data_kern, in pe_prog_convert_ctx_access()
2104 *insn++ = BPF_LDX_MEM(BPF_SIZEOF(long), si->dst_reg, si->dst_reg, in pe_prog_convert_ctx_access()
2109 return insn - insn_buf; in pe_prog_convert_ctx_access()