Lines Matching refs:insn
50 #define DST regs[insn->dst_reg]
51 #define SRC regs[insn->src_reg]
56 #define IMM insn->imm
336 static int bpf_adj_delta_to_imm(struct bpf_insn *insn, u32 pos, s32 end_old, in bpf_adj_delta_to_imm() argument
341 s64 imm = insn->imm; in bpf_adj_delta_to_imm()
350 insn->imm = imm; in bpf_adj_delta_to_imm()
354 static int bpf_adj_delta_to_off(struct bpf_insn *insn, u32 pos, s32 end_old, in bpf_adj_delta_to_off() argument
359 s32 off = insn->off; in bpf_adj_delta_to_off()
368 insn->off = off; in bpf_adj_delta_to_off()
376 struct bpf_insn *insn = prog->insnsi; in bpf_adj_branches() local
379 for (i = 0; i < insn_cnt; i++, insn++) { in bpf_adj_branches()
388 insn = prog->insnsi + end_old; in bpf_adj_branches()
390 code = insn->code; in bpf_adj_branches()
397 if (insn->src_reg != BPF_PSEUDO_CALL) in bpf_adj_branches()
399 ret = bpf_adj_delta_to_imm(insn, pos, end_old, in bpf_adj_branches()
402 ret = bpf_adj_delta_to_off(insn, pos, end_old, in bpf_adj_branches()
867 const struct bpf_insn *insn, bool extra_pass, in bpf_jit_get_func_addr() argument
870 s16 off = insn->off; in bpf_jit_get_func_addr()
871 s32 imm = insn->imm; in bpf_jit_get_func_addr()
874 *func_addr_fixed = insn->src_reg != BPF_PSEUDO_CALL; in bpf_jit_get_func_addr()
1081 struct bpf_insn *insn; in bpf_jit_blind_constants() local
1092 insn = clone->insnsi; in bpf_jit_blind_constants()
1094 for (i = 0; i < insn_cnt; i++, insn++) { in bpf_jit_blind_constants()
1099 if (insn[0].code == (BPF_LD | BPF_IMM | BPF_DW) && in bpf_jit_blind_constants()
1100 insn[1].code == 0) in bpf_jit_blind_constants()
1101 memcpy(aux, insn, sizeof(aux)); in bpf_jit_blind_constants()
1103 rewritten = bpf_jit_blind_insn(insn, aux, insn_buff, in bpf_jit_blind_constants()
1122 insn = clone->insnsi + i + insn_delta; in bpf_jit_blind_constants()
1311 static u64 __no_fgcse ___bpf_prog_run(u64 *regs, const struct bpf_insn *insn, u64 *stack) in ___bpf_prog_run() argument
1327 #define CONT ({ insn++; goto select_insn; }) in ___bpf_prog_run()
1328 #define CONT_JMP ({ insn++; goto select_insn; }) in ___bpf_prog_run()
1331 goto *jumptable[insn->code]; in ___bpf_prog_run()
1376 DST = (u64) (u32) insn[0].imm | ((u64) (u32) insn[1].imm) << 32; in ___bpf_prog_run()
1377 insn++; in ___bpf_prog_run()
1456 BPF_R0 = (__bpf_call_base + insn->imm)(BPF_R1, BPF_R2, BPF_R3, in ___bpf_prog_run()
1461 BPF_R0 = (__bpf_call_base_args + insn->imm)(BPF_R1, BPF_R2, in ___bpf_prog_run()
1464 insn + insn->off + 1); in ___bpf_prog_run()
1489 insn = prog->insnsi; in ___bpf_prog_run()
1495 insn += insn->off; in ___bpf_prog_run()
1503 insn += insn->off; \ in ___bpf_prog_run()
1509 insn += insn->off; \ in ___bpf_prog_run()
1515 insn += insn->off; \ in ___bpf_prog_run()
1521 insn += insn->off; \ in ___bpf_prog_run()
1540 *(SIZE *)(unsigned long) (DST + insn->off) = SRC; \ in ___bpf_prog_run()
1543 *(SIZE *)(unsigned long) (DST + insn->off) = IMM; \ in ___bpf_prog_run()
1546 DST = *(SIZE *)(unsigned long) (SRC + insn->off); \ in ___bpf_prog_run()
1556 (DST + insn->off)); in ___bpf_prog_run()
1560 (DST + insn->off)); in ___bpf_prog_run()
1570 pr_warn("BPF interpreter: unknown opcode %02x\n", insn->code); in ___bpf_prog_run()
1577 static unsigned int PROG_NAME(stack_size)(const void *ctx, const struct bpf_insn *insn) \
1584 return ___bpf_prog_run(regs, insn, stack); \
1590 const struct bpf_insn *insn) \
1601 return ___bpf_prog_run(regs, insn, stack); \
1622 const struct bpf_insn *insn) = {
1630 const struct bpf_insn *insn) = {
1637 void bpf_patch_call_args(struct bpf_insn *insn, u32 stack_depth) in bpf_patch_call_args() argument
1640 insn->off = (s16) insn->imm; in bpf_patch_call_args()
1641 insn->imm = interpreters_args[(round_up(stack_depth, 32) / 32) - 1] - in bpf_patch_call_args()
1643 insn->code = BPF_JMP | BPF_CALL_ARGS; in bpf_patch_call_args()
1648 const struct bpf_insn *insn) in __bpf_prog_ret0_warn() argument
1769 const struct bpf_insn *insn) in __bpf_prog_ret1() argument