Lines Matching refs:insn
56 #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
390 for (i = 0; i < insn_cnt; i++, insn++) { in bpf_adj_branches()
399 insn = prog->insnsi + end_old; in bpf_adj_branches()
401 if (bpf_pseudo_func(insn)) { in bpf_adj_branches()
402 ret = bpf_adj_delta_to_imm(insn, pos, end_old, in bpf_adj_branches()
408 code = insn->code; in bpf_adj_branches()
415 if (insn->src_reg != BPF_PSEUDO_CALL) in bpf_adj_branches()
417 ret = bpf_adj_delta_to_imm(insn, pos, end_old, in bpf_adj_branches()
420 ret = bpf_adj_delta_to_off(insn, pos, end_old, in bpf_adj_branches()
1185 const struct bpf_insn *insn, bool extra_pass, in bpf_jit_get_func_addr() argument
1188 s16 off = insn->off; in bpf_jit_get_func_addr()
1189 s32 imm = insn->imm; in bpf_jit_get_func_addr()
1192 *func_addr_fixed = insn->src_reg != BPF_PSEUDO_CALL; in bpf_jit_get_func_addr()
1401 struct bpf_insn *insn; in bpf_jit_blind_constants() local
1412 insn = clone->insnsi; in bpf_jit_blind_constants()
1414 for (i = 0; i < insn_cnt; i++, insn++) { in bpf_jit_blind_constants()
1415 if (bpf_pseudo_func(insn)) { in bpf_jit_blind_constants()
1420 insn++; in bpf_jit_blind_constants()
1429 if (insn[0].code == (BPF_LD | BPF_IMM | BPF_DW) && in bpf_jit_blind_constants()
1430 insn[1].code == 0) in bpf_jit_blind_constants()
1431 memcpy(aux, insn, sizeof(aux)); in bpf_jit_blind_constants()
1433 rewritten = bpf_jit_blind_insn(insn, aux, insn_buff, in bpf_jit_blind_constants()
1452 insn = clone->insnsi + i + insn_delta; in bpf_jit_blind_constants()
1648 static u64 ___bpf_prog_run(u64 *regs, const struct bpf_insn *insn) in ___bpf_prog_run() argument
1669 #define CONT ({ insn++; goto select_insn; }) in ___bpf_prog_run()
1670 #define CONT_JMP ({ insn++; goto select_insn; }) in ___bpf_prog_run()
1673 goto *jumptable[insn->code]; in ___bpf_prog_run()
1743 DST = (u64) (u32) insn[0].imm | ((u64) (u32) insn[1].imm) << 32; in ___bpf_prog_run()
1744 insn++; in ___bpf_prog_run()
1823 BPF_R0 = (__bpf_call_base + insn->imm)(BPF_R1, BPF_R2, BPF_R3, in ___bpf_prog_run()
1828 BPF_R0 = (__bpf_call_base_args + insn->imm)(BPF_R1, BPF_R2, in ___bpf_prog_run()
1831 insn + insn->off + 1); in ___bpf_prog_run()
1857 insn = prog->insnsi; in ___bpf_prog_run()
1863 insn += insn->off; in ___bpf_prog_run()
1871 insn += insn->off; \ in ___bpf_prog_run()
1877 insn += insn->off; \ in ___bpf_prog_run()
1883 insn += insn->off; \ in ___bpf_prog_run()
1889 insn += insn->off; \ in ___bpf_prog_run()
1920 *(SIZE *)(unsigned long) (DST + insn->off) = SRC; \ in ___bpf_prog_run()
1923 *(SIZE *)(unsigned long) (DST + insn->off) = IMM; \ in ___bpf_prog_run()
1926 DST = *(SIZE *)(unsigned long) (SRC + insn->off); \ in ___bpf_prog_run()
1930 (const void *)(long) (SRC + insn->off)); \ in ___bpf_prog_run()
1942 if (BPF_SIZE(insn->code) == BPF_W) \ in ___bpf_prog_run()
1944 (DST + insn->off)); \ in ___bpf_prog_run()
1947 (DST + insn->off)); \ in ___bpf_prog_run()
1950 if (BPF_SIZE(insn->code) == BPF_W) \ in ___bpf_prog_run()
1953 (atomic_t *)(unsigned long) (DST + insn->off)); \ in ___bpf_prog_run()
1957 (atomic64_t *)(unsigned long) (DST + insn->off)); \ in ___bpf_prog_run()
1970 if (BPF_SIZE(insn->code) == BPF_W) in ___bpf_prog_run()
1972 (atomic_t *)(unsigned long) (DST + insn->off), in ___bpf_prog_run()
1976 (atomic64_t *)(unsigned long) (DST + insn->off), in ___bpf_prog_run()
1980 if (BPF_SIZE(insn->code) == BPF_W) in ___bpf_prog_run()
1982 (atomic_t *)(unsigned long) (DST + insn->off), in ___bpf_prog_run()
1986 (atomic64_t *)(unsigned long) (DST + insn->off), in ___bpf_prog_run()
2003 insn->code, insn->imm); in ___bpf_prog_run()
2010 static unsigned int PROG_NAME(stack_size)(const void *ctx, const struct bpf_insn *insn) \
2017 return ___bpf_prog_run(regs, insn); \
2023 const struct bpf_insn *insn) \
2034 return ___bpf_prog_run(regs, insn); \
2055 const struct bpf_insn *insn) = {
2063 const struct bpf_insn *insn) = {
2070 void bpf_patch_call_args(struct bpf_insn *insn, u32 stack_depth) in bpf_patch_call_args() argument
2073 insn->off = (s16) insn->imm; in bpf_patch_call_args()
2074 insn->imm = interpreters_args[(round_up(stack_depth, 32) / 32) - 1] - in bpf_patch_call_args()
2076 insn->code = BPF_JMP | BPF_CALL_ARGS; in bpf_patch_call_args()
2081 const struct bpf_insn *insn) in __bpf_prog_ret0_warn() argument
2218 const struct bpf_insn *insn) in __bpf_prog_ret1() argument