• Home
  • Raw
  • Download

Lines Matching refs:code

1503 		if (insn[i].code != (BPF_JMP | BPF_CALL))  in check_subprogs()
1530 u8 code = insn[i].code; in check_subprogs() local
1532 if (code == (BPF_JMP | BPF_CALL) && in check_subprogs()
1536 if (BPF_CLASS(code) == BPF_LD && in check_subprogs()
1537 (BPF_MODE(code) == BPF_ABS || BPF_MODE(code) == BPF_IND)) in check_subprogs()
1539 if (BPF_CLASS(code) != BPF_JMP && BPF_CLASS(code) != BPF_JMP32) in check_subprogs()
1541 if (BPF_OP(code) == BPF_EXIT || BPF_OP(code) == BPF_CALL) in check_subprogs()
1554 if (code != (BPF_JMP | BPF_EXIT) && in check_subprogs()
1555 code != (BPF_JMP | BPF_JA)) { in check_subprogs()
1626 u8 code, class, op; in is_reg64() local
1628 code = insn->code; in is_reg64()
1629 class = BPF_CLASS(code); in is_reg64()
1630 op = BPF_OP(code); in is_reg64()
1665 return BPF_SIZE(code) == BPF_DW; in is_reg64()
1673 return BPF_SIZE(code) == BPF_DW; in is_reg64()
1677 u8 mode = BPF_MODE(code); in is_reg64()
1706 u8 class = BPF_CLASS(insn->code); in insn_no_def()
1826 u8 class = BPF_CLASS(insn->code); in backtrack_insn()
1827 u8 opcode = BPF_OP(insn->code); in backtrack_insn()
1828 u8 mode = BPF_MODE(insn->code); in backtrack_insn()
1833 if (insn->code == 0) in backtrack_insn()
1850 if (BPF_SRC(insn->code) == BPF_X) { in backtrack_insn()
1867 if (BPF_SRC(insn->code) == BPF_X) { in backtrack_insn()
1939 } else if (BPF_SRC(insn->code) == BPF_X) { in backtrack_insn()
2470 return BPF_CLASS(insn->code) == BPF_ST && BPF_MODE(insn->code) == BPF_MEM; in is_bpf_st_mem()
3537 if (insn[i].code != (BPF_JMP | BPF_CALL)) in check_max_stack_depth()
4166 if ((BPF_SIZE(insn->code) != BPF_W && BPF_SIZE(insn->code) != BPF_DW) || in check_xadd()
4199 BPF_SIZE(insn->code), BPF_READ, -1, true); in check_xadd()
4205 BPF_SIZE(insn->code), BPF_WRITE, -1, true); in check_xadd()
5924 return env->bypass_spec_v1 || BPF_SRC(insn->code) == BPF_K; in can_skip_alu_sanitation()
5976 if (BPF_SRC(insn->code) == BPF_K) { in sanitize_speculative_path()
5978 } else if (BPF_SRC(insn->code) == BPF_X) { in sanitize_speculative_path()
5999 u8 opcode = BPF_OP(insn->code); in sanitize_ptr_alu()
6101 const char *op = BPF_OP(insn->code) == BPF_ADD ? "add" : "sub"; in sanitize_err()
6219 u8 opcode = BPF_OP(insn->code); in adjust_ptr_min_max_vals()
6234 if (BPF_CLASS(insn->code) != BPF_ALU64) { in adjust_ptr_min_max_vals()
7009 u8 opcode = BPF_OP(insn->code); in adjust_scalar_min_max_vals()
7015 u64 insn_bitness = (BPF_CLASS(insn->code) == BPF_ALU64) ? 64 : 32; in adjust_scalar_min_max_vals()
7016 bool alu32 = (BPF_CLASS(insn->code) != BPF_ALU64); in adjust_scalar_min_max_vals()
7171 u8 opcode = BPF_OP(insn->code); in adjust_reg_min_max_vals()
7183 if (BPF_SRC(insn->code) == BPF_X) { in adjust_reg_min_max_vals()
7253 u8 opcode = BPF_OP(insn->code); in check_alu_op()
7258 if (BPF_SRC(insn->code) != 0 || in check_alu_op()
7267 BPF_CLASS(insn->code) == BPF_ALU64) { in check_alu_op()
7291 if (BPF_SRC(insn->code) == BPF_X) { in check_alu_op()
7313 if (BPF_SRC(insn->code) == BPF_X) { in check_alu_op()
7317 if (BPF_CLASS(insn->code) == BPF_ALU64) { in check_alu_op()
7360 if (BPF_CLASS(insn->code) == BPF_ALU64) { in check_alu_op()
7375 if (BPF_SRC(insn->code) == BPF_X) { in check_alu_op()
7397 BPF_SRC(insn->code) == BPF_K && insn->imm == 0) { in check_alu_op()
7403 opcode == BPF_ARSH) && BPF_SRC(insn->code) == BPF_K) { in check_alu_op()
7404 int size = BPF_CLASS(insn->code) == BPF_ALU64 ? 64 : 32; in check_alu_op()
8051 if (BPF_SRC(insn->code) != BPF_X) in try_match_pkt_pointers()
8055 if (BPF_CLASS(insn->code) == BPF_JMP32) in try_match_pkt_pointers()
8058 switch (BPF_OP(insn->code)) { in try_match_pkt_pointers()
8169 u8 opcode = BPF_OP(insn->code); in check_cond_jmp_op()
8180 if (BPF_SRC(insn->code) == BPF_X) { in check_cond_jmp_op()
8210 is_jmp32 = BPF_CLASS(insn->code) == BPF_JMP32; in check_cond_jmp_op()
8212 if (BPF_SRC(insn->code) == BPF_K) { in check_cond_jmp_op()
8238 if (BPF_SRC(insn->code) == BPF_X && !err && in check_cond_jmp_op()
8282 if (BPF_SRC(insn->code) == BPF_X) { in check_cond_jmp_op()
8332 if (!is_jmp32 && BPF_SRC(insn->code) == BPF_K && in check_cond_jmp_op()
8363 if (BPF_SIZE(insn->code) != BPF_DW) { in check_ld_imm()
8454 u8 mode = BPF_MODE(insn->code); in check_ld_abs()
8468 BPF_SIZE(insn->code) == BPF_DW || in check_ld_abs()
8791 if (BPF_CLASS(insns[t].code) == BPF_JMP || in check_cfg()
8792 BPF_CLASS(insns[t].code) == BPF_JMP32) { in check_cfg()
8793 u8 opcode = BPF_OP(insns[t].code); in check_cfg()
8815 if (BPF_SRC(insns[t].code) != BPF_K) { in check_cfg()
9131 if (!prog->insnsi[linfo[i].insn_off].code) { in check_btf_line()
10026 class = BPF_CLASS(insn->code); in do_check()
10118 insn->off, BPF_SIZE(insn->code), in do_check()
10147 if (BPF_MODE(insn->code) == BPF_XADD) { in do_check()
10168 insn->off, BPF_SIZE(insn->code), in do_check()
10183 if (BPF_MODE(insn->code) != BPF_MEM || in do_check()
10202 insn->off, BPF_SIZE(insn->code), in do_check()
10208 u8 opcode = BPF_OP(insn->code); in do_check()
10212 if (BPF_SRC(insn->code) != BPF_K || in do_check()
10236 if (BPF_SRC(insn->code) != BPF_K || in do_check()
10249 if (BPF_SRC(insn->code) != BPF_K || in do_check()
10297 u8 mode = BPF_MODE(insn->code); in do_check()
10541 if (BPF_CLASS(insn->code) == BPF_LDX && in resolve_pseudo_ldimm64()
10542 (BPF_MODE(insn->code) != BPF_MEM || insn->imm != 0)) { in resolve_pseudo_ldimm64()
10547 if (BPF_CLASS(insn->code) == BPF_STX && in resolve_pseudo_ldimm64()
10548 ((BPF_MODE(insn->code) != BPF_MEM && in resolve_pseudo_ldimm64()
10549 BPF_MODE(insn->code) != BPF_XADD) || insn->imm != 0)) { in resolve_pseudo_ldimm64()
10554 if (insn[0].code == (BPF_LD | BPF_IMM | BPF_DW)) { in resolve_pseudo_ldimm64()
10560 if (i == insn_cnt - 1 || insn[1].code != 0 || in resolve_pseudo_ldimm64()
10677 if (!bpf_opcode_in_insntable(insn->code)) { in resolve_pseudo_ldimm64()
10678 verbose(env, "unknown opcode %02x\n", insn->code); in resolve_pseudo_ldimm64()
10705 if (insn->code == (BPF_LD | BPF_IMM | BPF_DW)) in convert_pseudo_ld_imm64()
10975 static bool insn_is_cond_jump(u8 code) in insn_is_cond_jump() argument
10979 if (BPF_CLASS(code) == BPF_JMP32) in insn_is_cond_jump()
10982 if (BPF_CLASS(code) != BPF_JMP) in insn_is_cond_jump()
10985 op = BPF_OP(code); in insn_is_cond_jump()
10998 if (!insn_is_cond_jump(insn->code)) in opt_hard_wire_dead_code_branches()
11081 u8 code, class; in opt_subreg_zext_lo32_rnd_hi32() local
11087 code = insn.code; in opt_subreg_zext_lo32_rnd_hi32()
11088 class = BPF_CLASS(code); in opt_subreg_zext_lo32_rnd_hi32()
11098 BPF_MODE(code) == BPF_IMM) in opt_subreg_zext_lo32_rnd_hi32()
11183 if (insn->code == (BPF_LDX | BPF_MEM | BPF_B) || in convert_ctx_accesses()
11184 insn->code == (BPF_LDX | BPF_MEM | BPF_H) || in convert_ctx_accesses()
11185 insn->code == (BPF_LDX | BPF_MEM | BPF_W) || in convert_ctx_accesses()
11186 insn->code == (BPF_LDX | BPF_MEM | BPF_DW)) { in convert_ctx_accesses()
11189 } else if (insn->code == (BPF_STX | BPF_MEM | BPF_B) || in convert_ctx_accesses()
11190 insn->code == (BPF_STX | BPF_MEM | BPF_H) || in convert_ctx_accesses()
11191 insn->code == (BPF_STX | BPF_MEM | BPF_W) || in convert_ctx_accesses()
11192 insn->code == (BPF_STX | BPF_MEM | BPF_DW) || in convert_ctx_accesses()
11193 insn->code == (BPF_ST | BPF_MEM | BPF_B) || in convert_ctx_accesses()
11194 insn->code == (BPF_ST | BPF_MEM | BPF_H) || in convert_ctx_accesses()
11195 insn->code == (BPF_ST | BPF_MEM | BPF_W) || in convert_ctx_accesses()
11196 insn->code == (BPF_ST | BPF_MEM | BPF_DW)) { in convert_ctx_accesses()
11198 ctx_access = BPF_CLASS(insn->code) == BPF_STX; in convert_ctx_accesses()
11242 insn->code = BPF_LDX | BPF_PROBE_MEM | in convert_ctx_accesses()
11243 BPF_SIZE((insn)->code); in convert_ctx_accesses()
11280 insn->code = BPF_LDX | BPF_MEM | size_code; in convert_ctx_accesses()
11343 if (insn->code != (BPF_JMP | BPF_CALL) || in jit_subprogs()
11438 if (BPF_CLASS(insn->code) == BPF_LDX && in jit_subprogs()
11439 BPF_MODE(insn->code) == BPF_PROBE_MEM) in jit_subprogs()
11471 if (insn->code != (BPF_JMP | BPF_CALL) || in jit_subprogs()
11517 if (insn->code != (BPF_JMP | BPF_CALL) || in jit_subprogs()
11547 if (insn->code != (BPF_JMP | BPF_CALL) || in jit_subprogs()
11583 if (insn->code != (BPF_JMP | BPF_CALL) || in fixup_call_args()
11616 if (insn->code == (BPF_ALU64 | BPF_MOD | BPF_X) || in fixup_bpf_calls()
11617 insn->code == (BPF_ALU64 | BPF_DIV | BPF_X) || in fixup_bpf_calls()
11618 insn->code == (BPF_ALU | BPF_MOD | BPF_X) || in fixup_bpf_calls()
11619 insn->code == (BPF_ALU | BPF_DIV | BPF_X)) { in fixup_bpf_calls()
11620 bool is64 = BPF_CLASS(insn->code) == BPF_ALU64; in fixup_bpf_calls()
11621 bool isdiv = BPF_OP(insn->code) == BPF_DIV; in fixup_bpf_calls()
11656 if (BPF_CLASS(insn->code) == BPF_LD && in fixup_bpf_calls()
11657 (BPF_MODE(insn->code) == BPF_ABS || in fixup_bpf_calls()
11658 BPF_MODE(insn->code) == BPF_IND)) { in fixup_bpf_calls()
11675 if (insn->code == (BPF_ALU64 | BPF_ADD | BPF_X) || in fixup_bpf_calls()
11676 insn->code == (BPF_ALU64 | BPF_SUB | BPF_X)) { in fixup_bpf_calls()
11711 insn->code = insn->code == code_add ? in fixup_bpf_calls()
11728 if (insn->code != (BPF_JMP | BPF_CALL)) in fixup_bpf_calls()
11756 insn->code = BPF_JMP | BPF_TAIL_CALL; in fixup_bpf_calls()