Lines Matching defs:func
548 static struct bpf_func_state *func(struct bpf_verifier_env *env, const struct bpf_reg_state *reg)
1487 verbose(env, "func#%d @%d\n", i, subprog[i].start);
1998 struct bpf_func_state *func;
2007 func = st->frame[i];
2009 reg = &func->regs[j];
2015 for (j = 0; j < func->allocated_stack / BPF_REG_SIZE; j++) {
2016 if (func->stack[j].slot_type[0] != STACK_SPILL) {
2019 reg = &func->stack[j].spilled_ptr;
2034 struct bpf_func_state *func;
2046 func = st->frame[st->curframe];
2048 reg = &func->regs[regno];
2062 if (func->stack[spi].slot_type[0] != STACK_SPILL) {
2066 reg = &func->stack[spi].spilled_ptr;
2135 func = st->frame[st->curframe];
2139 reg = &func->regs[i];
2153 if (i >= func->allocated_stack / BPF_REG_SIZE) {
2171 if (func->stack[i].slot_type[0] != STACK_SPILL) {
2175 reg = &func->stack[i].spilled_ptr;
2186 print_verifier_state(env, func);
2414 /* func where register points to */
2507 /* func where src register points to */
2558 /* func where src register points to */
2663 struct bpf_func_state *ptr_state = func(env, reg);
2692 struct bpf_func_state *state = func(env, reg);
2747 struct bpf_func_state *state = func(env, reg);
3198 static int update_stack_depth(struct bpf_verifier_env *env, const struct bpf_func_state *func, int off)
3200 u16 stack = env->subprog_info[func->subprogno].stack_depth;
3207 env->subprog_info[func->subprogno].stack_depth = -off;
3630 struct bpf_func_state *state = func(env, reg);
3810 state = func(env, reg);
3952 struct bpf_func_state *state = func(env, reg);
4861 verbose(env, "cannot pass map_type %d into func %s#%d\n", map->map_type, func_id_name(func_id), func_id);
5098 verbose(env, "Caller passes invalid args into func#%d\n", subprog);
5318 verbose(env, "invalid func %s#%d\n", func_id_name(func_id), func_id);
5326 verbose(env, "unknown func %s#%d\n", func_id_name(func_id), func_id);
5342 changes_data = bpf_helper_changes_pkt_data(fn->func);
5344 verbose(env, "kernel subsystem misconfigured func %s#%d: r1 != ctx\n", func_id_name(func_id), func_id);
5353 verbose(env, "kernel subsystem misconfigured func %s#%d\n", func_id_name(func_id), func_id);
5395 verbose(env, "func %s#%d reference has not been acquired before\n", func_id_name(func_id), func_id);
5492 verbose(env, "invalid return type %u of func %s#%d\n", base_type(ret_type), func_id_name(func_id), func_id);
5497 verbose(env, "unknown return type %u of func %s#%d\n", base_type(ret_type), func_id_name(func_id), func_id);
5531 err_str = "cannot get callchain buffer for func %s#%d\n";
5534 err_str = "func %s#%d not supported without CONFIG_PERF_EVENTS\n";
8170 /* LSM and struct_ops func-ptr's return type could be "void" */
8251 * depends on the to-be-replaced kernel func or bpf program.
8548 /* The minimum supported BTF func info size */
8581 verbose(env, "invalid func info rec size %u\n", urec_size);
8604 verbose(env, "nonzero tailing record in func info");
8624 verbose(env, "nonzero insn_off %u for the first func info record", krecord[i].insn_off);
8628 verbose(env, "same or smaller insn offset (%u) than previous func info record (%u)", krecord[i].insn_off,
8641 verbose(env, "invalid type id %d in func info", krecord[i].type_id);
8757 * the later "missing bpf_line_info for func..." case
8786 verbose(env, "missing bpf_line_info for func#%u\n", s);
8797 verbose(env, "missing bpf_line_info for %u funcs starting from func#%u\n", env->subprog_cnt - s, s);
9763 * the state of dst_reg will be updated by this func
10966 struct bpf_prog *prog = env->prog, **func, *tmp;
11008 func = kcalloc(env->subprog_cnt, sizeof(prog), GFP_KERNEL);
11009 if (!func) {
11021 * func[i]->aux->stats will never be accessed and stays NULL
11023 func[i] = bpf_prog_alloc_no_stats(bpf_prog_size(len), GFP_USER);
11024 if (!func[i]) {
11027 memcpy(func[i]->insnsi, &prog->insnsi[subprog_start], len * sizeof(struct bpf_insn));
11028 func[i]->type = prog->type;
11029 func[i]->len = len;
11030 if (bpf_prog_calc_tag(func[i])) {
11033 func[i]->is_func = 1;
11034 func[i]->aux->func_idx = i;
11036 func[i]->aux->btf = prog->aux->btf;
11037 func[i]->aux->func_info = prog->aux->func_info;
11038 func[i]->aux->poke_tab = prog->aux->poke_tab;
11039 func[i]->aux->size_poke_tab = prog->aux->size_poke_tab;
11046 poke->aux = func[i]->aux;
11053 func[i]->aux->name[0] = 'F';
11054 func[i]->aux->stack_depth = env->subprog_info[i].stack_depth;
11055 func[i]->jit_requested = 1;
11056 func[i]->aux->linfo = prog->aux->linfo;
11057 func[i]->aux->nr_linfo = prog->aux->nr_linfo;
11058 func[i]->aux->jited_linfo = prog->aux->jited_linfo;
11059 func[i]->aux->linfo_idx = env->subprog_info[i].linfo_idx;
11061 insn = func[i]->insnsi;
11062 for (j = 0; j < func[i]->len; j++, insn++) {
11067 func[i]->aux->num_exentries = num_exentries;
11068 func[i]->aux->tail_call_reachable = env->subprog_info[i].tail_call_reachable;
11069 func[i] = bpf_int_jit_compile(func[i]);
11070 if (!func[i]->jited) {
11082 insn = func[i]->insnsi;
11083 for (j = 0; j < func[i]->len; j++, insn++) {
11088 insn->imm = BPF_CAST_CALL(func[subprog]->bpf_func) - __bpf_call_base;
11102 func[i]->aux->func = func;
11103 func[i]->aux->func_cnt = env->subprog_cnt;
11106 old_bpf_func = func[i]->bpf_func;
11107 tmp = bpf_int_jit_compile(func[i]);
11108 if (tmp != func[i] || func[i]->bpf_func != old_bpf_func) {
11120 bpf_prog_lock_ro(func[i]);
11121 bpf_prog_kallsyms_add(func[i]);
11138 prog->bpf_func = func[0]->bpf_func;
11139 prog->aux->func = func;
11157 if (!func[i]) {
11160 func[i]->aux->poke_tab = NULL;
11161 bpf_jit_free(func[i]);
11163 kfree(func);
11530 if (!fn->func) {
11531 verbose(env, "kernel subsystem misconfigured func %s#%d\n", func_id_name(insn->imm), insn->imm);
11534 insn->imm = fn->func - __bpf_call_base;
11803 BTF_ID(func, bpf_lsm_bprm_committed_creds)
11821 BTF_ID(func, __add_to_page_cache_locked)
11822 BTF_ID(func, should_fail_alloc_page)
11823 BTF_ID(func, should_failslab)
12006 addr = (long)tgt_prog->aux->func[subprog]->bpf_func;