Lines Matching refs:code
143 insn->code, insn->dst_reg, in print_bpf_end_insn()
144 BPF_SRC(insn->code) == BPF_TO_BE ? "be" : "le", in print_bpf_end_insn()
153 insn->code, insn->dst_reg, in print_bpf_bswap_insn()
159 return (BPF_OP(insn->code) == BPF_DIV || BPF_OP(insn->code) == BPF_MOD) && in is_sdiv_smod()
165 return BPF_OP(insn->code) == BPF_MOV && in is_movsx()
174 u8 class = BPF_CLASS(insn->code); in print_bpf_insn()
177 if (BPF_OP(insn->code) == BPF_END) { in print_bpf_insn()
182 } else if (BPF_OP(insn->code) == BPF_NEG) { in print_bpf_insn()
184 insn->code, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
187 } else if (BPF_SRC(insn->code) == BPF_X) { in print_bpf_insn()
189 insn->code, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
191 is_sdiv_smod(insn) ? bpf_alu_sign_string[BPF_OP(insn->code) >> 4] in print_bpf_insn()
192 : bpf_alu_string[BPF_OP(insn->code) >> 4], in print_bpf_insn()
198 insn->code, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
200 is_sdiv_smod(insn) ? bpf_alu_sign_string[BPF_OP(insn->code) >> 4] in print_bpf_insn()
201 : bpf_alu_string[BPF_OP(insn->code) >> 4], in print_bpf_insn()
205 if (BPF_MODE(insn->code) == BPF_MEM) in print_bpf_insn()
207 insn->code, in print_bpf_insn()
208 bpf_ldst_string[BPF_SIZE(insn->code) >> 3], in print_bpf_insn()
211 else if (BPF_MODE(insn->code) == BPF_ATOMIC && in print_bpf_insn()
215 insn->code, in print_bpf_insn()
216 bpf_ldst_string[BPF_SIZE(insn->code) >> 3], in print_bpf_insn()
220 } else if (BPF_MODE(insn->code) == BPF_ATOMIC && in print_bpf_insn()
226 insn->code, insn->src_reg, in print_bpf_insn()
227 BPF_SIZE(insn->code) == BPF_DW ? "64" : "", in print_bpf_insn()
229 bpf_ldst_string[BPF_SIZE(insn->code) >> 3], in print_bpf_insn()
231 } else if (BPF_MODE(insn->code) == BPF_ATOMIC && in print_bpf_insn()
234 insn->code, in print_bpf_insn()
235 BPF_SIZE(insn->code) == BPF_DW ? "64" : "", in print_bpf_insn()
236 bpf_ldst_string[BPF_SIZE(insn->code) >> 3], in print_bpf_insn()
239 } else if (BPF_MODE(insn->code) == BPF_ATOMIC && in print_bpf_insn()
242 insn->code, insn->src_reg, in print_bpf_insn()
243 BPF_SIZE(insn->code) == BPF_DW ? "64" : "", in print_bpf_insn()
244 bpf_ldst_string[BPF_SIZE(insn->code) >> 3], in print_bpf_insn()
247 verbose(cbs->private_data, "BUG_%02x\n", insn->code); in print_bpf_insn()
250 if (BPF_MODE(insn->code) == BPF_MEM) { in print_bpf_insn()
252 insn->code, in print_bpf_insn()
253 bpf_ldst_string[BPF_SIZE(insn->code) >> 3], in print_bpf_insn()
256 } else if (BPF_MODE(insn->code) == 0xc0 /* BPF_NOSPEC, no UAPI */) { in print_bpf_insn()
257 verbose(cbs->private_data, "(%02x) nospec\n", insn->code); in print_bpf_insn()
259 verbose(cbs->private_data, "BUG_st_%02x\n", insn->code); in print_bpf_insn()
262 if (BPF_MODE(insn->code) != BPF_MEM && BPF_MODE(insn->code) != BPF_MEMSX) { in print_bpf_insn()
263 verbose(cbs->private_data, "BUG_ldx_%02x\n", insn->code); in print_bpf_insn()
267 insn->code, insn->dst_reg, in print_bpf_insn()
268 BPF_MODE(insn->code) == BPF_MEM ? in print_bpf_insn()
269 bpf_ldst_string[BPF_SIZE(insn->code) >> 3] : in print_bpf_insn()
270 bpf_ldsx_string[BPF_SIZE(insn->code) >> 3], in print_bpf_insn()
273 if (BPF_MODE(insn->code) == BPF_ABS) { in print_bpf_insn()
275 insn->code, in print_bpf_insn()
276 bpf_ldst_string[BPF_SIZE(insn->code) >> 3], in print_bpf_insn()
278 } else if (BPF_MODE(insn->code) == BPF_IND) { in print_bpf_insn()
280 insn->code, in print_bpf_insn()
281 bpf_ldst_string[BPF_SIZE(insn->code) >> 3], in print_bpf_insn()
283 } else if (BPF_MODE(insn->code) == BPF_IMM && in print_bpf_insn()
284 BPF_SIZE(insn->code) == BPF_DW) { in print_bpf_insn()
297 insn->code, insn->dst_reg, in print_bpf_insn()
301 verbose(cbs->private_data, "BUG_ld_%02x\n", insn->code); in print_bpf_insn()
305 u8 opcode = BPF_OP(insn->code); in print_bpf_insn()
312 insn->code, in print_bpf_insn()
317 verbose(cbs->private_data, "(%02x) call %s#%d\n", insn->code, in print_bpf_insn()
322 } else if (insn->code == (BPF_JMP | BPF_JA)) { in print_bpf_insn()
324 insn->code, insn->off); in print_bpf_insn()
325 } else if (insn->code == (BPF_JMP32 | BPF_JA)) { in print_bpf_insn()
327 insn->code, insn->imm); in print_bpf_insn()
328 } else if (insn->code == (BPF_JMP | BPF_EXIT)) { in print_bpf_insn()
329 verbose(cbs->private_data, "(%02x) exit\n", insn->code); in print_bpf_insn()
330 } else if (BPF_SRC(insn->code) == BPF_X) { in print_bpf_insn()
333 insn->code, class == BPF_JMP32 ? 'w' : 'r', in print_bpf_insn()
335 bpf_jmp_string[BPF_OP(insn->code) >> 4], in print_bpf_insn()
341 insn->code, class == BPF_JMP32 ? 'w' : 'r', in print_bpf_insn()
343 bpf_jmp_string[BPF_OP(insn->code) >> 4], in print_bpf_insn()
348 insn->code, bpf_class_string[class]); in print_bpf_insn()