• Home
  • Raw
  • Download

Lines Matching refs:cnt

2290 	int cnt = 0;  in mark_reg_read()  local
2325 cnt++; in mark_reg_read()
2328 if (env->longest_mark_read_walk < cnt) in mark_reg_read()
2329 env->longest_mark_read_walk = cnt; in mark_reg_read()
2519 u32 cnt = cur->jmp_history_cnt; in push_jmp_history() local
2523 cnt++; in push_jmp_history()
2524 alloc_size = kmalloc_size_roundup(size_mul(cnt, sizeof(*p))); in push_jmp_history()
2528 p[cnt - 1].idx = env->insn_idx; in push_jmp_history()
2529 p[cnt - 1].prev_idx = env->prev_insn_idx; in push_jmp_history()
2531 cur->jmp_history_cnt = cnt; in push_jmp_history()
2551 u32 cnt = *history; in get_prev_insn_idx() local
2554 if (cnt == 0) in get_prev_insn_idx()
2556 if (cnt == 1 && st->jmp_history[0].idx == i) in get_prev_insn_idx()
2560 if (cnt && st->jmp_history[cnt - 1].idx == i) { in get_prev_insn_idx()
2561 i = st->jmp_history[cnt - 1].prev_idx; in get_prev_insn_idx()
13270 struct bpf_prog *new_prog, u32 off, u32 cnt) in adjust_insn_aux_data() argument
13282 old_data[off].zext_dst = insn_has_def32(env, insn + off + cnt - 1); in adjust_insn_aux_data()
13284 if (cnt == 1) in adjust_insn_aux_data()
13289 memcpy(new_data + off + cnt - 1, old_data + off, in adjust_insn_aux_data()
13290 sizeof(struct bpf_insn_aux_data) * (prog_len - off - cnt + 1)); in adjust_insn_aux_data()
13291 for (i = off; i < off + cnt - 1; i++) { in adjust_insn_aux_data()
13357 u32 off, u32 cnt) in adjust_subprog_starts_after_remove() argument
13367 if (env->subprog_info[j].start >= off + cnt) in adjust_subprog_starts_after_remove()
13372 if (env->subprog_info[j].start != off + cnt) in adjust_subprog_starts_after_remove()
13407 env->subprog_info[i].start -= cnt; in adjust_subprog_starts_after_remove()
13413 u32 cnt) in bpf_adj_linfo_after_remove() argument
13433 if (linfo[i].insn_off < off + cnt) in bpf_adj_linfo_after_remove()
13443 (i == nr_linfo || linfo[i].insn_off != off + cnt)) { in bpf_adj_linfo_after_remove()
13445 linfo[--i].insn_off = off + cnt; in bpf_adj_linfo_after_remove()
13459 linfo[i].insn_off -= cnt; in bpf_adj_linfo_after_remove()
13476 static int verifier_remove_insns(struct bpf_verifier_env *env, u32 off, u32 cnt) in verifier_remove_insns() argument
13483 bpf_prog_offload_remove_insns(env, off, cnt); in verifier_remove_insns()
13485 err = bpf_remove_insns(env->prog, off, cnt); in verifier_remove_insns()
13489 err = adjust_subprog_starts_after_remove(env, off, cnt); in verifier_remove_insns()
13493 err = bpf_adj_linfo_after_remove(env, off, cnt); in verifier_remove_insns()
13497 memmove(aux_data + off, aux_data + off + cnt, in verifier_remove_insns()
13498 sizeof(*aux_data) * (orig_prog_len - off - cnt)); in verifier_remove_insns()
13722 int i, cnt, size, ctx_field_size, delta = 0; in convert_ctx_accesses() local
13735 cnt = ops->gen_prologue(insn_buf, env->seen_direct_write, in convert_ctx_accesses()
13737 if (cnt >= ARRAY_SIZE(insn_buf)) { in convert_ctx_accesses()
13740 } else if (cnt) { in convert_ctx_accesses()
13741 new_prog = bpf_patch_insn_data(env, 0, insn_buf, cnt); in convert_ctx_accesses()
13746 delta += cnt - 1; in convert_ctx_accesses()
13786 cnt = ARRAY_SIZE(patch); in convert_ctx_accesses()
13787 new_prog = bpf_patch_insn_data(env, i + delta, patch, cnt); in convert_ctx_accesses()
13791 delta += cnt - 1; in convert_ctx_accesses()
13858 cnt = convert_ctx_access(type, insn, insn_buf, env->prog, in convert_ctx_accesses()
13860 if (cnt == 0 || cnt >= ARRAY_SIZE(insn_buf) || in convert_ctx_accesses()
13869 if (shift && cnt + 1 >= ARRAY_SIZE(insn_buf)) { in convert_ctx_accesses()
13875 insn_buf[cnt++] = BPF_ALU32_IMM(BPF_RSH, in convert_ctx_accesses()
13878 insn_buf[cnt++] = BPF_ALU32_IMM(BPF_AND, insn->dst_reg, in convert_ctx_accesses()
13882 insn_buf[cnt++] = BPF_ALU64_IMM(BPF_RSH, in convert_ctx_accesses()
13885 insn_buf[cnt++] = BPF_ALU32_IMM(BPF_AND, insn->dst_reg, in convert_ctx_accesses()
13890 new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt); in convert_ctx_accesses()
13894 delta += cnt - 1; in convert_ctx_accesses()
14227 int i, ret, cnt, delta = 0; in do_misc_fixups() local
14258 cnt = isdiv ? ARRAY_SIZE(chk_and_div) : in do_misc_fixups()
14261 new_prog = bpf_patch_insn_data(env, i + delta, patchlet, cnt); in do_misc_fixups()
14265 delta += cnt - 1; in do_misc_fixups()
14275 cnt = env->ops->gen_ld_abs(insn, insn_buf); in do_misc_fixups()
14276 if (cnt == 0 || cnt >= ARRAY_SIZE(insn_buf)) { in do_misc_fixups()
14281 new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt); in do_misc_fixups()
14285 delta += cnt - 1; in do_misc_fixups()
14332 cnt = patch - insn_buf; in do_misc_fixups()
14334 new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt); in do_misc_fixups()
14338 delta += cnt - 1; in do_misc_fixups()
14425 cnt = 3; in do_misc_fixups()
14426 new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt); in do_misc_fixups()
14430 delta += cnt - 1; in do_misc_fixups()
14457 cnt = 3; in do_misc_fixups()
14459 new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt); in do_misc_fixups()
14463 delta += cnt - 1; in do_misc_fixups()
14477 cnt = 2; in do_misc_fixups()
14479 new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt); in do_misc_fixups()
14483 delta += cnt - 1; in do_misc_fixups()
14511 cnt = ops->map_gen_lookup(map_ptr, insn_buf); in do_misc_fixups()
14512 if (cnt == -EOPNOTSUPP) in do_misc_fixups()
14514 if (cnt <= 0 || cnt >= ARRAY_SIZE(insn_buf)) { in do_misc_fixups()
14520 insn_buf, cnt); in do_misc_fixups()
14524 delta += cnt - 1; in do_misc_fixups()
14600 cnt = 3; in do_misc_fixups()
14603 cnt); in do_misc_fixups()
14607 delta += cnt - 1; in do_misc_fixups()
14626 cnt = 9; in do_misc_fixups()
14628 new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt); in do_misc_fixups()
14632 delta += cnt - 1; in do_misc_fixups()
14650 cnt = 6; in do_misc_fixups()
14653 cnt = 1; in do_misc_fixups()
14656 new_prog = bpf_patch_insn_data(env, i + delta, insn_buf, cnt); in do_misc_fixups()
14660 delta += cnt - 1; in do_misc_fixups()
14736 u32 *cnt) in inline_bpf_loop() argument
14792 *cnt = ARRAY_SIZE(insn_buf); in inline_bpf_loop()
14793 new_prog = bpf_patch_insn_data(env, position, insn_buf, *cnt); in inline_bpf_loop()
14826 int i, cur_subprog = 0, cnt, delta = 0; in optimize_bpf_loop() local
14845 &cnt); in optimize_bpf_loop()
14849 delta += cnt - 1; in optimize_bpf_loop()