Home
last modified time | relevance | path

Searched refs:BPF_ALU (Results 1 – 25 of 39) sorted by relevance

12

/Linux-v6.6/tools/bpf/
Dbpf_exp.y349 bpf_set_curr_instr(BPF_ALU | BPF_ADD | BPF_K, 0, 0, $3); }
351 bpf_set_curr_instr(BPF_ALU | BPF_ADD | BPF_X, 0, 0, 0); }
353 bpf_set_curr_instr(BPF_ALU | BPF_ADD | BPF_X, 0, 0, 0); }
358 bpf_set_curr_instr(BPF_ALU | BPF_SUB | BPF_K, 0, 0, $3); }
360 bpf_set_curr_instr(BPF_ALU | BPF_SUB | BPF_X, 0, 0, 0); }
362 bpf_set_curr_instr(BPF_ALU | BPF_SUB | BPF_X, 0, 0, 0); }
367 bpf_set_curr_instr(BPF_ALU | BPF_MUL | BPF_K, 0, 0, $3); }
369 bpf_set_curr_instr(BPF_ALU | BPF_MUL | BPF_X, 0, 0, 0); }
371 bpf_set_curr_instr(BPF_ALU | BPF_MUL | BPF_X, 0, 0, 0); }
376 bpf_set_curr_instr(BPF_ALU | BPF_DIV | BPF_K, 0, 0, $3); }
[all …]
Dbpf_dbg.c64 #define BPF_ALU_ADD (BPF_ALU | BPF_ADD)
65 #define BPF_ALU_SUB (BPF_ALU | BPF_SUB)
66 #define BPF_ALU_MUL (BPF_ALU | BPF_MUL)
67 #define BPF_ALU_DIV (BPF_ALU | BPF_DIV)
68 #define BPF_ALU_MOD (BPF_ALU | BPF_MOD)
69 #define BPF_ALU_NEG (BPF_ALU | BPF_NEG)
70 #define BPF_ALU_AND (BPF_ALU | BPF_AND)
71 #define BPF_ALU_OR (BPF_ALU | BPF_OR)
72 #define BPF_ALU_XOR (BPF_ALU | BPF_XOR)
73 #define BPF_ALU_LSH (BPF_ALU | BPF_LSH)
[all …]
/Linux-v6.6/arch/powerpc/net/
Dbpf_jit_comp64.c418 case BPF_ALU | BPF_ADD | BPF_X: /* (u32) dst += (u32) src */ in bpf_jit_build_body()
422 case BPF_ALU | BPF_SUB | BPF_X: /* (u32) dst -= (u32) src */ in bpf_jit_build_body()
426 case BPF_ALU | BPF_ADD | BPF_K: /* (u32) dst += (u32) imm */ in bpf_jit_build_body()
437 case BPF_ALU | BPF_SUB | BPF_K: /* (u32) dst -= (u32) imm */ in bpf_jit_build_body()
448 case BPF_ALU | BPF_MUL | BPF_X: /* (u32) dst *= (u32) src */ in bpf_jit_build_body()
450 if (BPF_CLASS(code) == BPF_ALU) in bpf_jit_build_body()
455 case BPF_ALU | BPF_MUL | BPF_K: /* (u32) dst *= (u32) imm */ in bpf_jit_build_body()
461 if (BPF_CLASS(code) == BPF_ALU) in bpf_jit_build_body()
467 case BPF_ALU | BPF_DIV | BPF_X: /* (u32) dst /= (u32) src */ in bpf_jit_build_body()
468 case BPF_ALU | BPF_MOD | BPF_X: /* (u32) dst %= (u32) src */ in bpf_jit_build_body()
[all …]
Dbpf_jit_comp32.c312 if (i && (BPF_CLASS(code) == BPF_ALU64 || BPF_CLASS(code) == BPF_ALU) && in bpf_jit_build_body()
313 (BPF_CLASS(prevcode) == BPF_ALU64 || BPF_CLASS(prevcode) == BPF_ALU) && in bpf_jit_build_body()
352 case BPF_ALU | BPF_ADD | BPF_X: /* (u32) dst += (u32) src */ in bpf_jit_build_body()
359 case BPF_ALU | BPF_SUB | BPF_X: /* (u32) dst -= (u32) src */ in bpf_jit_build_body()
366 case BPF_ALU | BPF_SUB | BPF_K: /* (u32) dst -= (u32) imm */ in bpf_jit_build_body()
369 case BPF_ALU | BPF_ADD | BPF_K: /* (u32) dst += (u32) imm */ in bpf_jit_build_body()
408 case BPF_ALU | BPF_MUL | BPF_X: /* (u32) dst *= (u32) src */ in bpf_jit_build_body()
411 case BPF_ALU | BPF_MUL | BPF_K: /* (u32) dst *= (u32) imm */ in bpf_jit_build_body()
451 case BPF_ALU | BPF_DIV | BPF_X: /* (u32) dst /= (u32) src */ in bpf_jit_build_body()
454 case BPF_ALU | BPF_MOD | BPF_X: /* (u32) dst %= (u32) src */ in bpf_jit_build_body()
[all …]
/Linux-v6.6/arch/mips/net/
Dbpf_jit_comp64.c649 case BPF_ALU | BPF_MOV | BPF_K: in build_insn()
654 case BPF_ALU | BPF_MOV | BPF_X: in build_insn()
664 case BPF_ALU | BPF_NEG: in build_insn()
673 case BPF_ALU | BPF_OR | BPF_K: in build_insn()
674 case BPF_ALU | BPF_AND | BPF_K: in build_insn()
675 case BPF_ALU | BPF_XOR | BPF_K: in build_insn()
676 case BPF_ALU | BPF_LSH | BPF_K: in build_insn()
692 case BPF_ALU | BPF_RSH | BPF_K: in build_insn()
693 case BPF_ALU | BPF_ARSH | BPF_K: in build_insn()
694 case BPF_ALU | BPF_ADD | BPF_K: in build_insn()
[all …]
Dbpf_jit_comp32.c1478 case BPF_ALU | BPF_MOV | BPF_K: in build_insn()
1483 case BPF_ALU | BPF_MOV | BPF_X: in build_insn()
1493 case BPF_ALU | BPF_NEG: in build_insn()
1508 case BPF_ALU | BPF_OR | BPF_K: in build_insn()
1509 case BPF_ALU | BPF_AND | BPF_K: in build_insn()
1510 case BPF_ALU | BPF_XOR | BPF_K: in build_insn()
1511 case BPF_ALU | BPF_LSH | BPF_K: in build_insn()
1512 case BPF_ALU | BPF_RSH | BPF_K: in build_insn()
1513 case BPF_ALU | BPF_ARSH | BPF_K: in build_insn()
1514 case BPF_ALU | BPF_ADD | BPF_K: in build_insn()
[all …]
/Linux-v6.6/arch/sparc/net/
Dbpf_jit_comp_32.c399 case BPF_ALU | BPF_ADD | BPF_X: /* A += X; */ in bpf_jit_compile()
402 case BPF_ALU | BPF_ADD | BPF_K: /* A += K; */ in bpf_jit_compile()
405 case BPF_ALU | BPF_SUB | BPF_X: /* A -= X; */ in bpf_jit_compile()
408 case BPF_ALU | BPF_SUB | BPF_K: /* A -= K */ in bpf_jit_compile()
411 case BPF_ALU | BPF_AND | BPF_X: /* A &= X */ in bpf_jit_compile()
414 case BPF_ALU | BPF_AND | BPF_K: /* A &= K */ in bpf_jit_compile()
417 case BPF_ALU | BPF_OR | BPF_X: /* A |= X */ in bpf_jit_compile()
420 case BPF_ALU | BPF_OR | BPF_K: /* A |= K */ in bpf_jit_compile()
424 case BPF_ALU | BPF_XOR | BPF_X: in bpf_jit_compile()
427 case BPF_ALU | BPF_XOR | BPF_K: /* A ^= K */ in bpf_jit_compile()
[all …]
Dbpf_jit_comp_64.c909 case BPF_ALU | BPF_MOV | BPF_X: in build_insn()
918 case BPF_ALU | BPF_ADD | BPF_X: in build_insn()
922 case BPF_ALU | BPF_SUB | BPF_X: in build_insn()
926 case BPF_ALU | BPF_AND | BPF_X: in build_insn()
930 case BPF_ALU | BPF_OR | BPF_X: in build_insn()
934 case BPF_ALU | BPF_XOR | BPF_X: in build_insn()
938 case BPF_ALU | BPF_MUL | BPF_X: in build_insn()
944 case BPF_ALU | BPF_DIV | BPF_X: in build_insn()
953 case BPF_ALU | BPF_MOD | BPF_X: { in build_insn()
974 case BPF_ALU | BPF_LSH | BPF_X: in build_insn()
[all …]
/Linux-v6.6/arch/parisc/net/
Dbpf_jit_comp64.c422 if (code & (BPF_ALU | BPF_X) || code & (BPF_ALU64 | BPF_X) || in init_regs()
510 if (BPF_CLASS(opcode) == BPF_ALU) { in emit_call_libgcc_ll()
608 case BPF_ALU | BPF_MOV | BPF_X: in bpf_jit_emit_insn()
622 case BPF_ALU | BPF_ADD | BPF_X: in bpf_jit_emit_insn()
628 case BPF_ALU | BPF_SUB | BPF_X: in bpf_jit_emit_insn()
634 case BPF_ALU | BPF_AND | BPF_X: in bpf_jit_emit_insn()
640 case BPF_ALU | BPF_OR | BPF_X: in bpf_jit_emit_insn()
646 case BPF_ALU | BPF_XOR | BPF_X: in bpf_jit_emit_insn()
652 case BPF_ALU | BPF_MUL | BPF_K: in bpf_jit_emit_insn()
657 case BPF_ALU | BPF_MUL | BPF_X: in bpf_jit_emit_insn()
[all …]
Dbpf_jit_comp32.c1184 case BPF_ALU | BPF_MOV | BPF_X: in bpf_jit_emit_insn()
1192 case BPF_ALU | BPF_ADD | BPF_X: in bpf_jit_emit_insn()
1193 case BPF_ALU | BPF_SUB | BPF_X: in bpf_jit_emit_insn()
1194 case BPF_ALU | BPF_AND | BPF_X: in bpf_jit_emit_insn()
1195 case BPF_ALU | BPF_OR | BPF_X: in bpf_jit_emit_insn()
1196 case BPF_ALU | BPF_XOR | BPF_X: in bpf_jit_emit_insn()
1198 case BPF_ALU | BPF_MUL | BPF_X: in bpf_jit_emit_insn()
1199 case BPF_ALU | BPF_MUL | BPF_K: in bpf_jit_emit_insn()
1201 case BPF_ALU | BPF_DIV | BPF_X: in bpf_jit_emit_insn()
1202 case BPF_ALU | BPF_DIV | BPF_K: in bpf_jit_emit_insn()
[all …]
/Linux-v6.6/arch/loongarch/net/
Dbpf_jit.c465 const bool is32 = BPF_CLASS(insn->code) == BPF_ALU || BPF_CLASS(insn->code) == BPF_JMP32; in build_insn()
469 case BPF_ALU | BPF_MOV | BPF_X: in build_insn()
476 case BPF_ALU | BPF_MOV | BPF_K: in build_insn()
482 case BPF_ALU | BPF_ADD | BPF_X: in build_insn()
489 case BPF_ALU | BPF_ADD | BPF_K: in build_insn()
501 case BPF_ALU | BPF_SUB | BPF_X: in build_insn()
508 case BPF_ALU | BPF_SUB | BPF_K: in build_insn()
520 case BPF_ALU | BPF_MUL | BPF_X: in build_insn()
527 case BPF_ALU | BPF_MUL | BPF_K: in build_insn()
535 case BPF_ALU | BPF_DIV | BPF_X: in build_insn()
[all …]
/Linux-v6.6/tools/include/linux/
Dfilter.h44 .code = BPF_ALU | BPF_OP(OP) | BPF_X, \
62 .code = BPF_ALU | BPF_OP(OP) | BPF_K, \
72 .code = BPF_ALU | BPF_END | BPF_SRC(TYPE), \
90 .code = BPF_ALU | BPF_MOV | BPF_X, \
108 .code = BPF_ALU | BPF_MOV | BPF_K, \
126 .code = BPF_ALU | BPF_MOV | BPF_SRC(TYPE), \
/Linux-v6.6/arch/s390/net/
Dbpf_jit_comp.c798 case BPF_ALU | BPF_MOV | BPF_X: /* dst = (u32) src */ in bpf_jit_insn()
808 case BPF_ALU | BPF_MOV | BPF_K: /* dst = (u32) imm */ in bpf_jit_insn()
835 case BPF_ALU | BPF_ADD | BPF_X: /* dst = (u32) dst + (u32) src */ in bpf_jit_insn()
844 case BPF_ALU | BPF_ADD | BPF_K: /* dst = (u32) dst + (u32) imm */ in bpf_jit_insn()
860 case BPF_ALU | BPF_SUB | BPF_X: /* dst = (u32) dst - (u32) src */ in bpf_jit_insn()
869 case BPF_ALU | BPF_SUB | BPF_K: /* dst = (u32) dst - (u32) imm */ in bpf_jit_insn()
890 case BPF_ALU | BPF_MUL | BPF_X: /* dst = (u32) dst * (u32) src */ in bpf_jit_insn()
899 case BPF_ALU | BPF_MUL | BPF_K: /* dst = (u32) dst * (u32) imm */ in bpf_jit_insn()
915 case BPF_ALU | BPF_DIV | BPF_X: /* dst = (u32) dst / (u32) src */ in bpf_jit_insn()
916 case BPF_ALU | BPF_MOD | BPF_X: /* dst = (u32) dst % (u32) src */ in bpf_jit_insn()
[all …]
/Linux-v6.6/arch/riscv/net/
Dbpf_jit_comp32.c1015 case BPF_ALU | BPF_MOV | BPF_X: in bpf_jit_emit_insn()
1023 case BPF_ALU | BPF_ADD | BPF_X: in bpf_jit_emit_insn()
1024 case BPF_ALU | BPF_SUB | BPF_X: in bpf_jit_emit_insn()
1025 case BPF_ALU | BPF_AND | BPF_X: in bpf_jit_emit_insn()
1026 case BPF_ALU | BPF_OR | BPF_X: in bpf_jit_emit_insn()
1027 case BPF_ALU | BPF_XOR | BPF_X: in bpf_jit_emit_insn()
1029 case BPF_ALU | BPF_MUL | BPF_X: in bpf_jit_emit_insn()
1030 case BPF_ALU | BPF_MUL | BPF_K: in bpf_jit_emit_insn()
1032 case BPF_ALU | BPF_DIV | BPF_X: in bpf_jit_emit_insn()
1033 case BPF_ALU | BPF_DIV | BPF_K: in bpf_jit_emit_insn()
[all …]
Dbpf_jit_comp64.c402 if (code & (BPF_ALU | BPF_X) || code & (BPF_ALU64 | BPF_X) || in init_regs()
1084 case BPF_ALU | BPF_MOV | BPF_X: in bpf_jit_emit_insn()
1109 case BPF_ALU | BPF_ADD | BPF_X: in bpf_jit_emit_insn()
1115 case BPF_ALU | BPF_SUB | BPF_X: in bpf_jit_emit_insn()
1125 case BPF_ALU | BPF_AND | BPF_X: in bpf_jit_emit_insn()
1131 case BPF_ALU | BPF_OR | BPF_X: in bpf_jit_emit_insn()
1137 case BPF_ALU | BPF_XOR | BPF_X: in bpf_jit_emit_insn()
1143 case BPF_ALU | BPF_MUL | BPF_X: in bpf_jit_emit_insn()
1149 case BPF_ALU | BPF_DIV | BPF_X: in bpf_jit_emit_insn()
1158 case BPF_ALU | BPF_MOD | BPF_X: in bpf_jit_emit_insn()
[all …]
/Linux-v6.6/arch/arm64/net/
Dbpf_jit_comp.c787 case BPF_ALU | BPF_MOV | BPF_X: in build_insn()
805 case BPF_ALU | BPF_ADD | BPF_X: in build_insn()
809 case BPF_ALU | BPF_SUB | BPF_X: in build_insn()
813 case BPF_ALU | BPF_AND | BPF_X: in build_insn()
817 case BPF_ALU | BPF_OR | BPF_X: in build_insn()
821 case BPF_ALU | BPF_XOR | BPF_X: in build_insn()
825 case BPF_ALU | BPF_MUL | BPF_X: in build_insn()
829 case BPF_ALU | BPF_DIV | BPF_X: in build_insn()
836 case BPF_ALU | BPF_MOD | BPF_X: in build_insn()
844 case BPF_ALU | BPF_LSH | BPF_X: in build_insn()
[all …]
/Linux-v6.6/tools/testing/selftests/bpf/
Ddisasm.c67 [BPF_ALU] = "alu",
176 if (class == BPF_ALU || class == BPF_ALU64) { in print_bpf_insn()
184 insn->code, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
185 insn->dst_reg, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
189 insn->code, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
194 class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
198 insn->code, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
/Linux-v6.6/kernel/bpf/
Ddisasm.c67 [BPF_ALU] = "alu",
176 if (class == BPF_ALU || class == BPF_ALU64) { in print_bpf_insn()
184 insn->code, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
185 insn->dst_reg, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
189 insn->code, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
194 class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
198 insn->code, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
/Linux-v6.6/arch/arm/net/
Dbpf_jit_32.c1377 case BPF_ALU | BPF_MOV | BPF_K: in build_insn()
1378 case BPF_ALU | BPF_MOV | BPF_X: in build_insn()
1404 case BPF_ALU | BPF_ADD | BPF_K: in build_insn()
1405 case BPF_ALU | BPF_ADD | BPF_X: in build_insn()
1406 case BPF_ALU | BPF_SUB | BPF_K: in build_insn()
1407 case BPF_ALU | BPF_SUB | BPF_X: in build_insn()
1408 case BPF_ALU | BPF_OR | BPF_K: in build_insn()
1409 case BPF_ALU | BPF_OR | BPF_X: in build_insn()
1410 case BPF_ALU | BPF_AND | BPF_K: in build_insn()
1411 case BPF_ALU | BPF_AND | BPF_X: in build_insn()
[all …]
/Linux-v6.6/samples/bpf/
Dbpf_insn.h20 .code = BPF_ALU | BPF_OP(OP) | BPF_X, \
38 .code = BPF_ALU | BPF_OP(OP) | BPF_K, \
56 .code = BPF_ALU | BPF_MOV | BPF_X, \
74 .code = BPF_ALU | BPF_MOV | BPF_K, \
/Linux-v6.6/arch/x86/net/
Dbpf_jit_comp32.c1689 case BPF_ALU | BPF_MOV | BPF_K: in do_jit()
1690 case BPF_ALU | BPF_MOV | BPF_X: in do_jit()
1718 case BPF_ALU | BPF_ADD | BPF_K: in do_jit()
1719 case BPF_ALU | BPF_ADD | BPF_X: in do_jit()
1720 case BPF_ALU | BPF_SUB | BPF_K: in do_jit()
1721 case BPF_ALU | BPF_SUB | BPF_X: in do_jit()
1722 case BPF_ALU | BPF_OR | BPF_K: in do_jit()
1723 case BPF_ALU | BPF_OR | BPF_X: in do_jit()
1724 case BPF_ALU | BPF_AND | BPF_K: in do_jit()
1725 case BPF_ALU | BPF_AND | BPF_X: in do_jit()
[all …]
Dbpf_jit_comp.c1068 case BPF_ALU | BPF_ADD | BPF_X: in do_jit()
1069 case BPF_ALU | BPF_SUB | BPF_X: in do_jit()
1070 case BPF_ALU | BPF_AND | BPF_X: in do_jit()
1071 case BPF_ALU | BPF_OR | BPF_X: in do_jit()
1072 case BPF_ALU | BPF_XOR | BPF_X: in do_jit()
1085 case BPF_ALU | BPF_MOV | BPF_X: in do_jit()
1097 case BPF_ALU | BPF_NEG: in do_jit()
1104 case BPF_ALU | BPF_ADD | BPF_K: in do_jit()
1105 case BPF_ALU | BPF_SUB | BPF_K: in do_jit()
1106 case BPF_ALU | BPF_AND | BPF_K: in do_jit()
[all …]
/Linux-v6.6/kernel/
Dseccomp.c306 case BPF_ALU | BPF_ADD | BPF_K: in seccomp_check_filter()
307 case BPF_ALU | BPF_ADD | BPF_X: in seccomp_check_filter()
308 case BPF_ALU | BPF_SUB | BPF_K: in seccomp_check_filter()
309 case BPF_ALU | BPF_SUB | BPF_X: in seccomp_check_filter()
310 case BPF_ALU | BPF_MUL | BPF_K: in seccomp_check_filter()
311 case BPF_ALU | BPF_MUL | BPF_X: in seccomp_check_filter()
312 case BPF_ALU | BPF_DIV | BPF_K: in seccomp_check_filter()
313 case BPF_ALU | BPF_DIV | BPF_X: in seccomp_check_filter()
314 case BPF_ALU | BPF_AND | BPF_K: in seccomp_check_filter()
315 case BPF_ALU | BPF_AND | BPF_X: in seccomp_check_filter()
[all …]
/Linux-v6.6/Documentation/bpf/standardization/
Dinstruction-set.rst182 BPF_ALU 0x04 32-bit arithmetic operations `Arithmetic and jump instructions`_
191 For arithmetic and jump instructions (``BPF_ALU``, ``BPF_ALU64``, ``BPF_JMP`` and
219 ``BPF_ALU`` uses 32-bit wide operands while ``BPF_ALU64`` uses 64-bit wide operands for
250 the destination register is unchanged whereas for ``BPF_ALU`` the upper
253 ``BPF_ADD | BPF_X | BPF_ALU`` means::
263 ``BPF_XOR | BPF_K | BPF_ALU`` means::
276 For unsigned operations (``BPF_DIV`` and ``BPF_MOD``), for ``BPF_ALU``,
281 For signed operations (``BPF_SDIV`` and ``BPF_SMOD``), for ``BPF_ALU``,
287 ``BPF_ALU | BPF_MOVSX`` :term:`sign extends<Sign Extend>` 8-bit and 16-bit operands into 32
298 The byte swap instructions use instruction classes of ``BPF_ALU`` and ``BPF_ALU64``
[all …]
/Linux-v6.6/lib/
Dtest_bpf.c145 insn[i] = __BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, k); in bpf_fill_maxinsns3()
237 insn[len - 2] = __BPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0); in bpf_fill_maxinsns7()
392 insn[len - 2] = __BPF_STMT(BPF_ALU | BPF_XOR | BPF_X, 0); in bpf_fill_maxinsns13()
3070 BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
3071 BPF_STMT(BPF_ALU | BPF_NEG, 0), /* A == -3 */
3074 BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
3088 BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
3099 BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 2),
3101 BPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0),
3102 BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 0xffffffff),
[all …]

12