4 BPF_MOV64_IMM(BPF_REG_1, 1),
5 BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, 2),
6 BPF_MOV64_IMM(BPF_REG_2, 3),
7 BPF_ALU64_REG(BPF_SUB, BPF_REG_1, BPF_REG_2),
8 BPF_ALU64_IMM(BPF_ADD, BPF_REG_1, -1),
9 BPF_ALU64_IMM(BPF_MUL, BPF_REG_1, 3),
10 BPF_MOV64_REG(BPF_REG_0, BPF_REG_1),
17 "xor32 zero extend check",
19 BPF_MOV32_IMM(BPF_REG_2, -1),
20 BPF_ALU64_IMM(BPF_LSH, BPF_REG_2, 32),
21 BPF_ALU64_IMM(BPF_OR, BPF_REG_2, 0xffff),
22 BPF_ALU32_REG(BPF_XOR, BPF_REG_2, BPF_REG_2),
23 BPF_MOV32_IMM(BPF_REG_0, 2),
24 BPF_JMP_IMM(BPF_JNE, BPF_REG_2, 0, 1),
25 BPF_MOV32_IMM(BPF_REG_0, 1),
28 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
35 BPF_MOV64_IMM(BPF_REG_0, 1),
36 BPF_ALU32_IMM(BPF_ARSH, BPF_REG_0, 5),
45 BPF_LD_IMM64(BPF_REG_0, 0x1122334485667788),
46 BPF_ALU32_IMM(BPF_ARSH, BPF_REG_0, 7),
55 BPF_MOV64_IMM(BPF_REG_0, 1),
56 BPF_MOV64_IMM(BPF_REG_1, 5),
57 BPF_ALU32_REG(BPF_ARSH, BPF_REG_0, BPF_REG_1),
66 BPF_LD_IMM64(BPF_REG_0, 0xffff55667788),
67 BPF_MOV64_IMM(BPF_REG_1, 15),
68 BPF_ALU32_REG(BPF_ARSH, BPF_REG_0, BPF_REG_1),
77 BPF_MOV64_IMM(BPF_REG_0, 1),
78 BPF_ALU64_IMM(BPF_ARSH, BPF_REG_0, 5),
86 BPF_MOV64_IMM(BPF_REG_0, 1),
87 BPF_MOV64_IMM(BPF_REG_1, 5),
88 BPF_ALU64_REG(BPF_ARSH, BPF_REG_0, BPF_REG_1),
96 BPF_LD_IMM64(BPF_REG_0, 1),
97 BPF_LD_IMM64(BPF_REG_1, 1),
98 BPF_ALU64_IMM(BPF_LSH, BPF_REG_1, 0),
99 BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 1, 1),
100 BPF_MOV64_IMM(BPF_REG_0, 2),
109 BPF_LD_IMM64(BPF_REG_0, 1),
110 BPF_LD_IMM64(BPF_REG_1, 0x100000000LL),
111 BPF_ALU64_REG(BPF_MOV, BPF_REG_2, BPF_REG_1),
112 BPF_ALU64_IMM(BPF_RSH, BPF_REG_1, 0),
113 BPF_JMP_REG(BPF_JEQ, BPF_REG_1, BPF_REG_2, 1),
114 BPF_MOV64_IMM(BPF_REG_0, 2),
123 BPF_LD_IMM64(BPF_REG_0, 1),
124 BPF_LD_IMM64(BPF_REG_1, 0x100000000LL),
125 BPF_ALU64_REG(BPF_MOV, BPF_REG_2, BPF_REG_1),
126 BPF_ALU64_IMM(BPF_ARSH, BPF_REG_1, 0),
127 BPF_JMP_REG(BPF_JEQ, BPF_REG_1, BPF_REG_2, 1),
128 BPF_MOV64_IMM(BPF_REG_0, 2),
137 BPF_LD_IMM64(BPF_REG_0, 1),
138 BPF_LD_IMM64(BPF_REG_1, 1),
139 BPF_LD_IMM64(BPF_REG_2, 0),
140 BPF_ALU64_REG(BPF_LSH, BPF_REG_1, BPF_REG_2),
141 BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 1, 1),
142 BPF_MOV64_IMM(BPF_REG_0, 2),
151 BPF_LD_IMM64(BPF_REG_0, 1),
152 BPF_LD_IMM64(BPF_REG_1, 0x100000000LL),
153 BPF_ALU64_REG(BPF_MOV, BPF_REG_2, BPF_REG_1),
154 BPF_LD_IMM64(BPF_REG_3, 0),
155 BPF_ALU64_REG(BPF_RSH, BPF_REG_1, BPF_REG_3),
156 BPF_JMP_REG(BPF_JEQ, BPF_REG_1, BPF_REG_2, 1),
157 BPF_MOV64_IMM(BPF_REG_0, 2),
166 BPF_LD_IMM64(BPF_REG_0, 1),
167 BPF_LD_IMM64(BPF_REG_1, 0x100000000LL),
168 BPF_ALU64_REG(BPF_MOV, BPF_REG_2, BPF_REG_1),
169 BPF_LD_IMM64(BPF_REG_3, 0),
170 BPF_ALU64_REG(BPF_ARSH, BPF_REG_1, BPF_REG_3),
171 BPF_JMP_REG(BPF_JEQ, BPF_REG_1, BPF_REG_2, 1),
172 BPF_MOV64_IMM(BPF_REG_0, 2),
179 "invalid 64-bit BPF_END with BPF_TO_BE",
181 BPF_MOV32_IMM(BPF_REG_0, 0),
183 .code = BPF_ALU64 | BPF_END | BPF_TO_BE,
184 .dst_reg = BPF_REG_0,
191 .errstr = "unknown opcode df",
197 BPF_MOV64_IMM(BPF_REG_2, 0),
198 BPF_MOV64_REG(BPF_REG_2, BPF_REG_2),
199 // Check bounds are OK
200 BPF_ALU64_REG(BPF_ADD, BPF_REG_1, BPF_REG_2),
201 BPF_MOV64_IMM(BPF_REG_0, 0),
204 .prog_type = BPF_PROG_TYPE_SCHED_CLS,
210 BPF_MOV64_IMM(BPF_REG_3, 0),
211 BPF_MOV64_REG(BPF_REG_2, BPF_REG_3),
212 // Check bounds are OK
213 BPF_ALU64_REG(BPF_ADD, BPF_REG_1, BPF_REG_2),
214 BPF_MOV64_IMM(BPF_REG_0, 0),
217 .prog_type = BPF_PROG_TYPE_SCHED_CLS,