• Home
  • Raw
  • Download

Lines Matching refs:insn

17 				   const struct bpf_insn *insn,  in __func_get_name()  argument
22 if (!insn->src_reg && in __func_get_name()
23 insn->imm >= 0 && insn->imm < __BPF_FUNC_MAX_ID && in __func_get_name()
24 func_id_str[insn->imm]) in __func_get_name()
25 return func_id_str[insn->imm]; in __func_get_name()
30 res = cbs->cb_call(cbs->private_data, insn); in __func_get_name()
35 if (insn->src_reg == BPF_PSEUDO_CALL) in __func_get_name()
36 snprintf(buff, len, "%+d", insn->imm); in __func_get_name()
37 else if (insn->src_reg == BPF_PSEUDO_KFUNC_CALL) in __func_get_name()
44 const struct bpf_insn *insn, in __func_imm_name() argument
48 return cbs->cb_imm(cbs->private_data, insn, full_imm); in __func_imm_name()
123 const struct bpf_insn *insn) in print_bpf_end_insn() argument
126 insn->code, insn->dst_reg, in print_bpf_end_insn()
127 BPF_SRC(insn->code) == BPF_TO_BE ? "be" : "le", in print_bpf_end_insn()
128 insn->imm, insn->dst_reg); in print_bpf_end_insn()
132 const struct bpf_insn *insn, in print_bpf_insn() argument
136 u8 class = BPF_CLASS(insn->code); in print_bpf_insn()
139 if (BPF_OP(insn->code) == BPF_END) { in print_bpf_insn()
141 verbose(cbs->private_data, "BUG_alu64_%02x\n", insn->code); in print_bpf_insn()
143 print_bpf_end_insn(verbose, cbs->private_data, insn); in print_bpf_insn()
144 } else if (BPF_OP(insn->code) == BPF_NEG) { in print_bpf_insn()
146 insn->code, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
147 insn->dst_reg, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
148 insn->dst_reg); in print_bpf_insn()
149 } else if (BPF_SRC(insn->code) == BPF_X) { in print_bpf_insn()
151 insn->code, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
152 insn->dst_reg, in print_bpf_insn()
153 bpf_alu_string[BPF_OP(insn->code) >> 4], in print_bpf_insn()
155 insn->src_reg); in print_bpf_insn()
158 insn->code, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
159 insn->dst_reg, in print_bpf_insn()
160 bpf_alu_string[BPF_OP(insn->code) >> 4], in print_bpf_insn()
161 insn->imm); in print_bpf_insn()
164 if (BPF_MODE(insn->code) == BPF_MEM) in print_bpf_insn()
166 insn->code, in print_bpf_insn()
167 bpf_ldst_string[BPF_SIZE(insn->code) >> 3], in print_bpf_insn()
168 insn->dst_reg, in print_bpf_insn()
169 insn->off, insn->src_reg); in print_bpf_insn()
170 else if (BPF_MODE(insn->code) == BPF_ATOMIC && in print_bpf_insn()
171 (insn->imm == BPF_ADD || insn->imm == BPF_AND || in print_bpf_insn()
172 insn->imm == BPF_OR || insn->imm == BPF_XOR)) { in print_bpf_insn()
174 insn->code, in print_bpf_insn()
175 bpf_ldst_string[BPF_SIZE(insn->code) >> 3], in print_bpf_insn()
176 insn->dst_reg, insn->off, in print_bpf_insn()
177 bpf_alu_string[BPF_OP(insn->imm) >> 4], in print_bpf_insn()
178 insn->src_reg); in print_bpf_insn()
179 } else if (BPF_MODE(insn->code) == BPF_ATOMIC && in print_bpf_insn()
180 (insn->imm == (BPF_ADD | BPF_FETCH) || in print_bpf_insn()
181 insn->imm == (BPF_AND | BPF_FETCH) || in print_bpf_insn()
182 insn->imm == (BPF_OR | BPF_FETCH) || in print_bpf_insn()
183 insn->imm == (BPF_XOR | BPF_FETCH))) { in print_bpf_insn()
185 insn->code, insn->src_reg, in print_bpf_insn()
186 BPF_SIZE(insn->code) == BPF_DW ? "64" : "", in print_bpf_insn()
187 bpf_atomic_alu_string[BPF_OP(insn->imm) >> 4], in print_bpf_insn()
188 bpf_ldst_string[BPF_SIZE(insn->code) >> 3], in print_bpf_insn()
189 insn->dst_reg, insn->off, insn->src_reg); in print_bpf_insn()
190 } else if (BPF_MODE(insn->code) == BPF_ATOMIC && in print_bpf_insn()
191 insn->imm == BPF_CMPXCHG) { in print_bpf_insn()
193 insn->code, in print_bpf_insn()
194 BPF_SIZE(insn->code) == BPF_DW ? "64" : "", in print_bpf_insn()
195 bpf_ldst_string[BPF_SIZE(insn->code) >> 3], in print_bpf_insn()
196 insn->dst_reg, insn->off, in print_bpf_insn()
197 insn->src_reg); in print_bpf_insn()
198 } else if (BPF_MODE(insn->code) == BPF_ATOMIC && in print_bpf_insn()
199 insn->imm == BPF_XCHG) { in print_bpf_insn()
201 insn->code, insn->src_reg, in print_bpf_insn()
202 BPF_SIZE(insn->code) == BPF_DW ? "64" : "", in print_bpf_insn()
203 bpf_ldst_string[BPF_SIZE(insn->code) >> 3], in print_bpf_insn()
204 insn->dst_reg, insn->off, insn->src_reg); in print_bpf_insn()
206 verbose(cbs->private_data, "BUG_%02x\n", insn->code); in print_bpf_insn()
209 if (BPF_MODE(insn->code) == BPF_MEM) { in print_bpf_insn()
211 insn->code, in print_bpf_insn()
212 bpf_ldst_string[BPF_SIZE(insn->code) >> 3], in print_bpf_insn()
213 insn->dst_reg, in print_bpf_insn()
214 insn->off, insn->imm); in print_bpf_insn()
215 } else if (BPF_MODE(insn->code) == 0xc0 /* BPF_NOSPEC, no UAPI */) { in print_bpf_insn()
216 verbose(cbs->private_data, "(%02x) nospec\n", insn->code); in print_bpf_insn()
218 verbose(cbs->private_data, "BUG_st_%02x\n", insn->code); in print_bpf_insn()
221 if (BPF_MODE(insn->code) != BPF_MEM) { in print_bpf_insn()
222 verbose(cbs->private_data, "BUG_ldx_%02x\n", insn->code); in print_bpf_insn()
226 insn->code, insn->dst_reg, in print_bpf_insn()
227 bpf_ldst_string[BPF_SIZE(insn->code) >> 3], in print_bpf_insn()
228 insn->src_reg, insn->off); in print_bpf_insn()
230 if (BPF_MODE(insn->code) == BPF_ABS) { in print_bpf_insn()
232 insn->code, in print_bpf_insn()
233 bpf_ldst_string[BPF_SIZE(insn->code) >> 3], in print_bpf_insn()
234 insn->imm); in print_bpf_insn()
235 } else if (BPF_MODE(insn->code) == BPF_IND) { in print_bpf_insn()
237 insn->code, in print_bpf_insn()
238 bpf_ldst_string[BPF_SIZE(insn->code) >> 3], in print_bpf_insn()
239 insn->src_reg, insn->imm); in print_bpf_insn()
240 } else if (BPF_MODE(insn->code) == BPF_IMM && in print_bpf_insn()
241 BPF_SIZE(insn->code) == BPF_DW) { in print_bpf_insn()
245 u64 imm = ((u64)(insn + 1)->imm << 32) | (u32)insn->imm; in print_bpf_insn()
246 bool is_ptr = insn->src_reg == BPF_PSEUDO_MAP_FD || in print_bpf_insn()
247 insn->src_reg == BPF_PSEUDO_MAP_VALUE; in print_bpf_insn()
254 insn->code, insn->dst_reg, in print_bpf_insn()
255 __func_imm_name(cbs, insn, imm, in print_bpf_insn()
258 verbose(cbs->private_data, "BUG_ld_%02x\n", insn->code); in print_bpf_insn()
262 u8 opcode = BPF_OP(insn->code); in print_bpf_insn()
267 if (insn->src_reg == BPF_PSEUDO_CALL) { in print_bpf_insn()
269 insn->code, in print_bpf_insn()
270 __func_get_name(cbs, insn, in print_bpf_insn()
274 verbose(cbs->private_data, "(%02x) call %s#%d\n", insn->code, in print_bpf_insn()
275 __func_get_name(cbs, insn, in print_bpf_insn()
277 insn->imm); in print_bpf_insn()
279 } else if (insn->code == (BPF_JMP | BPF_JA)) { in print_bpf_insn()
281 insn->code, insn->off); in print_bpf_insn()
282 } else if (insn->code == (BPF_JMP | BPF_EXIT)) { in print_bpf_insn()
283 verbose(cbs->private_data, "(%02x) exit\n", insn->code); in print_bpf_insn()
284 } else if (BPF_SRC(insn->code) == BPF_X) { in print_bpf_insn()
287 insn->code, class == BPF_JMP32 ? 'w' : 'r', in print_bpf_insn()
288 insn->dst_reg, in print_bpf_insn()
289 bpf_jmp_string[BPF_OP(insn->code) >> 4], in print_bpf_insn()
291 insn->src_reg, insn->off); in print_bpf_insn()
295 insn->code, class == BPF_JMP32 ? 'w' : 'r', in print_bpf_insn()
296 insn->dst_reg, in print_bpf_insn()
297 bpf_jmp_string[BPF_OP(insn->code) >> 4], in print_bpf_insn()
298 insn->imm, insn->off); in print_bpf_insn()
302 insn->code, bpf_class_string[class]); in print_bpf_insn()