Lines Matching defs:self

81 	int (*fill_helper)(struct bpf_test *self);
90 static int bpf_fill_maxinsns1(struct bpf_test *self)
104 self->u.ptr.insns = insn;
105 self->u.ptr.len = len;
110 static int bpf_fill_maxinsns2(struct bpf_test *self)
123 self->u.ptr.insns = insn;
124 self->u.ptr.len = len;
129 static int bpf_fill_maxinsns3(struct bpf_test *self)
150 self->u.ptr.insns = insn;
151 self->u.ptr.len = len;
156 static int bpf_fill_maxinsns4(struct bpf_test *self)
169 self->u.ptr.insns = insn;
170 self->u.ptr.len = len;
175 static int bpf_fill_maxinsns5(struct bpf_test *self)
192 self->u.ptr.insns = insn;
193 self->u.ptr.len = len;
198 static int bpf_fill_maxinsns6(struct bpf_test *self)
214 self->u.ptr.insns = insn;
215 self->u.ptr.len = len;
220 static int bpf_fill_maxinsns7(struct bpf_test *self)
240 self->u.ptr.insns = insn;
241 self->u.ptr.len = len;
246 static int bpf_fill_maxinsns8(struct bpf_test *self)
263 self->u.ptr.insns = insn;
264 self->u.ptr.len = len;
269 static int bpf_fill_maxinsns9(struct bpf_test *self)
289 self->u.ptr.insns = insn;
290 self->u.ptr.len = len;
295 static int bpf_fill_maxinsns10(struct bpf_test *self)
314 self->u.ptr.insns = insn;
315 self->u.ptr.len = len;
320 static int __bpf_fill_ja(struct bpf_test *self, unsigned int len,
343 self->u.ptr.insns = insn;
344 self->u.ptr.len = len;
349 static int bpf_fill_maxinsns11(struct bpf_test *self)
352 return __bpf_fill_ja(self, BPF_MAXINSNS, 68);
355 static int bpf_fill_maxinsns12(struct bpf_test *self)
372 self->u.ptr.insns = insn;
373 self->u.ptr.len = len;
378 static int bpf_fill_maxinsns13(struct bpf_test *self)
395 self->u.ptr.insns = insn;
396 self->u.ptr.len = len;
401 static int bpf_fill_ja(struct bpf_test *self)
404 return __bpf_fill_ja(self, 12, 9);
407 static int bpf_fill_ld_abs_get_processor_id(struct bpf_test *self)
425 self->u.ptr.insns = insn;
426 self->u.ptr.len = len;
431 static int __bpf_fill_stxdw(struct bpf_test *self, int size)
450 self->u.ptr.insns = insn;
451 self->u.ptr.len = len;
452 self->stack_depth = 40;
457 static int bpf_fill_stxw(struct bpf_test *self)
459 return __bpf_fill_stxdw(self, BPF_W);
462 static int bpf_fill_stxdw(struct bpf_test *self)
464 return __bpf_fill_stxdw(self, BPF_DW);
481 static int __bpf_fill_max_jmp(struct bpf_test *self, int jmp, int imm)
511 self->u.ptr.insns = insns;
512 self->u.ptr.len = len;
519 static int bpf_fill_max_jmp_taken(struct bpf_test *self)
521 return __bpf_fill_max_jmp(self, BPF_JEQ, 1);
525 static int bpf_fill_max_jmp_not_taken(struct bpf_test *self)
527 return __bpf_fill_max_jmp(self, BPF_JEQ, 0);
531 static int bpf_fill_max_jmp_always_taken(struct bpf_test *self)
533 return __bpf_fill_max_jmp(self, BPF_JGE, 0);
537 static int bpf_fill_max_jmp_never_taken(struct bpf_test *self)
539 return __bpf_fill_max_jmp(self, BPF_JLT, 0);
594 static int __bpf_fill_alu_shift(struct bpf_test *self, u8 op,
662 self->u.ptr.insns = insn;
663 self->u.ptr.len = len;
669 static int bpf_fill_alu64_lsh_imm(struct bpf_test *self)
671 return __bpf_fill_alu_shift(self, BPF_LSH, BPF_K, false);
674 static int bpf_fill_alu64_rsh_imm(struct bpf_test *self)
676 return __bpf_fill_alu_shift(self, BPF_RSH, BPF_K, false);
679 static int bpf_fill_alu64_arsh_imm(struct bpf_test *self)
681 return __bpf_fill_alu_shift(self, BPF_ARSH, BPF_K, false);
684 static int bpf_fill_alu64_lsh_reg(struct bpf_test *self)
686 return __bpf_fill_alu_shift(self, BPF_LSH, BPF_X, false);
689 static int bpf_fill_alu64_rsh_reg(struct bpf_test *self)
691 return __bpf_fill_alu_shift(self, BPF_RSH, BPF_X, false);
694 static int bpf_fill_alu64_arsh_reg(struct bpf_test *self)
696 return __bpf_fill_alu_shift(self, BPF_ARSH, BPF_X, false);
699 static int bpf_fill_alu32_lsh_imm(struct bpf_test *self)
701 return __bpf_fill_alu_shift(self, BPF_LSH, BPF_K, true);
704 static int bpf_fill_alu32_rsh_imm(struct bpf_test *self)
706 return __bpf_fill_alu_shift(self, BPF_RSH, BPF_K, true);
709 static int bpf_fill_alu32_arsh_imm(struct bpf_test *self)
711 return __bpf_fill_alu_shift(self, BPF_ARSH, BPF_K, true);
714 static int bpf_fill_alu32_lsh_reg(struct bpf_test *self)
716 return __bpf_fill_alu_shift(self, BPF_LSH, BPF_X, true);
719 static int bpf_fill_alu32_rsh_reg(struct bpf_test *self)
721 return __bpf_fill_alu_shift(self, BPF_RSH, BPF_X, true);
724 static int bpf_fill_alu32_arsh_reg(struct bpf_test *self)
726 return __bpf_fill_alu_shift(self, BPF_ARSH, BPF_X, true);
733 static int __bpf_fill_alu_shift_same_reg(struct bpf_test *self, u8 op,
772 self->u.ptr.insns = insn;
773 self->u.ptr.len = len;
779 static int bpf_fill_alu64_lsh_same_reg(struct bpf_test *self)
781 return __bpf_fill_alu_shift_same_reg(self, BPF_LSH, false);
784 static int bpf_fill_alu64_rsh_same_reg(struct bpf_test *self)
786 return __bpf_fill_alu_shift_same_reg(self, BPF_RSH, false);
789 static int bpf_fill_alu64_arsh_same_reg(struct bpf_test *self)
791 return __bpf_fill_alu_shift_same_reg(self, BPF_ARSH, false);
794 static int bpf_fill_alu32_lsh_same_reg(struct bpf_test *self)
796 return __bpf_fill_alu_shift_same_reg(self, BPF_LSH, true);
799 static int bpf_fill_alu32_rsh_same_reg(struct bpf_test *self)
801 return __bpf_fill_alu_shift_same_reg(self, BPF_RSH, true);
804 static int bpf_fill_alu32_arsh_same_reg(struct bpf_test *self)
806 return __bpf_fill_alu_shift_same_reg(self, BPF_ARSH, true);
821 static int __bpf_fill_pattern(struct bpf_test *self, void *arg,
838 len = extra + count * (*emit)(self, arg, NULL, 0, 0);
861 i += (*emit)(self, arg,
879 i += (*emit)(self, arg, &insns[i],
888 self->u.ptr.insns = insns;
889 self->u.ptr.len = i;
916 static int __bpf_emit_alu64_imm(struct bpf_test *self, void *arg,
937 static int __bpf_emit_alu32_imm(struct bpf_test *self, void *arg,
958 static int __bpf_emit_alu64_reg(struct bpf_test *self, void *arg,
980 static int __bpf_emit_alu32_reg(struct bpf_test *self, void *arg,
1002 static int __bpf_fill_alu64_imm(struct bpf_test *self, int op)
1004 return __bpf_fill_pattern(self, &op, 64, 32,
1009 static int __bpf_fill_alu32_imm(struct bpf_test *self, int op)
1011 return __bpf_fill_pattern(self, &op, 64, 32,
1016 static int __bpf_fill_alu64_reg(struct bpf_test *self, int op)
1018 return __bpf_fill_pattern(self, &op, 64, 64,
1023 static int __bpf_fill_alu32_reg(struct bpf_test *self, int op)
1025 return __bpf_fill_pattern(self, &op, 64, 64,
1031 static int bpf_fill_alu64_mov_imm(struct bpf_test *self)
1033 return __bpf_fill_alu64_imm(self, BPF_MOV);
1036 static int bpf_fill_alu64_and_imm(struct bpf_test *self)
1038 return __bpf_fill_alu64_imm(self, BPF_AND);
1041 static int bpf_fill_alu64_or_imm(struct bpf_test *self)
1043 return __bpf_fill_alu64_imm(self, BPF_OR);
1046 static int bpf_fill_alu64_xor_imm(struct bpf_test *self)
1048 return __bpf_fill_alu64_imm(self, BPF_XOR);
1051 static int bpf_fill_alu64_add_imm(struct bpf_test *self)
1053 return __bpf_fill_alu64_imm(self, BPF_ADD);
1056 static int bpf_fill_alu64_sub_imm(struct bpf_test *self)
1058 return __bpf_fill_alu64_imm(self, BPF_SUB);
1061 static int bpf_fill_alu64_mul_imm(struct bpf_test *self)
1063 return __bpf_fill_alu64_imm(self, BPF_MUL);
1066 static int bpf_fill_alu64_div_imm(struct bpf_test *self)
1068 return __bpf_fill_alu64_imm(self, BPF_DIV);
1071 static int bpf_fill_alu64_mod_imm(struct bpf_test *self)
1073 return __bpf_fill_alu64_imm(self, BPF_MOD);
1077 static int bpf_fill_alu32_mov_imm(struct bpf_test *self)
1079 return __bpf_fill_alu32_imm(self, BPF_MOV);
1082 static int bpf_fill_alu32_and_imm(struct bpf_test *self)
1084 return __bpf_fill_alu32_imm(self, BPF_AND);
1087 static int bpf_fill_alu32_or_imm(struct bpf_test *self)
1089 return __bpf_fill_alu32_imm(self, BPF_OR);
1092 static int bpf_fill_alu32_xor_imm(struct bpf_test *self)
1094 return __bpf_fill_alu32_imm(self, BPF_XOR);
1097 static int bpf_fill_alu32_add_imm(struct bpf_test *self)
1099 return __bpf_fill_alu32_imm(self, BPF_ADD);
1102 static int bpf_fill_alu32_sub_imm(struct bpf_test *self)
1104 return __bpf_fill_alu32_imm(self, BPF_SUB);
1107 static int bpf_fill_alu32_mul_imm(struct bpf_test *self)
1109 return __bpf_fill_alu32_imm(self, BPF_MUL);
1112 static int bpf_fill_alu32_div_imm(struct bpf_test *self)
1114 return __bpf_fill_alu32_imm(self, BPF_DIV);
1117 static int bpf_fill_alu32_mod_imm(struct bpf_test *self)
1119 return __bpf_fill_alu32_imm(self, BPF_MOD);
1123 static int bpf_fill_alu64_mov_reg(struct bpf_test *self)
1125 return __bpf_fill_alu64_reg(self, BPF_MOV);
1128 static int bpf_fill_alu64_and_reg(struct bpf_test *self)
1130 return __bpf_fill_alu64_reg(self, BPF_AND);
1133 static int bpf_fill_alu64_or_reg(struct bpf_test *self)
1135 return __bpf_fill_alu64_reg(self, BPF_OR);
1138 static int bpf_fill_alu64_xor_reg(struct bpf_test *self)
1140 return __bpf_fill_alu64_reg(self, BPF_XOR);
1143 static int bpf_fill_alu64_add_reg(struct bpf_test *self)
1145 return __bpf_fill_alu64_reg(self, BPF_ADD);
1148 static int bpf_fill_alu64_sub_reg(struct bpf_test *self)
1150 return __bpf_fill_alu64_reg(self, BPF_SUB);
1153 static int bpf_fill_alu64_mul_reg(struct bpf_test *self)
1155 return __bpf_fill_alu64_reg(self, BPF_MUL);
1158 static int bpf_fill_alu64_div_reg(struct bpf_test *self)
1160 return __bpf_fill_alu64_reg(self, BPF_DIV);
1163 static int bpf_fill_alu64_mod_reg(struct bpf_test *self)
1165 return __bpf_fill_alu64_reg(self, BPF_MOD);
1169 static int bpf_fill_alu32_mov_reg(struct bpf_test *self)
1171 return __bpf_fill_alu32_reg(self, BPF_MOV);
1174 static int bpf_fill_alu32_and_reg(struct bpf_test *self)
1176 return __bpf_fill_alu32_reg(self, BPF_AND);
1179 static int bpf_fill_alu32_or_reg(struct bpf_test *self)
1181 return __bpf_fill_alu32_reg(self, BPF_OR);
1184 static int bpf_fill_alu32_xor_reg(struct bpf_test *self)
1186 return __bpf_fill_alu32_reg(self, BPF_XOR);
1189 static int bpf_fill_alu32_add_reg(struct bpf_test *self)
1191 return __bpf_fill_alu32_reg(self, BPF_ADD);
1194 static int bpf_fill_alu32_sub_reg(struct bpf_test *self)
1196 return __bpf_fill_alu32_reg(self, BPF_SUB);
1199 static int bpf_fill_alu32_mul_reg(struct bpf_test *self)
1201 return __bpf_fill_alu32_reg(self, BPF_MUL);
1204 static int bpf_fill_alu32_div_reg(struct bpf_test *self)
1206 return __bpf_fill_alu32_reg(self, BPF_DIV);
1209 static int bpf_fill_alu32_mod_reg(struct bpf_test *self)
1211 return __bpf_fill_alu32_reg(self, BPF_MOD);
1218 static int __bpf_fill_alu_imm_regs(struct bpf_test *self, u8 op, bool alu32)
1268 self->u.ptr.insns = insns;
1269 self->u.ptr.len = len;
1276 static int bpf_fill_alu64_mov_imm_regs(struct bpf_test *self)
1278 return __bpf_fill_alu_imm_regs(self, BPF_MOV, false);
1281 static int bpf_fill_alu64_and_imm_regs(struct bpf_test *self)
1283 return __bpf_fill_alu_imm_regs(self, BPF_AND, false);
1286 static int bpf_fill_alu64_or_imm_regs(struct bpf_test *self)
1288 return __bpf_fill_alu_imm_regs(self, BPF_OR, false);
1291 static int bpf_fill_alu64_xor_imm_regs(struct bpf_test *self)
1293 return __bpf_fill_alu_imm_regs(self, BPF_XOR, false);
1296 static int bpf_fill_alu64_lsh_imm_regs(struct bpf_test *self)
1298 return __bpf_fill_alu_imm_regs(self, BPF_LSH, false);
1301 static int bpf_fill_alu64_rsh_imm_regs(struct bpf_test *self)
1303 return __bpf_fill_alu_imm_regs(self, BPF_RSH, false);
1306 static int bpf_fill_alu64_arsh_imm_regs(struct bpf_test *self)
1308 return __bpf_fill_alu_imm_regs(self, BPF_ARSH, false);
1311 static int bpf_fill_alu64_add_imm_regs(struct bpf_test *self)
1313 return __bpf_fill_alu_imm_regs(self, BPF_ADD, false);
1316 static int bpf_fill_alu64_sub_imm_regs(struct bpf_test *self)
1318 return __bpf_fill_alu_imm_regs(self, BPF_SUB, false);
1321 static int bpf_fill_alu64_mul_imm_regs(struct bpf_test *self)
1323 return __bpf_fill_alu_imm_regs(self, BPF_MUL, false);
1326 static int bpf_fill_alu64_div_imm_regs(struct bpf_test *self)
1328 return __bpf_fill_alu_imm_regs(self, BPF_DIV, false);
1331 static int bpf_fill_alu64_mod_imm_regs(struct bpf_test *self)
1333 return __bpf_fill_alu_imm_regs(self, BPF_MOD, false);
1337 static int bpf_fill_alu32_mov_imm_regs(struct bpf_test *self)
1339 return __bpf_fill_alu_imm_regs(self, BPF_MOV, true);
1342 static int bpf_fill_alu32_and_imm_regs(struct bpf_test *self)
1344 return __bpf_fill_alu_imm_regs(self, BPF_AND, true);
1347 static int bpf_fill_alu32_or_imm_regs(struct bpf_test *self)
1349 return __bpf_fill_alu_imm_regs(self, BPF_OR, true);
1352 static int bpf_fill_alu32_xor_imm_regs(struct bpf_test *self)
1354 return __bpf_fill_alu_imm_regs(self, BPF_XOR, true);
1357 static int bpf_fill_alu32_lsh_imm_regs(struct bpf_test *self)
1359 return __bpf_fill_alu_imm_regs(self, BPF_LSH, true);
1362 static int bpf_fill_alu32_rsh_imm_regs(struct bpf_test *self)
1364 return __bpf_fill_alu_imm_regs(self, BPF_RSH, true);
1367 static int bpf_fill_alu32_arsh_imm_regs(struct bpf_test *self)
1369 return __bpf_fill_alu_imm_regs(self, BPF_ARSH, true);
1372 static int bpf_fill_alu32_add_imm_regs(struct bpf_test *self)
1374 return __bpf_fill_alu_imm_regs(self, BPF_ADD, true);
1377 static int bpf_fill_alu32_sub_imm_regs(struct bpf_test *self)
1379 return __bpf_fill_alu_imm_regs(self, BPF_SUB, true);
1382 static int bpf_fill_alu32_mul_imm_regs(struct bpf_test *self)
1384 return __bpf_fill_alu_imm_regs(self, BPF_MUL, true);
1387 static int bpf_fill_alu32_div_imm_regs(struct bpf_test *self)
1389 return __bpf_fill_alu_imm_regs(self, BPF_DIV, true);
1392 static int bpf_fill_alu32_mod_imm_regs(struct bpf_test *self)
1394 return __bpf_fill_alu_imm_regs(self, BPF_MOD, true);
1401 static int __bpf_fill_alu_reg_pairs(struct bpf_test *self, u8 op, bool alu32)
1460 self->u.ptr.insns = insns;
1461 self->u.ptr.len = len;
1468 static int bpf_fill_alu64_mov_reg_pairs(struct bpf_test *self)
1470 return __bpf_fill_alu_reg_pairs(self, BPF_MOV, false);
1473 static int bpf_fill_alu64_and_reg_pairs(struct bpf_test *self)
1475 return __bpf_fill_alu_reg_pairs(self, BPF_AND, false);
1478 static int bpf_fill_alu64_or_reg_pairs(struct bpf_test *self)
1480 return __bpf_fill_alu_reg_pairs(self, BPF_OR, false);
1483 static int bpf_fill_alu64_xor_reg_pairs(struct bpf_test *self)
1485 return __bpf_fill_alu_reg_pairs(self, BPF_XOR, false);
1488 static int bpf_fill_alu64_lsh_reg_pairs(struct bpf_test *self)
1490 return __bpf_fill_alu_reg_pairs(self, BPF_LSH, false);
1493 static int bpf_fill_alu64_rsh_reg_pairs(struct bpf_test *self)
1495 return __bpf_fill_alu_reg_pairs(self, BPF_RSH, false);
1498 static int bpf_fill_alu64_arsh_reg_pairs(struct bpf_test *self)
1500 return __bpf_fill_alu_reg_pairs(self, BPF_ARSH, false);
1503 static int bpf_fill_alu64_add_reg_pairs(struct bpf_test *self)
1505 return __bpf_fill_alu_reg_pairs(self, BPF_ADD, false);
1508 static int bpf_fill_alu64_sub_reg_pairs(struct bpf_test *self)
1510 return __bpf_fill_alu_reg_pairs(self, BPF_SUB, false);
1513 static int bpf_fill_alu64_mul_reg_pairs(struct bpf_test *self)
1515 return __bpf_fill_alu_reg_pairs(self, BPF_MUL, false);
1518 static int bpf_fill_alu64_div_reg_pairs(struct bpf_test *self)
1520 return __bpf_fill_alu_reg_pairs(self, BPF_DIV, false);
1523 static int bpf_fill_alu64_mod_reg_pairs(struct bpf_test *self)
1525 return __bpf_fill_alu_reg_pairs(self, BPF_MOD, false);
1529 static int bpf_fill_alu32_mov_reg_pairs(struct bpf_test *self)
1531 return __bpf_fill_alu_reg_pairs(self, BPF_MOV, true);
1534 static int bpf_fill_alu32_and_reg_pairs(struct bpf_test *self)
1536 return __bpf_fill_alu_reg_pairs(self, BPF_AND, true);
1539 static int bpf_fill_alu32_or_reg_pairs(struct bpf_test *self)
1541 return __bpf_fill_alu_reg_pairs(self, BPF_OR, true);
1544 static int bpf_fill_alu32_xor_reg_pairs(struct bpf_test *self)
1546 return __bpf_fill_alu_reg_pairs(self, BPF_XOR, true);
1549 static int bpf_fill_alu32_lsh_reg_pairs(struct bpf_test *self)
1551 return __bpf_fill_alu_reg_pairs(self, BPF_LSH, true);
1554 static int bpf_fill_alu32_rsh_reg_pairs(struct bpf_test *self)
1556 return __bpf_fill_alu_reg_pairs(self, BPF_RSH, true);
1559 static int bpf_fill_alu32_arsh_reg_pairs(struct bpf_test *self)
1561 return __bpf_fill_alu_reg_pairs(self, BPF_ARSH, true);
1564 static int bpf_fill_alu32_add_reg_pairs(struct bpf_test *self)
1566 return __bpf_fill_alu_reg_pairs(self, BPF_ADD, true);
1569 static int bpf_fill_alu32_sub_reg_pairs(struct bpf_test *self)
1571 return __bpf_fill_alu_reg_pairs(self, BPF_SUB, true);
1574 static int bpf_fill_alu32_mul_reg_pairs(struct bpf_test *self)
1576 return __bpf_fill_alu_reg_pairs(self, BPF_MUL, true);
1579 static int bpf_fill_alu32_div_reg_pairs(struct bpf_test *self)
1581 return __bpf_fill_alu_reg_pairs(self, BPF_DIV, true);
1584 static int bpf_fill_alu32_mod_reg_pairs(struct bpf_test *self)
1586 return __bpf_fill_alu_reg_pairs(self, BPF_MOD, true);
1594 static int __bpf_emit_atomic64(struct bpf_test *self, void *arg,
1641 static int __bpf_emit_atomic32(struct bpf_test *self, void *arg,
1688 static int __bpf_emit_cmpxchg64(struct bpf_test *self, void *arg,
1728 static int __bpf_emit_cmpxchg32(struct bpf_test *self, void *arg,
1771 static int __bpf_fill_atomic64(struct bpf_test *self, int op)
1773 return __bpf_fill_pattern(self, &op, 64, 64,
1778 static int __bpf_fill_atomic32(struct bpf_test *self, int op)
1780 return __bpf_fill_pattern(self, &op, 64, 64,
1786 static int bpf_fill_atomic64_add(struct bpf_test *self)
1788 return __bpf_fill_atomic64(self, BPF_ADD);
1791 static int bpf_fill_atomic64_and(struct bpf_test *self)
1793 return __bpf_fill_atomic64(self, BPF_AND);
1796 static int bpf_fill_atomic64_or(struct bpf_test *self)
1798 return __bpf_fill_atomic64(self, BPF_OR);
1801 static int bpf_fill_atomic64_xor(struct bpf_test *self)
1803 return __bpf_fill_atomic64(self, BPF_XOR);
1806 static int bpf_fill_atomic64_add_fetch(struct bpf_test *self)
1808 return __bpf_fill_atomic64(self, BPF_ADD | BPF_FETCH);
1811 static int bpf_fill_atomic64_and_fetch(struct bpf_test *self)
1813 return __bpf_fill_atomic64(self, BPF_AND | BPF_FETCH);
1816 static int bpf_fill_atomic64_or_fetch(struct bpf_test *self)
1818 return __bpf_fill_atomic64(self, BPF_OR | BPF_FETCH);
1821 static int bpf_fill_atomic64_xor_fetch(struct bpf_test *self)
1823 return __bpf_fill_atomic64(self, BPF_XOR | BPF_FETCH);
1826 static int bpf_fill_atomic64_xchg(struct bpf_test *self)
1828 return __bpf_fill_atomic64(self, BPF_XCHG);
1831 static int bpf_fill_cmpxchg64(struct bpf_test *self)
1833 return __bpf_fill_pattern(self, NULL, 64, 64, 0, PATTERN_BLOCK2,
1838 static int bpf_fill_atomic32_add(struct bpf_test *self)
1840 return __bpf_fill_atomic32(self, BPF_ADD);
1843 static int bpf_fill_atomic32_and(struct bpf_test *self)
1845 return __bpf_fill_atomic32(self, BPF_AND);
1848 static int bpf_fill_atomic32_or(struct bpf_test *self)
1850 return __bpf_fill_atomic32(self, BPF_OR);
1853 static int bpf_fill_atomic32_xor(struct bpf_test *self)
1855 return __bpf_fill_atomic32(self, BPF_XOR);
1858 static int bpf_fill_atomic32_add_fetch(struct bpf_test *self)
1860 return __bpf_fill_atomic32(self, BPF_ADD | BPF_FETCH);
1863 static int bpf_fill_atomic32_and_fetch(struct bpf_test *self)
1865 return __bpf_fill_atomic32(self, BPF_AND | BPF_FETCH);
1868 static int bpf_fill_atomic32_or_fetch(struct bpf_test *self)
1870 return __bpf_fill_atomic32(self, BPF_OR | BPF_FETCH);
1873 static int bpf_fill_atomic32_xor_fetch(struct bpf_test *self)
1875 return __bpf_fill_atomic32(self, BPF_XOR | BPF_FETCH);
1878 static int bpf_fill_atomic32_xchg(struct bpf_test *self)
1880 return __bpf_fill_atomic32(self, BPF_XCHG);
1883 static int bpf_fill_cmpxchg32(struct bpf_test *self)
1885 return __bpf_fill_pattern(self, NULL, 64, 64, 0, PATTERN_BLOCK2,
1893 static int __bpf_fill_atomic_reg_pairs(struct bpf_test *self, u8 width, u8 op)
2020 self->u.ptr.insns = insn;
2021 self->u.ptr.len = i;
2028 static int bpf_fill_atomic64_add_reg_pairs(struct bpf_test *self)
2030 return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_ADD);
2033 static int bpf_fill_atomic64_and_reg_pairs(struct bpf_test *self)
2035 return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_AND);
2038 static int bpf_fill_atomic64_or_reg_pairs(struct bpf_test *self)
2040 return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_OR);
2043 static int bpf_fill_atomic64_xor_reg_pairs(struct bpf_test *self)
2045 return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_XOR);
2048 static int bpf_fill_atomic64_add_fetch_reg_pairs(struct bpf_test *self)
2050 return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_ADD | BPF_FETCH);
2053 static int bpf_fill_atomic64_and_fetch_reg_pairs(struct bpf_test *self)
2055 return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_AND | BPF_FETCH);
2058 static int bpf_fill_atomic64_or_fetch_reg_pairs(struct bpf_test *self)
2060 return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_OR | BPF_FETCH);
2063 static int bpf_fill_atomic64_xor_fetch_reg_pairs(struct bpf_test *self)
2065 return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_XOR | BPF_FETCH);
2068 static int bpf_fill_atomic64_xchg_reg_pairs(struct bpf_test *self)
2070 return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_XCHG);
2073 static int bpf_fill_atomic64_cmpxchg_reg_pairs(struct bpf_test *self)
2075 return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_CMPXCHG);
2079 static int bpf_fill_atomic32_add_reg_pairs(struct bpf_test *self)
2081 return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_ADD);
2084 static int bpf_fill_atomic32_and_reg_pairs(struct bpf_test *self)
2086 return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_AND);
2089 static int bpf_fill_atomic32_or_reg_pairs(struct bpf_test *self)
2091 return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_OR);
2094 static int bpf_fill_atomic32_xor_reg_pairs(struct bpf_test *self)
2096 return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_XOR);
2099 static int bpf_fill_atomic32_add_fetch_reg_pairs(struct bpf_test *self)
2101 return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_ADD | BPF_FETCH);
2104 static int bpf_fill_atomic32_and_fetch_reg_pairs(struct bpf_test *self)
2106 return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_AND | BPF_FETCH);
2109 static int bpf_fill_atomic32_or_fetch_reg_pairs(struct bpf_test *self)
2111 return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_OR | BPF_FETCH);
2114 static int bpf_fill_atomic32_xor_fetch_reg_pairs(struct bpf_test *self)
2116 return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_XOR | BPF_FETCH);
2119 static int bpf_fill_atomic32_xchg_reg_pairs(struct bpf_test *self)
2121 return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_XCHG);
2124 static int bpf_fill_atomic32_cmpxchg_reg_pairs(struct bpf_test *self)
2126 return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_CMPXCHG);
2138 static int bpf_fill_ld_imm64_magn(struct bpf_test *self)
2177 self->u.ptr.insns = insn;
2178 self->u.ptr.len = len;
2190 static int __bpf_fill_ld_imm64_bytes(struct bpf_test *self,
2239 self->u.ptr.insns = insn;
2240 self->u.ptr.len = len;
2246 static int bpf_fill_ld_imm64_checker(struct bpf_test *self)
2248 return __bpf_fill_ld_imm64_bytes(self, 0, 0xff, 0xff, 0xff);
2251 static int bpf_fill_ld_imm64_pos_neg(struct bpf_test *self)
2253 return __bpf_fill_ld_imm64_bytes(self, 1, 0x81, 0x80, 0x80);
2256 static int bpf_fill_ld_imm64_pos_zero(struct bpf_test *self)
2258 return __bpf_fill_ld_imm64_bytes(self, 1, 0x81, 0, 0xff);
2261 static int bpf_fill_ld_imm64_neg_zero(struct bpf_test *self)
2263 return __bpf_fill_ld_imm64_bytes(self, 0x80, 0x80, 0, 0xff);
2302 static int __bpf_emit_jmp_imm(struct bpf_test *self, void *arg,
2325 static int __bpf_emit_jmp32_imm(struct bpf_test *self, void *arg,
2346 static int __bpf_emit_jmp_reg(struct bpf_test *self, void *arg,
2368 static int __bpf_emit_jmp32_reg(struct bpf_test *self, void *arg,
2390 static int __bpf_fill_jmp_imm(struct bpf_test *self, int op)
2392 return __bpf_fill_pattern(self, &op, 64, 32,
2397 static int __bpf_fill_jmp32_imm(struct bpf_test *self, int op)
2399 return __bpf_fill_pattern(self, &op, 64, 32,
2404 static int __bpf_fill_jmp_reg(struct bpf_test *self, int op)
2406 return __bpf_fill_pattern(self, &op, 64, 64,
2411 static int __bpf_fill_jmp32_reg(struct bpf_test *self, int op)
2413 return __bpf_fill_pattern(self, &op, 64, 64,
2419 static int bpf_fill_jmp_jset_imm(struct bpf_test *self)
2421 return __bpf_fill_jmp_imm(self, BPF_JSET);
2424 static int bpf_fill_jmp_jeq_imm(struct bpf_test *self)
2426 return __bpf_fill_jmp_imm(self, BPF_JEQ);
2429 static int bpf_fill_jmp_jne_imm(struct bpf_test *self)
2431 return __bpf_fill_jmp_imm(self, BPF_JNE);
2434 static int bpf_fill_jmp_jgt_imm(struct bpf_test *self)
2436 return __bpf_fill_jmp_imm(self, BPF_JGT);
2439 static int bpf_fill_jmp_jge_imm(struct bpf_test *self)
2441 return __bpf_fill_jmp_imm(self, BPF_JGE);
2444 static int bpf_fill_jmp_jlt_imm(struct bpf_test *self)
2446 return __bpf_fill_jmp_imm(self, BPF_JLT);
2449 static int bpf_fill_jmp_jle_imm(struct bpf_test *self)
2451 return __bpf_fill_jmp_imm(self, BPF_JLE);
2454 static int bpf_fill_jmp_jsgt_imm(struct bpf_test *self)
2456 return __bpf_fill_jmp_imm(self, BPF_JSGT);
2459 static int bpf_fill_jmp_jsge_imm(struct bpf_test *self)
2461 return __bpf_fill_jmp_imm(self, BPF_JSGE);
2464 static int bpf_fill_jmp_jslt_imm(struct bpf_test *self)
2466 return __bpf_fill_jmp_imm(self, BPF_JSLT);
2469 static int bpf_fill_jmp_jsle_imm(struct bpf_test *self)
2471 return __bpf_fill_jmp_imm(self, BPF_JSLE);
2475 static int bpf_fill_jmp32_jset_imm(struct bpf_test *self)
2477 return __bpf_fill_jmp32_imm(self, BPF_JSET);
2480 static int bpf_fill_jmp32_jeq_imm(struct bpf_test *self)
2482 return __bpf_fill_jmp32_imm(self, BPF_JEQ);
2485 static int bpf_fill_jmp32_jne_imm(struct bpf_test *self)
2487 return __bpf_fill_jmp32_imm(self, BPF_JNE);
2490 static int bpf_fill_jmp32_jgt_imm(struct bpf_test *self)
2492 return __bpf_fill_jmp32_imm(self, BPF_JGT);
2495 static int bpf_fill_jmp32_jge_imm(struct bpf_test *self)
2497 return __bpf_fill_jmp32_imm(self, BPF_JGE);
2500 static int bpf_fill_jmp32_jlt_imm(struct bpf_test *self)
2502 return __bpf_fill_jmp32_imm(self, BPF_JLT);
2505 static int bpf_fill_jmp32_jle_imm(struct bpf_test *self)
2507 return __bpf_fill_jmp32_imm(self, BPF_JLE);
2510 static int bpf_fill_jmp32_jsgt_imm(struct bpf_test *self)
2512 return __bpf_fill_jmp32_imm(self, BPF_JSGT);
2515 static int bpf_fill_jmp32_jsge_imm(struct bpf_test *self)
2517 return __bpf_fill_jmp32_imm(self, BPF_JSGE);
2520 static int bpf_fill_jmp32_jslt_imm(struct bpf_test *self)
2522 return __bpf_fill_jmp32_imm(self, BPF_JSLT);
2525 static int bpf_fill_jmp32_jsle_imm(struct bpf_test *self)
2527 return __bpf_fill_jmp32_imm(self, BPF_JSLE);
2531 static int bpf_fill_jmp_jset_reg(struct bpf_test *self)
2533 return __bpf_fill_jmp_reg(self, BPF_JSET);
2536 static int bpf_fill_jmp_jeq_reg(struct bpf_test *self)
2538 return __bpf_fill_jmp_reg(self, BPF_JEQ);
2541 static int bpf_fill_jmp_jne_reg(struct bpf_test *self)
2543 return __bpf_fill_jmp_reg(self, BPF_JNE);
2546 static int bpf_fill_jmp_jgt_reg(struct bpf_test *self)
2548 return __bpf_fill_jmp_reg(self, BPF_JGT);
2551 static int bpf_fill_jmp_jge_reg(struct bpf_test *self)
2553 return __bpf_fill_jmp_reg(self, BPF_JGE);
2556 static int bpf_fill_jmp_jlt_reg(struct bpf_test *self)
2558 return __bpf_fill_jmp_reg(self, BPF_JLT);
2561 static int bpf_fill_jmp_jle_reg(struct bpf_test *self)
2563 return __bpf_fill_jmp_reg(self, BPF_JLE);
2566 static int bpf_fill_jmp_jsgt_reg(struct bpf_test *self)
2568 return __bpf_fill_jmp_reg(self, BPF_JSGT);
2571 static int bpf_fill_jmp_jsge_reg(struct bpf_test *self)
2573 return __bpf_fill_jmp_reg(self, BPF_JSGE);
2576 static int bpf_fill_jmp_jslt_reg(struct bpf_test *self)
2578 return __bpf_fill_jmp_reg(self, BPF_JSLT);
2581 static int bpf_fill_jmp_jsle_reg(struct bpf_test *self)
2583 return __bpf_fill_jmp_reg(self, BPF_JSLE);
2587 static int bpf_fill_jmp32_jset_reg(struct bpf_test *self)
2589 return __bpf_fill_jmp32_reg(self, BPF_JSET);
2592 static int bpf_fill_jmp32_jeq_reg(struct bpf_test *self)
2594 return __bpf_fill_jmp32_reg(self, BPF_JEQ);
2597 static int bpf_fill_jmp32_jne_reg(struct bpf_test *self)
2599 return __bpf_fill_jmp32_reg(self, BPF_JNE);
2602 static int bpf_fill_jmp32_jgt_reg(struct bpf_test *self)
2604 return __bpf_fill_jmp32_reg(self, BPF_JGT);
2607 static int bpf_fill_jmp32_jge_reg(struct bpf_test *self)
2609 return __bpf_fill_jmp32_reg(self, BPF_JGE);
2612 static int bpf_fill_jmp32_jlt_reg(struct bpf_test *self)
2614 return __bpf_fill_jmp32_reg(self, BPF_JLT);
2617 static int bpf_fill_jmp32_jle_reg(struct bpf_test *self)
2619 return __bpf_fill_jmp32_reg(self, BPF_JLE);
2622 static int bpf_fill_jmp32_jsgt_reg(struct bpf_test *self)
2624 return __bpf_fill_jmp32_reg(self, BPF_JSGT);
2627 static int bpf_fill_jmp32_jsge_reg(struct bpf_test *self)
2629 return __bpf_fill_jmp32_reg(self, BPF_JSGE);
2632 static int bpf_fill_jmp32_jslt_reg(struct bpf_test *self)
2634 return __bpf_fill_jmp32_reg(self, BPF_JSLT);
2637 static int bpf_fill_jmp32_jsle_reg(struct bpf_test *self)
2639 return __bpf_fill_jmp32_reg(self, BPF_JSLE);
2698 static int __bpf_fill_staggered_jumps(struct bpf_test *self,
2702 int size = self->test[0].result - 1;
2736 self->u.ptr.insns = insns;
2737 self->u.ptr.len = len;
2743 static int bpf_fill_staggered_ja(struct bpf_test *self)
2747 return __bpf_fill_staggered_jumps(self, &jmp, 0, 0);
2751 static int bpf_fill_staggered_jeq_imm(struct bpf_test *self)
2755 return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
2758 static int bpf_fill_staggered_jne_imm(struct bpf_test *self)
2762 return __bpf_fill_staggered_jumps(self, &jmp, 4321, 0);
2765 static int bpf_fill_staggered_jset_imm(struct bpf_test *self)
2769 return __bpf_fill_staggered_jumps(self, &jmp, 0x86, 0);
2772 static int bpf_fill_staggered_jgt_imm(struct bpf_test *self)
2776 return __bpf_fill_staggered_jumps(self, &jmp, 0x80000000, 0);
2779 static int bpf_fill_staggered_jge_imm(struct bpf_test *self)
2783 return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
2786 static int bpf_fill_staggered_jlt_imm(struct bpf_test *self)
2790 return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
2793 static int bpf_fill_staggered_jle_imm(struct bpf_test *self)
2797 return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
2800 static int bpf_fill_staggered_jsgt_imm(struct bpf_test *self)
2804 return __bpf_fill_staggered_jumps(self, &jmp, -1, 0);
2807 static int bpf_fill_staggered_jsge_imm(struct bpf_test *self)
2811 return __bpf_fill_staggered_jumps(self, &jmp, -2, 0);
2814 static int bpf_fill_staggered_jslt_imm(struct bpf_test *self)
2818 return __bpf_fill_staggered_jumps(self, &jmp, -2, 0);
2821 static int bpf_fill_staggered_jsle_imm(struct bpf_test *self)
2825 return __bpf_fill_staggered_jumps(self, &jmp, -1, 0);
2829 static int bpf_fill_staggered_jeq_reg(struct bpf_test *self)
2833 return __bpf_fill_staggered_jumps(self, &jmp, 1234, 1234);
2836 static int bpf_fill_staggered_jne_reg(struct bpf_test *self)
2840 return __bpf_fill_staggered_jumps(self, &jmp, 4321, 1234);
2843 static int bpf_fill_staggered_jset_reg(struct bpf_test *self)
2847 return __bpf_fill_staggered_jumps(self, &jmp, 0x86, 0x82);
2850 static int bpf_fill_staggered_jgt_reg(struct bpf_test *self)
2854 return __bpf_fill_staggered_jumps(self, &jmp, 0x80000000, 1234);
2857 static int bpf_fill_staggered_jge_reg(struct bpf_test *self)
2861 return __bpf_fill_staggered_jumps(self, &jmp, 1234, 1234);
2864 static int bpf_fill_staggered_jlt_reg(struct bpf_test *self)
2868 return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0x80000000);
2871 static int bpf_fill_staggered_jle_reg(struct bpf_test *self)
2875 return __bpf_fill_staggered_jumps(self, &jmp, 1234, 1234);
2878 static int bpf_fill_staggered_jsgt_reg(struct bpf_test *self)
2882 return __bpf_fill_staggered_jumps(self, &jmp, -1, -2);
2885 static int bpf_fill_staggered_jsge_reg(struct bpf_test *self)
2889 return __bpf_fill_staggered_jumps(self, &jmp, -2, -2);
2892 static int bpf_fill_staggered_jslt_reg(struct bpf_test *self)
2896 return __bpf_fill_staggered_jumps(self, &jmp, -2, -1);
2899 static int bpf_fill_staggered_jsle_reg(struct bpf_test *self)
2903 return __bpf_fill_staggered_jumps(self, &jmp, -1, -1);
2907 static int bpf_fill_staggered_jeq32_imm(struct bpf_test *self)
2911 return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
2914 static int bpf_fill_staggered_jne32_imm(struct bpf_test *self)
2918 return __bpf_fill_staggered_jumps(self, &jmp, 4321, 0);
2921 static int bpf_fill_staggered_jset32_imm(struct bpf_test *self)
2925 return __bpf_fill_staggered_jumps(self, &jmp, 0x86, 0);
2928 static int bpf_fill_staggered_jgt32_imm(struct bpf_test *self)
2932 return __bpf_fill_staggered_jumps(self, &jmp, 0x80000000, 0);
2935 static int bpf_fill_staggered_jge32_imm(struct bpf_test *self)
2939 return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
2942 static int bpf_fill_staggered_jlt32_imm(struct bpf_test *self)
2946 return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
2949 static int bpf_fill_staggered_jle32_imm(struct bpf_test *self)
2953 return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
2956 static int bpf_fill_staggered_jsgt32_imm(struct bpf_test *self)
2960 return __bpf_fill_staggered_jumps(self, &jmp, -1, 0);
2963 static int bpf_fill_staggered_jsge32_imm(struct bpf_test *self)
2967 return __bpf_fill_staggered_jumps(self, &jmp, -2, 0);
2970 static int bpf_fill_staggered_jslt32_imm(struct bpf_test *self)
2974 return __bpf_fill_staggered_jumps(self, &jmp, -2, 0);
2977 static int bpf_fill_staggered_jsle32_imm(struct bpf_test *self)
2981 return __bpf_fill_staggered_jumps(self, &jmp, -1, 0);
2985 static int bpf_fill_staggered_jeq32_reg(struct bpf_test *self)
2989 return __bpf_fill_staggered_jumps(self, &jmp, 1234, 1234);
2992 static int bpf_fill_staggered_jne32_reg(struct bpf_test *self)
2996 return __bpf_fill_staggered_jumps(self, &jmp, 4321, 1234);
2999 static int bpf_fill_staggered_jset32_reg(struct bpf_test *self)
3003 return __bpf_fill_staggered_jumps(self, &jmp, 0x86, 0x82);
3006 static int bpf_fill_staggered_jgt32_reg(struct bpf_test *self)
3010 return __bpf_fill_staggered_jumps(self, &jmp, 0x80000000, 1234);
3013 static int bpf_fill_staggered_jge32_reg(struct bpf_test *self)
3017 return __bpf_fill_staggered_jumps(self, &jmp, 1234, 1234);
3020 static int bpf_fill_staggered_jlt32_reg(struct bpf_test *self)
3024 return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0x80000000);
3027 static int bpf_fill_staggered_jle32_reg(struct bpf_test *self)
3031 return __bpf_fill_staggered_jumps(self, &jmp, 1234, 1234);
3034 static int bpf_fill_staggered_jsgt32_reg(struct bpf_test *self)
3038 return __bpf_fill_staggered_jumps(self, &jmp, -1, -2);
3041 static int bpf_fill_staggered_jsge32_reg(struct bpf_test *self)
3045 return __bpf_fill_staggered_jumps(self, &jmp, -2, -2);
3048 static int bpf_fill_staggered_jslt32_reg(struct bpf_test *self)
3052 return __bpf_fill_staggered_jumps(self, &jmp, -2, -1);
3055 static int bpf_fill_staggered_jsle32_reg(struct bpf_test *self)
3059 return __bpf_fill_staggered_jumps(self, &jmp, -1, -1);