Home
last modified time | relevance | path

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

12

/linux/tools/bpf/
H A 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 …]
H A 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/io_uring/
H A Dbpf_filter.c202 case BPF_ALU | BPF_ADD | BPF_K: in io_uring_check_cbpf_filter()
203 case BPF_ALU | BPF_ADD | BPF_X: in io_uring_check_cbpf_filter()
204 case BPF_ALU | BPF_SUB | BPF_K: in io_uring_check_cbpf_filter()
205 case BPF_ALU | BPF_SUB | BPF_X: in io_uring_check_cbpf_filter()
206 case BPF_ALU | BPF_MUL | BPF_K: in io_uring_check_cbpf_filter()
207 case BPF_ALU | BPF_MUL | BPF_X: in io_uring_check_cbpf_filter()
208 case BPF_ALU | BPF_DIV | BPF_K: in io_uring_check_cbpf_filter()
209 case BPF_ALU | BPF_DIV | BPF_X: in io_uring_check_cbpf_filter()
210 case BPF_ALU | BPF_AND | BPF_K: in io_uring_check_cbpf_filter()
211 case BPF_ALU | BPF_AND | BPF_X: in io_uring_check_cbpf_filter()
[all …]
/linux/arch/mips/net/
H A 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 …]
H A 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/arch/sparc/net/
H A 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 …]
/linux/arch/parisc/net/
H A 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 …]
H A 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/tools/include/linux/
H A Dfilter.h45 .code = BPF_ALU | BPF_OP(OP) | BPF_X, \
63 .code = BPF_ALU | BPF_OP(OP) | BPF_K, \
73 .code = BPF_ALU | BPF_END | BPF_SRC(TYPE), \
91 .code = BPF_ALU | BPF_MOV | BPF_X, \
109 .code = BPF_ALU | BPF_MOV | BPF_K, \
127 .code = BPF_ALU | BPF_MOV | BPF_X, \
145 .code = BPF_ALU | BPF_MOV | BPF_SRC(TYPE), \
/linux/arch/riscv/net/
H A Dbpf_jit_comp32.c1081 case BPF_ALU | BPF_MOV | BPF_X: in bpf_jit_emit_insn()
1103 case BPF_ALU | BPF_ADD | BPF_X: in bpf_jit_emit_insn()
1104 case BPF_ALU | BPF_SUB | BPF_X: in bpf_jit_emit_insn()
1105 case BPF_ALU | BPF_AND | BPF_X: in bpf_jit_emit_insn()
1106 case BPF_ALU | BPF_OR | BPF_X: in bpf_jit_emit_insn()
1107 case BPF_ALU | BPF_XOR | BPF_X: in bpf_jit_emit_insn()
1109 case BPF_ALU | BPF_MUL | BPF_X: in bpf_jit_emit_insn()
1110 case BPF_ALU | BPF_MUL | BPF_K: in bpf_jit_emit_insn()
1112 case BPF_ALU | BPF_DIV | BPF_X: in bpf_jit_emit_insn()
1113 case BPF_ALU | BPF_DIV | BPF_K: in bpf_jit_emit_insn()
[all …]
H A Dbpf_jit_comp64.c391 if (code & (BPF_ALU | BPF_X) || code & (BPF_ALU64 | BPF_X) || in init_regs()
1376 case BPF_ALU | BPF_MOV | BPF_X: in bpf_jit_emit_insn()
1427 case BPF_ALU | BPF_ADD | BPF_X: in bpf_jit_emit_insn()
1433 case BPF_ALU | BPF_SUB | BPF_X: in bpf_jit_emit_insn()
1443 case BPF_ALU | BPF_AND | BPF_X: in bpf_jit_emit_insn()
1449 case BPF_ALU | BPF_OR | BPF_X: in bpf_jit_emit_insn()
1455 case BPF_ALU | BPF_XOR | BPF_X: in bpf_jit_emit_insn()
1461 case BPF_ALU | BPF_MUL | BPF_X: in bpf_jit_emit_insn()
1467 case BPF_ALU | BPF_DIV | BPF_X: in bpf_jit_emit_insn()
1476 case BPF_ALU | BPF_MOD | BPF_X: in bpf_jit_emit_insn()
[all …]
/linux/samples/bpf/
H A 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/tools/testing/selftests/bpf/
H A Ddisasm.c67 [BPF_ALU] = "alu",
193 if (class == BPF_ALU || class == BPF_ALU64) { in print_bpf_insn()
201 insn->code, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
202 insn->dst_reg, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
213 insn->code, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
218 class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
222 insn->code, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
/linux/kernel/
H A Dseccomp.c304 case BPF_ALU | BPF_ADD | BPF_K: in seccomp_check_filter()
305 case BPF_ALU | BPF_ADD | BPF_X: in seccomp_check_filter()
306 case BPF_ALU | BPF_SUB | BPF_K: in seccomp_check_filter()
307 case BPF_ALU | BPF_SUB | BPF_X: in seccomp_check_filter()
308 case BPF_ALU | BPF_MUL | BPF_K: in seccomp_check_filter()
309 case BPF_ALU | BPF_MUL | BPF_X: in seccomp_check_filter()
310 case BPF_ALU | BPF_DIV | BPF_K: in seccomp_check_filter()
311 case BPF_ALU | BPF_DIV | BPF_X: in seccomp_check_filter()
312 case BPF_ALU | BPF_AND | BPF_K: in seccomp_check_filter()
313 case BPF_ALU | BPF_AN in seccomp_check_filter()
[all...]
/linux/kernel/bpf/
H A Ddisasm.c67 [BPF_ALU] = "alu",
193 if (class == BPF_ALU || class == BPF_ALU64) { in print_bpf_insn()
201 insn->code, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
202 insn->dst_reg, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
213 insn->code, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
218 class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
222 insn->code, class == BPF_ALU ? 'w' : 'r', in print_bpf_insn()
H A Dfixups.c72 if ((class == BPF_ALU || class == BPF_ALU64) && op == BPF_END && insn->imm != 64) in bpf_is_reg64()
76 if (class == BPF_ALU && op != BPF_END) in bpf_is_reg64()
1546 insn->code = BPF_ALU | BPF_MOV | BPF_X; in bpf_do_misc_fixups()
1555 insn->code = BPF_ALU | BPF_OP(insn->code) | BPF_SRC(insn->code); in bpf_do_misc_fixups()
1560 insn->code == (BPF_ALU | BPF_MOD | BPF_K) || in bpf_do_misc_fixups()
1561 insn->code == (BPF_ALU | BPF_DIV | BPF_K)) && in bpf_do_misc_fixups()
1568 *patch++ = BPF_RAW_INSN((is64 ? BPF_ALU64 : BPF_ALU) | in bpf_do_misc_fixups()
1589 insn->code == (BPF_ALU | BPF_MOD | BPF_X) || in bpf_do_misc_fixups()
1590 insn->code == (BPF_ALU | BPF_DIV | BPF_X)) { in bpf_do_misc_fixups()
1603 *patch++ = BPF_RAW_INSN((is64 ? BPF_ALU64 : BPF_ALU) | in bpf_do_misc_fixups()
[all …]
/linux/arch/loongarch/net/
H A Dbpf_jit.c710 const bool is32 = BPF_CLASS(insn->code) == BPF_ALU || BPF_CLASS(insn->code) == BPF_JMP32; in build_insn()
714 case BPF_ALU | BPF_MOV | BPF_X: in build_insn()
754 case BPF_ALU | BPF_MOV | BPF_K: in build_insn()
760 case BPF_ALU | BPF_ADD | BPF_X: in build_insn()
767 case BPF_ALU | BPF_ADD | BPF_K: in build_insn()
779 case BPF_ALU | BPF_SUB | BPF_X: in build_insn()
786 case BPF_ALU | BPF_SUB | BPF_K: in build_insn()
798 case BPF_ALU | BPF_MUL | BPF_X: in build_insn()
805 case BPF_ALU | BPF_MUL | BPF_K: in build_insn()
813 case BPF_ALU | BPF_DIV | BPF_X: in build_insn()
[all …]
/linux/arch/arm64/net/
H A Dbpf_jit_comp.c1333 case BPF_ALU | BPF_MOV | BPF_X: in build_insn()
1382 case BPF_ALU | BPF_ADD | BPF_X: in build_insn()
1386 case BPF_ALU | BPF_SUB | BPF_X: in build_insn()
1390 case BPF_ALU | BPF_AND | BPF_X: in build_insn()
1394 case BPF_ALU | BPF_OR | BPF_X: in build_insn()
1398 case BPF_ALU | BPF_XOR | BPF_X: in build_insn()
1402 case BPF_ALU | BPF_MUL | BPF_X: in build_insn()
1406 case BPF_ALU | BPF_DIV | BPF_X: in build_insn()
1413 case BPF_ALU | BPF_MOD | BPF_X: in build_insn()
1421 case BPF_ALU | BPF_LSH | BPF_X: in build_insn()
[all …]
/linux/arch/x86/net/
H A Dbpf_jit_comp.c1885 case BPF_ALU | BPF_ADD | BPF_X: in do_jit()
1886 case BPF_ALU | BPF_SUB | BPF_X: in do_jit()
1887 case BPF_ALU | BPF_AND | BPF_X: in do_jit()
1888 case BPF_ALU | BPF_OR | BPF_X: in do_jit()
1889 case BPF_ALU | BPF_XOR | BPF_X: in do_jit()
1945 case BPF_ALU | BPF_MOV | BPF_X: in do_jit()
1957 case BPF_ALU | BPF_NEG: in do_jit()
1964 case BPF_ALU | BPF_ADD | BPF_K: in do_jit()
1965 case BPF_ALU | BPF_SUB | BPF_K: in do_jit()
1966 case BPF_ALU | BPF_AND | BPF_K: in do_jit()
[all …]
/linux/include/uapi/linux/
H A Dbpf_common.h11 #define BPF_ALU 0x04 macro
/linux/tools/include/uapi/linux/
H A Dbpf_common.h11 #define BPF_ALU 0x04 macro
/linux/Documentation/bpf/
H A Dclassic_vs_extended.rst264 BPF_ALU 0x04 BPF_ALU 0x04
289 If BPF_CLASS(code) == BPF_ALU or BPF_ALU64 [ in eBPF ], BPF_OP(code) is one of::
323 So BPF_ADD | BPF_X | BPF_ALU means 32-bit addition in both classic BPF
326 BPF_XOR | BPF_K | BPF_ALU means A ^= imm32 in classic BPF and analogous
330 eBPF is using BPF_MOV | BPF_X | BPF_ALU code instead. Since there are no
332 exactly the same operations as BPF_ALU, but with 64-bit wide operands
H A Dclang-notes.rst20 For CPU versions prior to 3, Clang v7.0 and later can enable ``BPF_ALU`` support with
/linux/include/linux/
H A Dfilter.h119 .code = BPF_ALU | BPF_OP(OP) | BPF_X, \
142 .code = BPF_ALU | BPF_OP(OP) | BPF_K, \
154 .code = BPF_ALU | BPF_END | BPF_SRC(TYPE), \
182 .code = BPF_ALU | BPF_MOV | BPF_X, \
219 .code = BPF_ALU | BPF_MOV | BPF_K, \
237 .code = BPF_ALU | BPF_MOV | BPF_X, \
246 .code = BPF_ALU | BPF_MOV | BPF_X, \
254 return insn->code == (BPF_ALU | BPF_MOV | BPF_X) && insn->imm == 1; in insn_is_zext()
301 .code = BPF_ALU | BPF_MOV | BPF_SRC(TYPE), \
/linux/net/core/
H A Dfilter.c652 case BPF_ALU | BPF_ADD | BPF_X: in bpf_convert_filter()
653 case BPF_ALU | BPF_ADD | BPF_K: in bpf_convert_filter()
654 case BPF_ALU | BPF_SUB | BPF_X: in bpf_convert_filter()
655 case BPF_ALU | BPF_SUB | BPF_K: in bpf_convert_filter()
656 case BPF_ALU | BPF_AND | BPF_X: in bpf_convert_filter()
657 case BPF_ALU | BPF_AND | BPF_K: in bpf_convert_filter()
658 case BPF_ALU | BPF_OR | BPF_X: in bpf_convert_filter()
659 case BPF_ALU | BPF_OR | BPF_K: in bpf_convert_filter()
660 case BPF_ALU | BPF_LSH | BPF_X: in bpf_convert_filter()
661 case BPF_ALU | BPF_LSH | BPF_K: in bpf_convert_filter()
[all …]

12