AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/10/13 22:49 flow patch-triage
4m Args:
null

Results:
{
  "EnableConfigs": [
    "BPF_JIT",
    "BPF_SYSCALL"
  ],
  "FocusSymbols": [
    "bpf_int_jit_compile",
    "do_jit",
    "emit_div_const",
    "bpf_magic_udiv",
    "bpf_magic_sdiv",
    "adjust_cmp_imm",
    "arch_prepare_bpf_trampoline"
  ],
  "KMSANReasoning": "The patch series makes two main categories of changes:\n1. It deletes the legacy in-kernel BPF test module (`lib/test_bpf.c`) and associated symbols/config options, replacing them with user-space BPF selftests (`tools/testing/selftests/bpf/prog_tests/jit_insns.c`).\n2. It optimizes code generation in the x86-64 BPF JIT compiler (`arch/x86/net/bpf_jit_comp.c`), including strength reduction of 64-bit constant division and modulo operations into multiplications by magic numbers, zero-displacement ModR/M and SIB optimizations, peephole optimizations for ALU operations and comparisons, and helper refactoring for stack depth adjustments.\n\nThese modifications do not introduce or touch any kernel structures copied to user space, netlink skb attributes, ioctls, or socket options. No kernel memory allocations or initialization paths are altered in ways that could cause uninitialized heap/stack memory to be read or leaked. Potential bugs in BPF JIT emission would consist of incorrect native machine code generation, register clobbering, invalid jumps, or out-of-bounds memory accesses—issues that are caught by hardware traps, standard bug detectors, or KASAN. Therefore, there is no risk of uninitialized memory use or info-leak that would necessitate a dedicated KMSAN fuzzing session.",
  "NeedsKMSAN": false,
  "Reasoning": "The patch series introduces major optimizations and instruction encoding rewrites in the x86-64 BPF JIT compiler (arch/x86/net/bpf_jit_comp.c). Specifically, it adds constant division and modulo strength-reduction using magic multipliers (Hacker's Delight algorithms), comparison immediate adjustment, rewritten instruction suffix encodings, user address casting sequences, probe memory checks, and ALU immediate fast-paths. This code executes on amd64 when compiling eBPF programs via the bpf() syscall or socket filters, making it highly relevant and valuable for fuzzing to detect JIT encoding defects or arithmetic bugs.",
  "WorthFuzzing": true
}

1/1 2026/10/13 22:49 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit 84bac3838b12fe759c77e84095010fd4940a7bfb\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Tue Oct 13 22:49:47 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/Documentation/bpf/bpf_devel_QA.rst b/Documentation/bpf/bpf_devel_QA.rst\nindex edf8107a7beba..4729efd657c33 100644\n--- a/Documentation/bpf/bpf_devel_QA.rst\n+++ b/Documentation/bpf/bpf_devel_QA.rst\n@@ -374,9 +374,10 @@ developers in order to get the feature implemented in a timely manner.\n Please refer to the git log (``arch/*/net/``) to locate the necessary\n people for helping out.\n \n-Also always make sure to add BPF test cases (e.g. test_bpf.c and\n-test_verifier.c) for new instructions, so that they can receive\n-broad test coverage and help run-time testing the various BPF JITs.\n+Also always make sure to add BPF test cases (e.g. the jit_insns test\n+in test_progs and test_verifier.c) for new instructions, so that they\n+can receive broad test coverage and help run-time testing the various\n+BPF JITs.\n \n In case of new BPF instructions, once the changes have been accepted\n into the Linux kernel, please implement support into LLVM's BPF back\n@@ -514,10 +515,11 @@ A: If you run a kernel ``xyz``, then always run the BPF kernel selftests\n from that kernel ``xyz`` as well. Do not expect that the BPF selftest\n from the latest mainline tree will pass all the time.\n \n-In particular, test_bpf.c and test_verifier.c have a large number of\n-test cases and are constantly updated with new BPF test sequences, or\n-existing ones are adapted to verifier changes e.g. due to verifier\n-becoming smarter and being able to better track certain things.\n+In particular, test_verifier.c and the instruction tests in test_progs\n+have a large number of test cases and are constantly updated with new\n+BPF test sequences, or existing ones are adapted to verifier changes\n+e.g. due to verifier becoming smarter and being able to better track\n+certain things.\n \n LLVM\n ====\ndiff --git a/Documentation/networking/filter.rst b/Documentation/networking/filter.rst\nindex 8eb9a5d40f31b..e0b9dc14a9bf2 100644\n--- a/Documentation/networking/filter.rst\n+++ b/Documentation/networking/filter.rst\n@@ -656,16 +656,11 @@ from eBPF instruction set.\n Testing\n -------\n \n-Next to the BPF toolchain, the kernel also ships a test module that contains\n-various test cases for classic and eBPF that can be executed against\n-the BPF interpreter and JIT compiler. It can be found in lib/test_bpf.c and\n-enabled via Kconfig::\n-\n-  CONFIG_TEST_BPF=m\n-\n-After the module has been built and installed, the test suite can be executed\n-via insmod or modprobe against 'test_bpf' module. Results of the test cases\n-including timings in nsec can be found in the kernel log (dmesg).\n+Next to the BPF toolchain, the BPF selftests under tools/testing/selftests/bpf\n+ship instruction tests in test_progs, see jit_insns, which runs the eBPF\n+instructions over a range of operand magnitudes and signs, register\n+combinations, memory offsets and jump offsets against the BPF interpreter\n+or the JIT compiler, depending on the net.core.bpf_jit_enable setting.\n \n Misc\n ----\ndiff --git a/MAINTAINERS b/MAINTAINERS\nindex fe99b7437a2dc..80845ba7dfb56 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -4981,7 +4981,6 @@ F:\tinclude/uapi/linux/filter.h\n F:\tkernel/bpf/\n F:\tkernel/trace/bpf_trace.c\n F:\tlib/buildid.c\n-F:\tlib/test_bpf.c\n F:\tnet/bpf/\n F:\tnet/core/filter.c\n F:\tnet/sched/act_bpf.c\ndiff --git a/arch/m68k/configs/amiga_defconfig b/arch/m68k/configs/amiga_defconfig\nindex 8b7efe20dd128..0efd78d64a901 100644\n--- a/arch/m68k/configs/amiga_defconfig\n+++ b/arch/m68k/configs/amiga_defconfig\n@@ -576,7 +576,6 @@ CONFIG_TEST_IDA=m\n CONFIG_TEST_BITOPS=m\n CONFIG_TEST_VMALLOC=m\n CONFIG_TEST_WORKQUEUE=m\n-CONFIG_TEST_BPF=m\n CONFIG_FIND_BIT_BENCHMARK=m\n CONFIG_TEST_FIRMWARE=m\n CONFIG_TEST_SYSCTL=m\ndiff --git a/arch/m68k/configs/apollo_defconfig b/arch/m68k/configs/apollo_defconfig\nindex c7f7705806f97..35b54dc7e79c7 100644\n--- a/arch/m68k/configs/apollo_defconfig\n+++ b/arch/m68k/configs/apollo_defconfig\n@@ -531,7 +531,6 @@ CONFIG_TEST_IDA=m\n CONFIG_TEST_BITOPS=m\n CONFIG_TEST_VMALLOC=m\n CONFIG_TEST_WORKQUEUE=m\n-CONFIG_TEST_BPF=m\n CONFIG_FIND_BIT_BENCHMARK=m\n CONFIG_TEST_FIRMWARE=m\n CONFIG_TEST_SYSCTL=m\ndiff --git a/arch/m68k/configs/atari_defconfig b/arch/m68k/configs/atari_defconfig\nindex 2fb213161baec..265588b71b820 100644\n--- a/arch/m68k/configs/atari_defconfig\n+++ b/arch/m68k/configs/atari_defconfig\n@@ -554,7 +554,6 @@ CONFIG_TEST_IDA=m\n CONFIG_TEST_BITOPS=m\n CONFIG_TEST_VMALLOC=m\n CONFIG_TEST_WORKQUEUE=m\n-CONFIG_TEST_BPF=m\n CONFIG_FIND_BIT_BENCHMARK=m\n CONFIG_TEST_FIRMWARE=m\n CONFIG_TEST_SYSCTL=m\ndiff --git a/arch/m68k/configs/bvme6000_defconfig b/arch/m68k/configs/bvme6000_defconfig\nindex 6730242d4d486..595601e229718 100644\n--- a/arch/m68k/configs/bvme6000_defconfig\n+++ b/arch/m68k/configs/bvme6000_defconfig\n@@ -523,7 +523,6 @@ CONFIG_TEST_IDA=m\n CONFIG_TEST_BITOPS=m\n CONFIG_TEST_VMALLOC=m\n CONFIG_TEST_WORKQUEUE=m\n-CONFIG_TEST_BPF=m\n CONFIG_FIND_BIT_BENCHMARK=m\n CONFIG_TEST_FIRMWARE=m\n CONFIG_TEST_SYSCTL=m\ndiff --git a/arch/m68k/configs/hp300_defconfig b/arch/m68k/configs/hp300_defconfig\nindex 2b3ff26ac8fdf..568d80e3db22d 100644\n--- a/arch/m68k/configs/hp300_defconfig\n+++ b/arch/m68k/configs/hp300_defconfig\n@@ -533,7 +533,6 @@ CONFIG_TEST_IDA=m\n CONFIG_TEST_BITOPS=m\n CONFIG_TEST_VMALLOC=m\n CONFIG_TEST_WORKQUEUE=m\n-CONFIG_TEST_BPF=m\n CONFIG_FIND_BIT_BENCHMARK=m\n CONFIG_TEST_FIRMWARE=m\n CONFIG_TEST_SYSCTL=m\ndiff --git a/arch/m68k/configs/mac_defconfig b/arch/m68k/configs/mac_defconfig\nindex 61f32ef2547e0..da1f4677aa6d3 100644\n--- a/arch/m68k/configs/mac_defconfig\n+++ b/arch/m68k/configs/mac_defconfig\n@@ -552,7 +552,6 @@ CONFIG_TEST_IDA=m\n CONFIG_TEST_BITOPS=m\n CONFIG_TEST_VMALLOC=m\n CONFIG_TEST_WORKQUEUE=m\n-CONFIG_TEST_BPF=m\n CONFIG_FIND_BIT_BENCHMARK=m\n CONFIG_TEST_FIRMWARE=m\n CONFIG_TEST_SYSCTL=m\ndiff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig\nindex 2cbd6bf20a687..8e6466c514847 100644\n--- a/arch/m68k/configs/multi_defconfig\n+++ b/arch/m68k/configs/multi_defconfig\n@@ -639,7 +639,6 @@ CONFIG_TEST_IDA=m\n CONFIG_TEST_BITOPS=m\n CONFIG_TEST_VMALLOC=m\n CONFIG_TEST_WORKQUEUE=m\n-CONFIG_TEST_BPF=m\n CONFIG_FIND_BIT_BENCHMARK=m\n CONFIG_TEST_FIRMWARE=m\n CONFIG_TEST_SYSCTL=m\ndiff --git a/arch/m68k/configs/mvme147_defconfig b/arch/m68k/configs/mvme147_defconfig\nindex 019f8b8070be8..8e7882354e530 100644\n--- a/arch/m68k/configs/mvme147_defconfig\n+++ b/arch/m68k/configs/mvme147_defconfig\n@@ -523,7 +523,6 @@ CONFIG_TEST_IDA=m\n CONFIG_TEST_BITOPS=m\n CONFIG_TEST_VMALLOC=m\n CONFIG_TEST_WORKQUEUE=m\n-CONFIG_TEST_BPF=m\n CONFIG_FIND_BIT_BENCHMARK=m\n CONFIG_TEST_FIRMWARE=m\n CONFIG_TEST_SYSCTL=m\ndiff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig\nindex 3891632874258..d3e7049c2e433 100644\n--- a/arch/m68k/configs/mvme16x_defconfig\n+++ b/arch/m68k/configs/mvme16x_defconfig\n@@ -524,7 +524,6 @@ CONFIG_TEST_IDA=m\n CONFIG_TEST_BITOPS=m\n CONFIG_TEST_VMALLOC=m\n CONFIG_TEST_WORKQUEUE=m\n-CONFIG_TEST_BPF=m\n CONFIG_FIND_BIT_BENCHMARK=m\n CONFIG_TEST_FIRMWARE=m\n CONFIG_TEST_SYSCTL=m\ndiff --git a/arch/m68k/configs/q40_defconfig b/arch/m68k/configs/q40_defconfig\nindex cbc41443cffa6..c517c32dbdc7c 100644\n--- a/arch/m68k/configs/q40_defconfig\n+++ b/arch/m68k/configs/q40_defconfig\n@@ -542,7 +542,6 @@ CONFIG_TEST_IDA=m\n CONFIG_TEST_BITOPS=m\n CONFIG_TEST_VMALLOC=m\n CONFIG_TEST_WORKQUEUE=m\n-CONFIG_TEST_BPF=m\n CONFIG_FIND_BIT_BENCHMARK=m\n CONFIG_TEST_FIRMWARE=m\n CONFIG_TEST_SYSCTL=m\ndiff --git a/arch/m68k/configs/sun3_defconfig b/arch/m68k/configs/sun3_defconfig\nindex 273e840dc8d6a..924f5f05906fb 100644\n--- a/arch/m68k/configs/sun3_defconfig\n+++ b/arch/m68k/configs/sun3_defconfig\n@@ -520,7 +520,6 @@ CONFIG_TEST_IDA=m\n CONFIG_TEST_BITOPS=m\n CONFIG_TEST_VMALLOC=m\n CONFIG_TEST_WORKQUEUE=m\n-CONFIG_TEST_BPF=m\n CONFIG_FIND_BIT_BENCHMARK=m\n CONFIG_TEST_FIRMWARE=m\n CONFIG_TEST_SYSCTL=m\ndiff --git a/arch/m68k/configs/sun3x_defconfig b/arch/m68k/configs/sun3x_defconfig\nindex 843d72924bcb2..f63c6392d92ed 100644\n--- a/arch/m68k/configs/sun3x_defconfig\n+++ b/arch/m68k/configs/sun3x_defconfig\n@@ -521,7 +521,6 @@ CONFIG_TEST_IDA=m\n CONFIG_TEST_BITOPS=m\n CONFIG_TEST_VMALLOC=m\n CONFIG_TEST_WORKQUEUE=m\n-CONFIG_TEST_BPF=m\n CONFIG_FIND_BIT_BENCHMARK=m\n CONFIG_TEST_FIRMWARE=m\n CONFIG_TEST_SYSCTL=m\ndiff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig\nindex 1eb8e3457e8bf..e0b7901add11b 100644\n--- a/arch/powerpc/configs/ppc64_defconfig\n+++ b/arch/powerpc/configs/ppc64_defconfig\n@@ -442,7 +442,6 @@ CONFIG_TEST_IDA=m\n CONFIG_TEST_BITOPS=m\n CONFIG_TEST_VMALLOC=m\n CONFIG_TEST_USER_COPY=m\n-CONFIG_TEST_BPF=m\n CONFIG_TEST_BLACKHOLE_DEV=m\n CONFIG_FIND_BIT_BENCHMARK=m\n CONFIG_TEST_FIRMWARE=m\ndiff --git a/arch/s390/configs/debug_defconfig b/arch/s390/configs/debug_defconfig\nindex 3dae714743330..d597b4b532a34 100644\n--- a/arch/s390/configs/debug_defconfig\n+++ b/arch/s390/configs/debug_defconfig\n@@ -927,6 +927,5 @@ CONFIG_INTERVAL_TREE_TEST=m\n CONFIG_PERCPU_TEST=m\n CONFIG_ATOMIC64_SELFTEST=y\n CONFIG_TEST_BITOPS=m\n-CONFIG_TEST_BPF=m\n CONFIG_PAGE_TABLE_CHECK=y\n CONFIG_PAGE_TABLE_CHECK_ENFORCED=y\ndiff --git a/arch/s390/configs/defconfig b/arch/s390/configs/defconfig\nindex 6f5722634b4d3..c417b1717e895 100644\n--- a/arch/s390/configs/defconfig\n+++ b/arch/s390/configs/defconfig\n@@ -851,4 +851,3 @@ CONFIG_LKDTM=m\n CONFIG_KPROBES_SANITY_TEST=m\n CONFIG_PERCPU_TEST=m\n CONFIG_ATOMIC64_SELFTEST=y\n-CONFIG_TEST_BPF=m\ndiff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c\nindex 083fcd6cf15b7..3975a94ac812d 100644\n--- a/arch/x86/net/bpf_jit_comp.c\n+++ b/arch/x86/net/bpf_jit_comp.c\n@@ -421,7 +421,7 @@ static void pop_callee_regs(u8 **pprog, bool *callee_regs_used)\n }\n \n /* add rsp, depth */\n-static void emit_add_rsp(u8 **pprog, u16 depth)\n+static void emit_add_rsp(u8 **pprog, u32 depth)\n {\n \tu8 *prog = *pprog;\n \n@@ -435,7 +435,7 @@ static void emit_add_rsp(u8 **pprog, u16 depth)\n }\n \n /* sub rsp, depth */\n-static void emit_sub_rsp(u8 **pprog, u16 depth)\n+static void emit_sub_rsp(u8 **pprog, u32 depth)\n {\n \tu8 *prog = *pprog;\n \n@@ -472,6 +472,9 @@ static void emit_nops(u8 **pprog, int len)\n  * in arch/x86/kernel/alternative.c\n  */\n static int emit_call(u8 **prog, void *func, void *ip);\n+static void emit_ldx(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, int off);\n+static void emit_mov_reg(u8 **pprog, bool is64, u32 dst_reg, u32 src_reg);\n+static void emit_alu_imm(u8 **pprog, u32 op, u32 dst_reg, s32 imm, bool is64);\n \n static void emit_fineibt(u8 **pprog, u8 *ip, u32 hash, int arity)\n {\n@@ -607,8 +610,7 @@ static void emit_prologue(u8 **pprog, u8 *ip, u32 stack_depth, bool ebpf_from_cb\n \tEMIT_ENDBR();\n \n \t/* sub rsp, rounded_stack_depth */\n-\tif (stack_depth)\n-\t\tEMIT3_off32(0x48, 0x81, 0xEC, round_up(stack_depth, 8));\n+\temit_sub_rsp(\u0026prog, round_up(stack_depth, 8));\n \tif (tail_call_reachable)\n \t\temit_prologue_tail_call(\u0026prog, is_subprog);\n \t*pprog = prog;\n@@ -840,7 +842,7 @@ static void emit_bpf_tail_call_indirect(struct bpf_prog *bpf_prog,\n \t * if (index \u003e= array-\u003emap.max_entries)\n \t *\tgoto out;\n \t */\n-\tEMIT2(0x89, 0xD2);                        /* mov edx, edx */\n+\temit_mov_reg(\u0026prog, false, BPF_REG_3, BPF_REG_3); /* mov edx, edx */\n \tEMIT3(0x39, 0x56,                         /* cmp dword ptr [rsi + 16], edx */\n \t      offsetof(struct bpf_array, map.max_entries));\n \n@@ -851,7 +853,8 @@ static void emit_bpf_tail_call_indirect(struct bpf_prog *bpf_prog,\n \t * if ((*tcc_ptr)++ \u003e= MAX_TAIL_CALL_CNT)\n \t *\tgoto out;\n \t */\n-\tEMIT3_off32(0x48, 0x8B, 0x85, tcc_ptr_off); /* mov rax, qword ptr [rbp - tcc_ptr_off] */\n+\t/* mov rax, qword ptr [rbp - tcc_ptr_off] */\n+\temit_ldx(\u0026prog, BPF_DW, BPF_REG_0, BPF_REG_FP, tcc_ptr_off);\n \tEMIT4(0x48, 0x83, 0x38, MAX_TAIL_CALL_CNT); /* cmp qword ptr [rax], MAX_TAIL_CALL_CNT */\n \n \toffset = ctx-\u003etail_call_indirect_label - (prog + 2 - start);\n@@ -888,15 +891,13 @@ static void emit_bpf_tail_call_indirect(struct bpf_prog *bpf_prog,\n \t * Pop tail_call_cnt_ptr, if it's subprog.\n \t */\n \tEMIT1(0x58);                              /* pop rax */\n-\tif (stack_depth)\n-\t\tEMIT3_off32(0x48, 0x81, 0xC4,     /* add rsp, sd */\n-\t\t\t    round_up(stack_depth, 8));\n+\temit_add_rsp(\u0026prog, round_up(stack_depth, 8)); /* add rsp, sd */\n \n \t/* goto *(prog-\u003ebpf_func + X86_TAIL_CALL_OFFSET); */\n \tEMIT4(0x48, 0x8B, 0x49,                   /* mov rcx, qword ptr [rcx + 32] */\n \t      offsetof(struct bpf_prog, bpf_func));\n-\tEMIT4(0x48, 0x83, 0xC1,                   /* add rcx, X86_TAIL_CALL_OFFSET */\n-\t      X86_TAIL_CALL_OFFSET);\n+\t/* add rcx, X86_TAIL_CALL_OFFSET */\n+\temit_alu_imm(\u0026prog, BPF_ADD, BPF_REG_4, X86_TAIL_CALL_OFFSET, true);\n \t/*\n \t * Now we're ready to jump into next BPF program\n \t * rdi == ctx (1st arg)\n@@ -923,7 +924,8 @@ static void emit_bpf_tail_call_direct(struct bpf_prog *bpf_prog,\n \t * if ((*tcc_ptr)++ \u003e= MAX_TAIL_CALL_CNT)\n \t *\tgoto out;\n \t */\n-\tEMIT3_off32(0x48, 0x8B, 0x85, tcc_ptr_off);   /* mov rax, qword ptr [rbp - tcc_ptr_off] */\n+\t/* mov rax, qword ptr [rbp - tcc_ptr_off] */\n+\temit_ldx(\u0026prog, BPF_DW, BPF_REG_0, BPF_REG_FP, tcc_ptr_off);\n \tEMIT4(0x48, 0x83, 0x38, MAX_TAIL_CALL_CNT);   /* cmp qword ptr [rax], MAX_TAIL_CALL_CNT */\n \n \toffset = ctx-\u003etail_call_direct_label - (prog + 2 - start);\n@@ -955,8 +957,7 @@ static void emit_bpf_tail_call_direct(struct bpf_prog *bpf_prog,\n \t * Pop tail_call_cnt_ptr, if it's subprog.\n \t */\n \tEMIT1(0x58);                                  /* pop rax */\n-\tif (stack_depth)\n-\t\tEMIT3_off32(0x48, 0x81, 0xC4, round_up(stack_depth, 8));\n+\temit_add_rsp(\u0026prog, round_up(stack_depth, 8));\n \n \temit_nops(\u0026prog, X86_PATCH_SIZE);\n \n@@ -1106,8 +1107,9 @@ static void emit_movsx_reg(u8 **pprog, int num_bits, bool is64, u32 dst_reg,\n \t} else {\n \t\t/* movs[b,w]l dst, src */\n \t\tif (num_bits == 8) {\n-\t\t\tEMIT4(add_2mod(0x40, src_reg, dst_reg), 0x0f, 0xbe,\n-\t\t\t      add_2reg(0xC0, src_reg, dst_reg));\n+\t\t\tif (is_ereg(dst_reg) || is_ereg_8l(src_reg))\n+\t\t\t\tEMIT1(add_2mod(0x40, src_reg, dst_reg));\n+\t\t\tEMIT3(0x0f, 0xbe, add_2reg(0xC0, src_reg, dst_reg));\n \t\t} else if (num_bits == 16) {\n \t\t\tif (is_ereg(dst_reg) || is_ereg(src_reg))\n \t\t\t\tEMIT1(add_2mod(0x40, src_reg, dst_reg));\n@@ -1119,18 +1121,40 @@ static void emit_movsx_reg(u8 **pprog, int num_bits, bool is64, u32 dst_reg,\n \t*pprog = prog;\n }\n \n+/*\n+ * rbp and r13 as base register always need a displacement, since mod 00\n+ * with r/m 101 encodes a RIP-relative disp32 and with SIB base 101 a\n+ * disp32 without base instead.\n+ */\n+static bool base_needs_disp(u32 reg)\n+{\n+\treturn reg2hex[reg] == 5;\n+}\n+\n+static void emit_movzx_reg(u8 **pprog, int num_bits, u32 dst_reg, u32 src_reg)\n+{\n+\tu8 *prog = *pprog;\n+\n+\t/* movz[b,w]l dst, src */\n+\tif (is_ereg(dst_reg) ||\n+\t    (num_bits == 8 ? is_ereg_8l(src_reg) : is_ereg(src_reg)))\n+\t\tEMIT1(add_2mod(0x40, src_reg, dst_reg));\n+\tEMIT3(0x0F, num_bits == 8 ? 0xB6 : 0xB7,\n+\t      add_2reg(0xC0, src_reg, dst_reg));\n+\n+\t*pprog = prog;\n+}\n+\n /* Emit the suffix (ModR/M etc) for addressing *(ptr_reg + off) and val_reg */\n static void emit_insn_suffix(u8 **pprog, u32 ptr_reg, u32 val_reg, int off)\n {\n \tu8 *prog = *pprog;\n \n-\tif (is_imm8(off)) {\n-\t\t/* 1-byte signed displacement.\n-\t\t *\n-\t\t * If off == 0 we could skip this and save one extra byte, but\n-\t\t * special case of x86 R13 which always needs an offset is not\n-\t\t * worth the hassle\n-\t\t */\n+\tif (!off \u0026\u0026 !base_needs_disp(ptr_reg)) {\n+\t\t/* No displacement */\n+\t\tEMIT1(add_2reg(0x00, ptr_reg, val_reg));\n+\t} else if (is_imm8(off)) {\n+\t\t/* 1-byte signed displacement */\n \t\tEMIT2(add_2reg(0x40, ptr_reg, val_reg), off);\n \t} else {\n \t\t/* 4-byte signed displacement */\n@@ -1139,14 +1163,22 @@ static void emit_insn_suffix(u8 **pprog, u32 ptr_reg, u32 val_reg, int off)\n \t*pprog = prog;\n }\n \n-static void emit_insn_suffix_SIB(u8 **pprog, u32 ptr_reg, u32 val_reg, u32 index_reg, int off)\n+/*\n+ * Emit the suffix for addressing *(ptr_reg + (index_reg \u003c\u003c scale) + off)\n+ * and val_reg, with a SIB byte\n+ */\n+static void emit_insn_suffix_SIB(u8 **pprog, u32 ptr_reg, u32 val_reg, u32 index_reg, int off,\n+\t\t\t\t u8 scale)\n {\n+\tu8 sib = (scale \u003c\u003c 6) | add_2reg(0, ptr_reg, index_reg);\n \tu8 *prog = *pprog;\n \n-\tif (is_imm8(off)) {\n-\t\tEMIT3(add_2reg(0x44, BPF_REG_0, val_reg), add_2reg(0, ptr_reg, index_reg) /* SIB */, off);\n+\tif (!off \u0026\u0026 !base_needs_disp(ptr_reg)) {\n+\t\tEMIT2(add_2reg(0x04, BPF_REG_0, val_reg), sib);\n+\t} else if (is_imm8(off)) {\n+\t\tEMIT3(add_2reg(0x44, BPF_REG_0, val_reg), sib, off);\n \t} else {\n-\t\tEMIT2_off32(add_2reg(0x84, BPF_REG_0, val_reg), add_2reg(0, ptr_reg, index_reg) /* SIB */, off);\n+\t\tEMIT2_off32(add_2reg(0x84, BPF_REG_0, val_reg), sib, off);\n \t}\n \t*pprog = prog;\n }\n@@ -1179,6 +1211,85 @@ static void maybe_emit_1mod(u8 **pprog, u32 reg, bool is64)\n \t*pprog = prog;\n }\n \n+/* add/sub/and/or/xor dst_reg, imm with the imm8 and the rax short forms */\n+static void emit_alu_imm(u8 **pprog, u32 op, u32 dst_reg, s32 imm, bool is64)\n+{\n+\t/* ModR/M opcode extension and rax short form per operation */\n+\tstatic const u8 modrm[] = {\n+\t\t[BPF_ADD] = 0xC0, [BPF_SUB] = 0xE8, [BPF_AND] = 0xE0,\n+\t\t[BPF_OR] = 0xC8, [BPF_XOR] = 0xF0,\n+\t};\n+\tstatic const u8 short_op[] = {\n+\t\t[BPF_ADD] = 0x05, [BPF_SUB] = 0x2D, [BPF_AND] = 0x25,\n+\t\t[BPF_OR] = 0x0D, [BPF_XOR] = 0x35,\n+\t};\n+\tu8 *prog = *pprog;\n+\tbool inc;\n+\n+\t/* A non-negative mask clears the upper half like the 32-bit and does */\n+\tif (op == BPF_AND \u0026\u0026 imm \u003e= 0)\n+\t\tis64 = false;\n+\t/* add 128 is sub -128 and the other way round, which fit into an imm8 */\n+\tif ((op == BPF_ADD || op == BPF_SUB) \u0026\u0026 imm == 128) {\n+\t\top = op == BPF_ADD ? BPF_SUB : BPF_ADD;\n+\t\timm = -128;\n+\t}\n+\tinc = op == BPF_ADD ? imm == 1 : imm == -1;\n+\tmaybe_emit_1mod(\u0026prog, dst_reg, is64);\n+\t/* inc or dec for +-1, the flags are not read across instructions */\n+\tif ((op == BPF_ADD || op == BPF_SUB) \u0026\u0026 (imm == 1 || imm == -1))\n+\t\tEMIT2(0xFF, add_1reg(inc ? 0xC0 : 0xC8, dst_reg));\n+\telse if (is_imm8(imm))\n+\t\tEMIT3(0x83, add_1reg(modrm[op], dst_reg), imm);\n+\telse if (is_axreg(dst_reg))\n+\t\tEMIT1_off32(short_op[op], imm);\n+\telse\n+\t\tEMIT2_off32(0x81, add_1reg(modrm[op], dst_reg), imm);\n+\n+\t*pprog = prog;\n+}\n+\n+/* add/sub/and/or/xor dst_reg, src_reg */\n+static void emit_alu_reg(u8 **pprog, u32 op, u32 dst_reg, u32 src_reg, bool is64)\n+{\n+\tu8 *prog = *pprog;\n+\n+\tmaybe_emit_mod(\u0026prog, dst_reg, src_reg, is64);\n+\tEMIT2(simple_alu_opcodes[op], add_2reg(0xC0, dst_reg, src_reg));\n+\n+\t*pprog = prog;\n+}\n+\n+/* shl/shr/sar reg, imm */\n+static void emit_shift_imm(u8 **pprog, u32 op, u32 reg, u8 imm, bool is64)\n+{\n+\tu8 *prog = *pprog;\n+\n+\t/* The shift left by one is an add of the register to itself */\n+\tif (op == BPF_LSH \u0026\u0026 imm == 1) {\n+\t\temit_alu_reg(\u0026prog, BPF_ADD, reg, reg, is64);\n+\t} else {\n+\t\tmaybe_emit_1mod(\u0026prog, reg, is64);\n+\t\tif (imm == 1)\n+\t\t\tEMIT2(0xD1, add_1reg(simple_alu_opcodes[op], reg));\n+\t\telse\n+\t\t\tEMIT3(0xC1, add_1reg(simple_alu_opcodes[op], reg), imm);\n+\t}\n+\n+\t*pprog = prog;\n+}\n+\n+/* neg dst_reg */\n+static void emit_neg(u8 **pprog, u32 dst_reg, bool is64)\n+{\n+\tu8 *prog = *pprog;\n+\n+\tmaybe_emit_1mod(\u0026prog, dst_reg, is64);\n+\tEMIT2(0xF7, add_1reg(0xD8, dst_reg));\n+\n+\t*pprog = prog;\n+}\n+\n static int emit_kasan_check(struct bpf_verifier_env *env, u8 **pprog,\n \t\t\t    u32 addr_reg, s32 off, u32 bpf_size, u8 *ip,\n \t\t\t    bool is_write)\n@@ -1233,15 +1344,8 @@ static int emit_kasan_check(struct bpf_verifier_env *env, u8 **pprog,\n \tEMIT_mov(BPF_REG_1, addr_reg);\n \n \t/* add rdi, off (if offset is non-zero) */\n-\tif (off) {\n-\t\tif (is_imm8(off)) {\n-\t\t\t/* add rdi, imm8 */\n-\t\t\tEMIT4(0x48, 0x83, 0xC7, (u8)off);\n-\t\t} else {\n-\t\t\t/* add rdi, imm32 */\n-\t\t\tEMIT3_off32(0x48, 0x81, 0xC7, off);\n-\t\t}\n-\t}\n+\tif (off)\n+\t\temit_alu_imm(\u0026prog, BPF_ADD, BPF_REG_1, off, true);\n \n \t/* Adjust ip to account for the instrumentation generated so far */\n \tip += (prog - *pprog);\n@@ -1273,12 +1377,16 @@ static void emit_ldx(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, int off)\n \n \tswitch (size) {\n \tcase BPF_B:\n-\t\t/* Emit 'movzx rax, byte ptr [rax + off]' */\n-\t\tEMIT3(add_2mod(0x48, src_reg, dst_reg), 0x0F, 0xB6);\n+\t\t/* Emit 'movzx eax, byte ptr [rax + off]' */\n+\t\tif (is_ereg(dst_reg) || is_ereg(src_reg))\n+\t\t\tEMIT1(add_2mod(0x40, src_reg, dst_reg));\n+\t\tEMIT2(0x0F, 0xB6);\n \t\tbreak;\n \tcase BPF_H:\n-\t\t/* Emit 'movzx rax, word ptr [rax + off]' */\n-\t\tEMIT3(add_2mod(0x48, src_reg, dst_reg), 0x0F, 0xB7);\n+\t\t/* Emit 'movzx eax, word ptr [rax + off]' */\n+\t\tif (is_ereg(dst_reg) || is_ereg(src_reg))\n+\t\t\tEMIT1(add_2mod(0x40, src_reg, dst_reg));\n+\t\tEMIT2(0x0F, 0xB7);\n \t\tbreak;\n \tcase BPF_W:\n \t\t/* Emit 'mov eax, dword ptr [rax+0x14]' */\n@@ -1341,7 +1449,7 @@ static void emit_ldx_index(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, u32 i\n \t\tEMIT2(add_3mod(0x48, src_reg, dst_reg, index_reg), 0x8B);\n \t\tbreak;\n \t}\n-\temit_insn_suffix_SIB(\u0026prog, src_reg, dst_reg, index_reg, off);\n+\temit_insn_suffix_SIB(\u0026prog, src_reg, dst_reg, index_reg, off, 0);\n \t*pprog = prog;\n }\n \n@@ -1363,7 +1471,7 @@ static void emit_ldsx_index(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, u32\n \t\tEMIT2(add_3mod(0x48, src_reg, dst_reg, index_reg), 0x63);\n \t\tbreak;\n \t}\n-\temit_insn_suffix_SIB(\u0026prog, src_reg, dst_reg, index_reg, off);\n+\temit_insn_suffix_SIB(\u0026prog, src_reg, dst_reg, index_reg, off, 0);\n \t*pprog = prog;\n }\n \n@@ -1434,7 +1542,7 @@ static void emit_stx_index(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, u32 i\n \t\tEMIT2(add_3mod(0x48, dst_reg, src_reg, index_reg), 0x89);\n \t\tbreak;\n \t}\n-\temit_insn_suffix_SIB(\u0026prog, dst_reg, src_reg, index_reg, off);\n+\temit_insn_suffix_SIB(\u0026prog, dst_reg, src_reg, index_reg, off, 0);\n \t*pprog = prog;\n }\n \n@@ -1466,7 +1574,7 @@ static void emit_st_index(u8 **pprog, u32 size, u32 dst_reg, u32 index_reg, int\n \t\tEMIT2(add_3mod(0x48, dst_reg, 0, index_reg), 0xC7);\n \t\tbreak;\n \t}\n-\temit_insn_suffix_SIB(\u0026prog, dst_reg, 0, index_reg, off);\n+\temit_insn_suffix_SIB(\u0026prog, dst_reg, 0, index_reg, off, 0);\n \tEMIT(imm, bpf_size_to_x86_bytes(size));\n \t*pprog = prog;\n }\n@@ -1502,11 +1610,7 @@ static void emit_st(u8 **pprog, struct bpf_insn *insn, u32 dst_reg,\n \t\tbreak;\n \t}\n \n-\tif (is_imm8(insn_off))\n-\t\tEMIT2(add_1reg(0x40, dst_reg), insn_off);\n-\telse\n-\t\tEMIT1_off32(add_1reg(0x80, dst_reg), insn_off);\n-\n+\temit_insn_suffix(\u0026prog, dst_reg, BPF_REG_0, insn_off);\n \tEMIT(imm32, bpf_size_to_x86_bytes(BPF_SIZE(insn-\u003ecode)));\n \t*pprog = prog;\n }\n@@ -1614,7 +1718,7 @@ static int emit_atomic_rmw_index(u8 **pprog, u32 atomic_op, u32 size,\n \t\tpr_err(\"bpf_jit: unknown atomic opcode %02x\\n\", atomic_op);\n \t\treturn -EFAULT;\n \t}\n-\temit_insn_suffix_SIB(\u0026prog, dst_reg, src_reg, index_reg, off);\n+\temit_insn_suffix_SIB(\u0026prog, dst_reg, src_reg, index_reg, off, 0);\n \t*pprog = prog;\n \treturn 0;\n }\n@@ -1824,6 +1928,218 @@ static void emit_shiftx(u8 **pprog, u32 dst_reg, u8 src_reg, bool is64, u8 op)\n \t*pprog = prog;\n }\n \n+struct bpf_div_magic {\n+\tu64 m;\t\t/* multiplier, sign extended for signed division */\n+\tint s;\t\t/* shift of the high half of the product */\n+\tbool add;\t/* multiplier has 65 bits, use the add sequence */\n+};\n+\n+/*\n+ * Multiplier and shift for an unsigned division by the constant d, with\n+ * 2 \u003c= d \u003c 2^64 and a dividend below 2^(64 - lz): n / d == (mulhu(n, m)\n+ * \u003e\u003e s), or with the add sequence when m needs 65 bits, (((n - t) \u003e\u003e 1)\n+ * + t) \u003e\u003e (s - 1) with t = mulhu(n, m). Hacker's Delight, 2nd ed., figure\n+ * 10-2.\n+ */\n+static void bpf_magic_udiv(u64 d, int lz, struct bpf_div_magic *mag)\n+{\n+\tu64 mask = ~0ULL \u003e\u003e lz;\n+\tu64 nc, delta, q1, r1, q2, r2;\n+\tint p;\n+\n+\tmag-\u003eadd = false;\n+\t/* Largest value with nc mod d == d - 1 */\n+\tnc = mask - (mask % d + 1) % d;\n+\tp = 63;\n+\tq1 = (1ULL \u003c\u003c 63) / nc;\t\t\t/* 2^p / nc */\n+\tr1 = (1ULL \u003c\u003c 63) - q1 * nc;\t\t/* 2^p mod nc */\n+\tq2 = (~0ULL \u003e\u003e 1) / d;\t\t\t/* (2^p - 1) / d */\n+\tr2 = (~0ULL \u003e\u003e 1) - q2 * d;\t\t/* (2^p - 1) mod d */\n+\tdo {\n+\t\tp++;\n+\t\tif (r1 \u003e= nc - r1) {\n+\t\t\tq1 = 2 * q1 + 1;\n+\t\t\tr1 = 2 * r1 - nc;\n+\t\t} else {\n+\t\t\tq1 = 2 * q1;\n+\t\t\tr1 = 2 * r1;\n+\t\t}\n+\t\tif (r2 + 1 \u003e= d - r2) {\n+\t\t\tif (q2 \u003e= (~0ULL \u003e\u003e 1))\n+\t\t\t\tmag-\u003eadd = true;\n+\t\t\tq2 = 2 * q2 + 1;\n+\t\t\tr2 = 2 * r2 + 1 - d;\n+\t\t} else {\n+\t\t\tif (q2 \u003e= (1ULL \u003c\u003c 63))\n+\t\t\t\tmag-\u003eadd = true;\n+\t\t\tq2 = 2 * q2;\n+\t\t\tr2 = 2 * r2 + 1;\n+\t\t}\n+\t\tdelta = d - 1 - r2;\n+\t} while (p \u003c 128 \u0026\u0026 (q1 \u003c delta || (q1 == delta \u0026\u0026 r1 == 0)));\n+\n+\tmag-\u003em = q2 + 1;\n+\tmag-\u003es = p - 64;\n+}\n+\n+/*\n+ * Multiplier and shift for a signed division by the constant d, with\n+ * 2 \u003c= |d| \u003c 2^63: q = mulhs(n, m), q += n if d \u003e 0 and m \u003c 0, q -= n\n+ * if d \u003c 0 and m \u003e 0, q \u003e\u003e= s (arithmetic), n / d == q + (q \u003e\u003e\u003e 63).\n+ * Hacker's Delight, 2nd ed., figure 10-1.\n+ */\n+static void bpf_magic_sdiv(s64 d, struct bpf_div_magic *mag)\n+{\n+\tu64 ad = d \u003c 0 ? -(u64)d : (u64)d;\n+\tu64 t, anc, delta, q1, r1, q2, r2;\n+\tint p;\n+\n+\tt = (1ULL \u003c\u003c 63) + (d \u003c 0);\n+\tanc = t - 1 - t % ad;\t\t\t/* |nc| */\n+\tp = 63;\n+\tq1 = (1ULL \u003c\u003c 63) / anc;\t\t/* 2^p / |nc| */\n+\tr1 = (1ULL \u003c\u003c 63) - q1 * anc;\t\t/* 2^p mod |nc| */\n+\tq2 = (1ULL \u003c\u003c 63) / ad;\t\t\t/* 2^p / |d| */\n+\tr2 = (1ULL \u003c\u003c 63) - q2 * ad;\t\t/* 2^p mod |d| */\n+\tdo {\n+\t\tp++;\n+\t\tq1 = 2 * q1;\n+\t\tr1 = 2 * r1;\n+\t\tif (r1 \u003e= anc) {\n+\t\t\tq1++;\n+\t\t\tr1 -= anc;\n+\t\t}\n+\t\tq2 = 2 * q2;\n+\t\tr2 = 2 * r2;\n+\t\tif (r2 \u003e= ad) {\n+\t\t\tq2++;\n+\t\t\tr2 -= ad;\n+\t\t}\n+\t\tdelta = ad - r2;\n+\t} while (q1 \u003c delta || (q1 == delta \u0026\u0026 r1 == 0));\n+\n+\tmag-\u003em = q2 + 1;\n+\tif (d \u003c 0)\n+\t\tmag-\u003em = -mag-\u003em;\n+\tmag-\u003es = p - 64;\n+\tmag-\u003eadd = false;\n+}\n+\n+/*\n+ * Divide dst_reg by the constant in insn-\u003eimm of a 64-bit division through\n+ * a multiplication with the magic number from bpf_magic_udiv() or\n+ * bpf_magic_sdiv(). The dividend goes through rax and the multiplier\n+ * through r11, the caller saves rax and rdx unless they are dst_reg, and\n+ * r10 is scratch. Returns false for the divisors left to div/idiv.\n+ */\n+static bool emit_div_const(u8 **pprog, const struct bpf_insn *insn, u32 dst_reg)\n+{\n+\tbool is_mod = BPF_OP(insn-\u003ecode) == BPF_MOD;\n+\tbool is_signed = insn-\u003eoff == 1;\n+\tu32 n_reg = dst_reg, q_reg;\n+\ts32 imm32 = insn-\u003eimm;\n+\tstruct bpf_div_magic mag;\n+\tu8 *prog = *pprog;\n+\tint corr = 0, pre = 0, s;\n+\n+\tif (is_signed) {\n+\t\t/* |d| \u003e= 2, the verifier already rewrote d == -1 */\n+\t\tif (imm32 \u003e= -1 \u0026\u0026 imm32 \u003c= 1)\n+\t\t\treturn false;\n+\t\tbpf_magic_sdiv(imm32, \u0026mag);\n+\t\t/* q += n for d \u003e 0 and m \u003c 0, q -= n for d \u003c 0 and m \u003e 0 */\n+\t\tif (imm32 \u003e 0 \u0026\u0026 (s64)mag.m \u003c 0)\n+\t\t\tcorr = 1;\n+\t\telse if (imm32 \u003c 0 \u0026\u0026 (s64)mag.m \u003e 0)\n+\t\t\tcorr = -1;\n+\t} else {\n+\t\t/* d \u003e= 2, a negative imm32 is a divisor above 2^63 */\n+\t\tif (imm32 \u003c 2)\n+\t\t\treturn false;\n+\t\tbpf_magic_udiv(imm32, 0, \u0026mag);\n+\t\t/*\n+\t\t * Shift the dividend by the trailing zeros of an even divisor\n+\t\t * first, the magic number of the odd part then fits without\n+\t\t * the add sequence.\n+\t\t */\n+\t\tif (mag.add \u0026\u0026 !(imm32 \u0026 1)) {\n+\t\t\tpre = __ffs(imm32);\n+\t\t\tbpf_magic_udiv(imm32 \u003e\u003e pre, pre, \u0026mag);\n+\t\t\tif (mag.add)\n+\t\t\t\treturn false;\n+\t\t}\n+\t}\n+\ts = mag.s;\n+\t/*\n+\t * The shift is at most 63, or 64 with the add sequence which shifts\n+\t * by s - 1 and needs s \u003e= 1. Never hit for d \u003e= 2, kept as a guard\n+\t * against an unencodable count.\n+\t */\n+\tif (s \u003e 64 - !mag.add || (mag.add \u0026\u0026 !s))\n+\t\treturn false;\n+\n+\t/* Keep the dividend when the multiplication clobbers it */\n+\tif ((is_mod || mag.add || corr) \u0026\u0026\n+\t    (dst_reg == BPF_REG_0 || dst_reg == BPF_REG_3)) {\n+\t\temit_mov_reg(\u0026prog, true, BPF_REG_AX, dst_reg);\n+\t\tn_reg = BPF_REG_AX;\n+\t}\n+\n+\t/* mov rax, dst_reg; shr rax, pre; mov r11, m; mul r11 or imul r11 */\n+\tif (dst_reg != BPF_REG_0)\n+\t\temit_mov_reg(\u0026prog, true, BPF_REG_0, dst_reg);\n+\tif (pre)\n+\t\temit_shift_imm(\u0026prog, BPF_RSH, BPF_REG_0, pre, true);\n+\temit_mov_imm64(\u0026prog, AUX_REG, mag.m \u003e\u003e 32, (u32)mag.m);\n+\tEMIT3(0x49, 0xF7, is_signed ? 0xEB : 0xE3);\n+\tif (is_signed) {\n+\t\t/* add rdx, n_reg or sub rdx, n_reg */\n+\t\tif (corr)\n+\t\t\temit_alu_reg(\u0026prog, corr \u003e 0 ? BPF_ADD : BPF_SUB,\n+\t\t\t\t     BPF_REG_3, n_reg, true);\n+\t\t/* sar rdx, s */\n+\t\tif (s)\n+\t\t\temit_shift_imm(\u0026prog, BPF_ARSH, BPF_REG_3, s, true);\n+\t\t/* mov rax, rdx; shr rax, 63; add rdx, rax */\n+\t\temit_mov_reg(\u0026prog, true, BPF_REG_0, BPF_REG_3);\n+\t\temit_shift_imm(\u0026prog, BPF_RSH, BPF_REG_0, 63, true);\n+\t\temit_alu_reg(\u0026prog, BPF_ADD, BPF_REG_3, BPF_REG_0, true);\n+\t\tq_reg = BPF_REG_3;\n+\t} else if (!mag.add) {\n+\t\t/* shr rdx, s */\n+\t\tif (s)\n+\t\t\temit_shift_imm(\u0026prog, BPF_RSH, BPF_REG_3, s, true);\n+\t\tq_reg = BPF_REG_3;\n+\t} else {\n+\t\t/* mov rax, n_reg; sub rax, rdx; shr rax, 1 */\n+\t\temit_mov_reg(\u0026prog, true, BPF_REG_0, n_reg);\n+\t\temit_alu_reg(\u0026prog, BPF_SUB, BPF_REG_0, BPF_REG_3, true);\n+\t\temit_shift_imm(\u0026prog, BPF_RSH, BPF_REG_0, 1, true);\n+\t\t/* add rax, rdx; shr rax, s - 1 */\n+\t\temit_alu_reg(\u0026prog, BPF_ADD, BPF_REG_0, BPF_REG_3, true);\n+\t\tif (s \u003e 1)\n+\t\t\temit_shift_imm(\u0026prog, BPF_RSH, BPF_REG_0, s - 1, true);\n+\t\tq_reg = BPF_REG_0;\n+\t}\n+\n+\tif (is_mod) {\n+\t\t/* imul q_reg, q_reg, imm32 */\n+\t\tmaybe_emit_mod(\u0026prog, q_reg, q_reg, true);\n+\t\tif (is_imm8(imm32))\n+\t\t\tEMIT3(0x6B, add_2reg(0xC0, q_reg, q_reg), imm32);\n+\t\telse\n+\t\t\tEMIT2_off32(0x69, add_2reg(0xC0, q_reg, q_reg), imm32);\n+\t\t/* sub n_reg, q_reg */\n+\t\temit_alu_reg(\u0026prog, BPF_SUB, n_reg, q_reg, true);\n+\t\tq_reg = n_reg;\n+\t}\n+\tif (q_reg != dst_reg)\n+\t\temit_mov_reg(\u0026prog, true, dst_reg, q_reg);\n+\n+\t*pprog = prog;\n+\treturn true;\n+}\n+\n static void emit_priv_frame_ptr(u8 **pprog, void __percpu *priv_frame_ptr)\n {\n \tu8 *prog = *pprog;\n@@ -1845,7 +2161,7 @@ static void emit_priv_frame_ptr(u8 **pprog, void __percpu *priv_frame_ptr)\n #define INSN_SZ_DIFF (((addrs[i] - addrs[i - 1]) - (prog - temp)))\n \n #define __LOAD_TCC_PTR(off)\t\t\t\\\n-\tEMIT3_off32(0x48, 0x8B, 0x85, off)\n+\temit_ldx(\u0026prog, BPF_DW, BPF_REG_0, BPF_REG_FP, off)\n /* mov rax, qword ptr [rbp - rounded_stack_depth - 16] */\n #define LOAD_TAIL_CALL_CNT_PTR(stack)\t\t\t\t\\\n \t__LOAD_TCC_PTR(BPF_TAIL_CALL_CNT_PTR_STACK_OFF(stack))\n@@ -2000,6 +2316,54 @@ static int emit_kfunc_arena_args(struct bpf_prog *bpf_prog,\n \treturn prog - start;\n }\n \n+/*\n+ * A strict compare against 1 or 128 is the non-strict one against 0 or\n+ * 127, a strict one against -129 or, with a signed condition, -1 the\n+ * non-strict one against -128 or 0: the compare against 0 is a test\n+ * without immediate, 127 and -128 fit into an imm8.\n+ */\n+static void adjust_cmp_imm(u32 *op, s32 *imm)\n+{\n+\tif (*imm == 1 || *imm == 128) {\n+\t\tswitch (*op) {\n+\t\tcase BPF_JLT:\n+\t\t\t*op = BPF_JLE;\n+\t\t\tbreak;\n+\t\tcase BPF_JGE:\n+\t\t\t*op = BPF_JGT;\n+\t\t\tbreak;\n+\t\tcase BPF_JSLT:\n+\t\t\t*op = BPF_JSLE;\n+\t\t\tbreak;\n+\t\tcase BPF_JSGE:\n+\t\t\t*op = BPF_JSGT;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\treturn;\n+\t\t}\n+\t\t*imm -= 1;\n+\t} else if (*imm == -1 || *imm == -129) {\n+\t\tswitch (*op) {\n+\t\tcase BPF_JGT:\n+\t\tcase BPF_JLE:\n+\t\t\t/* -1 is the largest unsigned value */\n+\t\t\tif (*imm == -1)\n+\t\t\t\treturn;\n+\t\t\t*op = *op == BPF_JGT ? BPF_JGE : BPF_JLT;\n+\t\t\tbreak;\n+\t\tcase BPF_JSGT:\n+\t\t\t*op = BPF_JSGE;\n+\t\t\tbreak;\n+\t\tcase BPF_JSLE:\n+\t\t\t*op = BPF_JSLT;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\treturn;\n+\t\t}\n+\t\t*imm += 1;\n+\t}\n+}\n+\n static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *addrs, u8 *image,\n \t\t  u8 *rw_image, int oldproglen, struct jit_context *ctx, bool jmp_padding)\n {\n@@ -2134,7 +2498,7 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \t\tu32 dst_reg = insn-\u003edst_reg;\n \t\tu32 src_reg = insn-\u003esrc_reg;\n \t\tbool accesses_stack_only;\n-\t\tu8 b2 = 0, b3 = 0;\n+\t\tu8 b3 = 0;\n \t\tu8 *start_of_ldx;\n \t\ts64 jmp_offset;\n \t\ts32 insn_off;\n@@ -2142,6 +2506,8 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \t\tu8 jmp_cond;\n \t\tu8 *func;\n \t\tint nops;\n+\t\tu32 jmp_op = BPF_OP(insn-\u003ecode);\n+\t\ts32 cmp_imm;\n \n \t\tif (priv_frame_ptr) {\n \t\t\tif (src_reg == BPF_REG_FP)\n@@ -2172,43 +2538,24 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \t\tcase BPF_ALU64 | BPF_AND | BPF_X:\n \t\tcase BPF_ALU64 | BPF_OR | BPF_X:\n \t\tcase BPF_ALU64 | BPF_XOR | BPF_X:\n-\t\t\tmaybe_emit_mod(\u0026prog, dst_reg, src_reg,\n-\t\t\t\t       BPF_CLASS(insn-\u003ecode) == BPF_ALU64);\n-\t\t\tb2 = simple_alu_opcodes[BPF_OP(insn-\u003ecode)];\n-\t\t\tEMIT2(b2, add_2reg(0xC0, dst_reg, src_reg));\n+\t\t\temit_alu_reg(\u0026prog, BPF_OP(insn-\u003ecode), dst_reg, src_reg,\n+\t\t\t\t     BPF_CLASS(insn-\u003ecode) == BPF_ALU64);\n \t\t\tbreak;\n \n \t\tcase BPF_ALU64 | BPF_MOV | BPF_X:\n \t\t\tif (insn_is_cast_user(insn)) {\n-\t\t\t\tif (dst_reg != src_reg)\n-\t\t\t\t\t/* 32-bit mov */\n-\t\t\t\t\temit_mov_reg(\u0026prog, false, dst_reg, src_reg);\n-\t\t\t\t/* shl dst_reg, 32 */\n-\t\t\t\tmaybe_emit_1mod(\u0026prog, dst_reg, true);\n-\t\t\t\tEMIT3(0xC1, add_1reg(0xE0, dst_reg), 32);\n-\n-\t\t\t\t/* or dst_reg, user_vm_start */\n-\t\t\t\tmaybe_emit_1mod(\u0026prog, dst_reg, true);\n-\t\t\t\tif (is_axreg(dst_reg))\n-\t\t\t\t\tEMIT1_off32(0x0D,  user_vm_start \u003e\u003e 32);\n-\t\t\t\telse\n-\t\t\t\t\tEMIT2_off32(0x81, add_1reg(0xC8, dst_reg),  user_vm_start \u003e\u003e 32);\n-\n-\t\t\t\t/* rol dst_reg, 32 */\n-\t\t\t\tmaybe_emit_1mod(\u0026prog, dst_reg, true);\n-\t\t\t\tEMIT3(0xC1, add_1reg(0xC0, dst_reg), 32);\n-\n-\t\t\t\t/* xor r11, r11 */\n-\t\t\t\tEMIT3(0x4D, 0x31, 0xDB);\n-\n-\t\t\t\t/* test dst_reg32, dst_reg32; check if lower 32-bit are zero */\n+\t\t\t\t/* mov dst_reg32, src_reg32 to zero extend the low half */\n+\t\t\t\temit_mov_reg(\u0026prog, false, dst_reg, src_reg);\n+\t\t\t\t/* mov r11, the high half of user_vm_start; or r11, dst_reg */\n+\t\t\t\temit_mov_imm64(\u0026prog, AUX_REG, user_vm_start \u003e\u003e 32, 0);\n+\t\t\t\temit_alu_reg(\u0026prog, BPF_OR, AUX_REG, dst_reg, true);\n+\t\t\t\t/* test dst_reg32, dst_reg32; a NULL pointer stays NULL */\n \t\t\t\tmaybe_emit_mod(\u0026prog, dst_reg, dst_reg, false);\n \t\t\t\tEMIT2(0x85, add_2reg(0xC0, dst_reg, dst_reg));\n-\n-\t\t\t\t/* cmove r11, dst_reg; if so, set dst_reg to zero */\n+\t\t\t\t/* cmovne dst_reg, r11 */\n \t\t\t\t/* WARNING: Intel swapped src/dst register encoding in CMOVcc !!! */\n \t\t\t\tmaybe_emit_mod(\u0026prog, AUX_REG, dst_reg, true);\n-\t\t\t\tEMIT3(0x0F, 0x44, add_2reg(0xC0, AUX_REG, dst_reg));\n+\t\t\t\tEMIT3(0x0F, 0x45, add_2reg(0xC0, AUX_REG, dst_reg));\n \t\t\t\tbreak;\n \t\t\t} else if (insn_is_mov_percpu_addr(insn)) {\n \t\t\t\t/* mov \u003cdst\u003e, \u003csrc\u003e (if necessary) */\n@@ -2236,9 +2583,7 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \t\t\t/* neg dst */\n \t\tcase BPF_ALU | BPF_NEG:\n \t\tcase BPF_ALU64 | BPF_NEG:\n-\t\t\tmaybe_emit_1mod(\u0026prog, dst_reg,\n-\t\t\t\t\tBPF_CLASS(insn-\u003ecode) == BPF_ALU64);\n-\t\t\tEMIT2(0xF7, add_1reg(0xD8, dst_reg));\n+\t\t\temit_neg(\u0026prog, dst_reg, BPF_CLASS(insn-\u003ecode) == BPF_ALU64);\n \t\t\tbreak;\n \n \t\tcase BPF_ALU | BPF_ADD | BPF_K:\n@@ -2251,42 +2596,23 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \t\tcase BPF_ALU64 | BPF_AND | BPF_K:\n \t\tcase BPF_ALU64 | BPF_OR | BPF_K:\n \t\tcase BPF_ALU64 | BPF_XOR | BPF_K:\n-\t\t\tmaybe_emit_1mod(\u0026prog, dst_reg,\n-\t\t\t\t\tBPF_CLASS(insn-\u003ecode) == BPF_ALU64);\n-\n-\t\t\t/*\n-\t\t\t * b3 holds 'normal' opcode, b2 short form only valid\n-\t\t\t * in case dst is eax/rax.\n-\t\t\t */\n-\t\t\tswitch (BPF_OP(insn-\u003ecode)) {\n-\t\t\tcase BPF_ADD:\n-\t\t\t\tb3 = 0xC0;\n-\t\t\t\tb2 = 0x05;\n-\t\t\t\tbreak;\n-\t\t\tcase BPF_SUB:\n-\t\t\t\tb3 = 0xE8;\n-\t\t\t\tb2 = 0x2D;\n-\t\t\t\tbreak;\n-\t\t\tcase BPF_AND:\n-\t\t\t\tb3 = 0xE0;\n-\t\t\t\tb2 = 0x25;\n+\t\t\tif (BPF_OP(insn-\u003ecode) == BPF_AND \u0026\u0026\n+\t\t\t    (imm32 == 0xff || imm32 == 0xffff)) {\n+\t\t\t\t/* movzx dst_reg, dst_reg8/16 */\n+\t\t\t\temit_movzx_reg(\u0026prog, imm32 == 0xff ? 8 : 16,\n+\t\t\t\t\t       dst_reg, dst_reg);\n \t\t\t\tbreak;\n-\t\t\tcase BPF_OR:\n-\t\t\t\tb3 = 0xC8;\n-\t\t\t\tb2 = 0x0D;\n-\t\t\t\tbreak;\n-\t\t\tcase BPF_XOR:\n-\t\t\t\tb3 = 0xF0;\n-\t\t\t\tb2 = 0x35;\n+\t\t\t}\n+\t\t\tif (BPF_OP(insn-\u003ecode) == BPF_XOR \u0026\u0026 imm32 == -1) {\n+\t\t\t\t/* not dst_reg */\n+\t\t\t\tmaybe_emit_1mod(\u0026prog, dst_reg,\n+\t\t\t\t\t\tBPF_CLASS(insn-\u003ecode) == BPF_ALU64);\n+\t\t\t\tEMIT2(0xF7, add_1reg(0xD0, dst_reg));\n \t\t\t\tbreak;\n \t\t\t}\n \n-\t\t\tif (is_imm8(imm32))\n-\t\t\t\tEMIT3(0x83, add_1reg(b3, dst_reg), imm32);\n-\t\t\telse if (is_axreg(dst_reg))\n-\t\t\t\tEMIT1_off32(b2, imm32);\n-\t\t\telse\n-\t\t\t\tEMIT2_off32(0x81, add_1reg(b3, dst_reg), imm32);\n+\t\t\temit_alu_imm(\u0026prog, BPF_OP(insn-\u003ecode), dst_reg, imm32,\n+\t\t\t\t     BPF_CLASS(insn-\u003ecode) == BPF_ALU64);\n \t\t\tbreak;\n \n \t\tcase BPF_ALU64 | BPF_MOV | BPF_K:\n@@ -2317,6 +2643,11 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \t\t\tif (dst_reg != BPF_REG_3)\n \t\t\t\tEMIT1(0x52); /* push rdx */\n \n+\t\t\t/* LLVM strength-reduces the 32-bit ones itself */\n+\t\t\tif (is64 \u0026\u0026 BPF_SRC(insn-\u003ecode) == BPF_K \u0026\u0026\n+\t\t\t    emit_div_const(\u0026prog, insn, dst_reg))\n+\t\t\t\tgoto div_done;\n+\n \t\t\tif (BPF_SRC(insn-\u003ecode) == BPF_X) {\n \t\t\t\tif (src_reg == BPF_REG_0 ||\n \t\t\t\t    src_reg == BPF_REG_3) {\n@@ -2339,7 +2670,7 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \t\t\t\t * xor edx, edx\n \t\t\t\t * equivalent to 'xor rdx, rdx', but one byte less\n \t\t\t\t */\n-\t\t\t\tEMIT2(0x31, 0xd2);\n+\t\t\t\temit_mov_imm32(\u0026prog, false, BPF_REG_3, 0);\n \n \t\t\t\t/* div src_reg */\n \t\t\t\tmaybe_emit_1mod(\u0026prog, src_reg, is64);\n@@ -2363,7 +2694,7 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \t\t\t\t dst_reg != BPF_REG_0)\n \t\t\t\t/* mov dst_reg, rax */\n \t\t\t\temit_mov_reg(\u0026prog, is64, dst_reg, BPF_REG_0);\n-\n+div_done:\n \t\t\tif (dst_reg != BPF_REG_3)\n \t\t\t\tEMIT1(0x5A); /* pop rdx */\n \t\t\tif (dst_reg != BPF_REG_0)\n@@ -2373,6 +2704,25 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \n \t\tcase BPF_ALU | BPF_MUL | BPF_K:\n \t\tcase BPF_ALU64 | BPF_MUL | BPF_K:\n+\t\t\t/*\n+\t\t\t * lea for 3, 5 and 9, which LLVM leaves as a\n+\t\t\t * multiplication, but not for r13, which needs a\n+\t\t\t * displacement as base and makes the lea a slow three\n+\t\t\t * operand form on Intel.\n+\t\t\t */\n+\t\t\tif ((imm32 == 3 || imm32 == 5 || imm32 == 9) \u0026\u0026\n+\t\t\t    !base_needs_disp(dst_reg)) {\n+\t\t\t\t/* lea dst_reg, [dst_reg + dst_reg * (imm32 - 1)] */\n+\t\t\t\tif (BPF_CLASS(insn-\u003ecode) == BPF_ALU64)\n+\t\t\t\t\tEMIT1(add_3mod(0x48, dst_reg, dst_reg, dst_reg));\n+\t\t\t\telse if (is_ereg(dst_reg))\n+\t\t\t\t\tEMIT1(add_3mod(0x40, dst_reg, dst_reg, dst_reg));\n+\t\t\t\tEMIT1(0x8D);\n+\t\t\t\temit_insn_suffix_SIB(\u0026prog, dst_reg, dst_reg, dst_reg, 0,\n+\t\t\t\t\t\t     ilog2(imm32 - 1));\n+\t\t\t\tbreak;\n+\t\t\t}\n+\n \t\t\tmaybe_emit_mod(\u0026prog, dst_reg, dst_reg,\n \t\t\t\t       BPF_CLASS(insn-\u003ecode) == BPF_ALU64);\n \n@@ -2403,14 +2753,8 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \t\tcase BPF_ALU64 | BPF_LSH | BPF_K:\n \t\tcase BPF_ALU64 | BPF_RSH | BPF_K:\n \t\tcase BPF_ALU64 | BPF_ARSH | BPF_K:\n-\t\t\tmaybe_emit_1mod(\u0026prog, dst_reg,\n-\t\t\t\t\tBPF_CLASS(insn-\u003ecode) == BPF_ALU64);\n-\n-\t\t\tb3 = simple_alu_opcodes[BPF_OP(insn-\u003ecode)];\n-\t\t\tif (imm32 == 1)\n-\t\t\t\tEMIT2(0xD1, add_1reg(b3, dst_reg));\n-\t\t\telse\n-\t\t\t\tEMIT3(0xC1, add_1reg(b3, dst_reg), imm32);\n+\t\t\temit_shift_imm(\u0026prog, BPF_OP(insn-\u003ecode), dst_reg,\n+\t\t\t\t       imm32, BPF_CLASS(insn-\u003ecode) == BPF_ALU64);\n \t\t\tbreak;\n \n \t\tcase BPF_ALU | BPF_LSH | BPF_X:\n@@ -2419,8 +2763,12 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \t\tcase BPF_ALU64 | BPF_LSH | BPF_X:\n \t\tcase BPF_ALU64 | BPF_RSH | BPF_X:\n \t\tcase BPF_ALU64 | BPF_ARSH | BPF_X:\n-\t\t\t/* BMI2 shifts aren't better when shift count is already in rcx */\n-\t\t\tif (boot_cpu_has(X86_FEATURE_BMI2) \u0026\u0026 src_reg != BPF_REG_4) {\n+\t\t\t/*\n+\t\t\t * BMI2 shifts take the count from any register and,\n+\t\t\t * unlike the cl forms, are a single uop on Intel, so\n+\t\t\t * prefer them also when the count already is in rcx.\n+\t\t\t */\n+\t\t\tif (boot_cpu_has(X86_FEATURE_BMI2)) {\n \t\t\t\t/* shrx/sarx/shlx dst_reg, dst_reg, src_reg */\n \t\t\t\tbool w = (BPF_CLASS(insn-\u003ecode) == BPF_ALU64);\n \t\t\t\tu8 op;\n@@ -2476,18 +2824,16 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \t\tcase BPF_ALU64 | BPF_END | BPF_FROM_LE:\n \t\t\tswitch (imm32) {\n \t\t\tcase 16:\n-\t\t\t\t/* Emit 'ror %ax, 8' to swap lower 2 bytes */\n-\t\t\t\tEMIT1(0x66);\n+\t\t\t\t/* Emit 'bswap eax' to swap lower 4 bytes */\n \t\t\t\tif (is_ereg(dst_reg))\n \t\t\t\t\tEMIT1(0x41);\n-\t\t\t\tEMIT3(0xC1, add_1reg(0xC8, dst_reg), 8);\n+\t\t\t\tEMIT2(0x0F, add_1reg(0xC8, dst_reg));\n \n-\t\t\t\t/* Emit 'movzwl eax, ax' */\n-\t\t\t\tif (is_ereg(dst_reg))\n-\t\t\t\t\tEMIT3(0x45, 0x0F, 0xB7);\n-\t\t\t\telse\n-\t\t\t\t\tEMIT2(0x0F, 0xB7);\n-\t\t\t\tEMIT1(add_2reg(0xC0, dst_reg, dst_reg));\n+\t\t\t\t/*\n+\t\t\t\t * Emit 'shr eax, 16' to move the swapped lower\n+\t\t\t\t * 2 bytes back down and zero extend\n+\t\t\t\t */\n+\t\t\t\temit_shift_imm(\u0026prog, BPF_RSH, dst_reg, 16, false);\n \t\t\t\tbreak;\n \t\t\tcase 32:\n \t\t\t\t/* Emit 'bswap eax' to swap lower 4 bytes */\n@@ -2512,11 +2858,7 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \t\t\t\t * Emit 'movzwl eax, ax' to zero extend 16-bit\n \t\t\t\t * into 64 bit\n \t\t\t\t */\n-\t\t\t\tif (is_ereg(dst_reg))\n-\t\t\t\t\tEMIT3(0x45, 0x0F, 0xB7);\n-\t\t\t\telse\n-\t\t\t\t\tEMIT2(0x0F, 0xB7);\n-\t\t\t\tEMIT1(add_2reg(0xC0, dst_reg, dst_reg));\n+\t\t\t\temit_movzx_reg(\u0026prog, 16, dst_reg, dst_reg);\n \t\t\t\tbreak;\n \t\t\tcase 32:\n \t\t\t\t/* Emit 'mov eax, eax' to clear upper 32-bits */\n@@ -2730,38 +3072,32 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \t\t\t\t *   src_reg + insn-\u003eoff \u003e TASK_SIZE_MAX + PAGE_SIZE\n \t\t\t\t *   and\n \t\t\t\t *   src_reg + insn-\u003eoff \u003c VSYSCALL_ADDR\n+\t\t\t\t *\n+\t\t\t\t * The check is done on src_reg + insn-\u003eoff - VSYSCALL_ADDR\n+\t\t\t\t * against the next power of two above the limit. Addresses\n+\t\t\t\t * between the limit and that power of two are non-canonical\n+\t\t\t\t * and would fault anyway, so they get zeroed a bit earlier.\n \t\t\t\t */\n \n \t\t\t\tu64 limit = TASK_SIZE_MAX + PAGE_SIZE - VSYSCALL_ADDR;\n \t\t\t\tu8 *end_of_jmp;\n \n-\t\t\t\t/* movabsq r10, VSYSCALL_ADDR */\n-\t\t\t\temit_mov_imm64(\u0026prog, BPF_REG_AX, (long)VSYSCALL_ADDR \u003e\u003e 32,\n-\t\t\t\t\t       (u32)(long)VSYSCALL_ADDR);\n-\n-\t\t\t\t/* mov src_reg, r11 */\n-\t\t\t\tEMIT_mov(AUX_REG, src_reg);\n-\n-\t\t\t\tif (insn-\u003eoff) {\n-\t\t\t\t\t/* add r11, insn-\u003eoff */\n-\t\t\t\t\tmaybe_emit_1mod(\u0026prog, AUX_REG, true);\n-\t\t\t\t\tEMIT2_off32(0x81, add_1reg(0xC0, AUX_REG), insn-\u003eoff);\n-\t\t\t\t}\n-\n-\t\t\t\t/* sub r11, r10 */\n-\t\t\t\tmaybe_emit_mod(\u0026prog, AUX_REG, BPF_REG_AX, true);\n-\t\t\t\tEMIT2(0x29, add_2reg(0xC0, AUX_REG, BPF_REG_AX));\n-\n-\t\t\t\t/* movabsq r10, limit */\n-\t\t\t\temit_mov_imm64(\u0026prog, BPF_REG_AX, (long)limit \u003e\u003e 32,\n-\t\t\t\t\t       (u32)(long)limit);\n+\t\t\t\t/*\n+\t\t\t\t * lea r11, [src_reg + insn-\u003eoff - VSYSCALL_ADDR]\n+\t\t\t\t *\n+\t\t\t\t * VSYSCALL_ADDR is a small negative number, so the\n+\t\t\t\t * whole offset fits into the 32-bit displacement.\n+\t\t\t\t */\n+\t\t\t\tBUILD_BUG_ON((long)(s32)VSYSCALL_ADDR != (long)VSYSCALL_ADDR);\n+\t\t\t\tEMIT2(add_2mod(0x48, src_reg, AUX_REG), 0x8D);\n+\t\t\t\temit_insn_suffix(\u0026prog, src_reg, AUX_REG,\n+\t\t\t\t\t\t insn-\u003eoff - (s32)VSYSCALL_ADDR);\n \n-\t\t\t\t/* cmp r10, r11 */\n-\t\t\t\tmaybe_emit_mod(\u0026prog, AUX_REG, BPF_REG_AX, true);\n-\t\t\t\tEMIT2(0x39, add_2reg(0xC0, AUX_REG, BPF_REG_AX));\n+\t\t\t\t/* shr r11, fls64(limit) */\n+\t\t\t\temit_shift_imm(\u0026prog, BPF_RSH, AUX_REG, fls64(limit), true);\n \n-\t\t\t\t/* if unsigned '\u003e', goto load */\n-\t\t\t\tEMIT2(X86_JA, 0);\n+\t\t\t\t/* if not zero, goto load */\n+\t\t\t\tEMIT2(X86_JNE, 0);\n \t\t\t\tend_of_jmp = prog;\n \n \t\t\t\t/* xor dst_reg, dst_reg */\n@@ -2769,7 +3105,7 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \t\t\t\t/* jmp byte_after_ldx */\n \t\t\t\tEMIT2(0xEB, 0);\n \n-\t\t\t\t/* populate jmp_offset for JAE above to jump to start_of_ldx */\n+\t\t\t\t/* populate jmp_offset for JNE above to jump to start_of_ldx */\n \t\t\t\tstart_of_ldx = prog;\n \t\t\t\tend_of_jmp[-1] = start_of_ldx - end_of_jmp;\n \t\t\t} else if (!accesses_stack_only) {\n@@ -2946,8 +3282,10 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \n \t\t\tfunc = (u8 *) __bpf_call_base + imm32;\n \t\t\tif (src_reg == BPF_PSEUDO_CALL \u0026\u0026 tail_call_reachable) {\n+\t\t\t\tu8 *tcc_load = prog;\n+\n \t\t\t\tLOAD_TAIL_CALL_CNT_PTR(stack_depth);\n-\t\t\t\tip += 7;\n+\t\t\t\tip += prog - tcc_load;\n \t\t\t}\n \t\t\tif (!imm32)\n \t\t\t\treturn -EINVAL;\n@@ -3067,10 +3405,26 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \n \t\tcase BPF_JMP | BPF_JSET | BPF_K:\n \t\tcase BPF_JMP32 | BPF_JSET | BPF_K:\n+\t\t\tif ((u32)imm32 \u003c= U8_MAX) {\n+\t\t\t\t/*\n+\t\t\t\t * test dst_reg8, imm8: with the upper bits of the\n+\t\t\t\t * mask clear the result only depends on the low byte.\n+\t\t\t\t */\n+\t\t\t\tif (is_ereg_8l(dst_reg))\n+\t\t\t\t\tEMIT1(add_1mod(0x40, dst_reg));\n+\t\t\t\tif (is_axreg(dst_reg))\n+\t\t\t\t\tEMIT2(0xA8, imm32);\n+\t\t\t\telse\n+\t\t\t\t\tEMIT3(0xF6, add_1reg(0xC0, dst_reg), imm32);\n+\t\t\t\tgoto emit_cond_jmp;\n+\t\t\t}\n \t\t\t/* test dst_reg, imm32 */\n \t\t\tmaybe_emit_1mod(\u0026prog, dst_reg,\n \t\t\t\t\tBPF_CLASS(insn-\u003ecode) == BPF_JMP);\n-\t\t\tEMIT2_off32(0xF7, add_1reg(0xC0, dst_reg), imm32);\n+\t\t\tif (is_axreg(dst_reg))\n+\t\t\t\tEMIT1_off32(0xA9, imm32);\n+\t\t\telse\n+\t\t\t\tEMIT2_off32(0xF7, add_1reg(0xC0, dst_reg), imm32);\n \t\t\tgoto emit_cond_jmp;\n \n \t\tcase BPF_JMP | BPF_JEQ | BPF_K:\n@@ -3093,8 +3447,11 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \t\tcase BPF_JMP32 | BPF_JSLT | BPF_K:\n \t\tcase BPF_JMP32 | BPF_JSGE | BPF_K:\n \t\tcase BPF_JMP32 | BPF_JSLE | BPF_K:\n+\t\t\tcmp_imm = imm32;\n+\t\t\tadjust_cmp_imm(\u0026jmp_op, \u0026cmp_imm);\n+\n \t\t\t/* test dst_reg, dst_reg to save one extra byte */\n-\t\t\tif (imm32 == 0) {\n+\t\t\tif (cmp_imm == 0) {\n \t\t\t\tmaybe_emit_mod(\u0026prog, dst_reg, dst_reg,\n \t\t\t\t\t       BPF_CLASS(insn-\u003ecode) == BPF_JMP);\n \t\t\t\tEMIT2(0x85, add_2reg(0xC0, dst_reg, dst_reg));\n@@ -3105,13 +3462,15 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *\n \t\t\tmaybe_emit_1mod(\u0026prog, dst_reg,\n \t\t\t\t\tBPF_CLASS(insn-\u003ecode) == BPF_JMP);\n \n-\t\t\tif (is_imm8(imm32))\n-\t\t\t\tEMIT3(0x83, add_1reg(0xF8, dst_reg), imm32);\n+\t\t\tif (is_imm8(cmp_imm))\n+\t\t\t\tEMIT3(0x83, add_1reg(0xF8, dst_reg), cmp_imm);\n+\t\t\telse if (is_axreg(dst_reg))\n+\t\t\t\tEMIT1_off32(0x3D, cmp_imm);\n \t\t\telse\n-\t\t\t\tEMIT2_off32(0x81, add_1reg(0xF8, dst_reg), imm32);\n+\t\t\t\tEMIT2_off32(0x81, add_1reg(0xF8, dst_reg), cmp_imm);\n \n emit_cond_jmp:\t\t/* Convert BPF opcode to x86 */\n-\t\t\tswitch (BPF_OP(insn-\u003ecode)) {\n+\t\t\tswitch (jmp_op) {\n \t\t\tcase BPF_JEQ:\n \t\t\t\tjmp_cond = X86_JE;\n \t\t\t\tbreak;\n@@ -3949,13 +4308,8 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im\n \tif (im)\n \t\tim-\u003eksym.fp_start = prog - (u8 *)rw_image;\n \n-\tif (!is_imm8(stack_size)) {\n-\t\t/* sub rsp, stack_size */\n-\t\tEMIT3_off32(0x48, 0x81, 0xEC, stack_size);\n-\t} else {\n-\t\t/* sub rsp, stack_size */\n-\t\tEMIT4(0x48, 0x83, 0xEC, stack_size);\n-\t}\n+\t/* sub rsp, stack_size */\n+\temit_sub_rsp(\u0026prog, stack_size);\n \tif (flags \u0026 BPF_TRAMP_F_TAIL_CALL_CTX)\n \t\tEMIT1(0x50);\t\t/* push rax */\n \t/* mov QWORD PTR [rbp - rbx_off], rbx */\n@@ -4097,7 +4451,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im\n \n \tif (flags \u0026 BPF_TRAMP_F_SKIP_FRAME) {\n \t\t/* skip our return address and return to parent */\n-\t\tEMIT4(0x48, 0x83, 0xC4, 8); /* add rsp, 8 */\n+\t\temit_add_rsp(\u0026prog, 8); /* add rsp, 8 */\n \t}\n \temit_return(\u0026prog, image + (prog - (u8 *)rw_image));\n \t/* Make sure the trampoline generation logic doesn't overflow */\ndiff --git a/kernel/bpf/core.c b/kernel/bpf/core.c\nindex 05c89396119ad..642f0ab8eb2d8 100644\n--- a/kernel/bpf/core.c\n+++ b/kernel/bpf/core.c\n@@ -172,7 +172,6 @@ struct bpf_prog *bpf_prog_alloc(unsigned int size, gfp_t gfp_extra_flags)\n \t}\n \treturn prog;\n }\n-EXPORT_SYMBOL_GPL(bpf_prog_alloc);\n \n int bpf_prog_alloc_jited_linfo(struct bpf_prog *prog)\n {\n@@ -1681,7 +1680,6 @@ noinline u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)\n {\n \treturn 0;\n }\n-EXPORT_SYMBOL_GPL(__bpf_call_base);\n \n /* All UAPI available opcodes. */\n #define BPF_INSN_MAP(INSN_2, INSN_3)\t\t\\\n@@ -2747,7 +2745,6 @@ struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err)\n {\n \treturn __bpf_prog_select_runtime(NULL, fp, err);\n }\n-EXPORT_SYMBOL_GPL(bpf_prog_select_runtime);\n \n static unsigned int __bpf_prog_ret1(const void *ctx,\n \t\t\t\t    const struct bpf_insn *insn)\n@@ -3138,7 +3135,6 @@ void bpf_prog_free(struct bpf_prog *fp)\n \tINIT_WORK(\u0026aux-\u003ework, bpf_prog_free_deferred);\n \tschedule_work(\u0026aux-\u003ework);\n }\n-EXPORT_SYMBOL_GPL(bpf_prog_free);\n \n /* RNG for unprivileged user space with separated state from prandom_u32(). */\n static DEFINE_PER_CPU(struct rnd_state, bpf_user_rnd_state);\ndiff --git a/lib/Kconfig.debug b/lib/Kconfig.debug\nindex 2f34619905b60..d3d3604bedcff 100644\n--- a/lib/Kconfig.debug\n+++ b/lib/Kconfig.debug\n@@ -2638,19 +2638,6 @@ config TEST_WORKQUEUE\n \n \t  If unsure, say N.\n \n-config TEST_BPF\n-\ttristate \"Test BPF filter functionality\"\n-\tdepends on m \u0026\u0026 NET\n-\thelp\n-\t  This builds the \"test_bpf\" module that runs various test vectors\n-\t  against the BPF interpreter or BPF JIT compiler depending on the\n-\t  current setting. This is in particular useful for BPF JIT compiler\n-\t  development, but also to run regression tests against changes in\n-\t  the interpreter code. It also enables test stubs for eBPF maps and\n-\t  verifier used by user space verifier testsuite.\n-\n-\t  If unsure, say N.\n-\n config FIND_BIT_BENCHMARK\n \ttristate \"Test find_bit functions\"\n \thelp\ndiff --git a/lib/Makefile b/lib/Makefile\nindex dfab958327c5c..361b02903bef0 100644\n--- a/lib/Makefile\n+++ b/lib/Makefile\n@@ -66,7 +66,6 @@ obj-y += kstrtox.o\n obj-$(CONFIG_FIND_BIT_BENCHMARK) += find_bit_benchmark.o\n obj-$(CONFIG_REGION_ALLOC_BENCHMARK) += region_alloc_benchmark.o\n obj-$(CONFIG_FIND_BIT_BENCHMARK_RUST) += find_bit_benchmark_rust.o\n-obj-$(CONFIG_TEST_BPF) += test_bpf.o\n test_dhry-objs := dhry_1.o dhry_2.o dhry_run.o\n obj-$(CONFIG_TEST_DHRY) += test_dhry.o\n obj-$(CONFIG_TEST_FIRMWARE) += test_firmware.o\ndiff --git a/lib/test_bpf.c b/lib/test_bpf.c\ndeleted file mode 100644\nindex af6f3340c034f..0000000000000\n--- a/lib/test_bpf.c\n+++ /dev/null\n@@ -1,15934 +0,0 @@\n-// SPDX-License-Identifier: GPL-2.0-only\n-/*\n- * Testsuite for BPF interpreter and BPF JIT compiler\n- *\n- * Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com\n- */\n-\n-#define pr_fmt(fmt) KBUILD_MODNAME \": \" fmt\n-\n-#include \u003clinux/init.h\u003e\n-#include \u003clinux/module.h\u003e\n-#include \u003clinux/filter.h\u003e\n-#include \u003clinux/bpf.h\u003e\n-#include \u003clinux/skbuff.h\u003e\n-#include \u003clinux/netdevice.h\u003e\n-#include \u003clinux/if_vlan.h\u003e\n-#include \u003clinux/prandom.h\u003e\n-#include \u003clinux/highmem.h\u003e\n-#include \u003clinux/sched.h\u003e\n-\n-/* General test specific settings */\n-#define MAX_SUBTESTS\t3\n-#define MAX_TESTRUNS\t1000\n-#define MAX_DATA\t128\n-#define MAX_INSNS\t512\n-#define MAX_K\t\t0xffffFFFF\n-\n-/* Few constants used to init test 'skb' */\n-#define SKB_TYPE\t3\n-#define SKB_MARK\t0x1234aaaa\n-#define SKB_HASH\t0x1234aaab\n-#define SKB_QUEUE_MAP\t123\n-#define SKB_VLAN_TCI\t0xffff\n-#define SKB_VLAN_PRESENT\t1\n-#define SKB_DEV_IFINDEX\t577\n-#define SKB_DEV_TYPE\t588\n-\n-/* Redefine REGs to make tests less verbose */\n-#define R0\t\tBPF_REG_0\n-#define R1\t\tBPF_REG_1\n-#define R2\t\tBPF_REG_2\n-#define R3\t\tBPF_REG_3\n-#define R4\t\tBPF_REG_4\n-#define R5\t\tBPF_REG_5\n-#define R6\t\tBPF_REG_6\n-#define R7\t\tBPF_REG_7\n-#define R8\t\tBPF_REG_8\n-#define R9\t\tBPF_REG_9\n-#define R10\t\tBPF_REG_10\n-\n-/* Flags that can be passed to test cases */\n-#define FLAG_NO_DATA\t\tBIT(0)\n-#define FLAG_EXPECTED_FAIL\tBIT(1)\n-#define FLAG_SKB_FRAG\t\tBIT(2)\n-#define FLAG_VERIFIER_ZEXT\tBIT(3)\n-#define FLAG_LARGE_MEM\t\tBIT(4)\n-\n-enum {\n-\tCLASSIC  = BIT(6),\t/* Old BPF instructions only. */\n-\tINTERNAL = BIT(7),\t/* Extended instruction set.  */\n-};\n-\n-#define TEST_TYPE_MASK\t\t(CLASSIC | INTERNAL)\n-\n-struct bpf_test {\n-\tconst char *descr;\n-\tunion {\n-\t\tstruct sock_filter insns[MAX_INSNS];\n-\t\tstruct bpf_insn insns_int[MAX_INSNS];\n-\t\tstruct {\n-\t\t\tvoid *insns;\n-\t\t\tunsigned int len;\n-\t\t} ptr;\n-\t} u;\n-\t__u8 aux;\n-\t__u8 data[MAX_DATA];\n-\tstruct {\n-\t\tint data_size;\n-\t\t__u32 result;\n-\t} test[MAX_SUBTESTS];\n-\tint (*fill_helper)(struct bpf_test *self);\n-\tint expected_errcode; /* used when FLAG_EXPECTED_FAIL is set in the aux */\n-\t__u8 frag_data[MAX_DATA];\n-\tint stack_depth; /* for eBPF only, since tests don't call verifier */\n-\tint nr_testruns; /* Custom run count, defaults to MAX_TESTRUNS if 0 */\n-};\n-\n-/* Large test cases need separate allocation and fill handler. */\n-\n-static int bpf_fill_maxinsns1(struct bpf_test *self)\n-{\n-\tunsigned int len = BPF_MAXINSNS;\n-\tstruct sock_filter *insn;\n-\t__u32 k = ~0;\n-\tint i;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\tfor (i = 0; i \u003c len; i++, k--)\n-\t\tinsn[i] = __BPF_STMT(BPF_RET | BPF_K, k);\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\n-\treturn 0;\n-}\n-\n-static int bpf_fill_maxinsns2(struct bpf_test *self)\n-{\n-\tunsigned int len = BPF_MAXINSNS;\n-\tstruct sock_filter *insn;\n-\tint i;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\tfor (i = 0; i \u003c len; i++)\n-\t\tinsn[i] = __BPF_STMT(BPF_RET | BPF_K, 0xfefefefe);\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\n-\treturn 0;\n-}\n-\n-static int bpf_fill_maxinsns3(struct bpf_test *self)\n-{\n-\tunsigned int len = BPF_MAXINSNS;\n-\tstruct sock_filter *insn;\n-\tstruct rnd_state rnd;\n-\tint i;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\tprandom_seed_state(\u0026rnd, 3141592653589793238ULL);\n-\n-\tfor (i = 0; i \u003c len - 1; i++) {\n-\t\t__u32 k = prandom_u32_state(\u0026rnd);\n-\n-\t\tinsn[i] = __BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, k);\n-\t}\n-\n-\tinsn[len - 1] = __BPF_STMT(BPF_RET | BPF_A, 0);\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\n-\treturn 0;\n-}\n-\n-static int bpf_fill_maxinsns4(struct bpf_test *self)\n-{\n-\tunsigned int len = BPF_MAXINSNS + 1;\n-\tstruct sock_filter *insn;\n-\tint i;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\tfor (i = 0; i \u003c len; i++)\n-\t\tinsn[i] = __BPF_STMT(BPF_RET | BPF_K, 0xfefefefe);\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\n-\treturn 0;\n-}\n-\n-static int bpf_fill_maxinsns5(struct bpf_test *self)\n-{\n-\tunsigned int len = BPF_MAXINSNS;\n-\tstruct sock_filter *insn;\n-\tint i;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\tinsn[0] = __BPF_JUMP(BPF_JMP | BPF_JA, len - 2, 0, 0);\n-\n-\tfor (i = 1; i \u003c len - 1; i++)\n-\t\tinsn[i] = __BPF_STMT(BPF_RET | BPF_K, 0xfefefefe);\n-\n-\tinsn[len - 1] = __BPF_STMT(BPF_RET | BPF_K, 0xabababab);\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\n-\treturn 0;\n-}\n-\n-static int bpf_fill_maxinsns6(struct bpf_test *self)\n-{\n-\tunsigned int len = BPF_MAXINSNS;\n-\tstruct sock_filter *insn;\n-\tint i;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\tfor (i = 0; i \u003c len - 1; i++)\n-\t\tinsn[i] = __BPF_STMT(BPF_LD | BPF_W | BPF_ABS, SKF_AD_OFF +\n-\t\t\t\t     SKF_AD_VLAN_TAG_PRESENT);\n-\n-\tinsn[len - 1] = __BPF_STMT(BPF_RET | BPF_A, 0);\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\n-\treturn 0;\n-}\n-\n-static int bpf_fill_maxinsns7(struct bpf_test *self)\n-{\n-\tunsigned int len = BPF_MAXINSNS;\n-\tstruct sock_filter *insn;\n-\tint i;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\tfor (i = 0; i \u003c len - 4; i++)\n-\t\tinsn[i] = __BPF_STMT(BPF_LD | BPF_W | BPF_ABS, SKF_AD_OFF +\n-\t\t\t\t     SKF_AD_CPU);\n-\n-\tinsn[len - 4] = __BPF_STMT(BPF_MISC | BPF_TAX, 0);\n-\tinsn[len - 3] = __BPF_STMT(BPF_LD | BPF_W | BPF_ABS, SKF_AD_OFF +\n-\t\t\t\t   SKF_AD_CPU);\n-\tinsn[len - 2] = __BPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0);\n-\tinsn[len - 1] = __BPF_STMT(BPF_RET | BPF_A, 0);\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\n-\treturn 0;\n-}\n-\n-static int bpf_fill_maxinsns8(struct bpf_test *self)\n-{\n-\tunsigned int len = BPF_MAXINSNS;\n-\tstruct sock_filter *insn;\n-\tint i, jmp_off = len - 3;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\tinsn[0] = __BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff);\n-\n-\tfor (i = 1; i \u003c len - 1; i++)\n-\t\tinsn[i] = __BPF_JUMP(BPF_JMP | BPF_JGT, 0xffffffff, jmp_off--, 0);\n-\n-\tinsn[len - 1] = __BPF_STMT(BPF_RET | BPF_A, 0);\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\n-\treturn 0;\n-}\n-\n-static int bpf_fill_maxinsns9(struct bpf_test *self)\n-{\n-\tunsigned int len = BPF_MAXINSNS;\n-\tstruct bpf_insn *insn;\n-\tint i;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\tinsn[0] = BPF_JMP_IMM(BPF_JA, 0, 0, len - 2);\n-\tinsn[1] = BPF_ALU32_IMM(BPF_MOV, R0, 0xcbababab);\n-\tinsn[2] = BPF_EXIT_INSN();\n-\n-\tfor (i = 3; i \u003c len - 2; i++)\n-\t\tinsn[i] = BPF_ALU32_IMM(BPF_MOV, R0, 0xfefefefe);\n-\n-\tinsn[len - 2] = BPF_EXIT_INSN();\n-\tinsn[len - 1] = BPF_JMP_IMM(BPF_JA, 0, 0, -(len - 1));\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\n-\treturn 0;\n-}\n-\n-static int bpf_fill_maxinsns10(struct bpf_test *self)\n-{\n-\tunsigned int len = BPF_MAXINSNS, hlen = len - 2;\n-\tstruct bpf_insn *insn;\n-\tint i;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\tfor (i = 0; i \u003c hlen / 2; i++)\n-\t\tinsn[i] = BPF_JMP_IMM(BPF_JA, 0, 0, hlen - 2 - 2 * i);\n-\tfor (i = hlen - 1; i \u003e hlen / 2; i--)\n-\t\tinsn[i] = BPF_JMP_IMM(BPF_JA, 0, 0, hlen - 1 - 2 * i);\n-\n-\tinsn[hlen / 2] = BPF_JMP_IMM(BPF_JA, 0, 0, hlen / 2 - 1);\n-\tinsn[hlen]     = BPF_ALU32_IMM(BPF_MOV, R0, 0xabababac);\n-\tinsn[hlen + 1] = BPF_EXIT_INSN();\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\n-\treturn 0;\n-}\n-\n-static int __bpf_fill_ja(struct bpf_test *self, unsigned int len,\n-\t\t\t unsigned int plen)\n-{\n-\tstruct sock_filter *insn;\n-\tunsigned int rlen;\n-\tint i, j;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\trlen = (len % plen) - 1;\n-\n-\tfor (i = 0; i + plen \u003c len; i += plen)\n-\t\tfor (j = 0; j \u003c plen; j++)\n-\t\t\tinsn[i + j] = __BPF_JUMP(BPF_JMP | BPF_JA,\n-\t\t\t\t\t\t plen - 1 - j, 0, 0);\n-\tfor (j = 0; j \u003c rlen; j++)\n-\t\tinsn[i + j] = __BPF_JUMP(BPF_JMP | BPF_JA, rlen - 1 - j,\n-\t\t\t\t\t 0, 0);\n-\n-\tinsn[len - 1] = __BPF_STMT(BPF_RET | BPF_K, 0xababcbac);\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\n-\treturn 0;\n-}\n-\n-static int bpf_fill_maxinsns11(struct bpf_test *self)\n-{\n-\t/* Hits 70 passes on x86_64 and triggers NOPs padding. */\n-\treturn __bpf_fill_ja(self, BPF_MAXINSNS, 68);\n-}\n-\n-static int bpf_fill_maxinsns12(struct bpf_test *self)\n-{\n-\tunsigned int len = BPF_MAXINSNS;\n-\tstruct sock_filter *insn;\n-\tint i = 0;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\tinsn[0] = __BPF_JUMP(BPF_JMP | BPF_JA, len - 2, 0, 0);\n-\n-\tfor (i = 1; i \u003c len - 1; i++)\n-\t\tinsn[i] = __BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0);\n-\n-\tinsn[len - 1] = __BPF_STMT(BPF_RET | BPF_K, 0xabababab);\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\n-\treturn 0;\n-}\n-\n-static int bpf_fill_maxinsns13(struct bpf_test *self)\n-{\n-\tunsigned int len = BPF_MAXINSNS;\n-\tstruct sock_filter *insn;\n-\tint i = 0;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\tfor (i = 0; i \u003c len - 3; i++)\n-\t\tinsn[i] = __BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0);\n-\n-\tinsn[len - 3] = __BPF_STMT(BPF_LD | BPF_IMM, 0xabababab);\n-\tinsn[len - 2] = __BPF_STMT(BPF_ALU | BPF_XOR | BPF_X, 0);\n-\tinsn[len - 1] = __BPF_STMT(BPF_RET | BPF_A, 0);\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\n-\treturn 0;\n-}\n-\n-static int bpf_fill_ja(struct bpf_test *self)\n-{\n-\t/* Hits exactly 11 passes on x86_64 JIT. */\n-\treturn __bpf_fill_ja(self, 12, 9);\n-}\n-\n-static int bpf_fill_ld_abs_get_processor_id(struct bpf_test *self)\n-{\n-\tunsigned int len = BPF_MAXINSNS;\n-\tstruct sock_filter *insn;\n-\tint i;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\tfor (i = 0; i \u003c len - 1; i += 2) {\n-\t\tinsn[i] = __BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 0);\n-\t\tinsn[i + 1] = __BPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t\t SKF_AD_OFF + SKF_AD_CPU);\n-\t}\n-\n-\tinsn[len - 1] = __BPF_STMT(BPF_RET | BPF_K, 0xbee);\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\n-\treturn 0;\n-}\n-\n-static int __bpf_fill_stxdw(struct bpf_test *self, int size)\n-{\n-\tunsigned int len = BPF_MAXINSNS;\n-\tstruct bpf_insn *insn;\n-\tint i;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\tinsn[0] = BPF_ALU32_IMM(BPF_MOV, R0, 1);\n-\tinsn[1] = BPF_ST_MEM(size, R10, -40, 42);\n-\n-\tfor (i = 2; i \u003c len - 2; i++)\n-\t\tinsn[i] = BPF_STX_XADD(size, R10, R0, -40);\n-\n-\tinsn[len - 2] = BPF_LDX_MEM(size, R0, R10, -40);\n-\tinsn[len - 1] = BPF_EXIT_INSN();\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\tself-\u003estack_depth = 40;\n-\n-\treturn 0;\n-}\n-\n-static int bpf_fill_stxw(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_stxdw(self, BPF_W);\n-}\n-\n-static int bpf_fill_stxdw(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_stxdw(self, BPF_DW);\n-}\n-\n-static int __bpf_ld_imm64(struct bpf_insn insns[2], u8 reg, s64 imm64)\n-{\n-\tstruct bpf_insn tmp[] = {BPF_LD_IMM64(reg, imm64)};\n-\n-\tmemcpy(insns, tmp, sizeof(tmp));\n-\treturn 2;\n-}\n-\n-/*\n- * Branch conversion tests. Complex operations can expand to a lot\n- * of instructions when JITed. This in turn may cause jump offsets\n- * to overflow the field size of the native instruction, triggering\n- * a branch conversion mechanism in some JITs.\n- */\n-static int __bpf_fill_max_jmp(struct bpf_test *self, int jmp, int imm, bool alu32)\n-{\n-\tstruct bpf_insn *insns;\n-\tint len = S16_MAX + 5;\n-\tint i;\n-\n-\tinsns = kmalloc_objs(*insns, len);\n-\tif (!insns)\n-\t\treturn -ENOMEM;\n-\n-\ti = __bpf_ld_imm64(insns, R1, 0x0123456789abcdefULL);\n-\tinsns[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 1);\n-\tinsns[i++] = BPF_JMP_IMM(jmp, R0, imm, S16_MAX);\n-\tinsns[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 2);\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\twhile (i \u003c len - 1) {\n-\t\tstatic const int ops[] = {\n-\t\t\tBPF_LSH, BPF_RSH, BPF_ARSH, BPF_ADD,\n-\t\t\tBPF_SUB, BPF_MUL, BPF_DIV, BPF_MOD,\n-\t\t};\n-\t\tint op = ops[(i \u003e\u003e 1) % ARRAY_SIZE(ops)];\n-\n-\t\tif ((i \u0026 1) || alu32)\n-\t\t\tinsns[i++] = BPF_ALU32_REG(op, R0, R1);\n-\t\telse\n-\t\t\tinsns[i++] = BPF_ALU64_REG(op, R0, R1);\n-\t}\n-\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\tself-\u003eu.ptr.insns = insns;\n-\tself-\u003eu.ptr.len = len;\n-\tBUG_ON(i != len);\n-\n-\treturn 0;\n-}\n-\n-/* Branch taken by runtime decision */\n-static int bpf_fill_max_jmp_taken_32(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_max_jmp(self, BPF_JEQ, 1, true);\n-}\n-\n-static int bpf_fill_max_jmp_taken(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_max_jmp(self, BPF_JEQ, 1, false);\n-}\n-\n-/* Branch not taken by runtime decision */\n-static int bpf_fill_max_jmp_not_taken_32(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_max_jmp(self, BPF_JEQ, 0, true);\n-}\n-\n-static int bpf_fill_max_jmp_not_taken(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_max_jmp(self, BPF_JEQ, 0, false);\n-}\n-\n-/* Branch always taken, known at JIT time */\n-static int bpf_fill_max_jmp_always_taken_32(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_max_jmp(self, BPF_JGE, 0, true);\n-}\n-\n-static int bpf_fill_max_jmp_always_taken(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_max_jmp(self, BPF_JGE, 0, false);\n-}\n-\n-/* Branch never taken, known at JIT time */\n-static int bpf_fill_max_jmp_never_taken_32(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_max_jmp(self, BPF_JLT, 0, true);\n-}\n-\n-static int bpf_fill_max_jmp_never_taken(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_max_jmp(self, BPF_JLT, 0, false);\n-}\n-\n-/* ALU result computation used in tests */\n-enum { F_ALU32 = 1, F_SIGNED = 2 };\n-\n-static bool __bpf_alu_result(u64 *res, u64 v1, u64 v2, u8 op, u32 flags)\n-{\n-\tbool is_signed = flags \u0026 F_SIGNED;\n-\n-\t/* Narrow operands for ALU32 */\n-\tif (flags \u0026 F_ALU32) {\n-\t\tif (is_signed) {\n-\t\t\tv1 = (u64)(s32)v1;\n-\t\t\tv2 = (u64)(s32)v2;\n-\t\t} else {\n-\t\t\tv1 = (u32)v1;\n-\t\t\tv2 = (u32)v2;\n-\t\t}\n-\t}\n-\n-\t*res = 0;\n-\tswitch (op) {\n-\tcase BPF_MOV:\n-\t\t*res = v2;\n-\t\tbreak;\n-\tcase BPF_AND:\n-\t\t*res = v1 \u0026 v2;\n-\t\tbreak;\n-\tcase BPF_OR:\n-\t\t*res = v1 | v2;\n-\t\tbreak;\n-\tcase BPF_XOR:\n-\t\t*res = v1 ^ v2;\n-\t\tbreak;\n-\tcase BPF_LSH:\n-\t\t*res = v1 \u003c\u003c v2;\n-\t\tbreak;\n-\tcase BPF_RSH:\n-\t\t*res = v1 \u003e\u003e v2;\n-\t\tbreak;\n-\tcase BPF_ARSH:\n-\t\t*res = v1 \u003e\u003e v2;\n-\t\tif (v2 \u003e 0 \u0026\u0026 v1 \u003e S64_MAX)\n-\t\t\t*res |= ~0ULL \u003c\u003c (64 - v2);\n-\t\tbreak;\n-\tcase BPF_ADD:\n-\t\t*res = v1 + v2;\n-\t\tbreak;\n-\tcase BPF_SUB:\n-\t\t*res = v1 - v2;\n-\t\tbreak;\n-\tcase BPF_MUL:\n-\t\t*res = v1 * v2;\n-\t\tbreak;\n-\tcase BPF_DIV:\n-\t\tif (v2 == 0)\n-\t\t\treturn false;\n-\t\tif (!is_signed) {\n-\t\t\t*res = div64_u64(v1, v2);\n-\t\t} else {\n-\t\t\tif ((s64)v2 == -1) /* Handled by verifier */\n-\t\t\t\treturn false;\n-\t\t\t*res = (u64)div64_s64(v1, v2);\n-\t\t}\n-\t\tbreak;\n-\tcase BPF_MOD:\n-\t\tif (v2 == 0)\n-\t\t\treturn false;\n-\t\tif (!is_signed) {\n-\t\t\tdiv64_u64_rem(v1, v2, res);\n-\t\t} else {\n-\t\t\tif ((s64)v2 == -1)\n-\t\t\t\treturn false;\n-\t\t\t/*\n-\t\t\t * Avoid s64 % s64 which generates __moddi3 on\n-\t\t\t * 32-bit architectures. Use div64_s64 instead.\n-\t\t\t */\n-\t\t\t*res = (u64)((s64)v1 - div64_s64(v1, v2) * (s64)v2);\n-\t\t}\n-\t\tbreak;\n-\t}\n-\treturn true;\n-}\n-\n-/* Test an ALU shift operation for all valid shift values */\n-static int __bpf_fill_alu_shift(struct bpf_test *self, u8 op,\n-\t\t\t\tu8 mode, u32 flags)\n-{\n-\tstatic const s64 regs[] = {\n-\t\t0x0123456789abcdefLL, /* dword \u003e 0, word \u003c 0 */\n-\t\t0xfedcba9876543210LL, /* dword \u003c 0, word \u003e 0 */\n-\t\t0xfedcba0198765432LL, /* dword \u003c 0, word \u003c 0 */\n-\t\t0x0123458967abcdefLL, /* dword \u003e 0, word \u003e 0 */\n-\t};\n-\tint bits = (flags \u0026 F_ALU32) ? 32 : 64;\n-\tint len = (2 + 7 * bits) * ARRAY_SIZE(regs) + 3;\n-\tstruct bpf_insn *insn;\n-\tint imm, k;\n-\tint i = 0;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\tinsn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 0);\n-\n-\tfor (k = 0; k \u003c ARRAY_SIZE(regs); k++) {\n-\t\ts64 reg = regs[k];\n-\n-\t\ti += __bpf_ld_imm64(\u0026insn[i], R3, reg);\n-\n-\t\tfor (imm = 0; imm \u003c bits; imm++) {\n-\t\t\tu64 val;\n-\n-\t\t\t/* Perform operation */\n-\t\t\tinsn[i++] = BPF_ALU64_REG(BPF_MOV, R1, R3);\n-\t\t\tinsn[i++] = BPF_ALU64_IMM(BPF_MOV, R2, imm);\n-\t\t\tif (flags \u0026 F_ALU32) {\n-\t\t\t\tif (mode == BPF_K)\n-\t\t\t\t\tinsn[i++] = BPF_ALU32_IMM(op, R1, imm);\n-\t\t\t\telse\n-\t\t\t\t\tinsn[i++] = BPF_ALU32_REG(op, R1, R2);\n-\n-\t\t\t\tif (op == BPF_ARSH)\n-\t\t\t\t\treg = (s32)reg;\n-\t\t\t\telse\n-\t\t\t\t\treg = (u32)reg;\n-\t\t\t\t__bpf_alu_result(\u0026val, reg, imm, op, 0);\n-\t\t\t\tval = (u32)val;\n-\t\t\t} else {\n-\t\t\t\tif (mode == BPF_K)\n-\t\t\t\t\tinsn[i++] = BPF_ALU64_IMM(op, R1, imm);\n-\t\t\t\telse\n-\t\t\t\t\tinsn[i++] = BPF_ALU64_REG(op, R1, R2);\n-\t\t\t\t__bpf_alu_result(\u0026val, reg, imm, op, 0);\n-\t\t\t}\n-\n-\t\t\t/*\n-\t\t\t * When debugging a JIT that fails this test, one\n-\t\t\t * can write the immediate value to R0 here to find\n-\t\t\t * out which operand values that fail.\n-\t\t\t */\n-\n-\t\t\t/* Load reference and check the result */\n-\t\t\ti += __bpf_ld_imm64(\u0026insn[i], R4, val);\n-\t\t\tinsn[i++] = BPF_JMP_REG(BPF_JEQ, R1, R4, 1);\n-\t\t\tinsn[i++] = BPF_EXIT_INSN();\n-\t\t}\n-\t}\n-\n-\tinsn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 1);\n-\tinsn[i++] = BPF_EXIT_INSN();\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\tBUG_ON(i != len);\n-\n-\treturn 0;\n-}\n-\n-static int bpf_fill_alu64_lsh_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_shift(self, BPF_LSH, BPF_K, 0);\n-}\n-\n-static int bpf_fill_alu64_rsh_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_shift(self, BPF_RSH, BPF_K, 0);\n-}\n-\n-static int bpf_fill_alu64_arsh_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_shift(self, BPF_ARSH, BPF_K, 0);\n-}\n-\n-static int bpf_fill_alu64_lsh_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_shift(self, BPF_LSH, BPF_X, 0);\n-}\n-\n-static int bpf_fill_alu64_rsh_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_shift(self, BPF_RSH, BPF_X, 0);\n-}\n-\n-static int bpf_fill_alu64_arsh_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_shift(self, BPF_ARSH, BPF_X, 0);\n-}\n-\n-static int bpf_fill_alu32_lsh_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_shift(self, BPF_LSH, BPF_K, F_ALU32);\n-}\n-\n-static int bpf_fill_alu32_rsh_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_shift(self, BPF_RSH, BPF_K, F_ALU32);\n-}\n-\n-static int bpf_fill_alu32_arsh_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_shift(self, BPF_ARSH, BPF_K, F_ALU32);\n-}\n-\n-static int bpf_fill_alu32_lsh_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_shift(self, BPF_LSH, BPF_X, F_ALU32);\n-}\n-\n-static int bpf_fill_alu32_rsh_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_shift(self, BPF_RSH, BPF_X, F_ALU32);\n-}\n-\n-static int bpf_fill_alu32_arsh_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_shift(self, BPF_ARSH, BPF_X, F_ALU32);\n-}\n-\n-/*\n- * Test an ALU register shift operation for all valid shift values\n- * for the case when the source and destination are the same.\n- */\n-static int __bpf_fill_alu_shift_same_reg(struct bpf_test *self, u8 op,\n-\t\t\t\t\t u32 flags)\n-{\n-\tint bits = (flags \u0026 F_ALU32) ? 32 : 64;\n-\tint len = 3 + 6 * bits;\n-\tstruct bpf_insn *insn;\n-\tint i = 0;\n-\tu64 val;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\tinsn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 0);\n-\n-\tfor (val = 0; val \u003c bits; val++) {\n-\t\tu64 res;\n-\n-\t\t/* Perform operation */\n-\t\tinsn[i++] = BPF_ALU64_IMM(BPF_MOV, R1, val);\n-\t\tif (flags \u0026 F_ALU32)\n-\t\t\tinsn[i++] = BPF_ALU32_REG(op, R1, R1);\n-\t\telse\n-\t\t\tinsn[i++] = BPF_ALU64_REG(op, R1, R1);\n-\n-\t\t/* Compute the reference result */\n-\t\t__bpf_alu_result(\u0026res, val, val, op, 0);\n-\t\tif (flags \u0026 F_ALU32)\n-\t\t\tres = (u32)res;\n-\t\ti += __bpf_ld_imm64(\u0026insn[i], R2, res);\n-\n-\t\t/* Check the actual result */\n-\t\tinsn[i++] = BPF_JMP_REG(BPF_JEQ, R1, R2, 1);\n-\t\tinsn[i++] = BPF_EXIT_INSN();\n-\t}\n-\n-\tinsn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 1);\n-\tinsn[i++] = BPF_EXIT_INSN();\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\tBUG_ON(i != len);\n-\n-\treturn 0;\n-}\n-\n-static int bpf_fill_alu64_lsh_same_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_shift_same_reg(self, BPF_LSH, 0);\n-}\n-\n-static int bpf_fill_alu64_rsh_same_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_shift_same_reg(self, BPF_RSH, 0);\n-}\n-\n-static int bpf_fill_alu64_arsh_same_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_shift_same_reg(self, BPF_ARSH, 0);\n-}\n-\n-static int bpf_fill_alu32_lsh_same_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_shift_same_reg(self, BPF_LSH, F_ALU32);\n-}\n-\n-static int bpf_fill_alu32_rsh_same_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_shift_same_reg(self, BPF_RSH, F_ALU32);\n-}\n-\n-static int bpf_fill_alu32_arsh_same_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_shift_same_reg(self, BPF_ARSH, F_ALU32);\n-}\n-\n-/*\n- * Common operand pattern generator for exhaustive power-of-two magnitudes\n- * tests. The block size parameters can be adjusted to increase/reduce the\n- * number of combinatons tested and thereby execution speed and memory\n- * footprint.\n- */\n-\n-static inline s64 value(int msb, int delta, int sign)\n-{\n-\treturn sign * (1LL \u003c\u003c msb) + delta;\n-}\n-\n-static int __bpf_fill_pattern(struct bpf_test *self, void *arg,\n-\t\t\t      int dbits, int sbits, int block1, int block2,\n-\t\t\t      int (*emit)(struct bpf_test*, void*,\n-\t\t\t\t\t  struct bpf_insn*, s64, s64))\n-{\n-\tstatic const int sgn[][2] = {{1, 1}, {1, -1}, {-1, 1}, {-1, -1}};\n-\tstruct bpf_insn *insns;\n-\tint di, si, bt, db, sb;\n-\tint count, len, k;\n-\tint extra = 1 + 2;\n-\tint i = 0;\n-\n-\t/* Total number of iterations for the two pattern */\n-\tcount = (dbits - 1) * (sbits - 1) * block1 * block1 * ARRAY_SIZE(sgn);\n-\tcount += (max(dbits, sbits) - 1) * block2 * block2 * ARRAY_SIZE(sgn);\n-\n-\t/* Compute the maximum number of insns and allocate the buffer */\n-\tlen = extra + count * (*emit)(self, arg, NULL, 0, 0);\n-\tinsns = kmalloc_array(len, sizeof(*insns), GFP_KERNEL);\n-\tif (!insns)\n-\t\treturn -ENOMEM;\n-\n-\t/* Add head instruction(s) */\n-\tinsns[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 0);\n-\n-\t/*\n-\t * Pattern 1: all combinations of power-of-two magnitudes and sign,\n-\t * and with a block of contiguous values around each magnitude.\n-\t */\n-\tfor (di = 0; di \u003c dbits - 1; di++)                 /* Dst magnitudes */\n-\t\tfor (si = 0; si \u003c sbits - 1; si++)         /* Src magnitudes */\n-\t\t\tfor (k = 0; k \u003c ARRAY_SIZE(sgn); k++) /* Sign combos */\n-\t\t\t\tfor (db = -(block1 / 2);\n-\t\t\t\t     db \u003c (block1 + 1) / 2; db++)\n-\t\t\t\t\tfor (sb = -(block1 / 2);\n-\t\t\t\t\t     sb \u003c (block1 + 1) / 2; sb++) {\n-\t\t\t\t\t\ts64 dst, src;\n-\n-\t\t\t\t\t\tdst = value(di, db, sgn[k][0]);\n-\t\t\t\t\t\tsrc = value(si, sb, sgn[k][1]);\n-\t\t\t\t\t\ti += (*emit)(self, arg,\n-\t\t\t\t\t\t\t     \u0026insns[i],\n-\t\t\t\t\t\t\t     dst, src);\n-\t\t\t\t\t}\n-\t/*\n-\t * Pattern 2: all combinations for a larger block of values\n-\t * for each power-of-two magnitude and sign, where the magnitude is\n-\t * the same for both operands.\n-\t */\n-\tfor (bt = 0; bt \u003c max(dbits, sbits) - 1; bt++)        /* Magnitude   */\n-\t\tfor (k = 0; k \u003c ARRAY_SIZE(sgn); k++)         /* Sign combos */\n-\t\t\tfor (db = -(block2 / 2); db \u003c (block2 + 1) / 2; db++)\n-\t\t\t\tfor (sb = -(block2 / 2);\n-\t\t\t\t     sb \u003c (block2 + 1) / 2; sb++) {\n-\t\t\t\t\ts64 dst, src;\n-\n-\t\t\t\t\tdst = value(bt % dbits, db, sgn[k][0]);\n-\t\t\t\t\tsrc = value(bt % sbits, sb, sgn[k][1]);\n-\t\t\t\t\ti += (*emit)(self, arg, \u0026insns[i],\n-\t\t\t\t\t\t     dst, src);\n-\t\t\t\t}\n-\n-\t/* Append tail instructions */\n-\tinsns[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 1);\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\tBUG_ON(i \u003e len);\n-\n-\tself-\u003eu.ptr.insns = insns;\n-\tself-\u003eu.ptr.len = i;\n-\n-\treturn 0;\n-}\n-\n-/*\n- * Block size parameters used in pattern tests below. une as needed to\n- * increase/reduce the number combinations tested, see following examples.\n- *        block   values per operand MSB\n- * ----------------------------------------\n- *           0     none\n- *           1     (1 \u003c\u003c MSB)\n- *           2     (1 \u003c\u003c MSB) + [-1, 0]\n- *           3     (1 \u003c\u003c MSB) + [-1, 0, 1]\n- */\n-#define PATTERN_BLOCK1 1\n-#define PATTERN_BLOCK2 5\n-\n-/* Number of test runs for a pattern test */\n-#define NR_PATTERN_RUNS 1\n-\n-/*\n- * Exhaustive tests of ALU operations for all combinations of power-of-two\n- * magnitudes of the operands, both for positive and negative values. The\n- * test is designed to verify e.g. the ALU and ALU64 operations for JITs that\n- * emit different code depending on the magnitude of the immediate value.\n- */\n-static int __bpf_emit_alu64_imm(struct bpf_test *self, void *arg,\n-\t\t\t\tstruct bpf_insn *insns, s64 dst, s64 imm)\n-{\n-\tint *a = arg;\n-\tint op = a[0];\n-\tu32 flags = a[1];\n-\ts16 off = (flags \u0026 F_SIGNED) ? 1 : 0;\n-\tint i = 0;\n-\tu64 res;\n-\n-\tif (!insns)\n-\t\treturn 7;\n-\n-\tif (__bpf_alu_result(\u0026res, dst, (s32)imm, op, flags)) {\n-\t\ti += __bpf_ld_imm64(\u0026insns[i], R1, dst);\n-\t\ti += __bpf_ld_imm64(\u0026insns[i], R3, res);\n-\t\tinsns[i++] = BPF_ALU64_IMM_OFF(op, R1, imm, off);\n-\t\tinsns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 1);\n-\t\tinsns[i++] = BPF_EXIT_INSN();\n-\t}\n-\n-\treturn i;\n-}\n-\n-static int __bpf_emit_alu32_imm(struct bpf_test *self, void *arg,\n-\t\t\t\tstruct bpf_insn *insns, s64 dst, s64 imm)\n-{\n-\tint *a = arg;\n-\tint op = a[0];\n-\tu32 flags = a[1];\n-\ts16 off = (flags \u0026 F_SIGNED) ? 1 : 0;\n-\tint i = 0;\n-\tu64 res;\n-\n-\tif (!insns)\n-\t\treturn 7;\n-\n-\tif (__bpf_alu_result(\u0026res, dst, (s32)imm, op, flags | F_ALU32)) {\n-\t\ti += __bpf_ld_imm64(\u0026insns[i], R1, dst);\n-\t\ti += __bpf_ld_imm64(\u0026insns[i], R3, (u32)res);\n-\t\tinsns[i++] = BPF_ALU32_IMM_OFF(op, R1, imm, off);\n-\t\tinsns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 1);\n-\t\tinsns[i++] = BPF_EXIT_INSN();\n-\t}\n-\n-\treturn i;\n-}\n-\n-static int __bpf_emit_alu64_reg(struct bpf_test *self, void *arg,\n-\t\t\t\tstruct bpf_insn *insns, s64 dst, s64 src)\n-{\n-\tint op = *(int *)arg;\n-\tint i = 0;\n-\tu64 res;\n-\n-\tif (!insns)\n-\t\treturn 9;\n-\n-\tif (__bpf_alu_result(\u0026res, dst, src, op, 0)) {\n-\t\ti += __bpf_ld_imm64(\u0026insns[i], R1, dst);\n-\t\ti += __bpf_ld_imm64(\u0026insns[i], R2, src);\n-\t\ti += __bpf_ld_imm64(\u0026insns[i], R3, res);\n-\t\tinsns[i++] = BPF_ALU64_REG(op, R1, R2);\n-\t\tinsns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 1);\n-\t\tinsns[i++] = BPF_EXIT_INSN();\n-\t}\n-\n-\treturn i;\n-}\n-\n-static int __bpf_emit_alu32_reg(struct bpf_test *self, void *arg,\n-\t\t\t\tstruct bpf_insn *insns, s64 dst, s64 src)\n-{\n-\tint op = *(int *)arg;\n-\tint i = 0;\n-\tu64 res;\n-\n-\tif (!insns)\n-\t\treturn 9;\n-\n-\tif (__bpf_alu_result(\u0026res, (u32)dst, (u32)src, op, 0)) {\n-\t\ti += __bpf_ld_imm64(\u0026insns[i], R1, dst);\n-\t\ti += __bpf_ld_imm64(\u0026insns[i], R2, src);\n-\t\ti += __bpf_ld_imm64(\u0026insns[i], R3, (u32)res);\n-\t\tinsns[i++] = BPF_ALU32_REG(op, R1, R2);\n-\t\tinsns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 1);\n-\t\tinsns[i++] = BPF_EXIT_INSN();\n-\t}\n-\n-\treturn i;\n-}\n-\n-static int __bpf_fill_alu64_imm(struct bpf_test *self, int op, u32 flags)\n-{\n-\tint arg[2] = {op, flags};\n-\n-\treturn __bpf_fill_pattern(self, \u0026arg, 64, 32,\n-\t\t\t\t  PATTERN_BLOCK1, PATTERN_BLOCK2,\n-\t\t\t\t  \u0026__bpf_emit_alu64_imm);\n-}\n-\n-static int __bpf_fill_alu32_imm(struct bpf_test *self, int op, u32 flags)\n-{\n-\tint arg[2] = {op, flags};\n-\n-\treturn __bpf_fill_pattern(self, \u0026arg, 64, 32,\n-\t\t\t\t  PATTERN_BLOCK1, PATTERN_BLOCK2,\n-\t\t\t\t  \u0026__bpf_emit_alu32_imm);\n-}\n-\n-static int __bpf_fill_alu64_reg(struct bpf_test *self, int op)\n-{\n-\treturn __bpf_fill_pattern(self, \u0026op, 64, 64,\n-\t\t\t\t  PATTERN_BLOCK1, PATTERN_BLOCK2,\n-\t\t\t\t  \u0026__bpf_emit_alu64_reg);\n-}\n-\n-static int __bpf_fill_alu32_reg(struct bpf_test *self, int op)\n-{\n-\treturn __bpf_fill_pattern(self, \u0026op, 64, 64,\n-\t\t\t\t  PATTERN_BLOCK1, PATTERN_BLOCK2,\n-\t\t\t\t  \u0026__bpf_emit_alu32_reg);\n-}\n-\n-/* ALU64 immediate operations */\n-static int bpf_fill_alu64_mov_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_imm(self, BPF_MOV, 0);\n-}\n-\n-static int bpf_fill_alu64_and_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_imm(self, BPF_AND, 0);\n-}\n-\n-static int bpf_fill_alu64_or_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_imm(self, BPF_OR, 0);\n-}\n-\n-static int bpf_fill_alu64_xor_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_imm(self, BPF_XOR, 0);\n-}\n-\n-static int bpf_fill_alu64_add_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_imm(self, BPF_ADD, 0);\n-}\n-\n-static int bpf_fill_alu64_sub_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_imm(self, BPF_SUB, 0);\n-}\n-\n-static int bpf_fill_alu64_mul_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_imm(self, BPF_MUL, 0);\n-}\n-\n-static int bpf_fill_alu64_div_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_imm(self, BPF_DIV, 0);\n-}\n-\n-static int bpf_fill_alu64_mod_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_imm(self, BPF_MOD, 0);\n-}\n-\n-/* Signed ALU64 immediate operations */\n-static int bpf_fill_alu64_sdiv_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_imm(self, BPF_DIV, F_SIGNED);\n-}\n-\n-static int bpf_fill_alu64_smod_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_imm(self, BPF_MOD, F_SIGNED);\n-}\n-\n-/* Signed ALU32 immediate operations */\n-static int bpf_fill_alu32_sdiv_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_imm(self, BPF_DIV, F_SIGNED);\n-}\n-\n-static int bpf_fill_alu32_smod_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_imm(self, BPF_MOD, F_SIGNED);\n-}\n-\n-/* ALU32 immediate operations */\n-static int bpf_fill_alu32_mov_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_imm(self, BPF_MOV, 0);\n-}\n-\n-static int bpf_fill_alu32_and_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_imm(self, BPF_AND, 0);\n-}\n-\n-static int bpf_fill_alu32_or_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_imm(self, BPF_OR, 0);\n-}\n-\n-static int bpf_fill_alu32_xor_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_imm(self, BPF_XOR, 0);\n-}\n-\n-static int bpf_fill_alu32_add_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_imm(self, BPF_ADD, 0);\n-}\n-\n-static int bpf_fill_alu32_sub_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_imm(self, BPF_SUB, 0);\n-}\n-\n-static int bpf_fill_alu32_mul_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_imm(self, BPF_MUL, 0);\n-}\n-\n-static int bpf_fill_alu32_div_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_imm(self, BPF_DIV, 0);\n-}\n-\n-static int bpf_fill_alu32_mod_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_imm(self, BPF_MOD, 0);\n-}\n-\n-/* ALU64 register operations */\n-static int bpf_fill_alu64_mov_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_reg(self, BPF_MOV);\n-}\n-\n-static int bpf_fill_alu64_and_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_reg(self, BPF_AND);\n-}\n-\n-static int bpf_fill_alu64_or_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_reg(self, BPF_OR);\n-}\n-\n-static int bpf_fill_alu64_xor_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_reg(self, BPF_XOR);\n-}\n-\n-static int bpf_fill_alu64_add_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_reg(self, BPF_ADD);\n-}\n-\n-static int bpf_fill_alu64_sub_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_reg(self, BPF_SUB);\n-}\n-\n-static int bpf_fill_alu64_mul_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_reg(self, BPF_MUL);\n-}\n-\n-static int bpf_fill_alu64_div_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_reg(self, BPF_DIV);\n-}\n-\n-static int bpf_fill_alu64_mod_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu64_reg(self, BPF_MOD);\n-}\n-\n-/* ALU32 register operations */\n-static int bpf_fill_alu32_mov_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_reg(self, BPF_MOV);\n-}\n-\n-static int bpf_fill_alu32_and_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_reg(self, BPF_AND);\n-}\n-\n-static int bpf_fill_alu32_or_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_reg(self, BPF_OR);\n-}\n-\n-static int bpf_fill_alu32_xor_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_reg(self, BPF_XOR);\n-}\n-\n-static int bpf_fill_alu32_add_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_reg(self, BPF_ADD);\n-}\n-\n-static int bpf_fill_alu32_sub_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_reg(self, BPF_SUB);\n-}\n-\n-static int bpf_fill_alu32_mul_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_reg(self, BPF_MUL);\n-}\n-\n-static int bpf_fill_alu32_div_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_reg(self, BPF_DIV);\n-}\n-\n-static int bpf_fill_alu32_mod_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu32_reg(self, BPF_MOD);\n-}\n-\n-/*\n- * Test JITs that implement complex ALU operations as function\n- * calls, and must re-arrange operands for argument passing.\n- */\n-static int __bpf_fill_alu_imm_regs(struct bpf_test *self, u8 op,\n-\t\t\t\t    u32 flags)\n-{\n-\tint len = 2 + 10 * 10;\n-\tstruct bpf_insn *insns;\n-\tu64 dst, res;\n-\tint i = 0;\n-\tu32 imm;\n-\tint rd;\n-\n-\tinsns = kmalloc_objs(*insns, len);\n-\tif (!insns)\n-\t\treturn -ENOMEM;\n-\n-\t/* Operand and result values according to operation */\n-\tif (flags \u0026 F_SIGNED) {\n-\t\tif (flags \u0026 F_ALU32)\n-\t\t\tdst = -76543210;\n-\t\telse\n-\t\t\tdst = -7654321076543210LL;\n-\t} else {\n-\t\tif (flags \u0026 F_ALU32)\n-\t\t\tdst = 0x76543210U;\n-\t\telse\n-\t\t\tdst = 0x7edcba9876543210ULL;\n-\t}\n-\timm = 0x01234567U;\n-\n-\tif (op == BPF_LSH || op == BPF_RSH || op == BPF_ARSH)\n-\t\timm \u0026= 31;\n-\n-\t__bpf_alu_result(\u0026res, dst, imm, op, flags);\n-\n-\tif (flags \u0026 F_ALU32)\n-\t\tres = (u32)res;\n-\n-\t/* Check all operand registers */\n-\tfor (rd = R0; rd \u003c= R9; rd++) {\n-\t\ti += __bpf_ld_imm64(\u0026insns[i], rd, dst);\n-\n-\t\ts16 off = (flags \u0026 F_SIGNED) ? 1 : 0;\n-\n-\t\tif (flags \u0026 F_ALU32)\n-\t\t\tinsns[i++] = BPF_ALU32_IMM_OFF(op, rd, imm, off);\n-\t\telse\n-\t\t\tinsns[i++] = BPF_ALU64_IMM_OFF(op, rd, imm, off);\n-\n-\t\tinsns[i++] = BPF_JMP32_IMM(BPF_JEQ, rd, res, 2);\n-\t\tinsns[i++] = BPF_MOV64_IMM(R0, __LINE__);\n-\t\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\t\tinsns[i++] = BPF_ALU64_IMM(BPF_RSH, rd, 32);\n-\t\tinsns[i++] = BPF_JMP32_IMM(BPF_JEQ, rd, res \u003e\u003e 32, 2);\n-\t\tinsns[i++] = BPF_MOV64_IMM(R0, __LINE__);\n-\t\tinsns[i++] = BPF_EXIT_INSN();\n-\t}\n-\n-\tinsns[i++] = BPF_MOV64_IMM(R0, 1);\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\tself-\u003eu.ptr.insns = insns;\n-\tself-\u003eu.ptr.len = len;\n-\tBUG_ON(i != len);\n-\n-\treturn 0;\n-}\n-\n-/* ALU64 K registers */\n-static int bpf_fill_alu64_mov_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_MOV, 0);\n-}\n-\n-static int bpf_fill_alu64_and_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_AND, 0);\n-}\n-\n-static int bpf_fill_alu64_or_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_OR, 0);\n-}\n-\n-static int bpf_fill_alu64_xor_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_XOR, 0);\n-}\n-\n-static int bpf_fill_alu64_lsh_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_LSH, 0);\n-}\n-\n-static int bpf_fill_alu64_rsh_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_RSH, 0);\n-}\n-\n-static int bpf_fill_alu64_arsh_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_ARSH, 0);\n-}\n-\n-static int bpf_fill_alu64_add_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_ADD, 0);\n-}\n-\n-static int bpf_fill_alu64_sub_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_SUB, 0);\n-}\n-\n-static int bpf_fill_alu64_mul_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_MUL, 0);\n-}\n-\n-static int bpf_fill_alu64_div_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_DIV, 0);\n-}\n-\n-static int bpf_fill_alu64_mod_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_MOD, 0);\n-}\n-\n-/* Signed ALU64 K registers */\n-static int bpf_fill_alu64_sdiv_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_DIV, F_SIGNED);\n-}\n-\n-static int bpf_fill_alu64_smod_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_MOD, F_SIGNED);\n-}\n-\n-/* ALU32 K registers */\n-static int bpf_fill_alu32_mov_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_MOV, F_ALU32);\n-}\n-\n-static int bpf_fill_alu32_and_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_AND, F_ALU32);\n-}\n-\n-static int bpf_fill_alu32_or_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_OR, F_ALU32);\n-}\n-\n-static int bpf_fill_alu32_xor_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_XOR, F_ALU32);\n-}\n-\n-static int bpf_fill_alu32_lsh_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_LSH, F_ALU32);\n-}\n-\n-static int bpf_fill_alu32_rsh_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_RSH, F_ALU32);\n-}\n-\n-static int bpf_fill_alu32_arsh_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_ARSH, F_ALU32);\n-}\n-\n-static int bpf_fill_alu32_add_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_ADD, F_ALU32);\n-}\n-\n-static int bpf_fill_alu32_sub_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_SUB, F_ALU32);\n-}\n-\n-static int bpf_fill_alu32_mul_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_MUL, F_ALU32);\n-}\n-\n-static int bpf_fill_alu32_div_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_DIV, F_ALU32);\n-}\n-\n-static int bpf_fill_alu32_mod_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_MOD, F_ALU32);\n-}\n-\n-/* Signed ALU32 K registers */\n-static int bpf_fill_alu32_sdiv_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_DIV, F_ALU32 | F_SIGNED);\n-}\n-\n-static int bpf_fill_alu32_smod_imm_regs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_imm_regs(self, BPF_MOD, F_ALU32 | F_SIGNED);\n-}\n-\n-/*\n- * Test JITs that implement complex ALU operations as function\n- * calls, and must re-arrange operands for argument passing.\n- */\n-static int __bpf_fill_alu_reg_pairs(struct bpf_test *self, u8 op, bool alu32)\n-{\n-\tint len = 2 + 10 * 10 * 12;\n-\tu64 dst, src, res, same;\n-\tstruct bpf_insn *insns;\n-\tint rd, rs;\n-\tint i = 0;\n-\n-\tinsns = kmalloc_objs(*insns, len);\n-\tif (!insns)\n-\t\treturn -ENOMEM;\n-\n-\t/* Operand and result values according to operation */\n-\tif (alu32) {\n-\t\tdst = 0x76543210U;\n-\t\tsrc = 0x01234567U;\n-\t} else {\n-\t\tdst = 0x7edcba9876543210ULL;\n-\t\tsrc = 0x0123456789abcdefULL;\n-\t}\n-\n-\tif (op == BPF_LSH || op == BPF_RSH || op == BPF_ARSH)\n-\t\tsrc \u0026= 31;\n-\n-\t__bpf_alu_result(\u0026res, dst, src, op, 0);\n-\t__bpf_alu_result(\u0026same, src, src, op, 0);\n-\n-\tif (alu32) {\n-\t\tres = (u32)res;\n-\t\tsame = (u32)same;\n-\t}\n-\n-\t/* Check all combinations of operand registers */\n-\tfor (rd = R0; rd \u003c= R9; rd++) {\n-\t\tfor (rs = R0; rs \u003c= R9; rs++) {\n-\t\t\tu64 val = rd == rs ? same : res;\n-\n-\t\t\ti += __bpf_ld_imm64(\u0026insns[i], rd, dst);\n-\t\t\ti += __bpf_ld_imm64(\u0026insns[i], rs, src);\n-\n-\t\t\tif (alu32)\n-\t\t\t\tinsns[i++] = BPF_ALU32_REG(op, rd, rs);\n-\t\t\telse\n-\t\t\t\tinsns[i++] = BPF_ALU64_REG(op, rd, rs);\n-\n-\t\t\tinsns[i++] = BPF_JMP32_IMM(BPF_JEQ, rd, val, 2);\n-\t\t\tinsns[i++] = BPF_MOV64_IMM(R0, __LINE__);\n-\t\t\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\t\t\tinsns[i++] = BPF_ALU64_IMM(BPF_RSH, rd, 32);\n-\t\t\tinsns[i++] = BPF_JMP32_IMM(BPF_JEQ, rd, val \u003e\u003e 32, 2);\n-\t\t\tinsns[i++] = BPF_MOV64_IMM(R0, __LINE__);\n-\t\t\tinsns[i++] = BPF_EXIT_INSN();\n-\t\t}\n-\t}\n-\n-\tinsns[i++] = BPF_MOV64_IMM(R0, 1);\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\tself-\u003eu.ptr.insns = insns;\n-\tself-\u003eu.ptr.len = len;\n-\tBUG_ON(i != len);\n-\n-\treturn 0;\n-}\n-\n-/* ALU64 X register combinations */\n-static int bpf_fill_alu64_mov_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_MOV, false);\n-}\n-\n-static int bpf_fill_alu64_and_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_AND, false);\n-}\n-\n-static int bpf_fill_alu64_or_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_OR, false);\n-}\n-\n-static int bpf_fill_alu64_xor_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_XOR, false);\n-}\n-\n-static int bpf_fill_alu64_lsh_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_LSH, false);\n-}\n-\n-static int bpf_fill_alu64_rsh_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_RSH, false);\n-}\n-\n-static int bpf_fill_alu64_arsh_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_ARSH, false);\n-}\n-\n-static int bpf_fill_alu64_add_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_ADD, false);\n-}\n-\n-static int bpf_fill_alu64_sub_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_SUB, false);\n-}\n-\n-static int bpf_fill_alu64_mul_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_MUL, false);\n-}\n-\n-static int bpf_fill_alu64_div_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_DIV, false);\n-}\n-\n-static int bpf_fill_alu64_mod_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_MOD, false);\n-}\n-\n-/* ALU32 X register combinations */\n-static int bpf_fill_alu32_mov_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_MOV, true);\n-}\n-\n-static int bpf_fill_alu32_and_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_AND, true);\n-}\n-\n-static int bpf_fill_alu32_or_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_OR, true);\n-}\n-\n-static int bpf_fill_alu32_xor_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_XOR, true);\n-}\n-\n-static int bpf_fill_alu32_lsh_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_LSH, true);\n-}\n-\n-static int bpf_fill_alu32_rsh_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_RSH, true);\n-}\n-\n-static int bpf_fill_alu32_arsh_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_ARSH, true);\n-}\n-\n-static int bpf_fill_alu32_add_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_ADD, true);\n-}\n-\n-static int bpf_fill_alu32_sub_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_SUB, true);\n-}\n-\n-static int bpf_fill_alu32_mul_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_MUL, true);\n-}\n-\n-static int bpf_fill_alu32_div_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_DIV, true);\n-}\n-\n-static int bpf_fill_alu32_mod_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_alu_reg_pairs(self, BPF_MOD, true);\n-}\n-\n-/*\n- * Exhaustive tests of atomic operations for all power-of-two operand\n- * magnitudes, both for positive and negative values.\n- */\n-\n-static int __bpf_emit_atomic64(struct bpf_test *self, void *arg,\n-\t\t\t       struct bpf_insn *insns, s64 dst, s64 src)\n-{\n-\tint op = *(int *)arg;\n-\tu64 keep, fetch, res;\n-\tint i = 0;\n-\n-\tif (!insns)\n-\t\treturn 21;\n-\n-\tswitch (op) {\n-\tcase BPF_XCHG:\n-\t\tres = src;\n-\t\tbreak;\n-\tdefault:\n-\t\t__bpf_alu_result(\u0026res, dst, src, BPF_OP(op), 0);\n-\t}\n-\n-\tkeep = 0x0123456789abcdefULL;\n-\tif (op \u0026 BPF_FETCH)\n-\t\tfetch = dst;\n-\telse\n-\t\tfetch = src;\n-\n-\ti += __bpf_ld_imm64(\u0026insns[i], R0, keep);\n-\ti += __bpf_ld_imm64(\u0026insns[i], R1, dst);\n-\ti += __bpf_ld_imm64(\u0026insns[i], R2, src);\n-\ti += __bpf_ld_imm64(\u0026insns[i], R3, res);\n-\ti += __bpf_ld_imm64(\u0026insns[i], R4, fetch);\n-\ti += __bpf_ld_imm64(\u0026insns[i], R5, keep);\n-\n-\tinsns[i++] = BPF_STX_MEM(BPF_DW, R10, R1, -8);\n-\tinsns[i++] = BPF_ATOMIC_OP(BPF_DW, op, R10, R2, -8);\n-\tinsns[i++] = BPF_LDX_MEM(BPF_DW, R1, R10, -8);\n-\n-\tinsns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 1);\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\tinsns[i++] = BPF_JMP_REG(BPF_JEQ, R2, R4, 1);\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\tinsns[i++] = BPF_JMP_REG(BPF_JEQ, R0, R5, 1);\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\treturn i;\n-}\n-\n-static int __bpf_emit_atomic32(struct bpf_test *self, void *arg,\n-\t\t\t       struct bpf_insn *insns, s64 dst, s64 src)\n-{\n-\tint op = *(int *)arg;\n-\tu64 keep, fetch, res;\n-\tint i = 0;\n-\n-\tif (!insns)\n-\t\treturn 21;\n-\n-\tswitch (op) {\n-\tcase BPF_XCHG:\n-\t\tres = src;\n-\t\tbreak;\n-\tdefault:\n-\t\t__bpf_alu_result(\u0026res, (u32)dst, (u32)src, BPF_OP(op), 0);\n-\t}\n-\n-\tkeep = 0x0123456789abcdefULL;\n-\tif (op \u0026 BPF_FETCH)\n-\t\tfetch = (u32)dst;\n-\telse\n-\t\tfetch = src;\n-\n-\ti += __bpf_ld_imm64(\u0026insns[i], R0, keep);\n-\ti += __bpf_ld_imm64(\u0026insns[i], R1, (u32)dst);\n-\ti += __bpf_ld_imm64(\u0026insns[i], R2, src);\n-\ti += __bpf_ld_imm64(\u0026insns[i], R3, (u32)res);\n-\ti += __bpf_ld_imm64(\u0026insns[i], R4, fetch);\n-\ti += __bpf_ld_imm64(\u0026insns[i], R5, keep);\n-\n-\tinsns[i++] = BPF_STX_MEM(BPF_W, R10, R1, -4);\n-\tinsns[i++] = BPF_ATOMIC_OP(BPF_W, op, R10, R2, -4);\n-\tinsns[i++] = BPF_LDX_MEM(BPF_W, R1, R10, -4);\n-\n-\tinsns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 1);\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\tinsns[i++] = BPF_JMP_REG(BPF_JEQ, R2, R4, 1);\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\tinsns[i++] = BPF_JMP_REG(BPF_JEQ, R0, R5, 1);\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\treturn i;\n-}\n-\n-static int __bpf_emit_cmpxchg64(struct bpf_test *self, void *arg,\n-\t\t\t\tstruct bpf_insn *insns, s64 dst, s64 src)\n-{\n-\tint i = 0;\n-\n-\tif (!insns)\n-\t\treturn 23;\n-\n-\ti += __bpf_ld_imm64(\u0026insns[i], R0, ~dst);\n-\ti += __bpf_ld_imm64(\u0026insns[i], R1, dst);\n-\ti += __bpf_ld_imm64(\u0026insns[i], R2, src);\n-\n-\t/* Result unsuccessful */\n-\tinsns[i++] = BPF_STX_MEM(BPF_DW, R10, R1, -8);\n-\tinsns[i++] = BPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -8);\n-\tinsns[i++] = BPF_LDX_MEM(BPF_DW, R3, R10, -8);\n-\n-\tinsns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 2);\n-\tinsns[i++] = BPF_MOV64_IMM(R0, __LINE__);\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\tinsns[i++] = BPF_JMP_REG(BPF_JEQ, R0, R3, 2);\n-\tinsns[i++] = BPF_MOV64_IMM(R0, __LINE__);\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\t/* Result successful */\n-\tinsns[i++] = BPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -8);\n-\tinsns[i++] = BPF_LDX_MEM(BPF_DW, R3, R10, -8);\n-\n-\tinsns[i++] = BPF_JMP_REG(BPF_JEQ, R2, R3, 2);\n-\tinsns[i++] = BPF_MOV64_IMM(R0, __LINE__);\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\tinsns[i++] = BPF_JMP_REG(BPF_JEQ, R0, R1, 2);\n-\tinsns[i++] = BPF_MOV64_IMM(R0, __LINE__);\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\treturn i;\n-}\n-\n-static int __bpf_emit_cmpxchg32(struct bpf_test *self, void *arg,\n-\t\t\t\tstruct bpf_insn *insns, s64 dst, s64 src)\n-{\n-\tint i = 0;\n-\n-\tif (!insns)\n-\t\treturn 27;\n-\n-\ti += __bpf_ld_imm64(\u0026insns[i], R0, ~dst);\n-\ti += __bpf_ld_imm64(\u0026insns[i], R1, (u32)dst);\n-\ti += __bpf_ld_imm64(\u0026insns[i], R2, src);\n-\n-\t/* Result unsuccessful */\n-\tinsns[i++] = BPF_STX_MEM(BPF_W, R10, R1, -4);\n-\tinsns[i++] = BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R2, -4);\n-\tinsns[i++] = BPF_ZEXT_REG(R0); /* Zext always inserted by verifier */\n-\tinsns[i++] = BPF_LDX_MEM(BPF_W, R3, R10, -4);\n-\n-\tinsns[i++] = BPF_JMP32_REG(BPF_JEQ, R1, R3, 2);\n-\tinsns[i++] = BPF_MOV32_IMM(R0, __LINE__);\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\tinsns[i++] = BPF_JMP_REG(BPF_JEQ, R0, R3, 2);\n-\tinsns[i++] = BPF_MOV32_IMM(R0, __LINE__);\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\t/* Result successful */\n-\ti += __bpf_ld_imm64(\u0026insns[i], R0, dst);\n-\tinsns[i++] = BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R2, -4);\n-\tinsns[i++] = BPF_ZEXT_REG(R0); /* Zext always inserted by verifier */\n-\tinsns[i++] = BPF_LDX_MEM(BPF_W, R3, R10, -4);\n-\n-\tinsns[i++] = BPF_JMP32_REG(BPF_JEQ, R2, R3, 2);\n-\tinsns[i++] = BPF_MOV32_IMM(R0, __LINE__);\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\tinsns[i++] = BPF_JMP_REG(BPF_JEQ, R0, R1, 2);\n-\tinsns[i++] = BPF_MOV32_IMM(R0, __LINE__);\n-\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\treturn i;\n-}\n-\n-static int __bpf_fill_atomic64(struct bpf_test *self, int op)\n-{\n-\treturn __bpf_fill_pattern(self, \u0026op, 64, 64,\n-\t\t\t\t  0, PATTERN_BLOCK2,\n-\t\t\t\t  \u0026__bpf_emit_atomic64);\n-}\n-\n-static int __bpf_fill_atomic32(struct bpf_test *self, int op)\n-{\n-\treturn __bpf_fill_pattern(self, \u0026op, 64, 64,\n-\t\t\t\t  0, PATTERN_BLOCK2,\n-\t\t\t\t  \u0026__bpf_emit_atomic32);\n-}\n-\n-/* 64-bit atomic operations */\n-static int bpf_fill_atomic64_add(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic64(self, BPF_ADD);\n-}\n-\n-static int bpf_fill_atomic64_and(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic64(self, BPF_AND);\n-}\n-\n-static int bpf_fill_atomic64_or(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic64(self, BPF_OR);\n-}\n-\n-static int bpf_fill_atomic64_xor(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic64(self, BPF_XOR);\n-}\n-\n-static int bpf_fill_atomic64_add_fetch(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic64(self, BPF_ADD | BPF_FETCH);\n-}\n-\n-static int bpf_fill_atomic64_and_fetch(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic64(self, BPF_AND | BPF_FETCH);\n-}\n-\n-static int bpf_fill_atomic64_or_fetch(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic64(self, BPF_OR | BPF_FETCH);\n-}\n-\n-static int bpf_fill_atomic64_xor_fetch(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic64(self, BPF_XOR | BPF_FETCH);\n-}\n-\n-static int bpf_fill_atomic64_xchg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic64(self, BPF_XCHG);\n-}\n-\n-static int bpf_fill_cmpxchg64(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_pattern(self, NULL, 64, 64, 0, PATTERN_BLOCK2,\n-\t\t\t\t  \u0026__bpf_emit_cmpxchg64);\n-}\n-\n-/* 32-bit atomic operations */\n-static int bpf_fill_atomic32_add(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic32(self, BPF_ADD);\n-}\n-\n-static int bpf_fill_atomic32_and(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic32(self, BPF_AND);\n-}\n-\n-static int bpf_fill_atomic32_or(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic32(self, BPF_OR);\n-}\n-\n-static int bpf_fill_atomic32_xor(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic32(self, BPF_XOR);\n-}\n-\n-static int bpf_fill_atomic32_add_fetch(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic32(self, BPF_ADD | BPF_FETCH);\n-}\n-\n-static int bpf_fill_atomic32_and_fetch(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic32(self, BPF_AND | BPF_FETCH);\n-}\n-\n-static int bpf_fill_atomic32_or_fetch(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic32(self, BPF_OR | BPF_FETCH);\n-}\n-\n-static int bpf_fill_atomic32_xor_fetch(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic32(self, BPF_XOR | BPF_FETCH);\n-}\n-\n-static int bpf_fill_atomic32_xchg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic32(self, BPF_XCHG);\n-}\n-\n-static int bpf_fill_cmpxchg32(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_pattern(self, NULL, 64, 64, 0, PATTERN_BLOCK2,\n-\t\t\t\t  \u0026__bpf_emit_cmpxchg32);\n-}\n-\n-/*\n- * Test JITs that implement ATOMIC operations as function calls or\n- * other primitives, and must re-arrange operands for argument passing.\n- */\n-static int __bpf_fill_atomic_reg_pairs(struct bpf_test *self, u8 width, u8 op)\n-{\n-\tstruct bpf_insn *insn;\n-\tint len = 2 + 34 * 10 * 10;\n-\tu64 mem, upd, res;\n-\tint rd, rs, i = 0;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\t/* Operand and memory values */\n-\tif (width == BPF_DW) {\n-\t\tmem = 0x0123456789abcdefULL;\n-\t\tupd = 0xfedcba9876543210ULL;\n-\t} else { /* BPF_W */\n-\t\tmem = 0x01234567U;\n-\t\tupd = 0x76543210U;\n-\t}\n-\n-\t/* Memory updated according to operation */\n-\tswitch (op) {\n-\tcase BPF_XCHG:\n-\t\tres = upd;\n-\t\tbreak;\n-\tcase BPF_CMPXCHG:\n-\t\tres = mem;\n-\t\tbreak;\n-\tdefault:\n-\t\t__bpf_alu_result(\u0026res, mem, upd, BPF_OP(op), 0);\n-\t}\n-\n-\t/* Test all operand registers */\n-\tfor (rd = R0; rd \u003c= R9; rd++) {\n-\t\tfor (rs = R0; rs \u003c= R9; rs++) {\n-\t\t\tu64 cmp, src;\n-\n-\t\t\t/* Initialize value in memory */\n-\t\t\ti += __bpf_ld_imm64(\u0026insn[i], R0, mem);\n-\t\t\tinsn[i++] = BPF_STX_MEM(width, R10, R0, -8);\n-\n-\t\t\t/* Initialize registers in order */\n-\t\t\ti += __bpf_ld_imm64(\u0026insn[i], R0, ~mem);\n-\t\t\ti += __bpf_ld_imm64(\u0026insn[i], rs, upd);\n-\t\t\tinsn[i++] = BPF_MOV64_REG(rd, R10);\n-\n-\t\t\t/* Perform atomic operation */\n-\t\t\tinsn[i++] = BPF_ATOMIC_OP(width, op, rd, rs, -8);\n-\t\t\tif (op == BPF_CMPXCHG \u0026\u0026 width == BPF_W)\n-\t\t\t\tinsn[i++] = BPF_ZEXT_REG(R0);\n-\n-\t\t\t/* Check R0 register value */\n-\t\t\tif (op == BPF_CMPXCHG)\n-\t\t\t\tcmp = mem;  /* Expect value from memory */\n-\t\t\telse if (R0 == rd || R0 == rs)\n-\t\t\t\tcmp = 0;    /* Aliased, checked below */\n-\t\t\telse\n-\t\t\t\tcmp = ~mem; /* Expect value to be preserved */\n-\t\t\tif (cmp) {\n-\t\t\t\tinsn[i++] = BPF_JMP32_IMM(BPF_JEQ, R0,\n-\t\t\t\t\t\t\t   (u32)cmp, 2);\n-\t\t\t\tinsn[i++] = BPF_MOV32_IMM(R0, __LINE__);\n-\t\t\t\tinsn[i++] = BPF_EXIT_INSN();\n-\t\t\t\tinsn[i++] = BPF_ALU64_IMM(BPF_RSH, R0, 32);\n-\t\t\t\tinsn[i++] = BPF_JMP32_IMM(BPF_JEQ, R0,\n-\t\t\t\t\t\t\t   cmp \u003e\u003e 32, 2);\n-\t\t\t\tinsn[i++] = BPF_MOV32_IMM(R0, __LINE__);\n-\t\t\t\tinsn[i++] = BPF_EXIT_INSN();\n-\t\t\t}\n-\n-\t\t\t/* Check source register value */\n-\t\t\tif (rs == R0 \u0026\u0026 op == BPF_CMPXCHG)\n-\t\t\t\tsrc = 0;   /* Aliased with R0, checked above */\n-\t\t\telse if (rs == rd \u0026\u0026 (op == BPF_CMPXCHG ||\n-\t\t\t\t\t      !(op \u0026 BPF_FETCH)))\n-\t\t\t\tsrc = 0;   /* Aliased with rd, checked below */\n-\t\t\telse if (op == BPF_CMPXCHG)\n-\t\t\t\tsrc = upd; /* Expect value to be preserved */\n-\t\t\telse if (op \u0026 BPF_FETCH)\n-\t\t\t\tsrc = mem; /* Expect fetched value from mem */\n-\t\t\telse /* no fetch */\n-\t\t\t\tsrc = upd; /* Expect value to be preserved */\n-\t\t\tif (src) {\n-\t\t\t\tinsn[i++] = BPF_JMP32_IMM(BPF_JEQ, rs,\n-\t\t\t\t\t\t\t   (u32)src, 2);\n-\t\t\t\tinsn[i++] = BPF_MOV32_IMM(R0, __LINE__);\n-\t\t\t\tinsn[i++] = BPF_EXIT_INSN();\n-\t\t\t\tinsn[i++] = BPF_ALU64_IMM(BPF_RSH, rs, 32);\n-\t\t\t\tinsn[i++] = BPF_JMP32_IMM(BPF_JEQ, rs,\n-\t\t\t\t\t\t\t   src \u003e\u003e 32, 2);\n-\t\t\t\tinsn[i++] = BPF_MOV32_IMM(R0, __LINE__);\n-\t\t\t\tinsn[i++] = BPF_EXIT_INSN();\n-\t\t\t}\n-\n-\t\t\t/* Check destination register value */\n-\t\t\tif (!(rd == R0 \u0026\u0026 op == BPF_CMPXCHG) \u0026\u0026\n-\t\t\t    !(rd == rs \u0026\u0026 (op \u0026 BPF_FETCH))) {\n-\t\t\t\tinsn[i++] = BPF_JMP_REG(BPF_JEQ, rd, R10, 2);\n-\t\t\t\tinsn[i++] = BPF_MOV32_IMM(R0, __LINE__);\n-\t\t\t\tinsn[i++] = BPF_EXIT_INSN();\n-\t\t\t}\n-\n-\t\t\t/* Check value in memory */\n-\t\t\tif (rs != rd) {                  /* No aliasing */\n-\t\t\t\ti += __bpf_ld_imm64(\u0026insn[i], R1, res);\n-\t\t\t} else if (op == BPF_XCHG) {     /* Aliased, XCHG */\n-\t\t\t\tinsn[i++] = BPF_MOV64_REG(R1, R10);\n-\t\t\t} else if (op == BPF_CMPXCHG) {  /* Aliased, CMPXCHG */\n-\t\t\t\ti += __bpf_ld_imm64(\u0026insn[i], R1, mem);\n-\t\t\t} else {                        /* Aliased, ALU oper */\n-\t\t\t\ti += __bpf_ld_imm64(\u0026insn[i], R1, mem);\n-\t\t\t\tinsn[i++] = BPF_ALU64_REG(BPF_OP(op), R1, R10);\n-\t\t\t}\n-\n-\t\t\tinsn[i++] = BPF_LDX_MEM(width, R0, R10, -8);\n-\t\t\tif (width == BPF_DW)\n-\t\t\t\tinsn[i++] = BPF_JMP_REG(BPF_JEQ, R0, R1, 2);\n-\t\t\telse /* width == BPF_W */\n-\t\t\t\tinsn[i++] = BPF_JMP32_REG(BPF_JEQ, R0, R1, 2);\n-\t\t\tinsn[i++] = BPF_MOV32_IMM(R0, __LINE__);\n-\t\t\tinsn[i++] = BPF_EXIT_INSN();\n-\t\t}\n-\t}\n-\n-\tinsn[i++] = BPF_MOV64_IMM(R0, 1);\n-\tinsn[i++] = BPF_EXIT_INSN();\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = i;\n-\tBUG_ON(i \u003e len);\n-\n-\treturn 0;\n-}\n-\n-/* 64-bit atomic register tests */\n-static int bpf_fill_atomic64_add_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_ADD);\n-}\n-\n-static int bpf_fill_atomic64_and_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_AND);\n-}\n-\n-static int bpf_fill_atomic64_or_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_OR);\n-}\n-\n-static int bpf_fill_atomic64_xor_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_XOR);\n-}\n-\n-static int bpf_fill_atomic64_add_fetch_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_ADD | BPF_FETCH);\n-}\n-\n-static int bpf_fill_atomic64_and_fetch_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_AND | BPF_FETCH);\n-}\n-\n-static int bpf_fill_atomic64_or_fetch_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_OR | BPF_FETCH);\n-}\n-\n-static int bpf_fill_atomic64_xor_fetch_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_XOR | BPF_FETCH);\n-}\n-\n-static int bpf_fill_atomic64_xchg_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_XCHG);\n-}\n-\n-static int bpf_fill_atomic64_cmpxchg_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_CMPXCHG);\n-}\n-\n-/* 32-bit atomic register tests */\n-static int bpf_fill_atomic32_add_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_ADD);\n-}\n-\n-static int bpf_fill_atomic32_and_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_AND);\n-}\n-\n-static int bpf_fill_atomic32_or_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_OR);\n-}\n-\n-static int bpf_fill_atomic32_xor_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_XOR);\n-}\n-\n-static int bpf_fill_atomic32_add_fetch_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_ADD | BPF_FETCH);\n-}\n-\n-static int bpf_fill_atomic32_and_fetch_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_AND | BPF_FETCH);\n-}\n-\n-static int bpf_fill_atomic32_or_fetch_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_OR | BPF_FETCH);\n-}\n-\n-static int bpf_fill_atomic32_xor_fetch_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_XOR | BPF_FETCH);\n-}\n-\n-static int bpf_fill_atomic32_xchg_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_XCHG);\n-}\n-\n-static int bpf_fill_atomic32_cmpxchg_reg_pairs(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_CMPXCHG);\n-}\n-\n-/*\n- * Test the two-instruction 64-bit immediate load operation for all\n- * power-of-two magnitudes of the immediate operand. For each MSB, a block\n- * of immediate values centered around the power-of-two MSB are tested,\n- * both for positive and negative values. The test is designed to verify\n- * the operation for JITs that emit different code depending on the magnitude\n- * of the immediate value. This is often the case if the native instruction\n- * immediate field width is narrower than 32 bits.\n- */\n-static int bpf_fill_ld_imm64_magn(struct bpf_test *self)\n-{\n-\tint block = 64; /* Increase for more tests per MSB position */\n-\tint len = 3 + 8 * 63 * block * 2;\n-\tstruct bpf_insn *insn;\n-\tint bit, adj, sign;\n-\tint i = 0;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\tinsn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 0);\n-\n-\tfor (bit = 0; bit \u003c= 62; bit++) {\n-\t\tfor (adj = -block / 2; adj \u003c block / 2; adj++) {\n-\t\t\tfor (sign = -1; sign \u003c= 1; sign += 2) {\n-\t\t\t\ts64 imm = sign * ((1LL \u003c\u003c bit) + adj);\n-\n-\t\t\t\t/* Perform operation */\n-\t\t\t\ti += __bpf_ld_imm64(\u0026insn[i], R1, imm);\n-\n-\t\t\t\t/* Load reference */\n-\t\t\t\tinsn[i++] = BPF_ALU32_IMM(BPF_MOV, R2, imm);\n-\t\t\t\tinsn[i++] = BPF_ALU32_IMM(BPF_MOV, R3,\n-\t\t\t\t\t\t\t  (u32)(imm \u003e\u003e 32));\n-\t\t\t\tinsn[i++] = BPF_ALU64_IMM(BPF_LSH, R3, 32);\n-\t\t\t\tinsn[i++] = BPF_ALU64_REG(BPF_OR, R2, R3);\n-\n-\t\t\t\t/* Check result */\n-\t\t\t\tinsn[i++] = BPF_JMP_REG(BPF_JEQ, R1, R2, 1);\n-\t\t\t\tinsn[i++] = BPF_EXIT_INSN();\n-\t\t\t}\n-\t\t}\n-\t}\n-\n-\tinsn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 1);\n-\tinsn[i++] = BPF_EXIT_INSN();\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\tBUG_ON(i != len);\n-\n-\treturn 0;\n-}\n-\n-/*\n- * Test the two-instruction 64-bit immediate load operation for different\n- * combinations of bytes. Each byte in the 64-bit word is constructed as\n- * (base \u0026 mask) | (rand() \u0026 ~mask), where rand() is a deterministic LCG.\n- * All patterns (base1, mask1) and (base2, mask2) bytes are tested.\n- */\n-static int __bpf_fill_ld_imm64_bytes(struct bpf_test *self,\n-\t\t\t\t     u8 base1, u8 mask1,\n-\t\t\t\t     u8 base2, u8 mask2)\n-{\n-\tstruct bpf_insn *insn;\n-\tint len = 3 + 8 * BIT(8);\n-\tint pattern, index;\n-\tu32 rand = 1;\n-\tint i = 0;\n-\n-\tinsn = kmalloc_objs(*insn, len);\n-\tif (!insn)\n-\t\treturn -ENOMEM;\n-\n-\tinsn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 0);\n-\n-\tfor (pattern = 0; pattern \u003c BIT(8); pattern++) {\n-\t\tu64 imm = 0;\n-\n-\t\tfor (index = 0; index \u003c 8; index++) {\n-\t\t\tint byte;\n-\n-\t\t\tif (pattern \u0026 BIT(index))\n-\t\t\t\tbyte = (base1 \u0026 mask1) | (rand \u0026 ~mask1);\n-\t\t\telse\n-\t\t\t\tbyte = (base2 \u0026 mask2) | (rand \u0026 ~mask2);\n-\t\t\timm = (imm \u003c\u003c 8) | byte;\n-\t\t}\n-\n-\t\t/* Update our LCG */\n-\t\trand = rand * 1664525 + 1013904223;\n-\n-\t\t/* Perform operation */\n-\t\ti += __bpf_ld_imm64(\u0026insn[i], R1, imm);\n-\n-\t\t/* Load reference */\n-\t\tinsn[i++] = BPF_ALU32_IMM(BPF_MOV, R2, imm);\n-\t\tinsn[i++] = BPF_ALU32_IMM(BPF_MOV, R3, (u32)(imm \u003e\u003e 32));\n-\t\tinsn[i++] = BPF_ALU64_IMM(BPF_LSH, R3, 32);\n-\t\tinsn[i++] = BPF_ALU64_REG(BPF_OR, R2, R3);\n-\n-\t\t/* Check result */\n-\t\tinsn[i++] = BPF_JMP_REG(BPF_JEQ, R1, R2, 1);\n-\t\tinsn[i++] = BPF_EXIT_INSN();\n-\t}\n-\n-\tinsn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 1);\n-\tinsn[i++] = BPF_EXIT_INSN();\n-\n-\tself-\u003eu.ptr.insns = insn;\n-\tself-\u003eu.ptr.len = len;\n-\tBUG_ON(i != len);\n-\n-\treturn 0;\n-}\n-\n-static int bpf_fill_ld_imm64_checker(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_ld_imm64_bytes(self, 0, 0xff, 0xff, 0xff);\n-}\n-\n-static int bpf_fill_ld_imm64_pos_neg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_ld_imm64_bytes(self, 1, 0x81, 0x80, 0x80);\n-}\n-\n-static int bpf_fill_ld_imm64_pos_zero(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_ld_imm64_bytes(self, 1, 0x81, 0, 0xff);\n-}\n-\n-static int bpf_fill_ld_imm64_neg_zero(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_ld_imm64_bytes(self, 0x80, 0x80, 0, 0xff);\n-}\n-\n-/*\n- * Exhaustive tests of JMP operations for all combinations of power-of-two\n- * magnitudes of the operands, both for positive and negative values. The\n- * test is designed to verify e.g. the JMP and JMP32 operations for JITs that\n- * emit different code depending on the magnitude of the immediate value.\n- */\n-\n-static bool __bpf_match_jmp_cond(s64 v1, s64 v2, u8 op)\n-{\n-\tswitch (op) {\n-\tcase BPF_JSET:\n-\t\treturn !!(v1 \u0026 v2);\n-\tcase BPF_JEQ:\n-\t\treturn v1 == v2;\n-\tcase BPF_JNE:\n-\t\treturn v1 != v2;\n-\tcase BPF_JGT:\n-\t\treturn (u64)v1 \u003e (u64)v2;\n-\tcase BPF_JGE:\n-\t\treturn (u64)v1 \u003e= (u64)v2;\n-\tcase BPF_JLT:\n-\t\treturn (u64)v1 \u003c (u64)v2;\n-\tcase BPF_JLE:\n-\t\treturn (u64)v1 \u003c= (u64)v2;\n-\tcase BPF_JSGT:\n-\t\treturn v1 \u003e v2;\n-\tcase BPF_JSGE:\n-\t\treturn v1 \u003e= v2;\n-\tcase BPF_JSLT:\n-\t\treturn v1 \u003c v2;\n-\tcase BPF_JSLE:\n-\t\treturn v1 \u003c= v2;\n-\t}\n-\treturn false;\n-}\n-\n-static int __bpf_emit_jmp_imm(struct bpf_test *self, void *arg,\n-\t\t\t      struct bpf_insn *insns, s64 dst, s64 imm)\n-{\n-\tint op = *(int *)arg;\n-\n-\tif (insns) {\n-\t\tbool match = __bpf_match_jmp_cond(dst, (s32)imm, op);\n-\t\tint i = 0;\n-\n-\t\tinsns[i++] = BPF_ALU32_IMM(BPF_MOV, R0, match);\n-\n-\t\ti += __bpf_ld_imm64(\u0026insns[i], R1, dst);\n-\t\tinsns[i++] = BPF_JMP_IMM(op, R1, imm, 1);\n-\t\tif (!match)\n-\t\t\tinsns[i++] = BPF_JMP_IMM(BPF_JA, 0, 0, 1);\n-\t\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\t\treturn i;\n-\t}\n-\n-\treturn 5 + 1;\n-}\n-\n-static int __bpf_emit_jmp32_imm(struct bpf_test *self, void *arg,\n-\t\t\t\tstruct bpf_insn *insns, s64 dst, s64 imm)\n-{\n-\tint op = *(int *)arg;\n-\n-\tif (insns) {\n-\t\tbool match = __bpf_match_jmp_cond((s32)dst, (s32)imm, op);\n-\t\tint i = 0;\n-\n-\t\ti += __bpf_ld_imm64(\u0026insns[i], R1, dst);\n-\t\tinsns[i++] = BPF_JMP32_IMM(op, R1, imm, 1);\n-\t\tif (!match)\n-\t\t\tinsns[i++] = BPF_JMP_IMM(BPF_JA, 0, 0, 1);\n-\t\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\t\treturn i;\n-\t}\n-\n-\treturn 5;\n-}\n-\n-static int __bpf_emit_jmp_reg(struct bpf_test *self, void *arg,\n-\t\t\t      struct bpf_insn *insns, s64 dst, s64 src)\n-{\n-\tint op = *(int *)arg;\n-\n-\tif (insns) {\n-\t\tbool match = __bpf_match_jmp_cond(dst, src, op);\n-\t\tint i = 0;\n-\n-\t\ti += __bpf_ld_imm64(\u0026insns[i], R1, dst);\n-\t\ti += __bpf_ld_imm64(\u0026insns[i], R2, src);\n-\t\tinsns[i++] = BPF_JMP_REG(op, R1, R2, 1);\n-\t\tif (!match)\n-\t\t\tinsns[i++] = BPF_JMP_IMM(BPF_JA, 0, 0, 1);\n-\t\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\t\treturn i;\n-\t}\n-\n-\treturn 7;\n-}\n-\n-static int __bpf_emit_jmp32_reg(struct bpf_test *self, void *arg,\n-\t\t\t\tstruct bpf_insn *insns, s64 dst, s64 src)\n-{\n-\tint op = *(int *)arg;\n-\n-\tif (insns) {\n-\t\tbool match = __bpf_match_jmp_cond((s32)dst, (s32)src, op);\n-\t\tint i = 0;\n-\n-\t\ti += __bpf_ld_imm64(\u0026insns[i], R1, dst);\n-\t\ti += __bpf_ld_imm64(\u0026insns[i], R2, src);\n-\t\tinsns[i++] = BPF_JMP32_REG(op, R1, R2, 1);\n-\t\tif (!match)\n-\t\t\tinsns[i++] = BPF_JMP_IMM(BPF_JA, 0, 0, 1);\n-\t\tinsns[i++] = BPF_EXIT_INSN();\n-\n-\t\treturn i;\n-\t}\n-\n-\treturn 7;\n-}\n-\n-static int __bpf_fill_jmp_imm(struct bpf_test *self, int op)\n-{\n-\treturn __bpf_fill_pattern(self, \u0026op, 64, 32,\n-\t\t\t\t  PATTERN_BLOCK1, PATTERN_BLOCK2,\n-\t\t\t\t  \u0026__bpf_emit_jmp_imm);\n-}\n-\n-static int __bpf_fill_jmp32_imm(struct bpf_test *self, int op)\n-{\n-\treturn __bpf_fill_pattern(self, \u0026op, 64, 32,\n-\t\t\t\t  PATTERN_BLOCK1, PATTERN_BLOCK2,\n-\t\t\t\t  \u0026__bpf_emit_jmp32_imm);\n-}\n-\n-static int __bpf_fill_jmp_reg(struct bpf_test *self, int op)\n-{\n-\treturn __bpf_fill_pattern(self, \u0026op, 64, 64,\n-\t\t\t\t  PATTERN_BLOCK1, PATTERN_BLOCK2,\n-\t\t\t\t  \u0026__bpf_emit_jmp_reg);\n-}\n-\n-static int __bpf_fill_jmp32_reg(struct bpf_test *self, int op)\n-{\n-\treturn __bpf_fill_pattern(self, \u0026op, 64, 64,\n-\t\t\t\t  PATTERN_BLOCK1, PATTERN_BLOCK2,\n-\t\t\t\t  \u0026__bpf_emit_jmp32_reg);\n-}\n-\n-/* JMP immediate tests */\n-static int bpf_fill_jmp_jset_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_imm(self, BPF_JSET);\n-}\n-\n-static int bpf_fill_jmp_jeq_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_imm(self, BPF_JEQ);\n-}\n-\n-static int bpf_fill_jmp_jne_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_imm(self, BPF_JNE);\n-}\n-\n-static int bpf_fill_jmp_jgt_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_imm(self, BPF_JGT);\n-}\n-\n-static int bpf_fill_jmp_jge_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_imm(self, BPF_JGE);\n-}\n-\n-static int bpf_fill_jmp_jlt_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_imm(self, BPF_JLT);\n-}\n-\n-static int bpf_fill_jmp_jle_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_imm(self, BPF_JLE);\n-}\n-\n-static int bpf_fill_jmp_jsgt_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_imm(self, BPF_JSGT);\n-}\n-\n-static int bpf_fill_jmp_jsge_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_imm(self, BPF_JSGE);\n-}\n-\n-static int bpf_fill_jmp_jslt_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_imm(self, BPF_JSLT);\n-}\n-\n-static int bpf_fill_jmp_jsle_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_imm(self, BPF_JSLE);\n-}\n-\n-/* JMP32 immediate tests */\n-static int bpf_fill_jmp32_jset_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_imm(self, BPF_JSET);\n-}\n-\n-static int bpf_fill_jmp32_jeq_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_imm(self, BPF_JEQ);\n-}\n-\n-static int bpf_fill_jmp32_jne_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_imm(self, BPF_JNE);\n-}\n-\n-static int bpf_fill_jmp32_jgt_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_imm(self, BPF_JGT);\n-}\n-\n-static int bpf_fill_jmp32_jge_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_imm(self, BPF_JGE);\n-}\n-\n-static int bpf_fill_jmp32_jlt_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_imm(self, BPF_JLT);\n-}\n-\n-static int bpf_fill_jmp32_jle_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_imm(self, BPF_JLE);\n-}\n-\n-static int bpf_fill_jmp32_jsgt_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_imm(self, BPF_JSGT);\n-}\n-\n-static int bpf_fill_jmp32_jsge_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_imm(self, BPF_JSGE);\n-}\n-\n-static int bpf_fill_jmp32_jslt_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_imm(self, BPF_JSLT);\n-}\n-\n-static int bpf_fill_jmp32_jsle_imm(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_imm(self, BPF_JSLE);\n-}\n-\n-/* JMP register tests */\n-static int bpf_fill_jmp_jset_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_reg(self, BPF_JSET);\n-}\n-\n-static int bpf_fill_jmp_jeq_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_reg(self, BPF_JEQ);\n-}\n-\n-static int bpf_fill_jmp_jne_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_reg(self, BPF_JNE);\n-}\n-\n-static int bpf_fill_jmp_jgt_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_reg(self, BPF_JGT);\n-}\n-\n-static int bpf_fill_jmp_jge_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_reg(self, BPF_JGE);\n-}\n-\n-static int bpf_fill_jmp_jlt_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_reg(self, BPF_JLT);\n-}\n-\n-static int bpf_fill_jmp_jle_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_reg(self, BPF_JLE);\n-}\n-\n-static int bpf_fill_jmp_jsgt_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_reg(self, BPF_JSGT);\n-}\n-\n-static int bpf_fill_jmp_jsge_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_reg(self, BPF_JSGE);\n-}\n-\n-static int bpf_fill_jmp_jslt_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_reg(self, BPF_JSLT);\n-}\n-\n-static int bpf_fill_jmp_jsle_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp_reg(self, BPF_JSLE);\n-}\n-\n-/* JMP32 register tests */\n-static int bpf_fill_jmp32_jset_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_reg(self, BPF_JSET);\n-}\n-\n-static int bpf_fill_jmp32_jeq_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_reg(self, BPF_JEQ);\n-}\n-\n-static int bpf_fill_jmp32_jne_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_reg(self, BPF_JNE);\n-}\n-\n-static int bpf_fill_jmp32_jgt_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_reg(self, BPF_JGT);\n-}\n-\n-static int bpf_fill_jmp32_jge_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_reg(self, BPF_JGE);\n-}\n-\n-static int bpf_fill_jmp32_jlt_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_reg(self, BPF_JLT);\n-}\n-\n-static int bpf_fill_jmp32_jle_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_reg(self, BPF_JLE);\n-}\n-\n-static int bpf_fill_jmp32_jsgt_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_reg(self, BPF_JSGT);\n-}\n-\n-static int bpf_fill_jmp32_jsge_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_reg(self, BPF_JSGE);\n-}\n-\n-static int bpf_fill_jmp32_jslt_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_reg(self, BPF_JSLT);\n-}\n-\n-static int bpf_fill_jmp32_jsle_reg(struct bpf_test *self)\n-{\n-\treturn __bpf_fill_jmp32_reg(self, BPF_JSLE);\n-}\n-\n-/*\n- * Set up a sequence of staggered jumps, forwards and backwards with\n- * increasing offset. This tests the conversion of relative jumps to\n- * JITed native jumps. On some architectures, for example MIPS, a large\n- * PC-relative jump offset may overflow the immediate field of the native\n- * conditional branch instruction, triggering a conversion to use an\n- * absolute jump instead. Since this changes the jump offsets, another\n- * offset computation pass is necessary, and that may in turn trigger\n- * another branch conversion. This jump sequence is particularly nasty\n- * in that regard.\n- *\n- * The sequence generation is parameterized by size and jump type.\n- * The size must be even, and the expected result is always size + 1.\n- * Below is an example with size=8 and result=9.\n- *\n- *                     ________________________Start\n- *                     R0 = 0\n- *                     R1 = r1\n- *                     R2 = r2\n- *            ,------- JMP +4 * 3______________Preamble: 4 insns\n- * ,----------|-ind 0- if R0 != 7 JMP 8 * 3 + 1 \u003c--------------------.\n- * |          |        R0 = 8                                        |\n- * |          |        JMP +7 * 3               ------------------------.\n- * | ,--------|-----1- if R0 != 5 JMP 7 * 3 + 1 \u003c--------------.     |  |\n- * | |        |        R0 = 6                                  |     |  |\n- * | |        |        JMP +5 * 3               ------------------.  |  |\n- * | | ,------|-----2- if R0 != 3 JMP 6 * 3 + 1 \u003c--------.     |  |  |  |\n- * | | |      |        R0 = 4                            |     |  |  |  |\n- * | | |      |        JMP +3 * 3               ------------.  |  |  |  |\n- * | | | ,----|-----3- if R0 != 1 JMP 5 * 3 + 1 \u003c--.     |  |  |  |  |  |\n- * | | | |    |        R0 = 2                      |     |  |  |  |  |  |\n- * | | | |    |        JMP +1 * 3               ------.  |  |  |  |  |  |\n- * | | | | ,--t=====4\u003e if R0 != 0 JMP 4 * 3 + 1    1  2  3  4  5  6  7  8 loc\n- * | | | | |           R0 = 1                     -1 +2 -3 +4 -5 +6 -7 +8 off\n- * | | | | |           JMP -2 * 3               ---'  |  |  |  |  |  |  |\n- * | | | | | ,------5- if R0 != 2 JMP 3 * 3 + 1 \u003c-----'  |  |  |  |  |  |\n- * | | | | | |         R0 = 3                            |  |  |  |  |  |\n- * | | | | | |         JMP -4 * 3               ---------'  |  |  |  |  |\n- * | | | | | | ,----6- if R0 != 4 JMP 2 * 3 + 1 \u003c-----------'  |  |  |  |\n- * | | | | | | |       R0 = 5                                  |  |  |  |\n- * | | | | | | |       JMP -6 * 3               ---------------'  |  |  |\n- * | | | | | | | ,--7- if R0 != 6 JMP 1 * 3 + 1 \u003c-----------------'  |  |\n- * | | | | | | | |     R0 = 7                                        |  |\n- * | | Error | | |     JMP -8 * 3               ---------------------'  |\n- * | | paths | | | ,8- if R0 != 8 JMP 0 * 3 + 1 \u003c-----------------------'\n- * | | | | | | | | |   R0 = 9__________________Sequence: 3 * size - 1 insns\n- * `-+-+-+-+-+-+-+-+-\u003e EXIT____________________Return: 1 insn\n- *\n- */\n-\n-/* The maximum size parameter */\n-#define MAX_STAGGERED_JMP_SIZE ((0x7fff / 3) \u0026 ~1)\n-\n-/* We use a reduced number of iterations to get a reasonable execution time */\n-#define NR_STAGGERED_JMP_RUNS 10\n-\n-static int __bpf_fill_staggered_jumps(struct bpf_test *self,\n-\t\t\t\t      const struct bpf_insn *jmp,\n-\t\t\t\t      u64 r1, u64 r2)\n-{\n-\tint size = self-\u003etest[0].result - 1;\n-\tint len = 4 + 3 * (size + 1);\n-\tstruct bpf_insn *insns;\n-\tint off, ind;\n-\n-\tinsns = kmalloc_objs(*insns, len);\n-\tif (!insns)\n-\t\treturn -ENOMEM;\n-\n-\t/* Preamble */\n-\tinsns[0] = BPF_ALU64_IMM(BPF_MOV, R0, 0);\n-\tinsns[1] = BPF_ALU64_IMM(BPF_MOV, R1, r1);\n-\tinsns[2] = BPF_ALU64_IMM(BPF_MOV, R2, r2);\n-\tinsns[3] = BPF_JMP_IMM(BPF_JA, 0, 0, 3 * size / 2);\n-\n-\t/* Sequence */\n-\tfor (ind = 0, off = size; ind \u003c= size; ind++, off -= 2) {\n-\t\tstruct bpf_insn *ins = \u0026insns[4 + 3 * ind];\n-\t\tint loc;\n-\n-\t\tif (off == 0)\n-\t\t\toff--;\n-\n-\t\tloc = abs(off);\n-\t\tins[0] = BPF_JMP_IMM(BPF_JNE, R0, loc - 1,\n-\t\t\t\t     3 * (size - ind) + 1);\n-\t\tins[1] = BPF_ALU64_IMM(BPF_MOV, R0, loc);\n-\t\tins[2] = *jmp;\n-\t\tins[2].off = 3 * (off - 1);\n-\t}\n-\n-\t/* Return */\n-\tinsns[len - 1] = BPF_EXIT_INSN();\n-\n-\tself-\u003eu.ptr.insns = insns;\n-\tself-\u003eu.ptr.len = len;\n-\n-\treturn 0;\n-}\n-\n-/* 64-bit unconditional jump */\n-static int bpf_fill_staggered_ja(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_IMM(BPF_JA, 0, 0, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 0, 0);\n-}\n-\n-/* 64-bit immediate jumps */\n-static int bpf_fill_staggered_jeq_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_IMM(BPF_JEQ, R1, 1234, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 1234, 0);\n-}\n-\n-static int bpf_fill_staggered_jne_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_IMM(BPF_JNE, R1, 1234, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 4321, 0);\n-}\n-\n-static int bpf_fill_staggered_jset_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_IMM(BPF_JSET, R1, 0x82, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 0x86, 0);\n-}\n-\n-static int bpf_fill_staggered_jgt_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_IMM(BPF_JGT, R1, 1234, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 0x80000000, 0);\n-}\n-\n-static int bpf_fill_staggered_jge_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_IMM(BPF_JGE, R1, 1234, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 1234, 0);\n-}\n-\n-static int bpf_fill_staggered_jlt_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_IMM(BPF_JLT, R1, 0x80000000, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 1234, 0);\n-}\n-\n-static int bpf_fill_staggered_jle_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_IMM(BPF_JLE, R1, 1234, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 1234, 0);\n-}\n-\n-static int bpf_fill_staggered_jsgt_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_IMM(BPF_JSGT, R1, -2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, -1, 0);\n-}\n-\n-static int bpf_fill_staggered_jsge_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_IMM(BPF_JSGE, R1, -2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, -2, 0);\n-}\n-\n-static int bpf_fill_staggered_jslt_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_IMM(BPF_JSLT, R1, -1, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, -2, 0);\n-}\n-\n-static int bpf_fill_staggered_jsle_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_IMM(BPF_JSLE, R1, -1, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, -1, 0);\n-}\n-\n-/* 64-bit register jumps */\n-static int bpf_fill_staggered_jeq_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_REG(BPF_JEQ, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 1234, 1234);\n-}\n-\n-static int bpf_fill_staggered_jne_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_REG(BPF_JNE, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 4321, 1234);\n-}\n-\n-static int bpf_fill_staggered_jset_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_REG(BPF_JSET, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 0x86, 0x82);\n-}\n-\n-static int bpf_fill_staggered_jgt_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_REG(BPF_JGT, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 0x80000000, 1234);\n-}\n-\n-static int bpf_fill_staggered_jge_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_REG(BPF_JGE, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 1234, 1234);\n-}\n-\n-static int bpf_fill_staggered_jlt_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_REG(BPF_JLT, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 1234, 0x80000000);\n-}\n-\n-static int bpf_fill_staggered_jle_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_REG(BPF_JLE, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 1234, 1234);\n-}\n-\n-static int bpf_fill_staggered_jsgt_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_REG(BPF_JSGT, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, -1, -2);\n-}\n-\n-static int bpf_fill_staggered_jsge_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_REG(BPF_JSGE, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, -2, -2);\n-}\n-\n-static int bpf_fill_staggered_jslt_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_REG(BPF_JSLT, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, -2, -1);\n-}\n-\n-static int bpf_fill_staggered_jsle_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP_REG(BPF_JSLE, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, -1, -1);\n-}\n-\n-/* 32-bit immediate jumps */\n-static int bpf_fill_staggered_jeq32_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_IMM(BPF_JEQ, R1, 1234, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 1234, 0);\n-}\n-\n-static int bpf_fill_staggered_jne32_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_IMM(BPF_JNE, R1, 1234, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 4321, 0);\n-}\n-\n-static int bpf_fill_staggered_jset32_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_IMM(BPF_JSET, R1, 0x82, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 0x86, 0);\n-}\n-\n-static int bpf_fill_staggered_jgt32_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_IMM(BPF_JGT, R1, 1234, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 0x80000000, 0);\n-}\n-\n-static int bpf_fill_staggered_jge32_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_IMM(BPF_JGE, R1, 1234, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 1234, 0);\n-}\n-\n-static int bpf_fill_staggered_jlt32_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_IMM(BPF_JLT, R1, 0x80000000, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 1234, 0);\n-}\n-\n-static int bpf_fill_staggered_jle32_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_IMM(BPF_JLE, R1, 1234, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 1234, 0);\n-}\n-\n-static int bpf_fill_staggered_jsgt32_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_IMM(BPF_JSGT, R1, -2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, -1, 0);\n-}\n-\n-static int bpf_fill_staggered_jsge32_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_IMM(BPF_JSGE, R1, -2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, -2, 0);\n-}\n-\n-static int bpf_fill_staggered_jslt32_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_IMM(BPF_JSLT, R1, -1, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, -2, 0);\n-}\n-\n-static int bpf_fill_staggered_jsle32_imm(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_IMM(BPF_JSLE, R1, -1, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, -1, 0);\n-}\n-\n-/* 32-bit register jumps */\n-static int bpf_fill_staggered_jeq32_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_REG(BPF_JEQ, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 1234, 1234);\n-}\n-\n-static int bpf_fill_staggered_jne32_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_REG(BPF_JNE, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 4321, 1234);\n-}\n-\n-static int bpf_fill_staggered_jset32_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_REG(BPF_JSET, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 0x86, 0x82);\n-}\n-\n-static int bpf_fill_staggered_jgt32_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_REG(BPF_JGT, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 0x80000000, 1234);\n-}\n-\n-static int bpf_fill_staggered_jge32_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_REG(BPF_JGE, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 1234, 1234);\n-}\n-\n-static int bpf_fill_staggered_jlt32_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_REG(BPF_JLT, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 1234, 0x80000000);\n-}\n-\n-static int bpf_fill_staggered_jle32_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_REG(BPF_JLE, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, 1234, 1234);\n-}\n-\n-static int bpf_fill_staggered_jsgt32_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_REG(BPF_JSGT, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, -1, -2);\n-}\n-\n-static int bpf_fill_staggered_jsge32_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_REG(BPF_JSGE, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, -2, -2);\n-}\n-\n-static int bpf_fill_staggered_jslt32_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_REG(BPF_JSLT, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, -2, -1);\n-}\n-\n-static int bpf_fill_staggered_jsle32_reg(struct bpf_test *self)\n-{\n-\tstruct bpf_insn jmp = BPF_JMP32_REG(BPF_JSLE, R1, R2, 0);\n-\n-\treturn __bpf_fill_staggered_jumps(self, \u0026jmp, -1, -1);\n-}\n-\n-\n-static struct bpf_test tests[] = {\n-\t{\n-\t\t\"TAX\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 2),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_NEG, 0), /* A == -3 */\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_LEN, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0), /* X == len - 3 */\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_IND, 1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ 10, 20, 30, 40, 50 },\n-\t\t{ { 2, 10 }, { 3, 20 }, { 4, 30 } },\n-\t},\n-\t{\n-\t\t\"TXA\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_LEN, 0),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0) /* A == len * 2 */\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ 10, 20, 30, 40, 50 },\n-\t\t{ { 1, 2 }, { 3, 6 }, { 4, 8 } },\n-\t},\n-\t{\n-\t\t\"ADD_SUB_MUL_K\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 1),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 2),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 3),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 0xffffffff),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_MUL | BPF_K, 3),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0xfffffffd } }\n-\t},\n-\t{\n-\t\t\"DIV_MOD_KX\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 8),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 2),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0xffffffff),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_DIV | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0xffffffff),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 0x70000000),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0xffffffff),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_MOD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0xffffffff),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_MOD | BPF_K, 0x70000000),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0x20000000 } }\n-\t},\n-\t{\n-\t\t\"AND_OR_LSH_K\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0xff),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_AND | BPF_K, 0xf0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_LSH | BPF_K, 27),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0xf),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_OR | BPF_K, 0xf0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0x800000ff }, { 1, 0x800000ff } },\n-\t},\n-\t{\n-\t\t\"LD_IMM_0\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0), /* ld #0 */\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0, 1, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 1),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ },\n-\t\t{ { 1, 1 } },\n-\t},\n-\t{\n-\t\t\"LD_IND\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_LEN, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_IND, MAX_K),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 1)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ },\n-\t\t{ { 1, 0 }, { 10, 0 }, { 60, 0 } },\n-\t},\n-\t{\n-\t\t\"LD_ABS\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS, 1000),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 1)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ },\n-\t\t{ { 1, 0 }, { 10, 0 }, { 60, 0 } },\n-\t},\n-\t{\n-\t\t\"LD_ABS_LL\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_ABS, SKF_LL_OFF),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_ABS, SKF_LL_OFF + 1),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ 1, 2, 3 },\n-\t\t{ { 1, 0 }, { 2, 3 } },\n-\t},\n-\t{\n-\t\t\"LD_IND_LL\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, SKF_LL_OFF - 1),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_LEN, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_IND, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ 1, 2, 3, 0xff },\n-\t\t{ { 1, 1 }, { 3, 3 }, { 4, 0xff } },\n-\t},\n-\t{\n-\t\t\"LD_ABS_NET\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_ABS, SKF_NET_OFF),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_ABS, SKF_NET_OFF + 1),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3 },\n-\t\t{ { 15, 0 }, { 16, 3 } },\n-\t},\n-\t{\n-\t\t\"LD_IND_NET\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, SKF_NET_OFF - 15),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_LEN, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_IND, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3 },\n-\t\t{ { 14, 0 }, { 15, 1 }, { 17, 3 } },\n-\t},\n-\t{\n-\t\t\"LD_PKTTYPE\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_PKTTYPE),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, SKB_TYPE, 1, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_PKTTYPE),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, SKB_TYPE, 1, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_PKTTYPE),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, SKB_TYPE, 1, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ },\n-\t\t{ { 1, 3 }, { 10, 3 } },\n-\t},\n-\t{\n-\t\t\"LD_MARK\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_MARK),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ },\n-\t\t{ { 1, SKB_MARK}, { 10, SKB_MARK} },\n-\t},\n-\t{\n-\t\t\"LD_RXHASH\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_RXHASH),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ },\n-\t\t{ { 1, SKB_HASH}, { 10, SKB_HASH} },\n-\t},\n-\t{\n-\t\t\"LD_QUEUE\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_QUEUE),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ },\n-\t\t{ { 1, SKB_QUEUE_MAP }, { 10, SKB_QUEUE_MAP } },\n-\t},\n-\t{\n-\t\t\"LD_PROTOCOL\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_ABS, 1),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 20, 1, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_PROTOCOL),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_ABS, 2),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 30, 1, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 0),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ 10, 20, 30 },\n-\t\t{ { 10, ETH_P_IP }, { 100, ETH_P_IP } },\n-\t},\n-\t{\n-\t\t\"LD_VLAN_TAG\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_VLAN_TAG),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ },\n-\t\t{\n-\t\t\t{ 1, SKB_VLAN_TCI },\n-\t\t\t{ 10, SKB_VLAN_TCI }\n-\t\t},\n-\t},\n-\t{\n-\t\t\"LD_VLAN_TAG_PRESENT\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_VLAN_TAG_PRESENT),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ },\n-\t\t{\n-\t\t\t{ 1, SKB_VLAN_PRESENT },\n-\t\t\t{ 10, SKB_VLAN_PRESENT }\n-\t\t},\n-\t},\n-\t{\n-\t\t\"LD_IFINDEX\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_IFINDEX),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ },\n-\t\t{ { 1, SKB_DEV_IFINDEX }, { 10, SKB_DEV_IFINDEX } },\n-\t},\n-\t{\n-\t\t\"LD_HATYPE\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_HATYPE),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ },\n-\t\t{ { 1, SKB_DEV_TYPE }, { 10, SKB_DEV_TYPE } },\n-\t},\n-\t{\n-\t\t\"LD_CPU\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_CPU),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_CPU),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ },\n-\t\t{ { 1, 0 }, { 10, 0 } },\n-\t},\n-\t{\n-\t\t\"LD_NLATTR\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 2),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 3),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_NLATTR),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-#ifdef __BIG_ENDIAN\n-\t\t{ 0xff, 0xff, 0, 4, 0, 2, 0, 4, 0, 3 },\n-#else\n-\t\t{ 0xff, 0xff, 4, 0, 2, 0, 4, 0, 3, 0 },\n-#endif\n-\t\t{ { 4, 0 }, { 20, 6 } },\n-\t},\n-\t{\n-\t\t\"LD_NLATTR_NEST\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 2),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 3),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_NLATTR_NEST),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 2),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_NLATTR_NEST),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 2),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_NLATTR_NEST),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 2),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_NLATTR_NEST),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 2),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_NLATTR_NEST),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 2),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_NLATTR_NEST),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 2),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_NLATTR_NEST),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 2),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_NLATTR_NEST),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-#ifdef __BIG_ENDIAN\n-\t\t{ 0xff, 0xff, 0, 12, 0, 1, 0, 4, 0, 2, 0, 4, 0, 3 },\n-#else\n-\t\t{ 0xff, 0xff, 12, 0, 1, 0, 4, 0, 2, 0, 4, 0, 3, 0 },\n-#endif\n-\t\t{ { 4, 0 }, { 20, 10 } },\n-\t},\n-\t{\n-\t\t\"LD_PAYLOAD_OFF\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_PAY_OFFSET),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_PAY_OFFSET),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_PAY_OFFSET),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_PAY_OFFSET),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_PAY_OFFSET),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t/* 00:00:00:00:00:00 \u003e 00:00:00:00:00:00, ethtype IPv4 (0x0800),\n-\t\t * length 98: 127.0.0.1 \u003e 127.0.0.1: ICMP echo request,\n-\t\t * id 9737, seq 1, length 64\n-\t\t */\n-\t\t{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n-\t\t  0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n-\t\t  0x08, 0x00,\n-\t\t  0x45, 0x00, 0x00, 0x54, 0xac, 0x8b, 0x40, 0x00, 0x40,\n-\t\t  0x01, 0x90, 0x1b, 0x7f, 0x00, 0x00, 0x01 },\n-\t\t{ { 30, 0 }, { 100, 42 } },\n-\t},\n-\t{\n-\t\t\"LD_ANC_XOR\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 10),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 300),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_ALU_XOR_X),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ },\n-\t\t{ { 4, 0xA ^ 300 }, { 20, 0xA ^ 300 } },\n-\t},\n-\t{\n-\t\t\"SPILL_FILL\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_LEN, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 2),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_RSH, 1),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_XOR | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_ST, 1), /* M1 = 1 ^ len */\n-\t\t\tBPF_STMT(BPF_ALU | BPF_XOR | BPF_K, 0x80000000),\n-\t\t\tBPF_STMT(BPF_ST, 2), /* M2 = 1 ^ len ^ 0x80000000 */\n-\t\t\tBPF_STMT(BPF_STX, 15), /* M3 = len */\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 1),\n-\t\t\tBPF_STMT(BPF_LD | BPF_MEM, 2),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_XOR | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 15),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_XOR | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ },\n-\t\t{ { 1, 0x80000001 }, { 2, 0x80000002 }, { 60, 0x80000000 ^ 60 } }\n-\t},\n-\t{\n-\t\t\"JEQ\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_LEN, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_ABS, 2),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_X, 0, 0, 1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, MAX_K)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ 3, 3, 3, 3, 3 },\n-\t\t{ { 1, 0 }, { 3, 1 }, { 4, MAX_K } },\n-\t},\n-\t{\n-\t\t\"JGT\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_LEN, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_ABS, 2),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JGT | BPF_X, 0, 0, 1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, MAX_K)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ 4, 4, 4, 3, 3 },\n-\t\t{ { 2, 0 }, { 3, 1 }, { 4, MAX_K } },\n-\t},\n-\t{\n-\t\t\"JGE (jt 0), test 1\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_LEN, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_ABS, 2),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JGE | BPF_X, 0, 0, 1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, MAX_K)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ 4, 4, 4, 3, 3 },\n-\t\t{ { 2, 0 }, { 3, 1 }, { 4, 1 } },\n-\t},\n-\t{\n-\t\t\"JGE (jt 0), test 2\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_LEN, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_ABS, 2),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JGE | BPF_X, 0, 0, 1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, MAX_K)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ 4, 4, 5, 3, 3 },\n-\t\t{ { 4, 1 }, { 5, 1 }, { 6, MAX_K } },\n-\t},\n-\t{\n-\t\t\"JGE\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_LEN, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_IND, MAX_K),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 1, 1, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 10),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 2, 1, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 20),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 3, 1, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 30),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 4, 1, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 40),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, MAX_K)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ 1, 2, 3, 4, 5 },\n-\t\t{ { 1, 20 }, { 3, 40 }, { 5, MAX_K } },\n-\t},\n-\t{\n-\t\t\"JSET\",\n-\t\t.u.insns = {\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JA, 0, 0, 0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JA, 1, 1, 1),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JA, 0, 0, 0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JA, 0, 0, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_LEN, 0),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_SUB | BPF_K, 4),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_IND, 0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 1, 0, 1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 10),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0x80000000, 0, 1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 20),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 30),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 30),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 30),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 30),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 30),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, MAX_K)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ 0, 0xAA, 0x55, 1 },\n-\t\t{ { 4, 10 }, { 5, 20 }, { 6, MAX_K } },\n-\t},\n-\t{\n-\t\t\"tcpdump port 22\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 12),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x86dd, 0, 8), /* IPv6 */\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_ABS, 20),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x84, 2, 0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x6, 1, 0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x11, 0, 17),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 54),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 14, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 56),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 12, 13),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x0800, 0, 12), /* IPv4 */\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_ABS, 23),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x84, 2, 0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x6, 1, 0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x11, 0, 8),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 20),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0x1fff, 6, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 14),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_IND, 14),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 2, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_IND, 16),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 0, 1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 0xffff),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t/* 3c:07:54:43:e5:76 \u003e 10:bf:48:d6:43:d6, ethertype IPv4(0x0800)\n-\t\t * length 114: 10.1.1.149.49700 \u003e 10.1.2.10.22: Flags [P.],\n-\t\t * seq 1305692979:1305693027, ack 3650467037, win 65535,\n-\t\t * options [nop,nop,TS val 2502645400 ecr 3971138], length 48\n-\t\t */\n-\t\t{ 0x10, 0xbf, 0x48, 0xd6, 0x43, 0xd6,\n-\t\t  0x3c, 0x07, 0x54, 0x43, 0xe5, 0x76,\n-\t\t  0x08, 0x00,\n-\t\t  0x45, 0x10, 0x00, 0x64, 0x75, 0xb5,\n-\t\t  0x40, 0x00, 0x40, 0x06, 0xad, 0x2e, /* IP header */\n-\t\t  0x0a, 0x01, 0x01, 0x95, /* ip src */\n-\t\t  0x0a, 0x01, 0x02, 0x0a, /* ip dst */\n-\t\t  0xc2, 0x24,\n-\t\t  0x00, 0x16 /* dst port */ },\n-\t\t{ { 10, 0 }, { 30, 0 }, { 100, 65535 } },\n-\t},\n-\t{\n-\t\t\"tcpdump complex\",\n-\t\t.u.insns = {\n-\t\t\t/* tcpdump -nei eth0 'tcp port 22 and (((ip[2:2] -\n-\t\t\t * ((ip[0]\u00260xf)\u003c\u003c2)) - ((tcp[12]\u00260xf0)\u003e\u003e2)) != 0) and\n-\t\t\t * (len \u003e 115 or len \u003c 30000000000)' -d\n-\t\t\t */\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 12),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x86dd, 30, 0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x800, 0, 29),\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_ABS, 23),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x6, 0, 27),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 20),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0x1fff, 25, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 14),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_IND, 14),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 2, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_IND, 16),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 0, 20),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 16),\n-\t\t\tBPF_STMT(BPF_ST, 1),\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_ABS, 14),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_AND | BPF_K, 0xf),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_LSH | BPF_K, 2),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0x5), /* libpcap emits K on TAX */\n-\t\t\tBPF_STMT(BPF_LD | BPF_MEM, 1),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_ST, 5),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 14),\n-\t\t\tBPF_STMT(BPF_LD | BPF_B | BPF_IND, 26),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_AND | BPF_K, 0xf0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_RSH | BPF_K, 2),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0x9), /* libpcap emits K on TAX */\n-\t\t\tBPF_STMT(BPF_LD | BPF_MEM, 5),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_X, 0, 4, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_LEN, 0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JGT | BPF_K, 0x73, 1, 0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 0xfc23ac00, 1, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 0xffff),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ 0x10, 0xbf, 0x48, 0xd6, 0x43, 0xd6,\n-\t\t  0x3c, 0x07, 0x54, 0x43, 0xe5, 0x76,\n-\t\t  0x08, 0x00,\n-\t\t  0x45, 0x10, 0x00, 0x64, 0x75, 0xb5,\n-\t\t  0x40, 0x00, 0x40, 0x06, 0xad, 0x2e, /* IP header */\n-\t\t  0x0a, 0x01, 0x01, 0x95, /* ip src */\n-\t\t  0x0a, 0x01, 0x02, 0x0a, /* ip dst */\n-\t\t  0xc2, 0x24,\n-\t\t  0x00, 0x16 /* dst port */ },\n-\t\t{ { 10, 0 }, { 30, 0 }, { 100, 65535 } },\n-\t},\n-\t{\n-\t\t\"RET_A\",\n-\t\t.u.insns = {\n-\t\t\t/* check that uninitialized X and A contain zeros */\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0)\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ },\n-\t\t{ {1, 0}, {2, 0} },\n-\t},\n-\t{\n-\t\t\"INT: ADD trivial\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R1, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R1, 2),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R2, 3),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R1, R2),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R1, -1),\n-\t\t\tBPF_ALU64_IMM(BPF_MUL, R1, 3),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xfffffffd } }\n-\t},\n-\t{\n-\t\t\"INT: MUL_X\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, -1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R1, -1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R2, 3),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R1, R2),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R1, 0xfffffffd, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } }\n-\t},\n-\t{\n-\t\t\"INT: MUL_X2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, -1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R2, 3),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R1, R2),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R1, 8),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R1, 0x2ffffff, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } }\n-\t},\n-\t{\n-\t\t\"INT: MUL32_X\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R1, -1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R2, 3),\n-\t\t\tBPF_ALU32_REG(BPF_MUL, R1, R2),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R1, 8),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R1, 0xffffff, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } }\n-\t},\n-\t{\n-\t\t/* Have to test all register combinations, since\n-\t\t * JITing of different registers will produce\n-\t\t * different asm code.\n-\t\t */\n-\t\t\"INT: ADD 64-bit\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R1, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R2, 2),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R3, 3),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R4, 4),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R5, 5),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R6, 6),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R7, 7),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R8, 8),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R9, 9),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R0, 20),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R1, 20),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R2, 20),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R3, 20),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R4, 20),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R5, 20),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R6, 20),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R7, 20),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R8, 20),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R9, 20),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R0, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R1, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R2, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R3, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R4, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R5, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R6, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R7, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R8, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R9, 10),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R0),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R1),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R2),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R3),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R4),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R5),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R6),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R7),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R8),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R9), /* R0 == 155 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R0, 155, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R1, R0),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R1, R1),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R1, R2),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R1, R3),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R1, R4),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R1, R5),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R1, R6),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R1, R7),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R1, R8),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R1, R9), /* R1 == 456 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R1, 456, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R2, R0),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R2, R1),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R2, R2),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R2, R3),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R2, R4),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R2, R5),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R2, R6),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R2, R7),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R2, R8),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R2, R9), /* R2 == 1358 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R2, 1358, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R3, R0),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R3, R1),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R3, R2),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R3, R3),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R3, R4),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R3, R5),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R3, R6),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R3, R7),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R3, R8),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R3, R9), /* R3 == 4063 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R3, 4063, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R4, R0),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R4, R1),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R4, R2),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R4, R3),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R4, R4),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R4, R5),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R4, R6),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R4, R7),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R4, R8),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R4, R9), /* R4 == 12177 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R4, 12177, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R5, R0),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R5, R1),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R5, R2),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R5, R3),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R5, R4),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R5, R5),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R5, R6),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R5, R7),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R5, R8),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R5, R9), /* R5 == 36518 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R5, 36518, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R6, R0),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R6, R1),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R6, R2),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R6, R3),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R6, R4),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R6, R5),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R6, R6),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R6, R7),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R6, R8),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R6, R9), /* R6 == 109540 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R6, 109540, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R7, R0),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R7, R1),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R7, R2),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R7, R3),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R7, R4),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R7, R5),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R7, R6),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R7, R7),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R7, R8),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R7, R9), /* R7 == 328605 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R7, 328605, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R8, R0),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R8, R1),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R8, R2),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R8, R3),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R8, R4),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R8, R5),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R8, R6),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R8, R7),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R8, R8),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R8, R9), /* R8 == 985799 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R8, 985799, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R9, R0),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R9, R1),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R9, R2),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R9, R3),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R9, R4),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R9, R5),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R9, R6),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R9, R7),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R9, R8),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R9, R9), /* R9 == 2957380 */\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R0, R9),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2957380 } }\n-\t},\n-\t{\n-\t\t\"INT: ADD 32-bit\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 20),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R2, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R3, 3),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R4, 4),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R5, 5),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R6, 6),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R7, 7),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R8, 8),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R9, 9),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R1, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R2, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R3, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R4, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R5, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R6, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R7, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R8, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R9, 10),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R0, R1),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R0, R2),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R0, R3),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R0, R4),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R0, R5),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R0, R6),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R0, R7),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R0, R8),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R0, R9), /* R0 == 155 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R0, 155, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R1, R0),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R1, R1),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R1, R2),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R1, R3),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R1, R4),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R1, R5),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R1, R6),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R1, R7),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R1, R8),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R1, R9), /* R1 == 456 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R1, 456, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R2, R0),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R2, R1),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R2, R2),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R2, R3),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R2, R4),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R2, R5),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R2, R6),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R2, R7),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R2, R8),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R2, R9), /* R2 == 1358 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R2, 1358, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R3, R0),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R3, R1),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R3, R2),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R3, R3),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R3, R4),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R3, R5),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R3, R6),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R3, R7),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R3, R8),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R3, R9), /* R3 == 4063 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R3, 4063, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R4, R0),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R4, R1),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R4, R2),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R4, R3),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R4, R4),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R4, R5),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R4, R6),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R4, R7),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R4, R8),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R4, R9), /* R4 == 12177 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R4, 12177, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R5, R0),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R5, R1),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R5, R2),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R5, R3),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R5, R4),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R5, R5),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R5, R6),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R5, R7),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R5, R8),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R5, R9), /* R5 == 36518 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R5, 36518, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R6, R0),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R6, R1),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R6, R2),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R6, R3),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R6, R4),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R6, R5),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R6, R6),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R6, R7),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R6, R8),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R6, R9), /* R6 == 109540 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R6, 109540, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R7, R0),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R7, R1),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R7, R2),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R7, R3),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R7, R4),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R7, R5),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R7, R6),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R7, R7),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R7, R8),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R7, R9), /* R7 == 328605 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R7, 328605, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R8, R0),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R8, R1),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R8, R2),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R8, R3),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R8, R4),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R8, R5),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R8, R6),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R8, R7),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R8, R8),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R8, R9), /* R8 == 985799 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R8, 985799, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R9, R0),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R9, R1),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R9, R2),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R9, R3),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R9, R4),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R9, R5),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R9, R6),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R9, R7),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R9, R8),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R9, R9), /* R9 == 2957380 */\n-\t\t\tBPF_ALU32_REG(BPF_MOV, R0, R9),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2957380 } }\n-\t},\n-\t{\t/* Mainly checking JIT here. */\n-\t\t\"INT: SUB\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R1, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R2, 2),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R3, 3),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R4, 4),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R5, 5),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R6, 6),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R7, 7),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R8, 8),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R9, 9),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R0),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R1),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R2),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R3),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R4),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R5),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R6),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R7),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R8),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R9),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R0, 10),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R0, -55, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R1, R0),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R1, R2),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R1, R3),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R1, R4),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R1, R5),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R1, R6),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R1, R7),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R1, R8),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R1, R9),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R1, 10),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R2, R0),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R2, R1),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R2, R3),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R2, R4),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R2, R5),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R2, R6),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R2, R7),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R2, R8),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R2, R9),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R2, 10),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R3, R0),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R3, R1),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R3, R2),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R3, R4),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R3, R5),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R3, R6),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R3, R7),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R3, R8),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R3, R9),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R3, 10),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R4, R0),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R4, R1),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R4, R2),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R4, R3),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R4, R5),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R4, R6),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R4, R7),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R4, R8),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R4, R9),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R4, 10),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R5, R0),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R5, R1),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R5, R2),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R5, R3),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R5, R4),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R5, R6),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R5, R7),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R5, R8),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R5, R9),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R5, 10),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R6, R0),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R6, R1),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R6, R2),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R6, R3),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R6, R4),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R6, R5),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R6, R7),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R6, R8),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R6, R9),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R6, 10),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R7, R0),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R7, R1),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R7, R2),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R7, R3),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R7, R4),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R7, R5),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R7, R6),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R7, R8),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R7, R9),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R7, 10),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R8, R0),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R8, R1),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R8, R2),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R8, R3),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R8, R4),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R8, R5),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R8, R6),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R8, R7),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R8, R9),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R8, 10),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R9, R0),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R9, R1),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R9, R2),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R9, R3),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R9, R4),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R9, R5),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R9, R6),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R9, R7),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R9, R8),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R9, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R0, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_NEG, R0, 0),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R1),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R2),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R3),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R4),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R5),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R6),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R7),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R8),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R9),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 11 } }\n-\t},\n-\t{\t/* Mainly checking JIT here. */\n-\t\t\"INT: XOR\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R0),\n-\t\t\tBPF_ALU64_REG(BPF_XOR, R1, R1),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R0, R1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R1, -1),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R1, R1),\n-\t\t\tBPF_ALU64_REG(BPF_XOR, R2, R2),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R1, R2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R2, R2),\n-\t\t\tBPF_ALU64_REG(BPF_XOR, R3, R3),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R1, -1),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R3, R3),\n-\t\t\tBPF_ALU64_REG(BPF_XOR, R4, R4),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R2, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R5, -1),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R3, R4, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R4, R4),\n-\t\t\tBPF_ALU64_REG(BPF_XOR, R5, R5),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R3, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R7, -1),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R5, R4, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R5, 1),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R5, R5),\n-\t\t\tBPF_ALU64_REG(BPF_XOR, R6, R6),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R1, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R8, -1),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R5, R6, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R6, R6),\n-\t\t\tBPF_ALU64_REG(BPF_XOR, R7, R7),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R7, R6, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R7, R7),\n-\t\t\tBPF_ALU64_REG(BPF_XOR, R8, R8),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R7, R8, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R8, R8),\n-\t\t\tBPF_ALU64_REG(BPF_XOR, R9, R9),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R9, R8, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R9, R9),\n-\t\t\tBPF_ALU64_REG(BPF_XOR, R0, R0),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R9, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R1, R1),\n-\t\t\tBPF_ALU64_REG(BPF_XOR, R0, R0),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R9, R0, 2),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } }\n-\t},\n-\t{\t/* Mainly checking JIT here. */\n-\t\t\"INT: MUL\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 11),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R1, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R2, 2),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R3, 3),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R4, 4),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R5, 5),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R6, 6),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R7, 7),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R8, 8),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R9, 9),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R0, R0),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R0, R1),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R0, R2),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R0, R3),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R0, R4),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R0, R5),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R0, R6),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R0, R7),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R0, R8),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R0, R9),\n-\t\t\tBPF_ALU64_IMM(BPF_MUL, R0, 10),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R0, 439084800, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R1, R0),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R1, R2),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R1, R3),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R1, R4),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R1, R5),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R1, R6),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R1, R7),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R1, R8),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R1, R9),\n-\t\t\tBPF_ALU64_IMM(BPF_MUL, R1, 10),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R2, R1),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R2, 32),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R2, 0x5a924, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_IMM(BPF_LSH, R1, 32),\n-\t\t\tBPF_ALU64_IMM(BPF_ARSH, R1, 32),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R1, 0xebb90000, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R2, R0),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R2, R1),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R2, R3),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R2, R4),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R2, R5),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R2, R6),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R2, R7),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R2, R8),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R2, R9),\n-\t\t\tBPF_ALU64_IMM(BPF_MUL, R2, 10),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R2, 32),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R0, R2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x35d97ef2 } }\n-\t},\n-\t{\t/* Mainly checking JIT here. */\n-\t\t\"MOV REG64\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xffffffffffffffffLL),\n-\t\t\tBPF_MOV64_REG(R1, R0),\n-\t\t\tBPF_MOV64_REG(R2, R1),\n-\t\t\tBPF_MOV64_REG(R3, R2),\n-\t\t\tBPF_MOV64_REG(R4, R3),\n-\t\t\tBPF_MOV64_REG(R5, R4),\n-\t\t\tBPF_MOV64_REG(R6, R5),\n-\t\t\tBPF_MOV64_REG(R7, R6),\n-\t\t\tBPF_MOV64_REG(R8, R7),\n-\t\t\tBPF_MOV64_REG(R9, R8),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R1, 0),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R2, 0),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R3, 0),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R4, 0),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R5, 0),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R6, 0),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R7, 0),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R8, 0),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R9, 0),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R0),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R1),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R2),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R3),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R4),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R5),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R6),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R7),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R8),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R9),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R0, 0xfefe),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xfefe } }\n-\t},\n-\t{\t/* Mainly checking JIT here. */\n-\t\t\"MOV REG32\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xffffffffffffffffLL),\n-\t\t\tBPF_MOV64_REG(R1, R0),\n-\t\t\tBPF_MOV64_REG(R2, R1),\n-\t\t\tBPF_MOV64_REG(R3, R2),\n-\t\t\tBPF_MOV64_REG(R4, R3),\n-\t\t\tBPF_MOV64_REG(R5, R4),\n-\t\t\tBPF_MOV64_REG(R6, R5),\n-\t\t\tBPF_MOV64_REG(R7, R6),\n-\t\t\tBPF_MOV64_REG(R8, R7),\n-\t\t\tBPF_MOV64_REG(R9, R8),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R2, 0),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R3, 0),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R4, 0),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R5, 0),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R6, 0),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R7, 0),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R8, 0),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R9, 0),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R0),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R1),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R2),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R3),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R4),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R5),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R6),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R7),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R8),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R9),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R0, 0xfefe),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xfefe } }\n-\t},\n-\t{\t/* Mainly checking JIT here. */\n-\t\t\"LD IMM64\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xffffffffffffffffLL),\n-\t\t\tBPF_MOV64_REG(R1, R0),\n-\t\t\tBPF_MOV64_REG(R2, R1),\n-\t\t\tBPF_MOV64_REG(R3, R2),\n-\t\t\tBPF_MOV64_REG(R4, R3),\n-\t\t\tBPF_MOV64_REG(R5, R4),\n-\t\t\tBPF_MOV64_REG(R6, R5),\n-\t\t\tBPF_MOV64_REG(R7, R6),\n-\t\t\tBPF_MOV64_REG(R8, R7),\n-\t\t\tBPF_MOV64_REG(R9, R8),\n-\t\t\tBPF_LD_IMM64(R0, 0x0LL),\n-\t\t\tBPF_LD_IMM64(R1, 0x0LL),\n-\t\t\tBPF_LD_IMM64(R2, 0x0LL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0LL),\n-\t\t\tBPF_LD_IMM64(R4, 0x0LL),\n-\t\t\tBPF_LD_IMM64(R5, 0x0LL),\n-\t\t\tBPF_LD_IMM64(R6, 0x0LL),\n-\t\t\tBPF_LD_IMM64(R7, 0x0LL),\n-\t\t\tBPF_LD_IMM64(R8, 0x0LL),\n-\t\t\tBPF_LD_IMM64(R9, 0x0LL),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R0),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R1),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R2),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R3),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R4),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R5),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R6),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R7),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R8),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R9),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R0, 0xfefe),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xfefe } }\n-\t},\n-\t{\n-\t\t\"INT: ALU MIX\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 11),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R0, -1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R2, 2),\n-\t\t\tBPF_ALU64_IMM(BPF_XOR, R2, 3),\n-\t\t\tBPF_ALU64_REG(BPF_DIV, R0, R2),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R0, 10, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_IMM(BPF_MOD, R0, 3),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R0, 1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, -1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -1 } }\n-\t},\n-\t{\n-\t\t\"INT: shifts by register\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_MOV64_IMM(R0, -1234),\n-\t\t\tBPF_MOV64_IMM(R1, 1),\n-\t\t\tBPF_ALU32_REG(BPF_RSH, R0, R1),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R0, 0x7ffffd97, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV64_IMM(R2, 1),\n-\t\t\tBPF_ALU64_REG(BPF_LSH, R0, R2),\n-\t\t\tBPF_MOV32_IMM(R4, -1234),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R0, R4, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU64_IMM(BPF_AND, R4, 63),\n-\t\t\tBPF_ALU64_REG(BPF_LSH, R0, R4), /* R0 \u003c= 46 */\n-\t\t\tBPF_MOV64_IMM(R3, 47),\n-\t\t\tBPF_ALU64_REG(BPF_ARSH, R0, R3),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R0, -617, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV64_IMM(R2, 1),\n-\t\t\tBPF_ALU64_REG(BPF_LSH, R4, R2), /* R4 = 46 \u003c\u003c 1 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R4, 92, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV64_IMM(R4, 4),\n-\t\t\tBPF_ALU64_REG(BPF_LSH, R4, R4), /* R4 = 4 \u003c\u003c 4 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R4, 64, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV64_IMM(R4, 5),\n-\t\t\tBPF_ALU32_REG(BPF_LSH, R4, R4), /* R4 = 5 \u003c\u003c 5 */\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R4, 160, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV64_IMM(R0, -1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -1 } }\n-\t},\n-#ifdef CONFIG_32BIT\n-\t{\n-\t\t\"INT: 32-bit context pointer word order and zero-extension\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_JMP32_IMM(BPF_JEQ, R1, 0, 3),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R1, 32),\n-\t\t\tBPF_JMP32_IMM(BPF_JNE, R1, 0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } }\n-\t},\n-#endif\n-\t{\n-\t\t\"check: missing ret\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 1),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,\n-\t\t{ },\n-\t\t{ },\n-\t\t.fill_helper = NULL,\n-\t\t.expected_errcode = -EINVAL,\n-\t},\n-\t{\n-\t\t\"check: div_k_0\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 0)\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,\n-\t\t{ },\n-\t\t{ },\n-\t\t.fill_helper = NULL,\n-\t\t.expected_errcode = -EINVAL,\n-\t},\n-\t{\n-\t\t\"check: unknown insn\",\n-\t\t.u.insns = {\n-\t\t\t/* seccomp insn, rejected in socket filter */\n-\t\t\tBPF_STMT(BPF_LDX | BPF_W | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 0)\n-\t\t},\n-\t\tCLASSIC | FLAG_EXPECTED_FAIL,\n-\t\t{ },\n-\t\t{ },\n-\t\t.fill_helper = NULL,\n-\t\t.expected_errcode = -EINVAL,\n-\t},\n-\t{\n-\t\t\"check: out of range spill/fill\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_STX, 16),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 0)\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,\n-\t\t{ },\n-\t\t{ },\n-\t\t.fill_helper = NULL,\n-\t\t.expected_errcode = -EINVAL,\n-\t},\n-\t{\n-\t\t\"JUMPS + HOLES\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JGE, 0, 13, 15),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ, 0x90c2894d, 3, 4),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ, 0x90c2894d, 1, 2),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JGE, 0, 14, 15),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JGE, 0, 13, 14),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ, 0x2ac28349, 2, 3),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ, 0x2ac28349, 1, 2),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JGE, 0, 14, 15),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JGE, 0, 13, 14),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ, 0x90d2ff41, 2, 3),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ, 0x90d2ff41, 1, 2),\n-\t\t\tBPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ 0x00, 0x1b, 0x21, 0x3c, 0x9d, 0xf8,\n-\t\t  0x90, 0xe2, 0xba, 0x0a, 0x56, 0xb4,\n-\t\t  0x08, 0x00,\n-\t\t  0x45, 0x00, 0x00, 0x28, 0x00, 0x00,\n-\t\t  0x20, 0x00, 0x40, 0x11, 0x00, 0x00, /* IP header */\n-\t\t  0xc0, 0xa8, 0x33, 0x01,\n-\t\t  0xc0, 0xa8, 0x33, 0x02,\n-\t\t  0xbb, 0xb6,\n-\t\t  0xa9, 0xfa,\n-\t\t  0x00, 0x14, 0x00, 0x00,\n-\t\t  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,\n-\t\t  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,\n-\t\t  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,\n-\t\t  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,\n-\t\t  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,\n-\t\t  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,\n-\t\t  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,\n-\t\t  0xcc, 0xcc, 0xcc, 0xcc },\n-\t\t{ { 88, 0x001b } }\n-\t},\n-\t{\n-\t\t\"check: RET X\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_RET | BPF_X, 0),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,\n-\t\t{ },\n-\t\t{ },\n-\t\t.fill_helper = NULL,\n-\t\t.expected_errcode = -EINVAL,\n-\t},\n-\t{\n-\t\t\"check: LDX + RET X\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 42),\n-\t\t\tBPF_STMT(BPF_RET | BPF_X, 0),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,\n-\t\t{ },\n-\t\t{ },\n-\t\t.fill_helper = NULL,\n-\t\t.expected_errcode = -EINVAL,\n-\t},\n-\t{\t/* Mainly checking JIT here. */\n-\t\t\"M[]: alt STX + LDX\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 100),\n-\t\t\tBPF_STMT(BPF_STX, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 0),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_STX, 1),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_STX, 2),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 2),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_STX, 3),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 3),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_STX, 4),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 4),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_STX, 5),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 5),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_STX, 6),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 6),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_STX, 7),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 7),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_STX, 8),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 8),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_STX, 9),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 9),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_STX, 10),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 10),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_STX, 11),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 11),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_STX, 12),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 12),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_STX, 13),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 13),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_STX, 14),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 14),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_STX, 15),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 15),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 116 } },\n-\t},\n-\t{\t/* Mainly checking JIT here. */\n-\t\t\"M[]: full STX + full LDX\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0xbadfeedb),\n-\t\t\tBPF_STMT(BPF_STX, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0xecabedae),\n-\t\t\tBPF_STMT(BPF_STX, 1),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0xafccfeaf),\n-\t\t\tBPF_STMT(BPF_STX, 2),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0xbffdcedc),\n-\t\t\tBPF_STMT(BPF_STX, 3),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0xfbbbdccb),\n-\t\t\tBPF_STMT(BPF_STX, 4),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0xfbabcbda),\n-\t\t\tBPF_STMT(BPF_STX, 5),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0xaedecbdb),\n-\t\t\tBPF_STMT(BPF_STX, 6),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0xadebbade),\n-\t\t\tBPF_STMT(BPF_STX, 7),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0xfcfcfaec),\n-\t\t\tBPF_STMT(BPF_STX, 8),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0xbcdddbdc),\n-\t\t\tBPF_STMT(BPF_STX, 9),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0xfeefdfac),\n-\t\t\tBPF_STMT(BPF_STX, 10),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0xcddcdeea),\n-\t\t\tBPF_STMT(BPF_STX, 11),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0xaccfaebb),\n-\t\t\tBPF_STMT(BPF_STX, 12),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0xbdcccdcf),\n-\t\t\tBPF_STMT(BPF_STX, 13),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0xaaedecde),\n-\t\t\tBPF_STMT(BPF_STX, 14),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0xfaeacdad),\n-\t\t\tBPF_STMT(BPF_STX, 15),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 0),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 1),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 2),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 3),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 4),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 5),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 6),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 7),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 8),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 9),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 10),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 11),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 12),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 13),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 14),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_MEM, 15),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0x2a5a5e5 } },\n-\t},\n-\t{\n-\t\t\"check: SKF_AD_MAX\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF + SKF_AD_MAX),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,\n-\t\t{ },\n-\t\t{ },\n-\t\t.fill_helper = NULL,\n-\t\t.expected_errcode = -EINVAL,\n-\t},\n-\t{\t/* Passes checker but fails during runtime. */\n-\t\t\"LD [SKF_AD_OFF-1]\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_W | BPF_ABS,\n-\t\t\t\t SKF_AD_OFF - 1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 1),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ },\n-\t\t{ { 1, 0 } },\n-\t},\n-\t{\n-\t\t\"load 64-bit immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x567800001234LL),\n-\t\t\tBPF_MOV64_REG(R2, R1),\n-\t\t\tBPF_MOV64_REG(R3, R2),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R2, 32),\n-\t\t\tBPF_ALU64_IMM(BPF_LSH, R3, 32),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R3, 32),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R2, 0x5678, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R3, 0x1234, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_LD_IMM64(R0, 0x1ffffffffLL),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32), /* R0 = 1 */\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } }\n-\t},\n-\t/* BPF_ALU | BPF_MOV | BPF_X */\n-\t{\n-\t\t\"ALU_MOV_X: dst = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2),\n-\t\t\tBPF_ALU32_REG(BPF_MOV, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"ALU_MOV_X: dst = 4294967295\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 4294967295U),\n-\t\t\tBPF_ALU32_REG(BPF_MOV, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 4294967295U } },\n-\t},\n-\t{\n-\t\t\"ALU64_MOV_X: dst = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MOV_X: dst = 4294967295\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 4294967295U),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 4294967295U } },\n-\t},\n-\t/* BPF_ALU | BPF_MOV | BPF_K */\n-\t{\n-\t\t\"ALU_MOV_K: dst = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"ALU_MOV_K: dst = 4294967295\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 4294967295U),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 4294967295U } },\n-\t},\n-\t{\n-\t\t\"ALU_MOV_K: 0x0000ffffffff0000 = 0x00000000ffffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0000ffffffff0000LL),\n-\t\t\tBPF_LD_IMM64(R3, 0x00000000ffffffffLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R2, 0xffffffff),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU_MOV_K: small negative\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -123),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -123 } }\n-\t},\n-\t{\n-\t\t\"ALU_MOV_K: small negative zero extension\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -123),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } }\n-\t},\n-\t{\n-\t\t\"ALU_MOV_K: large negative\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -123456789),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -123456789 } }\n-\t},\n-\t{\n-\t\t\"ALU_MOV_K: large negative zero extension\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -123456789),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } }\n-\t},\n-\t{\n-\t\t\"ALU64_MOV_K: dst = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MOV_K: dst = 2147483647\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 2147483647),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2147483647 } },\n-\t},\n-\t{\n-\t\t\"ALU64_OR_K: dst = 0x0\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0000ffffffff0000LL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R2, 0x0),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MOV_K: dst = -1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0000ffffffff0000LL),\n-\t\t\tBPF_LD_IMM64(R3, 0xffffffffffffffffLL),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R2, 0xffffffff),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MOV_K: small negative\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, -123),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -123 } }\n-\t},\n-\t{\n-\t\t\"ALU64_MOV_K: small negative sign extension\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, -123),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffffffff } }\n-\t},\n-\t{\n-\t\t\"ALU64_MOV_K: large negative\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, -123456789),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -123456789 } }\n-\t},\n-\t{\n-\t\t\"ALU64_MOV_K: large negative sign extension\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, -123456789),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffffffff } }\n-\t},\n-\t/* MOVSX32 */\n-\t{\n-\t\t\"ALU_MOVSX | BPF_B\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x00000000ffffffefLL),\n-\t\t\tBPF_LD_IMM64(R3, 0xdeadbeefdeadbeefLL),\n-\t\t\tBPF_MOVSX32_REG(R1, R3, 8),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R1, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU_MOVSX | BPF_H\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x00000000ffffbeefLL),\n-\t\t\tBPF_LD_IMM64(R3, 0xdeadbeefdeadbeefLL),\n-\t\t\tBPF_MOVSX32_REG(R1, R3, 16),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R1, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t/* MOVSX64 REG */\n-\t{\n-\t\t\"ALU64_MOVSX | BPF_B\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0xffffffffffffffefLL),\n-\t\t\tBPF_LD_IMM64(R3, 0xdeadbeefdeadbeefLL),\n-\t\t\tBPF_MOVSX64_REG(R1, R3, 8),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R1, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MOVSX | BPF_H\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0xffffffffffffbeefLL),\n-\t\t\tBPF_LD_IMM64(R3, 0xdeadbeefdeadbeefLL),\n-\t\t\tBPF_MOVSX64_REG(R1, R3, 16),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R1, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MOVSX | BPF_W\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0xffffffffdeadbeefLL),\n-\t\t\tBPF_LD_IMM64(R3, 0xdeadbeefdeadbeefLL),\n-\t\t\tBPF_MOVSX64_REG(R1, R3, 32),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R1, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t/* BPF_ALU | BPF_ADD | BPF_X */\n-\t{\n-\t\t\"ALU_ADD_X: 1 + 2 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU_ADD_X: 1 + 4294967294 = 4294967295\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 4294967294U),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 4294967295U } },\n-\t},\n-\t{\n-\t\t\"ALU_ADD_X: 2 + 4294967294 = 0\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 2),\n-\t\t\tBPF_LD_IMM64(R1, 4294967294U),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R0, R1),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R0, 0, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_ADD_X: 1 + 2 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU64_ADD_X: 1 + 4294967294 = 4294967295\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 4294967294U),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 4294967295U } },\n-\t},\n-\t{\n-\t\t\"ALU64_ADD_X: 2 + 4294967294 = 4294967296\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 2),\n-\t\t\tBPF_LD_IMM64(R1, 4294967294U),\n-\t\t\tBPF_LD_IMM64(R2, 4294967296ULL),\n-\t\t\tBPF_ALU64_REG(BPF_ADD, R0, R1),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R0, R2, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_ALU | BPF_ADD | BPF_K */\n-\t{\n-\t\t\"ALU_ADD_K: 1 + 2 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU_ADD_K: 3 + 0 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU_ADD_K: 1 + 4294967294 = 4294967295\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R0, 4294967294U),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 4294967295U } },\n-\t},\n-\t{\n-\t\t\"ALU_ADD_K: 4294967294 + 2 = 0\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 4294967294U),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R0, 2),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R0, 0, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU_ADD_K: 0 + (-1) = 0x00000000ffffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0),\n-\t\t\tBPF_LD_IMM64(R3, 0x00000000ffffffff),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R2, 0xffffffff),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU_ADD_K: 0 + 0xffff = 0xffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0),\n-\t\t\tBPF_LD_IMM64(R3, 0xffff),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R2, 0xffff),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU_ADD_K: 0 + 0x7fffffff = 0x7fffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0),\n-\t\t\tBPF_LD_IMM64(R3, 0x7fffffff),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R2, 0x7fffffff),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU_ADD_K: 0 + 0x80000000 = 0x80000000\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0),\n-\t\t\tBPF_LD_IMM64(R3, 0x80000000),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R2, 0x80000000),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU_ADD_K: 0 + 0x80008000 = 0x80008000\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0),\n-\t\t\tBPF_LD_IMM64(R3, 0x80008000),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R2, 0x80008000),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_ADD_K: 1 + 2 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU64_ADD_K: 3 + 0 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU64_ADD_K: 1 + 2147483646 = 2147483647\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R0, 2147483646),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2147483647 } },\n-\t},\n-\t{\n-\t\t\"ALU64_ADD_K: 4294967294 + 2 = 4294967296\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 4294967294U),\n-\t\t\tBPF_LD_IMM64(R1, 4294967296ULL),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R0, 2),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R0, R1, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_ADD_K: 2147483646 + -2147483647 = -1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 2147483646),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R0, -2147483647),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_ADD_K: 1 + 0 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x1),\n-\t\t\tBPF_LD_IMM64(R3, 0x1),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R2, 0x0),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_ADD_K: 0 + (-1) = 0xffffffffffffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0),\n-\t\t\tBPF_LD_IMM64(R3, 0xffffffffffffffffLL),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R2, 0xffffffff),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_ADD_K: 0 + 0xffff = 0xffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0),\n-\t\t\tBPF_LD_IMM64(R3, 0xffff),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R2, 0xffff),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_ADD_K: 0 + 0x7fffffff = 0x7fffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0),\n-\t\t\tBPF_LD_IMM64(R3, 0x7fffffff),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R2, 0x7fffffff),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_ADD_K: 0 + 0x80000000 = 0xffffffff80000000\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0),\n-\t\t\tBPF_LD_IMM64(R3, 0xffffffff80000000LL),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R2, 0x80000000),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU_ADD_K: 0 + 0x80008000 = 0xffffffff80008000\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0),\n-\t\t\tBPF_LD_IMM64(R3, 0xffffffff80008000LL),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R2, 0x80008000),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t/* BPF_ALU | BPF_SUB | BPF_X */\n-\t{\n-\t\t\"ALU_SUB_X: 3 - 1 = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 1),\n-\t\t\tBPF_ALU32_REG(BPF_SUB, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"ALU_SUB_X: 4294967295 - 4294967294 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 4294967295U),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 4294967294U),\n-\t\t\tBPF_ALU32_REG(BPF_SUB, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_SUB_X: 3 - 1 = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 1),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"ALU64_SUB_X: 4294967295 - 4294967294 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 4294967295U),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 4294967294U),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_ALU | BPF_SUB | BPF_K */\n-\t{\n-\t\t\"ALU_SUB_K: 3 - 1 = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU32_IMM(BPF_SUB, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"ALU_SUB_K: 3 - 0 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU32_IMM(BPF_SUB, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU_SUB_K: 4294967295 - 4294967294 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 4294967295U),\n-\t\t\tBPF_ALU32_IMM(BPF_SUB, R0, 4294967294U),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_SUB_K: 3 - 1 = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"ALU64_SUB_K: 3 - 0 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU64_SUB_K: 4294967294 - 4294967295 = -1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 4294967294U),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R0, 4294967295U),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_ADD_K: 2147483646 - 2147483647 = -1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 2147483646),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R0, 2147483647),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -1 } },\n-\t},\n-\t/* BPF_ALU | BPF_MUL | BPF_X */\n-\t{\n-\t\t\"ALU_MUL_X: 2 * 3 = 6\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 3),\n-\t\t\tBPF_ALU32_REG(BPF_MUL, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 6 } },\n-\t},\n-\t{\n-\t\t\"ALU_MUL_X: 2 * 0x7FFFFFF8 = 0xFFFFFFF0\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0x7FFFFFF8),\n-\t\t\tBPF_ALU32_REG(BPF_MUL, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xFFFFFFF0 } },\n-\t},\n-\t{\n-\t\t\"ALU_MUL_X: -1 * -1 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, -1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, -1),\n-\t\t\tBPF_ALU32_REG(BPF_MUL, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MUL_X: 2 * 3 = 6\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 3),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 6 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MUL_X: 1 * 2147483647 = 2147483647\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2147483647),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2147483647 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MUL_X: 64x64 multiply, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0fedcba987654321LL),\n-\t\t\tBPF_LD_IMM64(R1, 0x123456789abcdef0LL),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xe5618cf0 } }\n-\t},\n-\t{\n-\t\t\"ALU64_MUL_X: 64x64 multiply, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0fedcba987654321LL),\n-\t\t\tBPF_LD_IMM64(R1, 0x123456789abcdef0LL),\n-\t\t\tBPF_ALU64_REG(BPF_MUL, R0, R1),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x2236d88f } }\n-\t},\n-\t/* BPF_ALU | BPF_MUL | BPF_K */\n-\t{\n-\t\t\"ALU_MUL_K: 2 * 3 = 6\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MUL, R0, 3),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 6 } },\n-\t},\n-\t{\n-\t\t\"ALU_MUL_K: 3 * 1 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU32_IMM(BPF_MUL, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU_MUL_K: 2 * 0x7FFFFFF8 = 0xFFFFFFF0\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MUL, R0, 0x7FFFFFF8),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xFFFFFFF0 } },\n-\t},\n-\t{\n-\t\t\"ALU_MUL_K: 1 * (-1) = 0x00000000ffffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x1),\n-\t\t\tBPF_LD_IMM64(R3, 0x00000000ffffffff),\n-\t\t\tBPF_ALU32_IMM(BPF_MUL, R2, 0xffffffff),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MUL_K: 2 * 3 = 6\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 2),\n-\t\t\tBPF_ALU64_IMM(BPF_MUL, R0, 3),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 6 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MUL_K: 3 * 1 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU64_IMM(BPF_MUL, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MUL_K: 1 * 2147483647 = 2147483647\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MUL, R0, 2147483647),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2147483647 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MUL_K: 1 * -2147483647 = -2147483647\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MUL, R0, -2147483647),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -2147483647 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MUL_K: 1 * (-1) = 0xffffffffffffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x1),\n-\t\t\tBPF_LD_IMM64(R3, 0xffffffffffffffffLL),\n-\t\t\tBPF_ALU64_IMM(BPF_MUL, R2, 0xffffffff),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MUL_K: 64x32 multiply, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_MUL, R0, 0x12345678),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xe242d208 } }\n-\t},\n-\t{\n-\t\t\"ALU64_MUL_K: 64x32 multiply, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_MUL, R0, 0x12345678),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xc28f5c28 } }\n-\t},\n-\t/* BPF_ALU | BPF_DIV | BPF_X */\n-\t{\n-\t\t\"ALU_DIV_X: 6 / 2 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 6),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2),\n-\t\t\tBPF_ALU32_REG(BPF_DIV, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU_DIV_X: 4294967295 / 4294967295 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 4294967295U),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 4294967295U),\n-\t\t\tBPF_ALU32_REG(BPF_DIV, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_DIV_X: 6 / 2 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 6),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2),\n-\t\t\tBPF_ALU64_REG(BPF_DIV, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU64_DIV_X: 2147483647 / 2147483647 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 2147483647),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2147483647),\n-\t\t\tBPF_ALU64_REG(BPF_DIV, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_DIV_X: 0xffffffffffffffff / (-1) = 0x0000000000000001\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0xffffffffffffffffLL),\n-\t\t\tBPF_LD_IMM64(R4, 0xffffffffffffffffLL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0000000000000001LL),\n-\t\t\tBPF_ALU64_REG(BPF_DIV, R2, R4),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t/* BPF_ALU | BPF_DIV | BPF_K */\n-\t{\n-\t\t\"ALU_DIV_K: 6 / 2 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 6),\n-\t\t\tBPF_ALU32_IMM(BPF_DIV, R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU_DIV_K: 3 / 1 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU32_IMM(BPF_DIV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU_DIV_K: 4294967295 / 4294967295 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 4294967295U),\n-\t\t\tBPF_ALU32_IMM(BPF_DIV, R0, 4294967295U),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU_DIV_K: 0xffffffffffffffff / (-1) = 0x1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0xffffffffffffffffLL),\n-\t\t\tBPF_LD_IMM64(R3, 0x1UL),\n-\t\t\tBPF_ALU32_IMM(BPF_DIV, R2, 0xffffffff),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_DIV_K: 6 / 2 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 6),\n-\t\t\tBPF_ALU64_IMM(BPF_DIV, R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU64_DIV_K: 3 / 1 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU64_IMM(BPF_DIV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU64_DIV_K: 2147483647 / 2147483647 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 2147483647),\n-\t\t\tBPF_ALU64_IMM(BPF_DIV, R0, 2147483647),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_DIV_K: 0xffffffffffffffff / (-1) = 0x0000000000000001\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0xffffffffffffffffLL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0000000000000001LL),\n-\t\t\tBPF_ALU64_IMM(BPF_DIV, R2, 0xffffffff),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t/* BPF_ALU | BPF_MOD | BPF_X */\n-\t{\n-\t\t\"ALU_MOD_X: 3 % 2 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2),\n-\t\t\tBPF_ALU32_REG(BPF_MOD, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU_MOD_X: 4294967295 % 4294967293 = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 4294967295U),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 4294967293U),\n-\t\t\tBPF_ALU32_REG(BPF_MOD, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MOD_X: 3 % 2 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2),\n-\t\t\tBPF_ALU64_REG(BPF_MOD, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MOD_X: 2147483647 % 2147483645 = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 2147483647),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2147483645),\n-\t\t\tBPF_ALU64_REG(BPF_MOD, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t/* BPF_ALU | BPF_MOD | BPF_K */\n-\t{\n-\t\t\"ALU_MOD_K: 3 % 2 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU32_IMM(BPF_MOD, R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU_MOD_K: 3 % 1 = 0\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU32_IMM(BPF_MOD, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t},\n-\t{\n-\t\t\"ALU_MOD_K: 4294967295 % 4294967293 = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 4294967295U),\n-\t\t\tBPF_ALU32_IMM(BPF_MOD, R0, 4294967293U),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MOD_K: 3 % 2 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU64_IMM(BPF_MOD, R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MOD_K: 3 % 1 = 0\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU64_IMM(BPF_MOD, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t},\n-\t{\n-\t\t\"ALU64_MOD_K: 2147483647 % 2147483645 = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 2147483647),\n-\t\t\tBPF_ALU64_IMM(BPF_MOD, R0, 2147483645),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t/* BPF_ALU | BPF_DIV | BPF_X off=1 (SDIV) */\n-\t{\n-\t\t\"ALU_SDIV_X: -6 / 2 = -3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, -6),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2),\n-\t\t\tBPF_ALU32_REG_OFF(BPF_DIV, R0, R1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -3 } },\n-\t},\n-\t/* BPF_ALU | BPF_DIV | BPF_K off=1 (SDIV) */\n-\t{\n-\t\t\"ALU_SDIV_K: -6 / 2 = -3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, -6),\n-\t\t\tBPF_ALU32_IMM_OFF(BPF_DIV, R0, 2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -3 } },\n-\t},\n-\t/* BPF_ALU64 | BPF_DIV | BPF_X off=1 (SDIV64) */\n-\t{\n-\t\t\"ALU64_SDIV_X: -6 / 2 = -3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, -6),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2),\n-\t\t\tBPF_ALU64_REG_OFF(BPF_DIV, R0, R1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -3 } },\n-\t},\n-\t/* BPF_ALU64 | BPF_DIV | BPF_K off=1 (SDIV64) */\n-\t{\n-\t\t\"ALU64_SDIV_K: -6 / 2 = -3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, -6),\n-\t\t\tBPF_ALU64_IMM_OFF(BPF_DIV, R0, 2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -3 } },\n-\t},\n-\t/* BPF_ALU | BPF_MOD | BPF_X off=1 (SMOD) */\n-\t{\n-\t\t\"ALU_SMOD_X: -7 % 2 = -1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, -7),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2),\n-\t\t\tBPF_ALU32_REG_OFF(BPF_MOD, R0, R1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -1 } },\n-\t},\n-\t/* BPF_ALU | BPF_MOD | BPF_K off=1 (SMOD) */\n-\t{\n-\t\t\"ALU_SMOD_K: -7 % 2 = -1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, -7),\n-\t\t\tBPF_ALU32_IMM_OFF(BPF_MOD, R0, 2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -1 } },\n-\t},\n-\t/* BPF_ALU64 | BPF_MOD | BPF_X off=1 (SMOD64) */\n-\t{\n-\t\t\"ALU64_SMOD_X: -7 % 2 = -1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, -7),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2),\n-\t\t\tBPF_ALU64_REG_OFF(BPF_MOD, R0, R1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -1 } },\n-\t},\n-\t/* BPF_ALU64 | BPF_MOD | BPF_K off=1 (SMOD64) */\n-\t{\n-\t\t\"ALU64_SMOD_K: -7 % 2 = -1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, -7),\n-\t\t\tBPF_ALU64_IMM_OFF(BPF_MOD, R0, 2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -1 } },\n-\t},\n-\t/* BPF_ALU | BPF_AND | BPF_X */\n-\t{\n-\t\t\"ALU_AND_X: 3 \u0026 2 = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2),\n-\t\t\tBPF_ALU32_REG(BPF_AND, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"ALU_AND_X: 0xffffffff \u0026 0xffffffff = 0xffffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xffffffff),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),\n-\t\t\tBPF_ALU32_REG(BPF_AND, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffffffff } },\n-\t},\n-\t{\n-\t\t\"ALU64_AND_X: 3 \u0026 2 = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2),\n-\t\t\tBPF_ALU64_REG(BPF_AND, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"ALU64_AND_X: 0xffffffff \u0026 0xffffffff = 0xffffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xffffffff),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),\n-\t\t\tBPF_ALU64_REG(BPF_AND, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffffffff } },\n-\t},\n-\t/* BPF_ALU | BPF_AND | BPF_K */\n-\t{\n-\t\t\"ALU_AND_K: 3 \u0026 2 = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU32_IMM(BPF_AND, R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"ALU_AND_K: 0xffffffff \u0026 0xffffffff = 0xffffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xffffffff),\n-\t\t\tBPF_ALU32_IMM(BPF_AND, R0, 0xffffffff),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffffffff } },\n-\t},\n-\t{\n-\t\t\"ALU_AND_K: Small immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0x01020304),\n-\t\t\tBPF_ALU32_IMM(BPF_AND, R0, 15),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 4 } }\n-\t},\n-\t{\n-\t\t\"ALU_AND_K: Large immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0xf1f2f3f4),\n-\t\t\tBPF_ALU32_IMM(BPF_AND, R0, 0xafbfcfdf),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xa1b2c3d4 } }\n-\t},\n-\t{\n-\t\t\"ALU_AND_K: Zero extension\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_LD_IMM64(R1, 0x0000000080a0c0e0LL),\n-\t\t\tBPF_ALU32_IMM(BPF_AND, R0, 0xf0f0f0f0),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R0, R1, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } }\n-\t},\n-\t{\n-\t\t\"ALU64_AND_K: 3 \u0026 2 = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU64_IMM(BPF_AND, R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"ALU64_AND_K: 0xffffffff \u0026 0xffffffff = 0xffffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xffffffff),\n-\t\t\tBPF_ALU64_IMM(BPF_AND, R0, 0xffffffff),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffffffff } },\n-\t},\n-\t{\n-\t\t\"ALU64_AND_K: 0x0000ffffffff0000 \u0026 0x0 = 0x0000000000000000\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0000ffffffff0000LL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0000000000000000LL),\n-\t\t\tBPF_ALU64_IMM(BPF_AND, R2, 0x0),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_AND_K: 0x0000ffffffff0000 \u0026 -1 = 0x0000ffffffff0000\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0000ffffffff0000LL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0000ffffffff0000LL),\n-\t\t\tBPF_ALU64_IMM(BPF_AND, R2, 0xffffffff),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_AND_K: 0xffffffffffffffff \u0026 -1 = 0xffffffffffffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0xffffffffffffffffLL),\n-\t\t\tBPF_LD_IMM64(R3, 0xffffffffffffffffLL),\n-\t\t\tBPF_ALU64_IMM(BPF_AND, R2, 0xffffffff),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_AND_K: Sign extension 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_LD_IMM64(R1, 0x00000000090b0d0fLL),\n-\t\t\tBPF_ALU64_IMM(BPF_AND, R0, 0x0f0f0f0f),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R0, R1, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } }\n-\t},\n-\t{\n-\t\t\"ALU64_AND_K: Sign extension 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_LD_IMM64(R1, 0x0123456780a0c0e0LL),\n-\t\t\tBPF_ALU64_IMM(BPF_AND, R0, 0xf0f0f0f0),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R0, R1, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } }\n-\t},\n-\t/* BPF_ALU | BPF_OR | BPF_X */\n-\t{\n-\t\t\"ALU_OR_X: 1 | 2 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2),\n-\t\t\tBPF_ALU32_REG(BPF_OR, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU_OR_X: 0x0 | 0xffffffff = 0xffffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),\n-\t\t\tBPF_ALU32_REG(BPF_OR, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffffffff } },\n-\t},\n-\t{\n-\t\t\"ALU64_OR_X: 1 | 2 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 2),\n-\t\t\tBPF_ALU64_REG(BPF_OR, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU64_OR_X: 0 | 0xffffffff = 0xffffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),\n-\t\t\tBPF_ALU64_REG(BPF_OR, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffffffff } },\n-\t},\n-\t/* BPF_ALU | BPF_OR | BPF_K */\n-\t{\n-\t\t\"ALU_OR_K: 1 | 2 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_OR, R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU_OR_K: 0 \u0026 0xffffffff = 0xffffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0),\n-\t\t\tBPF_ALU32_IMM(BPF_OR, R0, 0xffffffff),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffffffff } },\n-\t},\n-\t{\n-\t\t\"ALU_OR_K: Small immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0x01020304),\n-\t\t\tBPF_ALU32_IMM(BPF_OR, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x01020305 } }\n-\t},\n-\t{\n-\t\t\"ALU_OR_K: Large immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0x01020304),\n-\t\t\tBPF_ALU32_IMM(BPF_OR, R0, 0xa0b0c0d0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xa1b2c3d4 } }\n-\t},\n-\t{\n-\t\t\"ALU_OR_K: Zero extension\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_LD_IMM64(R1, 0x00000000f9fbfdffLL),\n-\t\t\tBPF_ALU32_IMM(BPF_OR, R0, 0xf0f0f0f0),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R0, R1, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } }\n-\t},\n-\t{\n-\t\t\"ALU64_OR_K: 1 | 2 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_OR, R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU64_OR_K: 0 \u0026 0xffffffff = 0xffffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0),\n-\t\t\tBPF_ALU64_IMM(BPF_OR, R0, 0xffffffff),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffffffff } },\n-\t},\n-\t{\n-\t\t\"ALU64_OR_K: 0x0000ffffffff0000 | 0x0 = 0x0000ffffffff0000\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0000ffffffff0000LL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0000ffffffff0000LL),\n-\t\t\tBPF_ALU64_IMM(BPF_OR, R2, 0x0),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_OR_K: 0x0000ffffffff0000 | -1 = 0xffffffffffffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0000ffffffff0000LL),\n-\t\t\tBPF_LD_IMM64(R3, 0xffffffffffffffffLL),\n-\t\t\tBPF_ALU64_IMM(BPF_OR, R2, 0xffffffff),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_OR_K: 0x000000000000000 | -1 = 0xffffffffffffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0000000000000000LL),\n-\t\t\tBPF_LD_IMM64(R3, 0xffffffffffffffffLL),\n-\t\t\tBPF_ALU64_IMM(BPF_OR, R2, 0xffffffff),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_OR_K: Sign extension 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_LD_IMM64(R1, 0x012345678fafcfefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_OR, R0, 0x0f0f0f0f),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R0, R1, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } }\n-\t},\n-\t{\n-\t\t\"ALU64_OR_K: Sign extension 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_LD_IMM64(R1, 0xfffffffff9fbfdffLL),\n-\t\t\tBPF_ALU64_IMM(BPF_OR, R0, 0xf0f0f0f0),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R0, R1, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } }\n-\t},\n-\t/* BPF_ALU | BPF_XOR | BPF_X */\n-\t{\n-\t\t\"ALU_XOR_X: 5 ^ 6 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 5),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 6),\n-\t\t\tBPF_ALU32_REG(BPF_XOR, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU_XOR_X: 0x1 ^ 0xffffffff = 0xfffffffe\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),\n-\t\t\tBPF_ALU32_REG(BPF_XOR, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xfffffffe } },\n-\t},\n-\t{\n-\t\t\"ALU64_XOR_X: 5 ^ 6 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 5),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 6),\n-\t\t\tBPF_ALU64_REG(BPF_XOR, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU64_XOR_X: 1 ^ 0xffffffff = 0xfffffffe\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),\n-\t\t\tBPF_ALU64_REG(BPF_XOR, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xfffffffe } },\n-\t},\n-\t/* BPF_ALU | BPF_XOR | BPF_K */\n-\t{\n-\t\t\"ALU_XOR_K: 5 ^ 6 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 5),\n-\t\t\tBPF_ALU32_IMM(BPF_XOR, R0, 6),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU_XOR_K: 1 ^ 0xffffffff = 0xfffffffe\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_XOR, R0, 0xffffffff),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xfffffffe } },\n-\t},\n-\t{\n-\t\t\"ALU_XOR_K: Small immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0x01020304),\n-\t\t\tBPF_ALU32_IMM(BPF_XOR, R0, 15),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x0102030b } }\n-\t},\n-\t{\n-\t\t\"ALU_XOR_K: Large immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0xf1f2f3f4),\n-\t\t\tBPF_ALU32_IMM(BPF_XOR, R0, 0xafbfcfdf),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x5e4d3c2b } }\n-\t},\n-\t{\n-\t\t\"ALU_XOR_K: Zero extension\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_LD_IMM64(R1, 0x00000000795b3d1fLL),\n-\t\t\tBPF_ALU32_IMM(BPF_XOR, R0, 0xf0f0f0f0),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R0, R1, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } }\n-\t},\n-\t{\n-\t\t\"ALU64_XOR_K: 5 ^ 6 = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 5),\n-\t\t\tBPF_ALU64_IMM(BPF_XOR, R0, 6),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU64_XOR_K: 1 ^ 0xffffffff = 0xfffffffe\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_XOR, R0, 0xffffffff),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xfffffffe } },\n-\t},\n-\t{\n-\t\t\"ALU64_XOR_K: 0x0000ffffffff0000 ^ 0x0 = 0x0000ffffffff0000\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0000ffffffff0000LL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0000ffffffff0000LL),\n-\t\t\tBPF_ALU64_IMM(BPF_XOR, R2, 0x0),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_XOR_K: 0x0000ffffffff0000 ^ -1 = 0xffff00000000ffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0000ffffffff0000LL),\n-\t\t\tBPF_LD_IMM64(R3, 0xffff00000000ffffLL),\n-\t\t\tBPF_ALU64_IMM(BPF_XOR, R2, 0xffffffff),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_XOR_K: 0x000000000000000 ^ -1 = 0xffffffffffffffff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x0000000000000000LL),\n-\t\t\tBPF_LD_IMM64(R3, 0xffffffffffffffffLL),\n-\t\t\tBPF_ALU64_IMM(BPF_XOR, R2, 0xffffffff),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_XOR_K: Sign extension 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_LD_IMM64(R1, 0x0123456786a4c2e0LL),\n-\t\t\tBPF_ALU64_IMM(BPF_XOR, R0, 0x0f0f0f0f),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R0, R1, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } }\n-\t},\n-\t{\n-\t\t\"ALU64_XOR_K: Sign extension 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_LD_IMM64(R1, 0xfedcba98795b3d1fLL),\n-\t\t\tBPF_ALU64_IMM(BPF_XOR, R0, 0xf0f0f0f0),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R0, R1, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } }\n-\t},\n-\t/* BPF_ALU | BPF_LSH | BPF_X */\n-\t{\n-\t\t\"ALU_LSH_X: 1 \u003c\u003c 1 = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 1),\n-\t\t\tBPF_ALU32_REG(BPF_LSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"ALU_LSH_X: 1 \u003c\u003c 31 = 0x80000000\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 31),\n-\t\t\tBPF_ALU32_REG(BPF_LSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x80000000 } },\n-\t},\n-\t{\n-\t\t\"ALU_LSH_X: 0x12345678 \u003c\u003c 12 = 0x45678000\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0x12345678),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 12),\n-\t\t\tBPF_ALU32_REG(BPF_LSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x45678000 } }\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_X: 1 \u003c\u003c 1 = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 1),\n-\t\t\tBPF_ALU64_REG(BPF_LSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_X: 1 \u003c\u003c 31 = 0x80000000\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 31),\n-\t\t\tBPF_ALU64_REG(BPF_LSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x80000000 } },\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_X: Shift \u003c 32, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 12),\n-\t\t\tBPF_ALU64_REG(BPF_LSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xbcdef000 } }\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_X: Shift \u003c 32, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 12),\n-\t\t\tBPF_ALU64_REG(BPF_LSH, R0, R1),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x3456789a } }\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_X: Shift \u003e 32, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 36),\n-\t\t\tBPF_ALU64_REG(BPF_LSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } }\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_X: Shift \u003e 32, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 36),\n-\t\t\tBPF_ALU64_REG(BPF_LSH, R0, R1),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x9abcdef0 } }\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_X: Shift == 32, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 32),\n-\t\t\tBPF_ALU64_REG(BPF_LSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } }\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_X: Shift == 32, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 32),\n-\t\t\tBPF_ALU64_REG(BPF_LSH, R0, R1),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x89abcdef } }\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_X: Zero shift, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0),\n-\t\t\tBPF_ALU64_REG(BPF_LSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x89abcdef } }\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_X: Zero shift, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0),\n-\t\t\tBPF_ALU64_REG(BPF_LSH, R0, R1),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x01234567 } }\n-\t},\n-\t/* BPF_ALU | BPF_LSH | BPF_K */\n-\t{\n-\t\t\"ALU_LSH_K: 1 \u003c\u003c 1 = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_LSH, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"ALU_LSH_K: 1 \u003c\u003c 31 = 0x80000000\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_LSH, R0, 31),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x80000000 } },\n-\t},\n-\t{\n-\t\t\"ALU_LSH_K: 0x12345678 \u003c\u003c 12 = 0x45678000\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0x12345678),\n-\t\t\tBPF_ALU32_IMM(BPF_LSH, R0, 12),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x45678000 } }\n-\t},\n-\t{\n-\t\t\"ALU_LSH_K: 0x12345678 \u003c\u003c 0 = 0x12345678\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0x12345678),\n-\t\t\tBPF_ALU32_IMM(BPF_LSH, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x12345678 } }\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_K: 1 \u003c\u003c 1 = 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_LSH, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_K: 1 \u003c\u003c 31 = 0x80000000\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_LSH, R0, 31),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x80000000 } },\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_K: Shift \u003c 32, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_LSH, R0, 12),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xbcdef000 } }\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_K: Shift \u003c 32, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_LSH, R0, 12),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x3456789a } }\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_K: Shift \u003e 32, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_LSH, R0, 36),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } }\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_K: Shift \u003e 32, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_LSH, R0, 36),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x9abcdef0 } }\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_K: Shift == 32, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_LSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } }\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_K: Shift == 32, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_LSH, R0, 32),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x89abcdef } }\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_K: Zero shift\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_LSH, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x89abcdef } }\n-\t},\n-\t/* BPF_ALU | BPF_RSH | BPF_X */\n-\t{\n-\t\t\"ALU_RSH_X: 2 \u003e\u003e 1 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 1),\n-\t\t\tBPF_ALU32_REG(BPF_RSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU_RSH_X: 0x80000000 \u003e\u003e 31 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x80000000),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 31),\n-\t\t\tBPF_ALU32_REG(BPF_RSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU_RSH_X: 0x12345678 \u003e\u003e 20 = 0x123\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0x12345678),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 20),\n-\t\t\tBPF_ALU32_REG(BPF_RSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x123 } }\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_X: 2 \u003e\u003e 1 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 1),\n-\t\t\tBPF_ALU64_REG(BPF_RSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_X: 0x80000000 \u003e\u003e 31 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x80000000),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 31),\n-\t\t\tBPF_ALU64_REG(BPF_RSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_X: Shift \u003c 32, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 12),\n-\t\t\tBPF_ALU64_REG(BPF_RSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x56789abc } }\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_X: Shift \u003c 32, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 12),\n-\t\t\tBPF_ALU64_REG(BPF_RSH, R0, R1),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x00081234 } }\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_X: Shift \u003e 32, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 36),\n-\t\t\tBPF_ALU64_REG(BPF_RSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x08123456 } }\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_X: Shift \u003e 32, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 36),\n-\t\t\tBPF_ALU64_REG(BPF_RSH, R0, R1),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } }\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_X: Shift == 32, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 32),\n-\t\t\tBPF_ALU64_REG(BPF_RSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x81234567 } }\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_X: Shift == 32, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 32),\n-\t\t\tBPF_ALU64_REG(BPF_RSH, R0, R1),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } }\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_X: Zero shift, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0),\n-\t\t\tBPF_ALU64_REG(BPF_RSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x89abcdef } }\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_X: Zero shift, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0),\n-\t\t\tBPF_ALU64_REG(BPF_RSH, R0, R1),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x81234567 } }\n-\t},\n-\t/* BPF_ALU | BPF_RSH | BPF_K */\n-\t{\n-\t\t\"ALU_RSH_K: 2 \u003e\u003e 1 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_RSH, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU_RSH_K: 0x80000000 \u003e\u003e 31 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x80000000),\n-\t\t\tBPF_ALU32_IMM(BPF_RSH, R0, 31),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU_RSH_K: 0x12345678 \u003e\u003e 20 = 0x123\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0x12345678),\n-\t\t\tBPF_ALU32_IMM(BPF_RSH, R0, 20),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x123 } }\n-\t},\n-\t{\n-\t\t\"ALU_RSH_K: 0x12345678 \u003e\u003e 0 = 0x12345678\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0x12345678),\n-\t\t\tBPF_ALU32_IMM(BPF_RSH, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x12345678 } }\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_K: 2 \u003e\u003e 1 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 2),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_K: 0x80000000 \u003e\u003e 31 = 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x80000000),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 31),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_K: Shift \u003c 32, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 12),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x56789abc } }\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_K: Shift \u003c 32, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 12),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x00081234 } }\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_K: Shift \u003e 32, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 36),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x08123456 } }\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_K: Shift \u003e 32, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 36),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } }\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_K: Shift == 32, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x81234567 } }\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_K: Shift == 32, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } }\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_K: Zero shift\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x89abcdef } }\n-\t},\n-\t/* BPF_ALU | BPF_ARSH | BPF_X */\n-\t{\n-\t\t\"ALU32_ARSH_X: -1234 \u003e\u003e 7 = -10\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -1234),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 7),\n-\t\t\tBPF_ALU32_REG(BPF_ARSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -10 } }\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_X: 0xff00ff0000000000 \u003e\u003e 40 = 0xffffffffffff00ff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xff00ff0000000000LL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 40),\n-\t\t\tBPF_ALU64_REG(BPF_ARSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffff00ff } },\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_X: Shift \u003c 32, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 12),\n-\t\t\tBPF_ALU64_REG(BPF_ARSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x56789abc } }\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_X: Shift \u003c 32, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 12),\n-\t\t\tBPF_ALU64_REG(BPF_ARSH, R0, R1),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xfff81234 } }\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_X: Shift \u003e 32, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 36),\n-\t\t\tBPF_ALU64_REG(BPF_ARSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xf8123456 } }\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_X: Shift \u003e 32, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 36),\n-\t\t\tBPF_ALU64_REG(BPF_ARSH, R0, R1),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -1 } }\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_X: Shift == 32, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 32),\n-\t\t\tBPF_ALU64_REG(BPF_ARSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x81234567 } }\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_X: Shift == 32, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 32),\n-\t\t\tBPF_ALU64_REG(BPF_ARSH, R0, R1),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -1 } }\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_X: Zero shift, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0),\n-\t\t\tBPF_ALU64_REG(BPF_ARSH, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x89abcdef } }\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_X: Zero shift, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0),\n-\t\t\tBPF_ALU64_REG(BPF_ARSH, R0, R1),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x81234567 } }\n-\t},\n-\t/* BPF_ALU | BPF_ARSH | BPF_K */\n-\t{\n-\t\t\"ALU32_ARSH_K: -1234 \u003e\u003e 7 = -10\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -1234),\n-\t\t\tBPF_ALU32_IMM(BPF_ARSH, R0, 7),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -10 } }\n-\t},\n-\t{\n-\t\t\"ALU32_ARSH_K: -1234 \u003e\u003e 0 = -1234\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -1234),\n-\t\t\tBPF_ALU32_IMM(BPF_ARSH, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -1234 } }\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_K: 0xff00ff0000000000 \u003e\u003e 40 = 0xffffffffffff00ff\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xff00ff0000000000LL),\n-\t\t\tBPF_ALU64_IMM(BPF_ARSH, R0, 40),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffff00ff } },\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_K: Shift \u003c 32, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 12),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x56789abc } }\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_K: Shift \u003c 32, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_ARSH, R0, 12),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xfff81234 } }\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_K: Shift \u003e 32, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_ARSH, R0, 36),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xf8123456 } }\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_K: Shift \u003e 32, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xf123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_ARSH, R0, 36),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -1 } }\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_K: Shift == 32, low word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_ARSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x81234567 } }\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_K: Shift == 32, high word\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_ARSH, R0, 32),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -1 } }\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_K: Zero shift\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x8123456789abcdefLL),\n-\t\t\tBPF_ALU64_IMM(BPF_ARSH, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x89abcdef } }\n-\t},\n-\t/* BPF_ALU | BPF_NEG */\n-\t{\n-\t\t\"ALU_NEG: -(3) = -3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 3),\n-\t\t\tBPF_ALU32_IMM(BPF_NEG, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -3 } },\n-\t},\n-\t{\n-\t\t\"ALU_NEG: -(-3) = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -3),\n-\t\t\tBPF_ALU32_IMM(BPF_NEG, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t{\n-\t\t\"ALU64_NEG: -(3) = -3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 3),\n-\t\t\tBPF_ALU64_IMM(BPF_NEG, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -3 } },\n-\t},\n-\t{\n-\t\t\"ALU64_NEG: -(-3) = 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, -3),\n-\t\t\tBPF_ALU64_IMM(BPF_NEG, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 3 } },\n-\t},\n-\t/* BPF_ALU | BPF_END | BPF_FROM_BE */\n-\t{\n-\t\t\"ALU_END_FROM_BE 16: 0x0123456789abcdef -\u003e 0xcdef\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ENDIAN(BPF_FROM_BE, R0, 16),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0,  cpu_to_be16(0xcdef) } },\n-\t},\n-\t{\n-\t\t\"ALU_END_FROM_BE 32: 0x0123456789abcdef -\u003e 0x89abcdef\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ENDIAN(BPF_FROM_BE, R0, 32),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R1, R0),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R1, 32),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R0, R1), /* R1 = 0 */\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, cpu_to_be32(0x89abcdef) } },\n-\t},\n-\t{\n-\t\t\"ALU_END_FROM_BE 64: 0x0123456789abcdef -\u003e 0x89abcdef\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ENDIAN(BPF_FROM_BE, R0, 64),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, (u32) cpu_to_be64(0x0123456789abcdefLL) } },\n-\t},\n-\t{\n-\t\t\"ALU_END_FROM_BE 64: 0x0123456789abcdef \u003e\u003e 32 -\u003e 0x01234567\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ENDIAN(BPF_FROM_BE, R0, 64),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, (u32) (cpu_to_be64(0x0123456789abcdefLL) \u003e\u003e 32) } },\n-\t},\n-\t/* BPF_ALU | BPF_END | BPF_FROM_BE, reversed */\n-\t{\n-\t\t\"ALU_END_FROM_BE 16: 0xfedcba9876543210 -\u003e 0x3210\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xfedcba9876543210ULL),\n-\t\t\tBPF_ENDIAN(BPF_FROM_BE, R0, 16),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0,  cpu_to_be16(0x3210) } },\n-\t},\n-\t{\n-\t\t\"ALU_END_FROM_BE 32: 0xfedcba9876543210 -\u003e 0x76543210\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xfedcba9876543210ULL),\n-\t\t\tBPF_ENDIAN(BPF_FROM_BE, R0, 32),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R1, R0),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R1, 32),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R0, R1), /* R1 = 0 */\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, cpu_to_be32(0x76543210) } },\n-\t},\n-\t{\n-\t\t\"ALU_END_FROM_BE 64: 0xfedcba9876543210 -\u003e 0x76543210\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xfedcba9876543210ULL),\n-\t\t\tBPF_ENDIAN(BPF_FROM_BE, R0, 64),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, (u32) cpu_to_be64(0xfedcba9876543210ULL) } },\n-\t},\n-\t{\n-\t\t\"ALU_END_FROM_BE 64: 0xfedcba9876543210 \u003e\u003e 32 -\u003e 0xfedcba98\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xfedcba9876543210ULL),\n-\t\t\tBPF_ENDIAN(BPF_FROM_BE, R0, 64),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, (u32) (cpu_to_be64(0xfedcba9876543210ULL) \u003e\u003e 32) } },\n-\t},\n-\t/* BPF_ALU | BPF_END | BPF_FROM_LE */\n-\t{\n-\t\t\"ALU_END_FROM_LE 16: 0x0123456789abcdef -\u003e 0xefcd\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ENDIAN(BPF_FROM_LE, R0, 16),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, cpu_to_le16(0xcdef) } },\n-\t},\n-\t{\n-\t\t\"ALU_END_FROM_LE 32: 0x0123456789abcdef -\u003e 0xefcdab89\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ENDIAN(BPF_FROM_LE, R0, 32),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R1, R0),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R1, 32),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R0, R1), /* R1 = 0 */\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, cpu_to_le32(0x89abcdef) } },\n-\t},\n-\t{\n-\t\t\"ALU_END_FROM_LE 64: 0x0123456789abcdef -\u003e 0x67452301\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ENDIAN(BPF_FROM_LE, R0, 64),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, (u32) cpu_to_le64(0x0123456789abcdefLL) } },\n-\t},\n-\t{\n-\t\t\"ALU_END_FROM_LE 64: 0x0123456789abcdef \u003e\u003e 32 -\u003e 0xefcdab89\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_ENDIAN(BPF_FROM_LE, R0, 64),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, (u32) (cpu_to_le64(0x0123456789abcdefLL) \u003e\u003e 32) } },\n-\t},\n-\t/* BPF_ALU | BPF_END | BPF_FROM_LE, reversed */\n-\t{\n-\t\t\"ALU_END_FROM_LE 16: 0xfedcba9876543210 -\u003e 0x1032\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xfedcba9876543210ULL),\n-\t\t\tBPF_ENDIAN(BPF_FROM_LE, R0, 16),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0,  cpu_to_le16(0x3210) } },\n-\t},\n-\t{\n-\t\t\"ALU_END_FROM_LE 32: 0xfedcba9876543210 -\u003e 0x10325476\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xfedcba9876543210ULL),\n-\t\t\tBPF_ENDIAN(BPF_FROM_LE, R0, 32),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R1, R0),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R1, 32),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R0, R1), /* R1 = 0 */\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, cpu_to_le32(0x76543210) } },\n-\t},\n-\t{\n-\t\t\"ALU_END_FROM_LE 64: 0xfedcba9876543210 -\u003e 0x10325476\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xfedcba9876543210ULL),\n-\t\t\tBPF_ENDIAN(BPF_FROM_LE, R0, 64),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, (u32) cpu_to_le64(0xfedcba9876543210ULL) } },\n-\t},\n-\t{\n-\t\t\"ALU_END_FROM_LE 64: 0xfedcba9876543210 \u003e\u003e 32 -\u003e 0x98badcfe\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xfedcba9876543210ULL),\n-\t\t\tBPF_ENDIAN(BPF_FROM_LE, R0, 64),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, (u32) (cpu_to_le64(0xfedcba9876543210ULL) \u003e\u003e 32) } },\n-\t},\n-\t/* BSWAP */\n-\t{\n-\t\t\"BSWAP 16: 0x0123456789abcdef -\u003e 0xefcd\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_BSWAP(R0, 16),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xefcd } },\n-\t},\n-\t{\n-\t\t\"BSWAP 32: 0x0123456789abcdef -\u003e 0xefcdab89\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_BSWAP(R0, 32),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R1, R0),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R1, 32),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R0, R1), /* R1 = 0 */\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xefcdab89 } },\n-\t},\n-\t{\n-\t\t\"BSWAP 64: 0x0123456789abcdef -\u003e 0x67452301\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_BSWAP(R0, 64),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x67452301 } },\n-\t},\n-\t{\n-\t\t\"BSWAP 64: 0x0123456789abcdef \u003e\u003e 32 -\u003e 0xefcdab89\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789abcdefLL),\n-\t\t\tBPF_BSWAP(R0, 64),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xefcdab89 } },\n-\t},\n-\t/* BSWAP, reversed */\n-\t{\n-\t\t\"BSWAP 16: 0xfedcba9876543210 -\u003e 0x1032\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xfedcba9876543210ULL),\n-\t\t\tBPF_BSWAP(R0, 16),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1032 } },\n-\t},\n-\t{\n-\t\t\"BSWAP 32: 0xfedcba9876543210 -\u003e 0x10325476\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xfedcba9876543210ULL),\n-\t\t\tBPF_BSWAP(R0, 32),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R1, R0),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R1, 32),\n-\t\t\tBPF_ALU32_REG(BPF_ADD, R0, R1), /* R1 = 0 */\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x10325476 } },\n-\t},\n-\t{\n-\t\t\"BSWAP 64: 0xfedcba9876543210 -\u003e 0x98badcfe\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xfedcba9876543210ULL),\n-\t\t\tBPF_BSWAP(R0, 64),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x98badcfe } },\n-\t},\n-\t{\n-\t\t\"BSWAP 64: 0xfedcba9876543210 \u003e\u003e 32 -\u003e 0x10325476\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0xfedcba9876543210ULL),\n-\t\t\tBPF_BSWAP(R0, 64),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R0, 32),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x10325476 } },\n-\t},\n-\t/* BPF_LDX_MEM B/H/W/DW */\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_B, base\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x0102030405060708ULL),\n-\t\t\tBPF_LD_IMM64(R2, 0x0000000000000008ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-#ifdef __BIG_ENDIAN\n-\t\t\tBPF_LDX_MEM(BPF_B, R0, R10, -1),\n-#else\n-\t\t\tBPF_LDX_MEM(BPF_B, R0, R10, -8),\n-#endif\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R2, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_B, MSB set\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x8182838485868788ULL),\n-\t\t\tBPF_LD_IMM64(R2, 0x0000000000000088ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-#ifdef __BIG_ENDIAN\n-\t\t\tBPF_LDX_MEM(BPF_B, R0, R10, -1),\n-#else\n-\t\t\tBPF_LDX_MEM(BPF_B, R0, R10, -8),\n-#endif\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R2, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_B, negative offset\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x8182838485868788ULL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0000000000000088ULL),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R1, 512),\n-\t\t\tBPF_STX_MEM(BPF_B, R1, R2, -256),\n-\t\t\tBPF_LDX_MEM(BPF_B, R0, R1, -256),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R3, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_LARGE_MEM,\n-\t\t{ },\n-\t\t{ { 512, 0 } },\n-\t\t.stack_depth = 0,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_B, small positive offset\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x8182838485868788ULL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0000000000000088ULL),\n-\t\t\tBPF_STX_MEM(BPF_B, R1, R2, 256),\n-\t\t\tBPF_LDX_MEM(BPF_B, R0, R1, 256),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R3, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_LARGE_MEM,\n-\t\t{ },\n-\t\t{ { 512, 0 } },\n-\t\t.stack_depth = 0,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_B, large positive offset\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x8182838485868788ULL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0000000000000088ULL),\n-\t\t\tBPF_STX_MEM(BPF_B, R1, R2, 4096),\n-\t\t\tBPF_LDX_MEM(BPF_B, R0, R1, 4096),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R3, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_LARGE_MEM,\n-\t\t{ },\n-\t\t{ { 4096 + 16, 0 } },\n-\t\t.stack_depth = 0,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_H, base\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x0102030405060708ULL),\n-\t\t\tBPF_LD_IMM64(R2, 0x0000000000000708ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-#ifdef __BIG_ENDIAN\n-\t\t\tBPF_LDX_MEM(BPF_H, R0, R10, -2),\n-#else\n-\t\t\tBPF_LDX_MEM(BPF_H, R0, R10, -8),\n-#endif\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R2, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_H, MSB set\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x8182838485868788ULL),\n-\t\t\tBPF_LD_IMM64(R2, 0x0000000000008788ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-#ifdef __BIG_ENDIAN\n-\t\t\tBPF_LDX_MEM(BPF_H, R0, R10, -2),\n-#else\n-\t\t\tBPF_LDX_MEM(BPF_H, R0, R10, -8),\n-#endif\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R2, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_H, negative offset\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x8182838485868788ULL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0000000000008788ULL),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R1, 512),\n-\t\t\tBPF_STX_MEM(BPF_H, R1, R2, -256),\n-\t\t\tBPF_LDX_MEM(BPF_H, R0, R1, -256),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R3, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_LARGE_MEM,\n-\t\t{ },\n-\t\t{ { 512, 0 } },\n-\t\t.stack_depth = 0,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_H, small positive offset\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x8182838485868788ULL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0000000000008788ULL),\n-\t\t\tBPF_STX_MEM(BPF_H, R1, R2, 256),\n-\t\t\tBPF_LDX_MEM(BPF_H, R0, R1, 256),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R3, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_LARGE_MEM,\n-\t\t{ },\n-\t\t{ { 512, 0 } },\n-\t\t.stack_depth = 0,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_H, large positive offset\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x8182838485868788ULL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0000000000008788ULL),\n-\t\t\tBPF_STX_MEM(BPF_H, R1, R2, 8192),\n-\t\t\tBPF_LDX_MEM(BPF_H, R0, R1, 8192),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R3, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_LARGE_MEM,\n-\t\t{ },\n-\t\t{ { 8192 + 16, 0 } },\n-\t\t.stack_depth = 0,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_H, unaligned positive offset\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x8182838485868788ULL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0000000000008788ULL),\n-\t\t\tBPF_STX_MEM(BPF_H, R1, R2, 13),\n-\t\t\tBPF_LDX_MEM(BPF_H, R0, R1, 13),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R3, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_LARGE_MEM,\n-\t\t{ },\n-\t\t{ { 32, 0 } },\n-\t\t.stack_depth = 0,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_W, base\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x0102030405060708ULL),\n-\t\t\tBPF_LD_IMM64(R2, 0x0000000005060708ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-#ifdef __BIG_ENDIAN\n-\t\t\tBPF_LDX_MEM(BPF_W, R0, R10, -4),\n-#else\n-\t\t\tBPF_LDX_MEM(BPF_W, R0, R10, -8),\n-#endif\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R2, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_W, MSB set\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x8182838485868788ULL),\n-\t\t\tBPF_LD_IMM64(R2, 0x0000000085868788ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-#ifdef __BIG_ENDIAN\n-\t\t\tBPF_LDX_MEM(BPF_W, R0, R10, -4),\n-#else\n-\t\t\tBPF_LDX_MEM(BPF_W, R0, R10, -8),\n-#endif\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R2, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_W, negative offset\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x8182838485868788ULL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0000000085868788ULL),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R1, 512),\n-\t\t\tBPF_STX_MEM(BPF_W, R1, R2, -256),\n-\t\t\tBPF_LDX_MEM(BPF_W, R0, R1, -256),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R3, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_LARGE_MEM,\n-\t\t{ },\n-\t\t{ { 512, 0 } },\n-\t\t.stack_depth = 0,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_W, small positive offset\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x8182838485868788ULL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0000000085868788ULL),\n-\t\t\tBPF_STX_MEM(BPF_W, R1, R2, 256),\n-\t\t\tBPF_LDX_MEM(BPF_W, R0, R1, 256),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R3, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_LARGE_MEM,\n-\t\t{ },\n-\t\t{ { 512, 0 } },\n-\t\t.stack_depth = 0,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_W, large positive offset\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x8182838485868788ULL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0000000085868788ULL),\n-\t\t\tBPF_STX_MEM(BPF_W, R1, R2, 16384),\n-\t\t\tBPF_LDX_MEM(BPF_W, R0, R1, 16384),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R3, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_LARGE_MEM,\n-\t\t{ },\n-\t\t{ { 16384 + 16, 0 } },\n-\t\t.stack_depth = 0,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_W, unaligned positive offset\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x8182838485868788ULL),\n-\t\t\tBPF_LD_IMM64(R3, 0x0000000085868788ULL),\n-\t\t\tBPF_STX_MEM(BPF_W, R1, R2, 13),\n-\t\t\tBPF_LDX_MEM(BPF_W, R0, R1, 13),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R3, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_LARGE_MEM,\n-\t\t{ },\n-\t\t{ { 32, 0 } },\n-\t\t.stack_depth = 0,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_DW, base\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x0102030405060708ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, R10, -8),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R1, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_DW, MSB set\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x8182838485868788ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, R10, -8),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R1, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_DW, negative offset\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x8182838485868788ULL),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R1, 512),\n-\t\t\tBPF_STX_MEM(BPF_DW, R1, R2, -256),\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, R1, -256),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R2, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_LARGE_MEM,\n-\t\t{ },\n-\t\t{ { 512, 0 } },\n-\t\t.stack_depth = 0,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_DW, small positive offset\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x8182838485868788ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R1, R2, 256),\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, R1, 256),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R2, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_LARGE_MEM,\n-\t\t{ },\n-\t\t{ { 512, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_DW, large positive offset\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x8182838485868788ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R1, R2, 32760),\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, R1, 32760),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R2, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_LARGE_MEM,\n-\t\t{ },\n-\t\t{ { 32768, 0 } },\n-\t\t.stack_depth = 0,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEM | BPF_DW, unaligned positive offset\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0x8182838485868788ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R1, R2, 13),\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, R1, 13),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R2, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_LARGE_MEM,\n-\t\t{ },\n-\t\t{ { 32, 0 } },\n-\t\t.stack_depth = 0,\n-\t},\n-\t/* BPF_LDX_MEMSX B/H/W */\n-\t{\n-\t\t\"BPF_LDX_MEMSX | BPF_B\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0xdead0000000000f0ULL),\n-\t\t\tBPF_LD_IMM64(R2, 0xfffffffffffffff0ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-#ifdef __BIG_ENDIAN\n-\t\t\tBPF_LDX_MEMSX(BPF_B, R0, R10, -1),\n-#else\n-\t\t\tBPF_LDX_MEMSX(BPF_B, R0, R10, -8),\n-#endif\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R2, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEMSX | BPF_H\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0xdead00000000f123ULL),\n-\t\t\tBPF_LD_IMM64(R2, 0xfffffffffffff123ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-#ifdef __BIG_ENDIAN\n-\t\t\tBPF_LDX_MEMSX(BPF_H, R0, R10, -2),\n-#else\n-\t\t\tBPF_LDX_MEMSX(BPF_H, R0, R10, -8),\n-#endif\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R2, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"BPF_LDX_MEMSX | BPF_W\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x00000000deadbeefULL),\n-\t\t\tBPF_LD_IMM64(R2, 0xffffffffdeadbeefULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-#ifdef __BIG_ENDIAN\n-\t\t\tBPF_LDX_MEMSX(BPF_W, R0, R10, -4),\n-#else\n-\t\t\tBPF_LDX_MEMSX(BPF_W, R0, R10, -8),\n-#endif\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R2, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t/* BPF_STX_MEM B/H/W/DW */\n-\t{\n-\t\t\"BPF_STX_MEM | BPF_B\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x8090a0b0c0d0e0f0ULL),\n-\t\t\tBPF_LD_IMM64(R2, 0x0102030405060708ULL),\n-\t\t\tBPF_LD_IMM64(R3, 0x8090a0b0c0d0e008ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-#ifdef __BIG_ENDIAN\n-\t\t\tBPF_STX_MEM(BPF_B, R10, R2, -1),\n-#else\n-\t\t\tBPF_STX_MEM(BPF_B, R10, R2, -8),\n-#endif\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, R10, -8),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R3, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"BPF_STX_MEM | BPF_B, MSB set\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x8090a0b0c0d0e0f0ULL),\n-\t\t\tBPF_LD_IMM64(R2, 0x8182838485868788ULL),\n-\t\t\tBPF_LD_IMM64(R3, 0x8090a0b0c0d0e088ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-#ifdef __BIG_ENDIAN\n-\t\t\tBPF_STX_MEM(BPF_B, R10, R2, -1),\n-#else\n-\t\t\tBPF_STX_MEM(BPF_B, R10, R2, -8),\n-#endif\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, R10, -8),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R3, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"BPF_STX_MEM | BPF_H\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x8090a0b0c0d0e0f0ULL),\n-\t\t\tBPF_LD_IMM64(R2, 0x0102030405060708ULL),\n-\t\t\tBPF_LD_IMM64(R3, 0x8090a0b0c0d00708ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-#ifdef __BIG_ENDIAN\n-\t\t\tBPF_STX_MEM(BPF_H, R10, R2, -2),\n-#else\n-\t\t\tBPF_STX_MEM(BPF_H, R10, R2, -8),\n-#endif\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, R10, -8),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R3, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"BPF_STX_MEM | BPF_H, MSB set\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x8090a0b0c0d0e0f0ULL),\n-\t\t\tBPF_LD_IMM64(R2, 0x8182838485868788ULL),\n-\t\t\tBPF_LD_IMM64(R3, 0x8090a0b0c0d08788ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-#ifdef __BIG_ENDIAN\n-\t\t\tBPF_STX_MEM(BPF_H, R10, R2, -2),\n-#else\n-\t\t\tBPF_STX_MEM(BPF_H, R10, R2, -8),\n-#endif\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, R10, -8),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R3, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"BPF_STX_MEM | BPF_W\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x8090a0b0c0d0e0f0ULL),\n-\t\t\tBPF_LD_IMM64(R2, 0x0102030405060708ULL),\n-\t\t\tBPF_LD_IMM64(R3, 0x8090a0b005060708ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-#ifdef __BIG_ENDIAN\n-\t\t\tBPF_STX_MEM(BPF_W, R10, R2, -4),\n-#else\n-\t\t\tBPF_STX_MEM(BPF_W, R10, R2, -8),\n-#endif\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, R10, -8),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R3, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"BPF_STX_MEM | BPF_W, MSB set\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x8090a0b0c0d0e0f0ULL),\n-\t\t\tBPF_LD_IMM64(R2, 0x8182838485868788ULL),\n-\t\t\tBPF_LD_IMM64(R3, 0x8090a0b085868788ULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-#ifdef __BIG_ENDIAN\n-\t\t\tBPF_STX_MEM(BPF_W, R10, R2, -4),\n-#else\n-\t\t\tBPF_STX_MEM(BPF_W, R10, R2, -8),\n-#endif\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, R10, -8),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R3, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t/* BPF_ST(X) | BPF_MEM | BPF_B/H/W/DW */\n-\t{\n-\t\t\"ST_MEM_B: Store/Load byte: max negative\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_ST_MEM(BPF_B, R10, -40, 0xff),\n-\t\t\tBPF_LDX_MEM(BPF_B, R0, R10, -40),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xff } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"ST_MEM_B: Store/Load byte: max positive\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_ST_MEM(BPF_H, R10, -40, 0x7f),\n-\t\t\tBPF_LDX_MEM(BPF_H, R0, R10, -40),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x7f } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"STX_MEM_B: Store/Load byte: max negative\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 0xffLL),\n-\t\t\tBPF_STX_MEM(BPF_B, R10, R1, -40),\n-\t\t\tBPF_LDX_MEM(BPF_B, R0, R10, -40),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xff } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"ST_MEM_H: Store/Load half word: max negative\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_ST_MEM(BPF_H, R10, -40, 0xffff),\n-\t\t\tBPF_LDX_MEM(BPF_H, R0, R10, -40),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffff } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"ST_MEM_H: Store/Load half word: max positive\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_ST_MEM(BPF_H, R10, -40, 0x7fff),\n-\t\t\tBPF_LDX_MEM(BPF_H, R0, R10, -40),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x7fff } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"STX_MEM_H: Store/Load half word: max negative\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 0xffffLL),\n-\t\t\tBPF_STX_MEM(BPF_H, R10, R1, -40),\n-\t\t\tBPF_LDX_MEM(BPF_H, R0, R10, -40),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffff } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"ST_MEM_W: Store/Load word: max negative\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_ST_MEM(BPF_W, R10, -40, 0xffffffff),\n-\t\t\tBPF_LDX_MEM(BPF_W, R0, R10, -40),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffffffff } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"ST_MEM_W: Store/Load word: max positive\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_ST_MEM(BPF_W, R10, -40, 0x7fffffff),\n-\t\t\tBPF_LDX_MEM(BPF_W, R0, R10, -40),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x7fffffff } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"STX_MEM_W: Store/Load word: max negative\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 0xffffffffLL),\n-\t\t\tBPF_STX_MEM(BPF_W, R10, R1, -40),\n-\t\t\tBPF_LDX_MEM(BPF_W, R0, R10, -40),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffffffff } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"ST_MEM_DW: Store/Load double word: max negative\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_ST_MEM(BPF_DW, R10, -40, 0xffffffff),\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, R10, -40),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffffffff } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"ST_MEM_DW: Store/Load double word: max negative 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R2, 0xffff00000000ffffLL),\n-\t\t\tBPF_LD_IMM64(R3, 0xffffffffffffffffLL),\n-\t\t\tBPF_ST_MEM(BPF_DW, R10, -40, 0xffffffff),\n-\t\t\tBPF_LDX_MEM(BPF_DW, R2, R10, -40),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R2, R3, 2),\n-\t\t\tBPF_MOV32_IMM(R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_MOV32_IMM(R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x1 } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"ST_MEM_DW: Store/Load double word: max positive\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_ST_MEM(BPF_DW, R10, -40, 0x7fffffff),\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, R10, -40),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x7fffffff } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"STX_MEM_DW: Store/Load double word: max negative\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 0xffffffffffffffffLL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -40),\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, R10, -40),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffffffff } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"STX_MEM_DW: Store double word: first word in memory\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 0x0123456789abcdefLL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -40),\n-\t\t\tBPF_LDX_MEM(BPF_W, R0, R10, -40),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-#ifdef __BIG_ENDIAN\n-\t\t{ { 0, 0x01234567 } },\n-#else\n-\t\t{ { 0, 0x89abcdef } },\n-#endif\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"STX_MEM_DW: Store double word: second word in memory\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 0x0123456789abcdefLL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -40),\n-\t\t\tBPF_LDX_MEM(BPF_W, R0, R10, -36),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-#ifdef __BIG_ENDIAN\n-\t\t{ { 0, 0x89abcdef } },\n-#else\n-\t\t{ { 0, 0x01234567 } },\n-#endif\n-\t\t.stack_depth = 40,\n-\t},\n-\t/* BPF_STX | BPF_ATOMIC | BPF_W/DW */\n-\t{\n-\t\t\"STX_XADD_W: X + 1 + 1 + 1 + ...\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 4134 } },\n-\t\t.fill_helper = bpf_fill_stxw,\n-\t},\n-\t{\n-\t\t\"STX_XADD_DW: X + 1 + 1 + 1 + ...\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 4134 } },\n-\t\t.fill_helper = bpf_fill_stxdw,\n-\t},\n-\t/*\n-\t * Exhaustive tests of atomic operation variants.\n-\t * Individual tests are expanded from template macros for all\n-\t * combinations of ALU operation, word size and fetching.\n-\t */\n-#define BPF_ATOMIC_POISON(width) ((width) == BPF_W ? (0xbaadf00dULL \u003c\u003c 32) : 0)\n-\n-#define BPF_ATOMIC_OP_TEST1(width, op, logic, old, update, result)\t\\\n-{\t\t\t\t\t\t\t\t\t\\\n-\t\"BPF_ATOMIC | \" #width \", \" #op \": Test: \"\t\t\t\\\n-\t\t#old \" \" #logic \" \" #update \" = \" #result,\t\t\\\n-\t.u.insns_int = {\t\t\t\t\t\t\\\n-\t\tBPF_LD_IMM64(R5, (update) | BPF_ATOMIC_POISON(width)),\t\\\n-\t\tBPF_ST_MEM(width, R10, -40, old),\t\t\t\\\n-\t\tBPF_ATOMIC_OP(width, op, R10, R5, -40),\t\t\t\\\n-\t\tBPF_LDX_MEM(width, R0, R10, -40),\t\t\t\\\n-\t\tBPF_ALU64_REG(BPF_MOV, R1, R0),\t\t\t\t\\\n-\t\tBPF_ALU64_IMM(BPF_RSH, R1, 32),\t\t\t\t\\\n-\t\tBPF_ALU64_REG(BPF_OR, R0, R1),\t\t\t\t\\\n-\t\tBPF_EXIT_INSN(),\t\t\t\t\t\\\n-\t},\t\t\t\t\t\t\t\t\\\n-\tINTERNAL,\t\t\t\t\t\t\t\\\n-\t{ },\t\t\t\t\t\t\t\t\\\n-\t{ { 0, result } },\t\t\t\t\t\t\\\n-\t.stack_depth = 40,\t\t\t\t\t\t\\\n-}\n-#define BPF_ATOMIC_OP_TEST2(width, op, logic, old, update, result)\t\\\n-{\t\t\t\t\t\t\t\t\t\\\n-\t\"BPF_ATOMIC | \" #width \", \" #op \": Test side effects, r10: \"\t\\\n-\t\t#old \" \" #logic \" \" #update \" = \" #result,\t\t\\\n-\t.u.insns_int = {\t\t\t\t\t\t\\\n-\t\tBPF_ALU64_REG(BPF_MOV, R1, R10),\t\t\t\\\n-\t\tBPF_LD_IMM64(R0, (update) | BPF_ATOMIC_POISON(width)),\t\\\n-\t\tBPF_ST_MEM(BPF_W, R10, -40, old),\t\t\t\\\n-\t\tBPF_ATOMIC_OP(width, op, R10, R0, -40),\t\t\t\\\n-\t\tBPF_ALU64_REG(BPF_MOV, R0, R10),\t\t\t\\\n-\t\tBPF_ALU64_REG(BPF_SUB, R0, R1),\t\t\t\t\\\n-\t\tBPF_ALU64_REG(BPF_MOV, R1, R0),\t\t\t\t\\\n-\t\tBPF_ALU64_IMM(BPF_RSH, R1, 32),\t\t\t\t\\\n-\t\tBPF_ALU64_REG(BPF_OR, R0, R1),\t\t\t\t\\\n-\t\tBPF_EXIT_INSN(),\t\t\t\t\t\\\n-\t},\t\t\t\t\t\t\t\t\\\n-\tINTERNAL,\t\t\t\t\t\t\t\\\n-\t{ },\t\t\t\t\t\t\t\t\\\n-\t{ { 0, 0 } },\t\t\t\t\t\t\t\\\n-\t.stack_depth = 40,\t\t\t\t\t\t\\\n-}\n-#define BPF_ATOMIC_OP_TEST3(width, op, logic, old, update, result)\t\\\n-{\t\t\t\t\t\t\t\t\t\\\n-\t\"BPF_ATOMIC | \" #width \", \" #op \": Test side effects, r0: \"\t\\\n-\t\t#old \" \" #logic \" \" #update \" = \" #result,\t\t\\\n-\t.u.insns_int = {\t\t\t\t\t\t\\\n-\t\tBPF_ALU64_REG(BPF_MOV, R0, R10),\t\t\t\\\n-\t\tBPF_LD_IMM64(R1, (update) | BPF_ATOMIC_POISON(width)),\t\\\n-\t\tBPF_ST_MEM(width, R10, -40, old),\t\t\t\\\n-\t\tBPF_ATOMIC_OP(width, op, R10, R1, -40),\t\t\t\\\n-\t\tBPF_ALU64_REG(BPF_SUB, R0, R10),\t\t\t\\\n-\t\tBPF_ALU64_REG(BPF_MOV, R1, R0),\t\t\t\t\\\n-\t\tBPF_ALU64_IMM(BPF_RSH, R1, 32),\t\t\t\t\\\n-\t\tBPF_ALU64_REG(BPF_OR, R0, R1),\t\t\t\t\\\n-\t\tBPF_EXIT_INSN(),\t\t\t\t\t\\\n-\t},\t\t\t\t\t\t\t\t\\\n-\tINTERNAL,                                                       \\\n-\t{ },                                                            \\\n-\t{ { 0, 0 } },                                                   \\\n-\t.stack_depth = 40,                                              \\\n-}\n-#define BPF_ATOMIC_OP_TEST4(width, op, logic, old, update, result)\t\\\n-{\t\t\t\t\t\t\t\t\t\\\n-\t\"BPF_ATOMIC | \" #width \", \" #op \": Test fetch: \"\t\t\\\n-\t\t#old \" \" #logic \" \" #update \" = \" #result,\t\t\\\n-\t.u.insns_int = {\t\t\t\t\t\t\\\n-\t\tBPF_LD_IMM64(R3, (update) | BPF_ATOMIC_POISON(width)),\t\\\n-\t\tBPF_ST_MEM(width, R10, -40, old),\t\t\t\\\n-\t\tBPF_ATOMIC_OP(width, op, R10, R3, -40),\t\t\t\\\n-\t\tBPF_ALU32_REG(BPF_MOV, R0, R3),                         \\\n-\t\tBPF_EXIT_INSN(),\t\t\t\t\t\\\n-\t},\t\t\t\t\t\t\t\t\\\n-\tINTERNAL,                                                       \\\n-\t{ },                                                            \\\n-\t{ { 0, (op) \u0026 BPF_FETCH ? old : update } },\t\t\t\\\n-\t.stack_depth = 40,                                              \\\n-}\n-\t/* BPF_ATOMIC | BPF_W: BPF_ADD */\n-\tBPF_ATOMIC_OP_TEST1(BPF_W, BPF_ADD, +, 0x12, 0xab, 0xbd),\n-\tBPF_ATOMIC_OP_TEST2(BPF_W, BPF_ADD, +, 0x12, 0xab, 0xbd),\n-\tBPF_ATOMIC_OP_TEST3(BPF_W, BPF_ADD, +, 0x12, 0xab, 0xbd),\n-\tBPF_ATOMIC_OP_TEST4(BPF_W, BPF_ADD, +, 0x12, 0xab, 0xbd),\n-\t/* BPF_ATOMIC | BPF_W: BPF_ADD | BPF_FETCH */\n-\tBPF_ATOMIC_OP_TEST1(BPF_W, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),\n-\tBPF_ATOMIC_OP_TEST2(BPF_W, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),\n-\tBPF_ATOMIC_OP_TEST3(BPF_W, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),\n-\tBPF_ATOMIC_OP_TEST4(BPF_W, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),\n-\t/* BPF_ATOMIC | BPF_DW: BPF_ADD */\n-\tBPF_ATOMIC_OP_TEST1(BPF_DW, BPF_ADD, +, 0x12, 0xab, 0xbd),\n-\tBPF_ATOMIC_OP_TEST2(BPF_DW, BPF_ADD, +, 0x12, 0xab, 0xbd),\n-\tBPF_ATOMIC_OP_TEST3(BPF_DW, BPF_ADD, +, 0x12, 0xab, 0xbd),\n-\tBPF_ATOMIC_OP_TEST4(BPF_DW, BPF_ADD, +, 0x12, 0xab, 0xbd),\n-\t/* BPF_ATOMIC | BPF_DW: BPF_ADD | BPF_FETCH */\n-\tBPF_ATOMIC_OP_TEST1(BPF_DW, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),\n-\tBPF_ATOMIC_OP_TEST2(BPF_DW, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),\n-\tBPF_ATOMIC_OP_TEST3(BPF_DW, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),\n-\tBPF_ATOMIC_OP_TEST4(BPF_DW, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),\n-\t/* BPF_ATOMIC | BPF_W: BPF_AND */\n-\tBPF_ATOMIC_OP_TEST1(BPF_W, BPF_AND, \u0026, 0x12, 0xab, 0x02),\n-\tBPF_ATOMIC_OP_TEST2(BPF_W, BPF_AND, \u0026, 0x12, 0xab, 0x02),\n-\tBPF_ATOMIC_OP_TEST3(BPF_W, BPF_AND, \u0026, 0x12, 0xab, 0x02),\n-\tBPF_ATOMIC_OP_TEST4(BPF_W, BPF_AND, \u0026, 0x12, 0xab, 0x02),\n-\t/* BPF_ATOMIC | BPF_W: BPF_AND | BPF_FETCH */\n-\tBPF_ATOMIC_OP_TEST1(BPF_W, BPF_AND | BPF_FETCH, \u0026, 0x12, 0xab, 0x02),\n-\tBPF_ATOMIC_OP_TEST2(BPF_W, BPF_AND | BPF_FETCH, \u0026, 0x12, 0xab, 0x02),\n-\tBPF_ATOMIC_OP_TEST3(BPF_W, BPF_AND | BPF_FETCH, \u0026, 0x12, 0xab, 0x02),\n-\tBPF_ATOMIC_OP_TEST4(BPF_W, BPF_AND | BPF_FETCH, \u0026, 0x12, 0xab, 0x02),\n-\t/* BPF_ATOMIC | BPF_DW: BPF_AND */\n-\tBPF_ATOMIC_OP_TEST1(BPF_DW, BPF_AND, \u0026, 0x12, 0xab, 0x02),\n-\tBPF_ATOMIC_OP_TEST2(BPF_DW, BPF_AND, \u0026, 0x12, 0xab, 0x02),\n-\tBPF_ATOMIC_OP_TEST3(BPF_DW, BPF_AND, \u0026, 0x12, 0xab, 0x02),\n-\tBPF_ATOMIC_OP_TEST4(BPF_DW, BPF_AND, \u0026, 0x12, 0xab, 0x02),\n-\t/* BPF_ATOMIC | BPF_DW: BPF_AND | BPF_FETCH */\n-\tBPF_ATOMIC_OP_TEST1(BPF_DW, BPF_AND | BPF_FETCH, \u0026, 0x12, 0xab, 0x02),\n-\tBPF_ATOMIC_OP_TEST2(BPF_DW, BPF_AND | BPF_FETCH, \u0026, 0x12, 0xab, 0x02),\n-\tBPF_ATOMIC_OP_TEST3(BPF_DW, BPF_AND | BPF_FETCH, \u0026, 0x12, 0xab, 0x02),\n-\tBPF_ATOMIC_OP_TEST4(BPF_DW, BPF_AND | BPF_FETCH, \u0026, 0x12, 0xab, 0x02),\n-\t/* BPF_ATOMIC | BPF_W: BPF_OR */\n-\tBPF_ATOMIC_OP_TEST1(BPF_W, BPF_OR, |, 0x12, 0xab, 0xbb),\n-\tBPF_ATOMIC_OP_TEST2(BPF_W, BPF_OR, |, 0x12, 0xab, 0xbb),\n-\tBPF_ATOMIC_OP_TEST3(BPF_W, BPF_OR, |, 0x12, 0xab, 0xbb),\n-\tBPF_ATOMIC_OP_TEST4(BPF_W, BPF_OR, |, 0x12, 0xab, 0xbb),\n-\t/* BPF_ATOMIC | BPF_W: BPF_OR | BPF_FETCH */\n-\tBPF_ATOMIC_OP_TEST1(BPF_W, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),\n-\tBPF_ATOMIC_OP_TEST2(BPF_W, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),\n-\tBPF_ATOMIC_OP_TEST3(BPF_W, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),\n-\tBPF_ATOMIC_OP_TEST4(BPF_W, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),\n-\t/* BPF_ATOMIC | BPF_DW: BPF_OR */\n-\tBPF_ATOMIC_OP_TEST1(BPF_DW, BPF_OR, |, 0x12, 0xab, 0xbb),\n-\tBPF_ATOMIC_OP_TEST2(BPF_DW, BPF_OR, |, 0x12, 0xab, 0xbb),\n-\tBPF_ATOMIC_OP_TEST3(BPF_DW, BPF_OR, |, 0x12, 0xab, 0xbb),\n-\tBPF_ATOMIC_OP_TEST4(BPF_DW, BPF_OR, |, 0x12, 0xab, 0xbb),\n-\t/* BPF_ATOMIC | BPF_DW: BPF_OR | BPF_FETCH */\n-\tBPF_ATOMIC_OP_TEST1(BPF_DW, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),\n-\tBPF_ATOMIC_OP_TEST2(BPF_DW, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),\n-\tBPF_ATOMIC_OP_TEST3(BPF_DW, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),\n-\tBPF_ATOMIC_OP_TEST4(BPF_DW, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),\n-\t/* BPF_ATOMIC | BPF_W: BPF_XOR */\n-\tBPF_ATOMIC_OP_TEST1(BPF_W, BPF_XOR, ^, 0x12, 0xab, 0xb9),\n-\tBPF_ATOMIC_OP_TEST2(BPF_W, BPF_XOR, ^, 0x12, 0xab, 0xb9),\n-\tBPF_ATOMIC_OP_TEST3(BPF_W, BPF_XOR, ^, 0x12, 0xab, 0xb9),\n-\tBPF_ATOMIC_OP_TEST4(BPF_W, BPF_XOR, ^, 0x12, 0xab, 0xb9),\n-\t/* BPF_ATOMIC | BPF_W: BPF_XOR | BPF_FETCH */\n-\tBPF_ATOMIC_OP_TEST1(BPF_W, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),\n-\tBPF_ATOMIC_OP_TEST2(BPF_W, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),\n-\tBPF_ATOMIC_OP_TEST3(BPF_W, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),\n-\tBPF_ATOMIC_OP_TEST4(BPF_W, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),\n-\t/* BPF_ATOMIC | BPF_DW: BPF_XOR */\n-\tBPF_ATOMIC_OP_TEST1(BPF_DW, BPF_XOR, ^, 0x12, 0xab, 0xb9),\n-\tBPF_ATOMIC_OP_TEST2(BPF_DW, BPF_XOR, ^, 0x12, 0xab, 0xb9),\n-\tBPF_ATOMIC_OP_TEST3(BPF_DW, BPF_XOR, ^, 0x12, 0xab, 0xb9),\n-\tBPF_ATOMIC_OP_TEST4(BPF_DW, BPF_XOR, ^, 0x12, 0xab, 0xb9),\n-\t/* BPF_ATOMIC | BPF_DW: BPF_XOR | BPF_FETCH */\n-\tBPF_ATOMIC_OP_TEST1(BPF_DW, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),\n-\tBPF_ATOMIC_OP_TEST2(BPF_DW, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),\n-\tBPF_ATOMIC_OP_TEST3(BPF_DW, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),\n-\tBPF_ATOMIC_OP_TEST4(BPF_DW, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),\n-\t/* BPF_ATOMIC | BPF_W: BPF_XCHG */\n-\tBPF_ATOMIC_OP_TEST1(BPF_W, BPF_XCHG, xchg, 0x12, 0xab, 0xab),\n-\tBPF_ATOMIC_OP_TEST2(BPF_W, BPF_XCHG, xchg, 0x12, 0xab, 0xab),\n-\tBPF_ATOMIC_OP_TEST3(BPF_W, BPF_XCHG, xchg, 0x12, 0xab, 0xab),\n-\tBPF_ATOMIC_OP_TEST4(BPF_W, BPF_XCHG, xchg, 0x12, 0xab, 0xab),\n-\t/* BPF_ATOMIC | BPF_DW: BPF_XCHG */\n-\tBPF_ATOMIC_OP_TEST1(BPF_DW, BPF_XCHG, xchg, 0x12, 0xab, 0xab),\n-\tBPF_ATOMIC_OP_TEST2(BPF_DW, BPF_XCHG, xchg, 0x12, 0xab, 0xab),\n-\tBPF_ATOMIC_OP_TEST3(BPF_DW, BPF_XCHG, xchg, 0x12, 0xab, 0xab),\n-\tBPF_ATOMIC_OP_TEST4(BPF_DW, BPF_XCHG, xchg, 0x12, 0xab, 0xab),\n-#undef BPF_ATOMIC_POISON\n-#undef BPF_ATOMIC_OP_TEST1\n-#undef BPF_ATOMIC_OP_TEST2\n-#undef BPF_ATOMIC_OP_TEST3\n-#undef BPF_ATOMIC_OP_TEST4\n-\t/* BPF_ATOMIC | BPF_W, BPF_CMPXCHG */\n-\t{\n-\t\t\"BPF_ATOMIC | BPF_W, BPF_CMPXCHG: Test successful return\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ST_MEM(BPF_W, R10, -40, 0x01234567),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0x01234567),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R3, 0x89abcdef),\n-\t\t\tBPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R3, -40),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x01234567 } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"BPF_ATOMIC | BPF_W, BPF_CMPXCHG: Test successful store\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ST_MEM(BPF_W, R10, -40, 0x01234567),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0x01234567),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R3, 0x89abcdef),\n-\t\t\tBPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R3, -40),\n-\t\t\tBPF_LDX_MEM(BPF_W, R0, R10, -40),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x89abcdef } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"BPF_ATOMIC | BPF_W, BPF_CMPXCHG: Test failure return\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ST_MEM(BPF_W, R10, -40, 0x01234567),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0x76543210),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R3, 0x89abcdef),\n-\t\t\tBPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R3, -40),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x01234567 } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"BPF_ATOMIC | BPF_W, BPF_CMPXCHG: Test failure store\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ST_MEM(BPF_W, R10, -40, 0x01234567),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0x76543210),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R3, 0x89abcdef),\n-\t\t\tBPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R3, -40),\n-\t\t\tBPF_LDX_MEM(BPF_W, R0, R10, -40),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x01234567 } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"BPF_ATOMIC | BPF_W, BPF_CMPXCHG: Test side effects\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ST_MEM(BPF_W, R10, -40, 0x01234567),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0x01234567),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R3, 0x89abcdef),\n-\t\t\tBPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R3, -40),\n-\t\t\tBPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R3, -40),\n-\t\t\tBPF_ALU32_REG(BPF_MOV, R0, R3),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x89abcdef } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t/* BPF_ATOMIC | BPF_DW, BPF_CMPXCHG */\n-\t{\n-\t\t\"BPF_ATOMIC | BPF_DW, BPF_CMPXCHG: Test successful return\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x0123456789abcdefULL),\n-\t\t\tBPF_LD_IMM64(R2, 0xfedcba9876543210ULL),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R0, R1),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -40),\n-\t\t\tBPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -40),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R1, 1),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"BPF_ATOMIC | BPF_DW, BPF_CMPXCHG: Test successful store\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x0123456789abcdefULL),\n-\t\t\tBPF_LD_IMM64(R2, 0xfedcba9876543210ULL),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R0, R1),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R0, -40),\n-\t\t\tBPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -40),\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, R10, -40),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R2, 1),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"BPF_ATOMIC | BPF_DW, BPF_CMPXCHG: Test failure return\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x0123456789abcdefULL),\n-\t\t\tBPF_LD_IMM64(R2, 0xfedcba9876543210ULL),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R0, R1),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R0, 1),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -40),\n-\t\t\tBPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -40),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R1, 1),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"BPF_ATOMIC | BPF_DW, BPF_CMPXCHG: Test failure store\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x0123456789abcdefULL),\n-\t\t\tBPF_LD_IMM64(R2, 0xfedcba9876543210ULL),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R0, R1),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R0, 1),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -40),\n-\t\t\tBPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -40),\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, R10, -40),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R1, 1),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t{\n-\t\t\"BPF_ATOMIC | BPF_DW, BPF_CMPXCHG: Test side effects\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x0123456789abcdefULL),\n-\t\t\tBPF_LD_IMM64(R2, 0xfedcba9876543210ULL),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R0, R1),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -40),\n-\t\t\tBPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -40),\n-\t\t\tBPF_LD_IMM64(R0, 0xfedcba9876543210ULL),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R2, 1),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 40,\n-\t},\n-\t/* BPF_JMP32 | BPF_JEQ | BPF_K */\n-\t{\n-\t\t\"JMP32_JEQ_K: Small immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 123),\n-\t\t\tBPF_JMP32_IMM(BPF_JEQ, R0, 321, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JEQ, R0, 123, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 123 } }\n-\t},\n-\t{\n-\t\t\"JMP32_JEQ_K: Large immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 12345678),\n-\t\t\tBPF_JMP32_IMM(BPF_JEQ, R0, 12345678 \u0026 0xffff, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JEQ, R0, 12345678, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 12345678 } }\n-\t},\n-\t{\n-\t\t\"JMP32_JEQ_K: negative immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -123),\n-\t\t\tBPF_JMP32_IMM(BPF_JEQ, R0,  123, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JEQ, R0, -123, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -123 } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JEQ | BPF_X */\n-\t{\n-\t\t\"JMP32_JEQ_X\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1234),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 4321),\n-\t\t\tBPF_JMP32_REG(BPF_JEQ, R0, R1, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 1234),\n-\t\t\tBPF_JMP32_REG(BPF_JEQ, R0, R1, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1234 } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JNE | BPF_K */\n-\t{\n-\t\t\"JMP32_JNE_K: Small immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 123),\n-\t\t\tBPF_JMP32_IMM(BPF_JNE, R0, 123, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JNE, R0, 321, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 123 } }\n-\t},\n-\t{\n-\t\t\"JMP32_JNE_K: Large immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 12345678),\n-\t\t\tBPF_JMP32_IMM(BPF_JNE, R0, 12345678, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JNE, R0, 12345678 \u0026 0xffff, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 12345678 } }\n-\t},\n-\t{\n-\t\t\"JMP32_JNE_K: negative immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -123),\n-\t\t\tBPF_JMP32_IMM(BPF_JNE, R0, -123, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JNE, R0,  123, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -123 } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JNE | BPF_X */\n-\t{\n-\t\t\"JMP32_JNE_X\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1234),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 1234),\n-\t\t\tBPF_JMP32_REG(BPF_JNE, R0, R1, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 4321),\n-\t\t\tBPF_JMP32_REG(BPF_JNE, R0, R1, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1234 } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JSET | BPF_K */\n-\t{\n-\t\t\"JMP32_JSET_K: Small immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JSET, R0, 2, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JSET, R0, 3, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } }\n-\t},\n-\t{\n-\t\t\"JMP32_JSET_K: Large immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0x40000000),\n-\t\t\tBPF_JMP32_IMM(BPF_JSET, R0, 0x3fffffff, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JSET, R0, 0x60000000, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x40000000 } }\n-\t},\n-\t{\n-\t\t\"JMP32_JSET_K: negative immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -123),\n-\t\t\tBPF_JMP32_IMM(BPF_JSET, R0, -1, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -123 } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JSET | BPF_X */\n-\t{\n-\t\t\"JMP32_JSET_X\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 8),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 7),\n-\t\t\tBPF_JMP32_REG(BPF_JSET, R0, R1, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 8 | 2),\n-\t\t\tBPF_JMP32_REG(BPF_JNE, R0, R1, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 8 } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JGT | BPF_K */\n-\t{\n-\t\t\"JMP32_JGT_K: Small immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 123),\n-\t\t\tBPF_JMP32_IMM(BPF_JGT, R0, 123, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JGT, R0, 122, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 123 } }\n-\t},\n-\t{\n-\t\t\"JMP32_JGT_K: Large immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),\n-\t\t\tBPF_JMP32_IMM(BPF_JGT, R0, 0xffffffff, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JGT, R0, 0xfffffffd, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xfffffffe } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JGT | BPF_X */\n-\t{\n-\t\t\"JMP32_JGT_X\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),\n-\t\t\tBPF_JMP32_REG(BPF_JGT, R0, R1, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0xfffffffd),\n-\t\t\tBPF_JMP32_REG(BPF_JGT, R0, R1, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xfffffffe } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JGE | BPF_K */\n-\t{\n-\t\t\"JMP32_JGE_K: Small immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 123),\n-\t\t\tBPF_JMP32_IMM(BPF_JGE, R0, 124, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JGE, R0, 123, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 123 } }\n-\t},\n-\t{\n-\t\t\"JMP32_JGE_K: Large immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),\n-\t\t\tBPF_JMP32_IMM(BPF_JGE, R0, 0xffffffff, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JGE, R0, 0xfffffffe, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xfffffffe } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JGE | BPF_X */\n-\t{\n-\t\t\"JMP32_JGE_X\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),\n-\t\t\tBPF_JMP32_REG(BPF_JGE, R0, R1, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0xfffffffe),\n-\t\t\tBPF_JMP32_REG(BPF_JGE, R0, R1, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xfffffffe } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JLT | BPF_K */\n-\t{\n-\t\t\"JMP32_JLT_K: Small immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 123),\n-\t\t\tBPF_JMP32_IMM(BPF_JLT, R0, 123, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JLT, R0, 124, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 123 } }\n-\t},\n-\t{\n-\t\t\"JMP32_JLT_K: Large immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),\n-\t\t\tBPF_JMP32_IMM(BPF_JLT, R0, 0xfffffffd, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JLT, R0, 0xffffffff, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xfffffffe } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JLT | BPF_X */\n-\t{\n-\t\t\"JMP32_JLT_X\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0xfffffffd),\n-\t\t\tBPF_JMP32_REG(BPF_JLT, R0, R1, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),\n-\t\t\tBPF_JMP32_REG(BPF_JLT, R0, R1, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xfffffffe } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JLE | BPF_K */\n-\t{\n-\t\t\"JMP32_JLE_K: Small immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 123),\n-\t\t\tBPF_JMP32_IMM(BPF_JLE, R0, 122, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JLE, R0, 123, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 123 } }\n-\t},\n-\t{\n-\t\t\"JMP32_JLE_K: Large immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),\n-\t\t\tBPF_JMP32_IMM(BPF_JLE, R0, 0xfffffffd, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JLE, R0, 0xfffffffe, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xfffffffe } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JLE | BPF_X */\n-\t{\n-\t\t\"JMP32_JLE_X\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0xfffffffd),\n-\t\t\tBPF_JMP32_REG(BPF_JLE, R0, R1, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0xfffffffe),\n-\t\t\tBPF_JMP32_REG(BPF_JLE, R0, R1, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xfffffffe } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JSGT | BPF_K */\n-\t{\n-\t\t\"JMP32_JSGT_K: Small immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -123),\n-\t\t\tBPF_JMP32_IMM(BPF_JSGT, R0, -123, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JSGT, R0, -124, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -123 } }\n-\t},\n-\t{\n-\t\t\"JMP32_JSGT_K: Large immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -12345678),\n-\t\t\tBPF_JMP32_IMM(BPF_JSGT, R0, -12345678, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JSGT, R0, -12345679, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -12345678 } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JSGT | BPF_X */\n-\t{\n-\t\t\"JMP32_JSGT_X\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -12345678),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, -12345678),\n-\t\t\tBPF_JMP32_REG(BPF_JSGT, R0, R1, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, -12345679),\n-\t\t\tBPF_JMP32_REG(BPF_JSGT, R0, R1, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -12345678 } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JSGE | BPF_K */\n-\t{\n-\t\t\"JMP32_JSGE_K: Small immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -123),\n-\t\t\tBPF_JMP32_IMM(BPF_JSGE, R0, -122, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JSGE, R0, -123, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -123 } }\n-\t},\n-\t{\n-\t\t\"JMP32_JSGE_K: Large immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -12345678),\n-\t\t\tBPF_JMP32_IMM(BPF_JSGE, R0, -12345677, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JSGE, R0, -12345678, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -12345678 } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JSGE | BPF_X */\n-\t{\n-\t\t\"JMP32_JSGE_X\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -12345678),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, -12345677),\n-\t\t\tBPF_JMP32_REG(BPF_JSGE, R0, R1, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, -12345678),\n-\t\t\tBPF_JMP32_REG(BPF_JSGE, R0, R1, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -12345678 } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JSLT | BPF_K */\n-\t{\n-\t\t\"JMP32_JSLT_K: Small immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -123),\n-\t\t\tBPF_JMP32_IMM(BPF_JSLT, R0, -123, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JSLT, R0, -122, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -123 } }\n-\t},\n-\t{\n-\t\t\"JMP32_JSLT_K: Large immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -12345678),\n-\t\t\tBPF_JMP32_IMM(BPF_JSLT, R0, -12345678, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JSLT, R0, -12345677, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -12345678 } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JSLT | BPF_X */\n-\t{\n-\t\t\"JMP32_JSLT_X\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -12345678),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, -12345678),\n-\t\t\tBPF_JMP32_REG(BPF_JSLT, R0, R1, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, -12345677),\n-\t\t\tBPF_JMP32_REG(BPF_JSLT, R0, R1, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -12345678 } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JSLE | BPF_K */\n-\t{\n-\t\t\"JMP32_JSLE_K: Small immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -123),\n-\t\t\tBPF_JMP32_IMM(BPF_JSLE, R0, -124, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JSLE, R0, -123, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -123 } }\n-\t},\n-\t{\n-\t\t\"JMP32_JSLE_K: Large immediate\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -12345678),\n-\t\t\tBPF_JMP32_IMM(BPF_JSLE, R0, -12345679, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JSLE, R0, -12345678, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -12345678 } }\n-\t},\n-\t/* BPF_JMP32 | BPF_JSLE | BPF_K */\n-\t{\n-\t\t\"JMP32_JSLE_X\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -12345678),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, -12345679),\n-\t\t\tBPF_JMP32_REG(BPF_JSLE, R0, R1, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, -12345678),\n-\t\t\tBPF_JMP32_REG(BPF_JSLE, R0, R1, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, -12345678 } }\n-\t},\n-\t/* BPF_JMP | BPF_EXIT */\n-\t{\n-\t\t\"JMP_EXIT\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0x4711),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0x4712),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0x4711 } },\n-\t},\n-\t/* BPF_JMP | BPF_JA */\n-\t{\n-\t\t\"JMP_JA: Unconditional jump: if (true) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_JMP_IMM(BPF_JA, 0, 0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP32 | BPF_JA */\n-\t{\n-\t\t\"JMP32_JA: Unconditional jump: if (true) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_JMP32_IMM(BPF_JA, 0, 1, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JSLT | BPF_K */\n-\t{\n-\t\t\"JMP_JSLT_K: Signed jump: if (-2 \u003c -1) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 0xfffffffffffffffeLL),\n-\t\t\tBPF_JMP_IMM(BPF_JSLT, R1, -1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JSLT_K: Signed jump: if (-1 \u003c -1) return 0\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_LD_IMM64(R1, 0xffffffffffffffffLL),\n-\t\t\tBPF_JMP_IMM(BPF_JSLT, R1, -1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JSGT | BPF_K */\n-\t{\n-\t\t\"JMP_JSGT_K: Signed jump: if (-1 \u003e -2) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 0xffffffffffffffffLL),\n-\t\t\tBPF_JMP_IMM(BPF_JSGT, R1, -2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JSGT_K: Signed jump: if (-1 \u003e -1) return 0\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_LD_IMM64(R1, 0xffffffffffffffffLL),\n-\t\t\tBPF_JMP_IMM(BPF_JSGT, R1, -1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JSLE | BPF_K */\n-\t{\n-\t\t\"JMP_JSLE_K: Signed jump: if (-2 \u003c= -1) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 0xfffffffffffffffeLL),\n-\t\t\tBPF_JMP_IMM(BPF_JSLE, R1, -1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JSLE_K: Signed jump: if (-1 \u003c= -1) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 0xffffffffffffffffLL),\n-\t\t\tBPF_JMP_IMM(BPF_JSLE, R1, -1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JSLE_K: Signed jump: value walk 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_JMP_IMM(BPF_JSLE, R1, 0, 6),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R1, 1),\n-\t\t\tBPF_JMP_IMM(BPF_JSLE, R1, 0, 4),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R1, 1),\n-\t\t\tBPF_JMP_IMM(BPF_JSLE, R1, 0, 2),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R1, 1),\n-\t\t\tBPF_JMP_IMM(BPF_JSLE, R1, 0, 1),\n-\t\t\tBPF_EXIT_INSN(),\t\t/* bad exit */\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\t/* good exit */\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JSLE_K: Signed jump: value walk 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_JMP_IMM(BPF_JSLE, R1, 0, 4),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R1, 2),\n-\t\t\tBPF_JMP_IMM(BPF_JSLE, R1, 0, 2),\n-\t\t\tBPF_ALU64_IMM(BPF_SUB, R1, 2),\n-\t\t\tBPF_JMP_IMM(BPF_JSLE, R1, 0, 1),\n-\t\t\tBPF_EXIT_INSN(),\t\t/* bad exit */\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\t/* good exit */\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JSGE | BPF_K */\n-\t{\n-\t\t\"JMP_JSGE_K: Signed jump: if (-1 \u003e= -2) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 0xffffffffffffffffLL),\n-\t\t\tBPF_JMP_IMM(BPF_JSGE, R1, -2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JSGE_K: Signed jump: if (-1 \u003e= -1) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 0xffffffffffffffffLL),\n-\t\t\tBPF_JMP_IMM(BPF_JSGE, R1, -1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JSGE_K: Signed jump: value walk 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, -3),\n-\t\t\tBPF_JMP_IMM(BPF_JSGE, R1, 0, 6),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R1, 1),\n-\t\t\tBPF_JMP_IMM(BPF_JSGE, R1, 0, 4),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R1, 1),\n-\t\t\tBPF_JMP_IMM(BPF_JSGE, R1, 0, 2),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R1, 1),\n-\t\t\tBPF_JMP_IMM(BPF_JSGE, R1, 0, 1),\n-\t\t\tBPF_EXIT_INSN(),\t\t/* bad exit */\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\t/* good exit */\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JSGE_K: Signed jump: value walk 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, -3),\n-\t\t\tBPF_JMP_IMM(BPF_JSGE, R1, 0, 4),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R1, 2),\n-\t\t\tBPF_JMP_IMM(BPF_JSGE, R1, 0, 2),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R1, 2),\n-\t\t\tBPF_JMP_IMM(BPF_JSGE, R1, 0, 1),\n-\t\t\tBPF_EXIT_INSN(),\t\t/* bad exit */\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\t/* good exit */\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JGT | BPF_K */\n-\t{\n-\t\t\"JMP_JGT_K: if (3 \u003e 2) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_JMP_IMM(BPF_JGT, R1, 2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JGT_K: Unsigned jump: if (-1 \u003e 1) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, -1),\n-\t\t\tBPF_JMP_IMM(BPF_JGT, R1, 1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JLT | BPF_K */\n-\t{\n-\t\t\"JMP_JLT_K: if (2 \u003c 3) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 2),\n-\t\t\tBPF_JMP_IMM(BPF_JLT, R1, 3, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JGT_K: Unsigned jump: if (1 \u003c -1) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 1),\n-\t\t\tBPF_JMP_IMM(BPF_JLT, R1, -1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JGE | BPF_K */\n-\t{\n-\t\t\"JMP_JGE_K: if (3 \u003e= 2) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_JMP_IMM(BPF_JGE, R1, 2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JLE | BPF_K */\n-\t{\n-\t\t\"JMP_JLE_K: if (2 \u003c= 3) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 2),\n-\t\t\tBPF_JMP_IMM(BPF_JLE, R1, 3, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JGT | BPF_K jump backwards */\n-\t{\n-\t\t\"JMP_JGT_K: if (3 \u003e 2) return 1 (jump backwards)\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_JMP_IMM(BPF_JA, 0, 0, 2), /* goto start */\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1), /* out: */\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0), /* start: */\n-\t\t\tBPF_LD_IMM64(R1, 3), /* note: this takes 2 insns */\n-\t\t\tBPF_JMP_IMM(BPF_JGT, R1, 2, -6), /* goto out */\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JGE_K: if (3 \u003e= 3) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_JMP_IMM(BPF_JGE, R1, 3, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JLT | BPF_K jump backwards */\n-\t{\n-\t\t\"JMP_JGT_K: if (2 \u003c 3) return 1 (jump backwards)\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_JMP_IMM(BPF_JA, 0, 0, 2), /* goto start */\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1), /* out: */\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0), /* start: */\n-\t\t\tBPF_LD_IMM64(R1, 2), /* note: this takes 2 insns */\n-\t\t\tBPF_JMP_IMM(BPF_JLT, R1, 3, -6), /* goto out */\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JLE_K: if (3 \u003c= 3) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_JMP_IMM(BPF_JLE, R1, 3, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JNE | BPF_K */\n-\t{\n-\t\t\"JMP_JNE_K: if (3 != 2) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R1, 2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JEQ | BPF_K */\n-\t{\n-\t\t\"JMP_JEQ_K: if (3 == 3) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R1, 3, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JSET | BPF_K */\n-\t{\n-\t\t\"JMP_JSET_K: if (0x3 \u0026 0x2) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_JMP_IMM(BPF_JSET, R1, 2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JSET_K: if (0x3 \u0026 0xffffffff) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_JMP_IMM(BPF_JSET, R1, 0xffffffff, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JSGT | BPF_X */\n-\t{\n-\t\t\"JMP_JSGT_X: Signed jump: if (-1 \u003e -2) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, -1),\n-\t\t\tBPF_LD_IMM64(R2, -2),\n-\t\t\tBPF_JMP_REG(BPF_JSGT, R1, R2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JSGT_X: Signed jump: if (-1 \u003e -1) return 0\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_LD_IMM64(R1, -1),\n-\t\t\tBPF_LD_IMM64(R2, -1),\n-\t\t\tBPF_JMP_REG(BPF_JSGT, R1, R2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JSLT | BPF_X */\n-\t{\n-\t\t\"JMP_JSLT_X: Signed jump: if (-2 \u003c -1) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, -1),\n-\t\t\tBPF_LD_IMM64(R2, -2),\n-\t\t\tBPF_JMP_REG(BPF_JSLT, R2, R1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JSLT_X: Signed jump: if (-1 \u003c -1) return 0\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_LD_IMM64(R1, -1),\n-\t\t\tBPF_LD_IMM64(R2, -1),\n-\t\t\tBPF_JMP_REG(BPF_JSLT, R1, R2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JSGE | BPF_X */\n-\t{\n-\t\t\"JMP_JSGE_X: Signed jump: if (-1 \u003e= -2) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, -1),\n-\t\t\tBPF_LD_IMM64(R2, -2),\n-\t\t\tBPF_JMP_REG(BPF_JSGE, R1, R2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JSGE_X: Signed jump: if (-1 \u003e= -1) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, -1),\n-\t\t\tBPF_LD_IMM64(R2, -1),\n-\t\t\tBPF_JMP_REG(BPF_JSGE, R1, R2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JSLE | BPF_X */\n-\t{\n-\t\t\"JMP_JSLE_X: Signed jump: if (-2 \u003c= -1) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, -1),\n-\t\t\tBPF_LD_IMM64(R2, -2),\n-\t\t\tBPF_JMP_REG(BPF_JSLE, R2, R1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JSLE_X: Signed jump: if (-1 \u003c= -1) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, -1),\n-\t\t\tBPF_LD_IMM64(R2, -1),\n-\t\t\tBPF_JMP_REG(BPF_JSLE, R1, R2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JGT | BPF_X */\n-\t{\n-\t\t\"JMP_JGT_X: if (3 \u003e 2) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_LD_IMM64(R2, 2),\n-\t\t\tBPF_JMP_REG(BPF_JGT, R1, R2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JGT_X: Unsigned jump: if (-1 \u003e 1) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, -1),\n-\t\t\tBPF_LD_IMM64(R2, 1),\n-\t\t\tBPF_JMP_REG(BPF_JGT, R1, R2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JLT | BPF_X */\n-\t{\n-\t\t\"JMP_JLT_X: if (2 \u003c 3) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_LD_IMM64(R2, 2),\n-\t\t\tBPF_JMP_REG(BPF_JLT, R2, R1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JLT_X: Unsigned jump: if (1 \u003c -1) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, -1),\n-\t\t\tBPF_LD_IMM64(R2, 1),\n-\t\t\tBPF_JMP_REG(BPF_JLT, R2, R1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JGE | BPF_X */\n-\t{\n-\t\t\"JMP_JGE_X: if (3 \u003e= 2) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_LD_IMM64(R2, 2),\n-\t\t\tBPF_JMP_REG(BPF_JGE, R1, R2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JGE_X: if (3 \u003e= 3) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_LD_IMM64(R2, 3),\n-\t\t\tBPF_JMP_REG(BPF_JGE, R1, R2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JLE | BPF_X */\n-\t{\n-\t\t\"JMP_JLE_X: if (2 \u003c= 3) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_LD_IMM64(R2, 2),\n-\t\t\tBPF_JMP_REG(BPF_JLE, R2, R1, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JLE_X: if (3 \u003c= 3) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_LD_IMM64(R2, 3),\n-\t\t\tBPF_JMP_REG(BPF_JLE, R1, R2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t/* Mainly testing JIT + imm64 here. */\n-\t\t\"JMP_JGE_X: ldimm64 test 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_LD_IMM64(R2, 2),\n-\t\t\tBPF_JMP_REG(BPF_JGE, R1, R2, 2),\n-\t\t\tBPF_LD_IMM64(R0, 0xffffffffffffffffULL),\n-\t\t\tBPF_LD_IMM64(R0, 0xeeeeeeeeeeeeeeeeULL),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xeeeeeeeeU } },\n-\t},\n-\t{\n-\t\t\"JMP_JGE_X: ldimm64 test 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_LD_IMM64(R2, 2),\n-\t\t\tBPF_JMP_REG(BPF_JGE, R1, R2, 0),\n-\t\t\tBPF_LD_IMM64(R0, 0xffffffffffffffffULL),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffffffffU } },\n-\t},\n-\t{\n-\t\t\"JMP_JGE_X: ldimm64 test 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_LD_IMM64(R2, 2),\n-\t\t\tBPF_JMP_REG(BPF_JGE, R1, R2, 4),\n-\t\t\tBPF_LD_IMM64(R0, 0xffffffffffffffffULL),\n-\t\t\tBPF_LD_IMM64(R0, 0xeeeeeeeeeeeeeeeeULL),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JLE_X: ldimm64 test 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_LD_IMM64(R2, 2),\n-\t\t\tBPF_JMP_REG(BPF_JLE, R2, R1, 2),\n-\t\t\tBPF_LD_IMM64(R0, 0xffffffffffffffffULL),\n-\t\t\tBPF_LD_IMM64(R0, 0xeeeeeeeeeeeeeeeeULL),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xeeeeeeeeU } },\n-\t},\n-\t{\n-\t\t\"JMP_JLE_X: ldimm64 test 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_LD_IMM64(R2, 2),\n-\t\t\tBPF_JMP_REG(BPF_JLE, R2, R1, 0),\n-\t\t\tBPF_LD_IMM64(R0, 0xffffffffffffffffULL),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0xffffffffU } },\n-\t},\n-\t{\n-\t\t\"JMP_JLE_X: ldimm64 test 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_LD_IMM64(R2, 2),\n-\t\t\tBPF_JMP_REG(BPF_JLE, R2, R1, 4),\n-\t\t\tBPF_LD_IMM64(R0, 0xffffffffffffffffULL),\n-\t\t\tBPF_LD_IMM64(R0, 0xeeeeeeeeeeeeeeeeULL),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JNE | BPF_X */\n-\t{\n-\t\t\"JMP_JNE_X: if (3 != 2) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_LD_IMM64(R2, 2),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R1, R2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JEQ | BPF_X */\n-\t{\n-\t\t\"JMP_JEQ_X: if (3 == 3) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_LD_IMM64(R2, 3),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R1, R2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t/* BPF_JMP | BPF_JSET | BPF_X */\n-\t{\n-\t\t\"JMP_JSET_X: if (0x3 \u0026 0x2) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_LD_IMM64(R2, 2),\n-\t\t\tBPF_JMP_REG(BPF_JSET, R1, R2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JSET_X: if (0x3 \u0026 0xffffffff) return 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_LD_IMM64(R1, 3),\n-\t\t\tBPF_LD_IMM64(R2, 0xffffffff),\n-\t\t\tBPF_JMP_REG(BPF_JSET, R1, R2, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JA: Jump, gap, jump, ...\",\n-\t\t{ },\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0xababcbac } },\n-\t\t.fill_helper = bpf_fill_ja,\n-\t},\n-\t{\t/* Mainly checking JIT here. */\n-\t\t\"BPF_MAXINSNS: Maximum possible literals\",\n-\t\t{ },\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0xffffffff } },\n-\t\t.fill_helper = bpf_fill_maxinsns1,\n-\t},\n-\t{\t/* Mainly checking JIT here. */\n-\t\t\"BPF_MAXINSNS: Single literal\",\n-\t\t{ },\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0xfefefefe } },\n-\t\t.fill_helper = bpf_fill_maxinsns2,\n-\t},\n-\t{\t/* Mainly checking JIT here. */\n-\t\t\"BPF_MAXINSNS: Run/add until end\",\n-\t\t{ },\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0x947bf368 } },\n-\t\t.fill_helper = bpf_fill_maxinsns3,\n-\t},\n-\t{\n-\t\t\"BPF_MAXINSNS: Too many instructions\",\n-\t\t{ },\n-\t\tCLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,\n-\t\t{ },\n-\t\t{ },\n-\t\t.fill_helper = bpf_fill_maxinsns4,\n-\t\t.expected_errcode = -EINVAL,\n-\t},\n-\t{\t/* Mainly checking JIT here. */\n-\t\t\"BPF_MAXINSNS: Very long jump\",\n-\t\t{ },\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0xabababab } },\n-\t\t.fill_helper = bpf_fill_maxinsns5,\n-\t},\n-\t{\t/* Mainly checking JIT here. */\n-\t\t\"BPF_MAXINSNS: Ctx heavy transformations\",\n-\t\t{ },\n-\t\tCLASSIC,\n-\t\t{ },\n-\t\t{\n-\t\t\t{  1, SKB_VLAN_PRESENT },\n-\t\t\t{ 10, SKB_VLAN_PRESENT }\n-\t\t},\n-\t\t.fill_helper = bpf_fill_maxinsns6,\n-\t},\n-\t{\t/* Mainly checking JIT here. */\n-\t\t\"BPF_MAXINSNS: Call heavy transformations\",\n-\t\t{ },\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 1, 0 }, { 10, 0 } },\n-\t\t.fill_helper = bpf_fill_maxinsns7,\n-\t},\n-\t{\t/* Mainly checking JIT here. */\n-\t\t\"BPF_MAXINSNS: Jump heavy test\",\n-\t\t{ },\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0xffffffff } },\n-\t\t.fill_helper = bpf_fill_maxinsns8,\n-\t},\n-\t{\t/* Mainly checking JIT here. */\n-\t\t\"BPF_MAXINSNS: Very long jump backwards\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0xcbababab } },\n-\t\t.fill_helper = bpf_fill_maxinsns9,\n-\t},\n-\t{\t/* Mainly checking JIT here. */\n-\t\t\"BPF_MAXINSNS: Edge hopping nuthouse\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0xabababac } },\n-\t\t.fill_helper = bpf_fill_maxinsns10,\n-\t},\n-\t{\n-\t\t\"BPF_MAXINSNS: Jump, gap, jump, ...\",\n-\t\t{ },\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0xababcbac } },\n-\t\t.fill_helper = bpf_fill_maxinsns11,\n-\t},\n-\t{\n-\t\t\"BPF_MAXINSNS: jump over MSH\",\n-\t\t{ },\n-\t\tCLASSIC | FLAG_EXPECTED_FAIL,\n-\t\t{ 0xfa, 0xfb, 0xfc, 0xfd, },\n-\t\t{ { 4, 0xabababab } },\n-\t\t.fill_helper = bpf_fill_maxinsns12,\n-\t\t.expected_errcode = -EINVAL,\n-\t},\n-\t{\n-\t\t\"BPF_MAXINSNS: exec all MSH\",\n-\t\t{ },\n-\t\tCLASSIC,\n-\t\t{ 0xfa, 0xfb, 0xfc, 0xfd, },\n-\t\t{ { 4, 0xababab83 } },\n-\t\t.fill_helper = bpf_fill_maxinsns13,\n-\t},\n-\t{\n-\t\t\"BPF_MAXINSNS: ld_abs+get_processor_id\",\n-\t\t{ },\n-\t\tCLASSIC,\n-\t\t{ },\n-\t\t{ { 1, 0xbee } },\n-\t\t.fill_helper = bpf_fill_ld_abs_get_processor_id,\n-\t},\n-\t/*\n-\t * LD_IND / LD_ABS on fragmented SKBs\n-\t */\n-\t{\n-\t\t\"LD_IND byte frag\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x40),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_B, 0x0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_SKB_FRAG,\n-\t\t{ },\n-\t\t{ {0x40, 0x42} },\n-\t\t.frag_data = {\n-\t\t\t0x42, 0x00, 0x00, 0x00,\n-\t\t\t0x43, 0x44, 0x00, 0x00,\n-\t\t\t0x21, 0x07, 0x19, 0x83,\n-\t\t},\n-\t},\n-\t{\n-\t\t\"LD_IND halfword frag\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x40),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_H, 0x4),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_SKB_FRAG,\n-\t\t{ },\n-\t\t{ {0x40, 0x4344} },\n-\t\t.frag_data = {\n-\t\t\t0x42, 0x00, 0x00, 0x00,\n-\t\t\t0x43, 0x44, 0x00, 0x00,\n-\t\t\t0x21, 0x07, 0x19, 0x83,\n-\t\t},\n-\t},\n-\t{\n-\t\t\"LD_IND word frag\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x40),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_W, 0x8),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_SKB_FRAG,\n-\t\t{ },\n-\t\t{ {0x40, 0x21071983} },\n-\t\t.frag_data = {\n-\t\t\t0x42, 0x00, 0x00, 0x00,\n-\t\t\t0x43, 0x44, 0x00, 0x00,\n-\t\t\t0x21, 0x07, 0x19, 0x83,\n-\t\t},\n-\t},\n-\t{\n-\t\t\"LD_IND halfword mixed head/frag\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x40),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_H, -0x1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_SKB_FRAG,\n-\t\t{ [0x3e] = 0x25, [0x3f] = 0x05, },\n-\t\t{ {0x40, 0x0519} },\n-\t\t.frag_data = { 0x19, 0x82 },\n-\t},\n-\t{\n-\t\t\"LD_IND word mixed head/frag\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x40),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_W, -0x2),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_SKB_FRAG,\n-\t\t{ [0x3e] = 0x25, [0x3f] = 0x05, },\n-\t\t{ {0x40, 0x25051982} },\n-\t\t.frag_data = { 0x19, 0x82 },\n-\t},\n-\t{\n-\t\t\"LD_ABS byte frag\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_B, 0x40),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_SKB_FRAG,\n-\t\t{ },\n-\t\t{ {0x40, 0x42} },\n-\t\t.frag_data = {\n-\t\t\t0x42, 0x00, 0x00, 0x00,\n-\t\t\t0x43, 0x44, 0x00, 0x00,\n-\t\t\t0x21, 0x07, 0x19, 0x83,\n-\t\t},\n-\t},\n-\t{\n-\t\t\"LD_ABS halfword frag\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_H, 0x44),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_SKB_FRAG,\n-\t\t{ },\n-\t\t{ {0x40, 0x4344} },\n-\t\t.frag_data = {\n-\t\t\t0x42, 0x00, 0x00, 0x00,\n-\t\t\t0x43, 0x44, 0x00, 0x00,\n-\t\t\t0x21, 0x07, 0x19, 0x83,\n-\t\t},\n-\t},\n-\t{\n-\t\t\"LD_ABS word frag\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x48),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_SKB_FRAG,\n-\t\t{ },\n-\t\t{ {0x40, 0x21071983} },\n-\t\t.frag_data = {\n-\t\t\t0x42, 0x00, 0x00, 0x00,\n-\t\t\t0x43, 0x44, 0x00, 0x00,\n-\t\t\t0x21, 0x07, 0x19, 0x83,\n-\t\t},\n-\t},\n-\t{\n-\t\t\"LD_ABS halfword mixed head/frag\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_H, 0x3f),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_SKB_FRAG,\n-\t\t{ [0x3e] = 0x25, [0x3f] = 0x05, },\n-\t\t{ {0x40, 0x0519} },\n-\t\t.frag_data = { 0x19, 0x82 },\n-\t},\n-\t{\n-\t\t\"LD_ABS word mixed head/frag\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x3e),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_SKB_FRAG,\n-\t\t{ [0x3e] = 0x25, [0x3f] = 0x05, },\n-\t\t{ {0x40, 0x25051982} },\n-\t\t.frag_data = { 0x19, 0x82 },\n-\t},\n-\t/*\n-\t * LD_IND / LD_ABS on non fragmented SKBs\n-\t */\n-\t{\n-\t\t/*\n-\t\t * this tests that the JIT/interpreter correctly resets X\n-\t\t * before using it in an LD_IND instruction.\n-\t\t */\n-\t\t\"LD_IND byte default X\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_B, 0x1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x1] = 0x42 },\n-\t\t{ {0x40, 0x42 } },\n-\t},\n-\t{\n-\t\t\"LD_IND byte positive offset\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x3e),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_B, 0x1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x40, 0x82 } },\n-\t},\n-\t{\n-\t\t\"LD_IND byte negative offset\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x3e),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_B, -0x1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x40, 0x05 } },\n-\t},\n-\t{\n-\t\t\"LD_IND byte positive offset, all ff\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x3e),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_B, 0x1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0xff, [0x3d] = 0xff,  [0x3e] = 0xff, [0x3f] = 0xff },\n-\t\t{ {0x40, 0xff } },\n-\t},\n-\t{\n-\t\t\"LD_IND byte positive offset, out of bounds\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x3e),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_B, 0x1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x3f, 0 }, },\n-\t},\n-\t{\n-\t\t\"LD_IND byte negative offset, out of bounds\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x3e),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_B, -0x3f),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x3f, 0 } },\n-\t},\n-\t{\n-\t\t\"LD_IND byte negative offset, multiple calls\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x3b),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_B, SKF_LL_OFF + 1),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_B, SKF_LL_OFF + 2),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_B, SKF_LL_OFF + 3),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_B, SKF_LL_OFF + 4),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x40, 0x82 }, },\n-\t},\n-\t{\n-\t\t\"LD_IND halfword positive offset\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x20),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_H, 0x2),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{\n-\t\t\t[0x1c] = 0xaa, [0x1d] = 0x55,\n-\t\t\t[0x1e] = 0xbb, [0x1f] = 0x66,\n-\t\t\t[0x20] = 0xcc, [0x21] = 0x77,\n-\t\t\t[0x22] = 0xdd, [0x23] = 0x88,\n-\t\t},\n-\t\t{ {0x40, 0xdd88 } },\n-\t},\n-\t{\n-\t\t\"LD_IND halfword negative offset\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x20),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_H, -0x2),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{\n-\t\t\t[0x1c] = 0xaa, [0x1d] = 0x55,\n-\t\t\t[0x1e] = 0xbb, [0x1f] = 0x66,\n-\t\t\t[0x20] = 0xcc, [0x21] = 0x77,\n-\t\t\t[0x22] = 0xdd, [0x23] = 0x88,\n-\t\t},\n-\t\t{ {0x40, 0xbb66 } },\n-\t},\n-\t{\n-\t\t\"LD_IND halfword unaligned\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x20),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_H, -0x1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{\n-\t\t\t[0x1c] = 0xaa, [0x1d] = 0x55,\n-\t\t\t[0x1e] = 0xbb, [0x1f] = 0x66,\n-\t\t\t[0x20] = 0xcc, [0x21] = 0x77,\n-\t\t\t[0x22] = 0xdd, [0x23] = 0x88,\n-\t\t},\n-\t\t{ {0x40, 0x66cc } },\n-\t},\n-\t{\n-\t\t\"LD_IND halfword positive offset, all ff\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x3d),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_H, 0x1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0xff, [0x3d] = 0xff,  [0x3e] = 0xff, [0x3f] = 0xff },\n-\t\t{ {0x40, 0xffff } },\n-\t},\n-\t{\n-\t\t\"LD_IND halfword positive offset, out of bounds\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x3e),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_H, 0x1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x3f, 0 }, },\n-\t},\n-\t{\n-\t\t\"LD_IND halfword negative offset, out of bounds\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x3e),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_H, -0x3f),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x3f, 0 } },\n-\t},\n-\t{\n-\t\t\"LD_IND word positive offset\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x20),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_W, 0x4),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{\n-\t\t\t[0x1c] = 0xaa, [0x1d] = 0x55,\n-\t\t\t[0x1e] = 0xbb, [0x1f] = 0x66,\n-\t\t\t[0x20] = 0xcc, [0x21] = 0x77,\n-\t\t\t[0x22] = 0xdd, [0x23] = 0x88,\n-\t\t\t[0x24] = 0xee, [0x25] = 0x99,\n-\t\t\t[0x26] = 0xff, [0x27] = 0xaa,\n-\t\t},\n-\t\t{ {0x40, 0xee99ffaa } },\n-\t},\n-\t{\n-\t\t\"LD_IND word negative offset\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x20),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_W, -0x4),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{\n-\t\t\t[0x1c] = 0xaa, [0x1d] = 0x55,\n-\t\t\t[0x1e] = 0xbb, [0x1f] = 0x66,\n-\t\t\t[0x20] = 0xcc, [0x21] = 0x77,\n-\t\t\t[0x22] = 0xdd, [0x23] = 0x88,\n-\t\t\t[0x24] = 0xee, [0x25] = 0x99,\n-\t\t\t[0x26] = 0xff, [0x27] = 0xaa,\n-\t\t},\n-\t\t{ {0x40, 0xaa55bb66 } },\n-\t},\n-\t{\n-\t\t\"LD_IND word unaligned (addr \u0026 3 == 2)\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x20),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_W, -0x2),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{\n-\t\t\t[0x1c] = 0xaa, [0x1d] = 0x55,\n-\t\t\t[0x1e] = 0xbb, [0x1f] = 0x66,\n-\t\t\t[0x20] = 0xcc, [0x21] = 0x77,\n-\t\t\t[0x22] = 0xdd, [0x23] = 0x88,\n-\t\t\t[0x24] = 0xee, [0x25] = 0x99,\n-\t\t\t[0x26] = 0xff, [0x27] = 0xaa,\n-\t\t},\n-\t\t{ {0x40, 0xbb66cc77 } },\n-\t},\n-\t{\n-\t\t\"LD_IND word unaligned (addr \u0026 3 == 1)\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x20),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_W, -0x3),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{\n-\t\t\t[0x1c] = 0xaa, [0x1d] = 0x55,\n-\t\t\t[0x1e] = 0xbb, [0x1f] = 0x66,\n-\t\t\t[0x20] = 0xcc, [0x21] = 0x77,\n-\t\t\t[0x22] = 0xdd, [0x23] = 0x88,\n-\t\t\t[0x24] = 0xee, [0x25] = 0x99,\n-\t\t\t[0x26] = 0xff, [0x27] = 0xaa,\n-\t\t},\n-\t\t{ {0x40, 0x55bb66cc } },\n-\t},\n-\t{\n-\t\t\"LD_IND word unaligned (addr \u0026 3 == 3)\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x20),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_W, -0x1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{\n-\t\t\t[0x1c] = 0xaa, [0x1d] = 0x55,\n-\t\t\t[0x1e] = 0xbb, [0x1f] = 0x66,\n-\t\t\t[0x20] = 0xcc, [0x21] = 0x77,\n-\t\t\t[0x22] = 0xdd, [0x23] = 0x88,\n-\t\t\t[0x24] = 0xee, [0x25] = 0x99,\n-\t\t\t[0x26] = 0xff, [0x27] = 0xaa,\n-\t\t},\n-\t\t{ {0x40, 0x66cc77dd } },\n-\t},\n-\t{\n-\t\t\"LD_IND word positive offset, all ff\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x3b),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_W, 0x1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0xff, [0x3d] = 0xff,  [0x3e] = 0xff, [0x3f] = 0xff },\n-\t\t{ {0x40, 0xffffffff } },\n-\t},\n-\t{\n-\t\t\"LD_IND word positive offset, out of bounds\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x3e),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_W, 0x1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x3f, 0 }, },\n-\t},\n-\t{\n-\t\t\"LD_IND word negative offset, out of bounds\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LDX | BPF_IMM, 0x3e),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IND | BPF_W, -0x3f),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x3f, 0 } },\n-\t},\n-\t{\n-\t\t\"LD_ABS byte\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_B, 0x20),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{\n-\t\t\t[0x1c] = 0xaa, [0x1d] = 0x55,\n-\t\t\t[0x1e] = 0xbb, [0x1f] = 0x66,\n-\t\t\t[0x20] = 0xcc, [0x21] = 0x77,\n-\t\t\t[0x22] = 0xdd, [0x23] = 0x88,\n-\t\t\t[0x24] = 0xee, [0x25] = 0x99,\n-\t\t\t[0x26] = 0xff, [0x27] = 0xaa,\n-\t\t},\n-\t\t{ {0x40, 0xcc } },\n-\t},\n-\t{\n-\t\t\"LD_ABS byte positive offset, all ff\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_B, 0x3f),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0xff, [0x3d] = 0xff,  [0x3e] = 0xff, [0x3f] = 0xff },\n-\t\t{ {0x40, 0xff } },\n-\t},\n-\t{\n-\t\t\"LD_ABS byte positive offset, out of bounds\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_B, 0x3f),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x3f, 0 }, },\n-\t},\n-\t{\n-\t\t\"LD_ABS byte negative offset, out of bounds load\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_B, -1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_EXPECTED_FAIL,\n-\t\t.expected_errcode = -EINVAL,\n-\t},\n-\t{\n-\t\t\"LD_ABS byte negative offset, in bounds\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_B, SKF_LL_OFF + 0x3f),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x40, 0x82 }, },\n-\t},\n-\t{\n-\t\t\"LD_ABS byte negative offset, out of bounds\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_B, SKF_LL_OFF + 0x3f),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x3f, 0 }, },\n-\t},\n-\t{\n-\t\t\"LD_ABS byte negative offset, multiple calls\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_B, SKF_LL_OFF + 0x3c),\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_B, SKF_LL_OFF + 0x3d),\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_B, SKF_LL_OFF + 0x3e),\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_B, SKF_LL_OFF + 0x3f),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x40, 0x82 }, },\n-\t},\n-\t{\n-\t\t\"LD_ABS halfword\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_H, 0x22),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{\n-\t\t\t[0x1c] = 0xaa, [0x1d] = 0x55,\n-\t\t\t[0x1e] = 0xbb, [0x1f] = 0x66,\n-\t\t\t[0x20] = 0xcc, [0x21] = 0x77,\n-\t\t\t[0x22] = 0xdd, [0x23] = 0x88,\n-\t\t\t[0x24] = 0xee, [0x25] = 0x99,\n-\t\t\t[0x26] = 0xff, [0x27] = 0xaa,\n-\t\t},\n-\t\t{ {0x40, 0xdd88 } },\n-\t},\n-\t{\n-\t\t\"LD_ABS halfword unaligned\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_H, 0x25),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{\n-\t\t\t[0x1c] = 0xaa, [0x1d] = 0x55,\n-\t\t\t[0x1e] = 0xbb, [0x1f] = 0x66,\n-\t\t\t[0x20] = 0xcc, [0x21] = 0x77,\n-\t\t\t[0x22] = 0xdd, [0x23] = 0x88,\n-\t\t\t[0x24] = 0xee, [0x25] = 0x99,\n-\t\t\t[0x26] = 0xff, [0x27] = 0xaa,\n-\t\t},\n-\t\t{ {0x40, 0x99ff } },\n-\t},\n-\t{\n-\t\t\"LD_ABS halfword positive offset, all ff\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_H, 0x3e),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0xff, [0x3d] = 0xff,  [0x3e] = 0xff, [0x3f] = 0xff },\n-\t\t{ {0x40, 0xffff } },\n-\t},\n-\t{\n-\t\t\"LD_ABS halfword positive offset, out of bounds\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_H, 0x3f),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x3f, 0 }, },\n-\t},\n-\t{\n-\t\t\"LD_ABS halfword negative offset, out of bounds load\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_H, -1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_EXPECTED_FAIL,\n-\t\t.expected_errcode = -EINVAL,\n-\t},\n-\t{\n-\t\t\"LD_ABS halfword negative offset, in bounds\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_H, SKF_LL_OFF + 0x3e),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x40, 0x1982 }, },\n-\t},\n-\t{\n-\t\t\"LD_ABS halfword negative offset, out of bounds\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_H, SKF_LL_OFF + 0x3e),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x3f, 0 }, },\n-\t},\n-\t{\n-\t\t\"LD_ABS word\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x1c),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{\n-\t\t\t[0x1c] = 0xaa, [0x1d] = 0x55,\n-\t\t\t[0x1e] = 0xbb, [0x1f] = 0x66,\n-\t\t\t[0x20] = 0xcc, [0x21] = 0x77,\n-\t\t\t[0x22] = 0xdd, [0x23] = 0x88,\n-\t\t\t[0x24] = 0xee, [0x25] = 0x99,\n-\t\t\t[0x26] = 0xff, [0x27] = 0xaa,\n-\t\t},\n-\t\t{ {0x40, 0xaa55bb66 } },\n-\t},\n-\t{\n-\t\t\"LD_ABS word unaligned (addr \u0026 3 == 2)\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x22),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{\n-\t\t\t[0x1c] = 0xaa, [0x1d] = 0x55,\n-\t\t\t[0x1e] = 0xbb, [0x1f] = 0x66,\n-\t\t\t[0x20] = 0xcc, [0x21] = 0x77,\n-\t\t\t[0x22] = 0xdd, [0x23] = 0x88,\n-\t\t\t[0x24] = 0xee, [0x25] = 0x99,\n-\t\t\t[0x26] = 0xff, [0x27] = 0xaa,\n-\t\t},\n-\t\t{ {0x40, 0xdd88ee99 } },\n-\t},\n-\t{\n-\t\t\"LD_ABS word unaligned (addr \u0026 3 == 1)\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x21),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{\n-\t\t\t[0x1c] = 0xaa, [0x1d] = 0x55,\n-\t\t\t[0x1e] = 0xbb, [0x1f] = 0x66,\n-\t\t\t[0x20] = 0xcc, [0x21] = 0x77,\n-\t\t\t[0x22] = 0xdd, [0x23] = 0x88,\n-\t\t\t[0x24] = 0xee, [0x25] = 0x99,\n-\t\t\t[0x26] = 0xff, [0x27] = 0xaa,\n-\t\t},\n-\t\t{ {0x40, 0x77dd88ee } },\n-\t},\n-\t{\n-\t\t\"LD_ABS word unaligned (addr \u0026 3 == 3)\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x23),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{\n-\t\t\t[0x1c] = 0xaa, [0x1d] = 0x55,\n-\t\t\t[0x1e] = 0xbb, [0x1f] = 0x66,\n-\t\t\t[0x20] = 0xcc, [0x21] = 0x77,\n-\t\t\t[0x22] = 0xdd, [0x23] = 0x88,\n-\t\t\t[0x24] = 0xee, [0x25] = 0x99,\n-\t\t\t[0x26] = 0xff, [0x27] = 0xaa,\n-\t\t},\n-\t\t{ {0x40, 0x88ee99ff } },\n-\t},\n-\t{\n-\t\t\"LD_ABS word positive offset, all ff\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x3c),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0xff, [0x3d] = 0xff,  [0x3e] = 0xff, [0x3f] = 0xff },\n-\t\t{ {0x40, 0xffffffff } },\n-\t},\n-\t{\n-\t\t\"LD_ABS word positive offset, out of bounds\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x3f),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x3f, 0 }, },\n-\t},\n-\t{\n-\t\t\"LD_ABS word negative offset, out of bounds load\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_W, -1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_EXPECTED_FAIL,\n-\t\t.expected_errcode = -EINVAL,\n-\t},\n-\t{\n-\t\t\"LD_ABS word negative offset, in bounds\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_W, SKF_LL_OFF + 0x3c),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x40, 0x25051982 }, },\n-\t},\n-\t{\n-\t\t\"LD_ABS word negative offset, out of bounds\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_ABS | BPF_W, SKF_LL_OFF + 0x3c),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x3f, 0 }, },\n-\t},\n-\t{\n-\t\t\"LDX_MSH standalone, preserved A\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0xffeebbaa),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3c),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x40, 0xffeebbaa }, },\n-\t},\n-\t{\n-\t\t\"LDX_MSH standalone, preserved A 2\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0x175e9d63),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3c),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3d),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3e),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3f),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x40, 0x175e9d63 }, },\n-\t},\n-\t{\n-\t\t\"LDX_MSH standalone, test result 1\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0xffeebbaa),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3c),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x40, 0x14 }, },\n-\t},\n-\t{\n-\t\t\"LDX_MSH standalone, test result 2\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0xffeebbaa),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3e),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x40, 0x24 }, },\n-\t},\n-\t{\n-\t\t\"LDX_MSH standalone, negative offset\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0xffeebbaa),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_B | BPF_MSH, -1),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x40, 0 }, },\n-\t},\n-\t{\n-\t\t\"LDX_MSH standalone, negative offset 2\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0xffeebbaa),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_B | BPF_MSH, SKF_LL_OFF + 0x3e),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x40, 0x24 }, },\n-\t},\n-\t{\n-\t\t\"LDX_MSH standalone, out of bounds\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0xffeebbaa),\n-\t\t\tBPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x40),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TXA, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC,\n-\t\t{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },\n-\t\t{ {0x40, 0 }, },\n-\t},\n-\t/*\n-\t * verify that the interpreter or JIT correctly sets A and X\n-\t * to 0.\n-\t */\n-\t{\n-\t\t\"ADD default X\",\n-\t\t.u.insns = {\n-\t\t\t/*\n-\t\t\t * A = 0x42\n-\t\t\t * A = A + X\n-\t\t\t * ret A\n-\t\t\t */\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0x42),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{},\n-\t\t{ {0x1, 0x42 } },\n-\t},\n-\t{\n-\t\t\"ADD default A\",\n-\t\t.u.insns = {\n-\t\t\t/*\n-\t\t\t * A = A + 0x42\n-\t\t\t * ret A\n-\t\t\t */\n-\t\t\tBPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 0x42),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{},\n-\t\t{ {0x1, 0x42 } },\n-\t},\n-\t{\n-\t\t\"SUB default X\",\n-\t\t.u.insns = {\n-\t\t\t/*\n-\t\t\t * A = 0x66\n-\t\t\t * A = A - X\n-\t\t\t * ret A\n-\t\t\t */\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0x66),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{},\n-\t\t{ {0x1, 0x66 } },\n-\t},\n-\t{\n-\t\t\"SUB default A\",\n-\t\t.u.insns = {\n-\t\t\t/*\n-\t\t\t * A = A - -0x66\n-\t\t\t * ret A\n-\t\t\t */\n-\t\t\tBPF_STMT(BPF_ALU | BPF_SUB | BPF_K, -0x66),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{},\n-\t\t{ {0x1, 0x66 } },\n-\t},\n-\t{\n-\t\t\"MUL default X\",\n-\t\t.u.insns = {\n-\t\t\t/*\n-\t\t\t * A = 0x42\n-\t\t\t * A = A * X\n-\t\t\t * ret A\n-\t\t\t */\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0x42),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_MUL | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{},\n-\t\t{ {0x1, 0x0 } },\n-\t},\n-\t{\n-\t\t\"MUL default A\",\n-\t\t.u.insns = {\n-\t\t\t/*\n-\t\t\t * A = A * 0x66\n-\t\t\t * ret A\n-\t\t\t */\n-\t\t\tBPF_STMT(BPF_ALU | BPF_MUL | BPF_K, 0x66),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{},\n-\t\t{ {0x1, 0x0 } },\n-\t},\n-\t{\n-\t\t\"DIV default X\",\n-\t\t.u.insns = {\n-\t\t\t/*\n-\t\t\t * A = 0x42\n-\t\t\t * A = A / X ; this halt the filter execution if X is 0\n-\t\t\t * ret 0x42\n-\t\t\t */\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0x42),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_DIV | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 0x42),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{},\n-\t\t{ {0x1, 0x0 } },\n-\t},\n-\t{\n-\t\t\"DIV default A\",\n-\t\t.u.insns = {\n-\t\t\t/*\n-\t\t\t * A = A / 1\n-\t\t\t * ret A\n-\t\t\t */\n-\t\t\tBPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 0x1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{},\n-\t\t{ {0x1, 0x0 } },\n-\t},\n-\t{\n-\t\t\"MOD default X\",\n-\t\t.u.insns = {\n-\t\t\t/*\n-\t\t\t * A = 0x42\n-\t\t\t * A = A mod X ; this halt the filter execution if X is 0\n-\t\t\t * ret 0x42\n-\t\t\t */\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0x42),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_MOD | BPF_X, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 0x42),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{},\n-\t\t{ {0x1, 0x0 } },\n-\t},\n-\t{\n-\t\t\"MOD default A\",\n-\t\t.u.insns = {\n-\t\t\t/*\n-\t\t\t * A = A mod 1\n-\t\t\t * ret A\n-\t\t\t */\n-\t\t\tBPF_STMT(BPF_ALU | BPF_MOD | BPF_K, 0x1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_A, 0x0),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{},\n-\t\t{ {0x1, 0x0 } },\n-\t},\n-\t{\n-\t\t\"JMP EQ default A\",\n-\t\t.u.insns = {\n-\t\t\t/*\n-\t\t\t * cmp A, 0x0, 0, 1\n-\t\t\t * ret 0x42\n-\t\t\t * ret 0x66\n-\t\t\t */\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x0, 0, 1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 0x42),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 0x66),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{},\n-\t\t{ {0x1, 0x42 } },\n-\t},\n-\t{\n-\t\t\"JMP EQ default X\",\n-\t\t.u.insns = {\n-\t\t\t/*\n-\t\t\t * A = 0x0\n-\t\t\t * cmp A, X, 0, 1\n-\t\t\t * ret 0x42\n-\t\t\t * ret 0x66\n-\t\t\t */\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0x0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_X, 0x0, 0, 1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 0x42),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 0x66),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{},\n-\t\t{ {0x1, 0x42 } },\n-\t},\n-\t/* Checking interpreter vs JIT wrt signed extended imms. */\n-\t{\n-\t\t\"JNE signed compare, test 1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0xfefbbc12),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R3, 0xffff0000),\n-\t\t\tBPF_MOV64_REG(R2, R1),\n-\t\t\tBPF_ALU64_REG(BPF_AND, R2, R3),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R2, -17104896, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JNE signed compare, test 2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0xfefbbc12),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R3, 0xffff0000),\n-\t\t\tBPF_MOV64_REG(R2, R1),\n-\t\t\tBPF_ALU64_REG(BPF_AND, R2, R3),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R2, 0xfefb0000, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JNE signed compare, test 3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R1, 0xfefbbc12),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R3, 0xffff0000),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R4, 0xfefb0000),\n-\t\t\tBPF_MOV64_REG(R2, R1),\n-\t\t\tBPF_ALU64_REG(BPF_AND, R2, R3),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R2, R4, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"JNE signed compare, test 4\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, -17104896),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R1, -17104896, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"JNE signed compare, test 5\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0xfefb0000),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R1, 0xfefb0000, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JNE signed compare, test 6\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x7efb0000),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R1, 0x7efb0000, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, 2),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t},\n-\t{\n-\t\t\"JNE signed compare, test 7\",\n-\t\t.u.insns = {\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0xffff0000),\n-\t\t\tBPF_STMT(BPF_MISC | BPF_TAX, 0),\n-\t\t\tBPF_STMT(BPF_LD | BPF_IMM, 0xfefbbc12),\n-\t\t\tBPF_STMT(BPF_ALU | BPF_AND | BPF_X, 0),\n-\t\t\tBPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0xfefb0000, 1, 0),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 1),\n-\t\t\tBPF_STMT(BPF_RET | BPF_K, 2),\n-\t\t},\n-\t\tCLASSIC | FLAG_NO_DATA,\n-\t\t{},\n-\t\t{ { 0, 2 } },\n-\t},\n-\t/* BPF_LDX_MEM with operand aliasing */\n-\t{\n-\t\t\"LDX_MEM_B: operand register aliasing\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ST_MEM(BPF_B, R10, -8, 123),\n-\t\t\tBPF_MOV64_REG(R0, R10),\n-\t\t\tBPF_LDX_MEM(BPF_B, R0, R0, -8),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 123 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"LDX_MEM_H: operand register aliasing\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ST_MEM(BPF_H, R10, -8, 12345),\n-\t\t\tBPF_MOV64_REG(R0, R10),\n-\t\t\tBPF_LDX_MEM(BPF_H, R0, R0, -8),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 12345 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"LDX_MEM_W: operand register aliasing\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ST_MEM(BPF_W, R10, -8, 123456789),\n-\t\t\tBPF_MOV64_REG(R0, R10),\n-\t\t\tBPF_LDX_MEM(BPF_W, R0, R0, -8),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 123456789 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"LDX_MEM_DW: operand register aliasing\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x123456789abcdefULL),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-\t\t\tBPF_MOV64_REG(R0, R10),\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, R0, -8),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R1),\n-\t\t\tBPF_MOV64_REG(R1, R0),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R1, 32),\n-\t\t\tBPF_ALU64_REG(BPF_OR, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t/*\n-\t * Register (non-)clobbering tests for the case where a JIT implements\n-\t * complex ALU or ATOMIC operations via function calls. If so, the\n-\t * function call must be transparent to the eBPF registers. The JIT\n-\t * must therefore save and restore relevant registers across the call.\n-\t * The following tests check that the eBPF registers retain their\n-\t * values after such an operation. Mainly intended for complex ALU\n-\t * and atomic operation, but we run it for all. You never know...\n-\t *\n-\t * Note that each operations should be tested twice with different\n-\t * destinations, to check preservation for all registers.\n-\t */\n-#define BPF_TEST_CLOBBER_ALU(alu, op, dst, src)\t\t\t\\\n-\t{\t\t\t\t\t\t\t\\\n-\t\t#alu \"_\" #op \" to \" #dst \": no clobbering\",\t\\\n-\t\t.u.insns_int = {\t\t\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, R0),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R1, R1),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R2, R2),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R3, R3),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R4, R4),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R5, R5),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R6, R6),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R7, R7),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R8, R8),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R9, R9),\t\t\\\n-\t\t\tBPF_##alu(BPF_ ##op, dst, src),\t\t\\\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, dst, dst),\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R0, R0, 10),\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R1, R1, 9),\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R2, R2, 8),\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R3, R3, 7),\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R4, R4, 6),\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R5, R5, 5),\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R6, R6, 4),\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R7, R7, 3),\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R8, R8, 2),\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R9, R9, 1),\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\t\t\\\n-\t\t\tBPF_EXIT_INSN(),\t\t\t\\\n-\t\t},\t\t\t\t\t\t\\\n-\t\tINTERNAL,\t\t\t\t\t\\\n-\t\t{ },\t\t\t\t\t\t\\\n-\t\t{ { 0, 1 } }\t\t\t\t\t\\\n-\t}\n-\t/* ALU64 operations, register clobbering */\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, AND, R8, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, AND, R9, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, OR, R8, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, OR, R9, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, XOR, R8, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, XOR, R9, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, LSH, R8, 12),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, LSH, R9, 12),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, RSH, R8, 12),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, RSH, R9, 12),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, ARSH, R8, 12),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, ARSH, R9, 12),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, ADD, R8, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, ADD, R9, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, SUB, R8, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, SUB, R9, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, MUL, R8, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, MUL, R9, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, DIV, R8, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, DIV, R9, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, MOD, R8, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_IMM, MOD, R9, 123456789),\n-\t/* ALU32 immediate operations, register clobbering */\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, AND, R8, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, AND, R9, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, OR, R8, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, OR, R9, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, XOR, R8, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, XOR, R9, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, LSH, R8, 12),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, LSH, R9, 12),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, RSH, R8, 12),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, RSH, R9, 12),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, ARSH, R8, 12),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, ARSH, R9, 12),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, ADD, R8, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, ADD, R9, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, SUB, R8, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, SUB, R9, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, MUL, R8, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, MUL, R9, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, DIV, R8, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, DIV, R9, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, MOD, R8, 123456789),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_IMM, MOD, R9, 123456789),\n-\t/* ALU64 register operations, register clobbering */\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, AND, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, AND, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, OR, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, OR, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, XOR, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, XOR, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, LSH, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, LSH, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, RSH, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, RSH, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, ARSH, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, ARSH, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, ADD, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, ADD, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, SUB, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, SUB, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, MUL, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, MUL, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, DIV, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, DIV, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, MOD, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU64_REG, MOD, R9, R1),\n-\t/* ALU32 register operations, register clobbering */\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, AND, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, AND, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, OR, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, OR, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, XOR, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, XOR, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, LSH, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, LSH, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, RSH, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, RSH, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, ARSH, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, ARSH, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, ADD, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, ADD, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, SUB, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, SUB, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, MUL, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, MUL, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, DIV, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, DIV, R9, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, MOD, R8, R1),\n-\tBPF_TEST_CLOBBER_ALU(ALU32_REG, MOD, R9, R1),\n-#undef BPF_TEST_CLOBBER_ALU\n-#define BPF_TEST_CLOBBER_ATOMIC(width, op)\t\t\t\\\n-\t{\t\t\t\t\t\t\t\\\n-\t\t\"Atomic_\" #width \" \" #op \": no clobbering\",\t\\\n-\t\t.u.insns_int = {\t\t\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R1, 1),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R2, 2),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R3, 3),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R4, 4),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R5, 5),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R6, 6),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R7, 7),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R8, 8),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R9, 9),\t\t\\\n-\t\t\tBPF_ST_MEM(width, R10, -8,\t\t\\\n-\t\t\t\t   (op) == BPF_CMPXCHG ? 0 :\t\\\n-\t\t\t\t   (op) \u0026 BPF_FETCH ? 1 : 0),\t\\\n-\t\t\tBPF_ATOMIC_OP(width, op, R10, R1, -8),\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R0, 0, 10),\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R1, 1, 9),\t\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R2, 2, 8),\t\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R3, 3, 7),\t\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R4, 4, 6),\t\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R5, 5, 5),\t\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R6, 6, 4),\t\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R7, 7, 3),\t\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R8, 8, 2),\t\t\\\n-\t\t\tBPF_JMP_IMM(BPF_JNE, R9, 9, 1),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\t\t\\\n-\t\t\tBPF_EXIT_INSN(),\t\t\t\\\n-\t\t},\t\t\t\t\t\t\\\n-\t\tINTERNAL,\t\t\t\t\t\\\n-\t\t{ },\t\t\t\t\t\t\\\n-\t\t{ { 0, 1 } },\t\t\t\t\t\\\n-\t\t.stack_depth = 8,\t\t\t\t\\\n-\t}\n-\t/* 64-bit atomic operations, register clobbering */\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_ADD),\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_AND),\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_OR),\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_XOR),\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_ADD | BPF_FETCH),\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_AND | BPF_FETCH),\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_OR | BPF_FETCH),\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_XOR | BPF_FETCH),\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_XCHG),\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_CMPXCHG),\n-\t/* 32-bit atomic operations, register clobbering */\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_ADD),\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_AND),\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_OR),\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_XOR),\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_ADD | BPF_FETCH),\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_AND | BPF_FETCH),\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_OR | BPF_FETCH),\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_XOR | BPF_FETCH),\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_XCHG),\n-\tBPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_CMPXCHG),\n-#undef BPF_TEST_CLOBBER_ATOMIC\n-\t/* Checking that ALU32 src is not zero extended in place */\n-#define BPF_ALU32_SRC_ZEXT(op)\t\t\t\t\t\\\n-\t{\t\t\t\t\t\t\t\\\n-\t\t\"ALU32_\" #op \"_X: src preserved in zext\",\t\\\n-\t\t.u.insns_int = {\t\t\t\t\\\n-\t\t\tBPF_LD_IMM64(R1, 0x0123456789acbdefULL),\\\n-\t\t\tBPF_LD_IMM64(R2, 0xfedcba9876543210ULL),\\\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R0, R1),\t\t\\\n-\t\t\tBPF_ALU32_REG(BPF_##op, R2, R1),\t\\\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R1),\t\t\\\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R1, R0),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R1, 32),\t\t\\\n-\t\t\tBPF_ALU64_REG(BPF_OR, R0, R1),\t\t\\\n-\t\t\tBPF_EXIT_INSN(),\t\t\t\\\n-\t\t},\t\t\t\t\t\t\\\n-\t\tINTERNAL,\t\t\t\t\t\\\n-\t\t{ },\t\t\t\t\t\t\\\n-\t\t{ { 0, 0 } },\t\t\t\t\t\\\n-\t}\n-\tBPF_ALU32_SRC_ZEXT(MOV),\n-\tBPF_ALU32_SRC_ZEXT(AND),\n-\tBPF_ALU32_SRC_ZEXT(OR),\n-\tBPF_ALU32_SRC_ZEXT(XOR),\n-\tBPF_ALU32_SRC_ZEXT(ADD),\n-\tBPF_ALU32_SRC_ZEXT(SUB),\n-\tBPF_ALU32_SRC_ZEXT(MUL),\n-\tBPF_ALU32_SRC_ZEXT(DIV),\n-\tBPF_ALU32_SRC_ZEXT(MOD),\n-#undef BPF_ALU32_SRC_ZEXT\n-\t/* Checking that ATOMIC32 src is not zero extended in place */\n-#define BPF_ATOMIC32_SRC_ZEXT(op)\t\t\t\t\t\\\n-\t{\t\t\t\t\t\t\t\t\\\n-\t\t\"ATOMIC_W_\" #op \": src preserved in zext\",\t\t\\\n-\t\t.u.insns_int = {\t\t\t\t\t\\\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789acbdefULL),\t\\\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R1, R0),\t\t\t\\\n-\t\t\tBPF_ST_MEM(BPF_W, R10, -4, 0),\t\t\t\\\n-\t\t\tBPF_ATOMIC_OP(BPF_W, BPF_##op, R10, R1, -4),\t\\\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R1),\t\t\t\\\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R1, R0),\t\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R1, 32),\t\t\t\\\n-\t\t\tBPF_ALU64_REG(BPF_OR, R0, R1),\t\t\t\\\n-\t\t\tBPF_EXIT_INSN(),\t\t\t\t\\\n-\t\t},\t\t\t\t\t\t\t\\\n-\t\tINTERNAL,\t\t\t\t\t\t\\\n-\t\t{ },\t\t\t\t\t\t\t\\\n-\t\t{ { 0, 0 } },\t\t\t\t\t\t\\\n-\t\t.stack_depth = 8,\t\t\t\t\t\\\n-\t}\n-\tBPF_ATOMIC32_SRC_ZEXT(ADD),\n-\tBPF_ATOMIC32_SRC_ZEXT(AND),\n-\tBPF_ATOMIC32_SRC_ZEXT(OR),\n-\tBPF_ATOMIC32_SRC_ZEXT(XOR),\n-#undef BPF_ATOMIC32_SRC_ZEXT\n-\t/* Checking that CMPXCHG32 src is not zero extended in place */\n-\t{\n-\t\t\"ATOMIC_W_CMPXCHG: src preserved in zext\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_LD_IMM64(R1, 0x0123456789acbdefULL),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R2, R1),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R0, 0),\n-\t\t\tBPF_ST_MEM(BPF_W, R10, -4, 0),\n-\t\t\tBPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R1, -4),\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R1, R2),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R2, R1),\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R2, 32),\n-\t\t\tBPF_ALU64_REG(BPF_OR, R1, R2),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R0, R1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t\t.stack_depth = 8,\n-\t},\n-\t/* Checking that JMP32 immediate src is not zero extended in place */\n-#define BPF_JMP32_IMM_ZEXT(op)\t\t\t\t\t\\\n-\t{\t\t\t\t\t\t\t\\\n-\t\t\"JMP32_\" #op \"_K: operand preserved in zext\",\t\\\n-\t\t.u.insns_int = {\t\t\t\t\\\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789acbdefULL),\\\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R1, R0),\t\t\\\n-\t\t\tBPF_JMP32_IMM(BPF_##op, R0, 1234, 1),\t\\\n-\t\t\tBPF_JMP_A(0), /* Nop */\t\t\t\\\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R1),\t\t\\\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R1, R0),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R1, 32),\t\t\\\n-\t\t\tBPF_ALU64_REG(BPF_OR, R0, R1),\t\t\\\n-\t\t\tBPF_EXIT_INSN(),\t\t\t\\\n-\t\t},\t\t\t\t\t\t\\\n-\t\tINTERNAL,\t\t\t\t\t\\\n-\t\t{ },\t\t\t\t\t\t\\\n-\t\t{ { 0, 0 } },\t\t\t\t\t\\\n-\t}\n-\tBPF_JMP32_IMM_ZEXT(JEQ),\n-\tBPF_JMP32_IMM_ZEXT(JNE),\n-\tBPF_JMP32_IMM_ZEXT(JSET),\n-\tBPF_JMP32_IMM_ZEXT(JGT),\n-\tBPF_JMP32_IMM_ZEXT(JGE),\n-\tBPF_JMP32_IMM_ZEXT(JLT),\n-\tBPF_JMP32_IMM_ZEXT(JLE),\n-\tBPF_JMP32_IMM_ZEXT(JSGT),\n-\tBPF_JMP32_IMM_ZEXT(JSGE),\n-\tBPF_JMP32_IMM_ZEXT(JSLT),\n-\tBPF_JMP32_IMM_ZEXT(JSLE),\n-#undef BPF_JMP2_IMM_ZEXT\n-\t/* Checking that JMP32 dst \u0026 src are not zero extended in place */\n-#define BPF_JMP32_REG_ZEXT(op)\t\t\t\t\t\\\n-\t{\t\t\t\t\t\t\t\\\n-\t\t\"JMP32_\" #op \"_X: operands preserved in zext\",\t\\\n-\t\t.u.insns_int = {\t\t\t\t\\\n-\t\t\tBPF_LD_IMM64(R0, 0x0123456789acbdefULL),\\\n-\t\t\tBPF_LD_IMM64(R1, 0xfedcba9876543210ULL),\\\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R2, R0),\t\t\\\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R3, R1),\t\t\\\n-\t\t\tBPF_JMP32_IMM(BPF_##op, R0, R1, 1),\t\\\n-\t\t\tBPF_JMP_A(0), /* Nop */\t\t\t\\\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R0, R2),\t\t\\\n-\t\t\tBPF_ALU64_REG(BPF_SUB, R1, R3),\t\t\\\n-\t\t\tBPF_ALU64_REG(BPF_OR, R0, R1),\t\t\\\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R1, R0),\t\t\\\n-\t\t\tBPF_ALU64_IMM(BPF_RSH, R1, 32),\t\t\\\n-\t\t\tBPF_ALU64_REG(BPF_OR, R0, R1),\t\t\\\n-\t\t\tBPF_EXIT_INSN(),\t\t\t\\\n-\t\t},\t\t\t\t\t\t\\\n-\t\tINTERNAL,\t\t\t\t\t\\\n-\t\t{ },\t\t\t\t\t\t\\\n-\t\t{ { 0, 0 } },\t\t\t\t\t\\\n-\t}\n-\tBPF_JMP32_REG_ZEXT(JEQ),\n-\tBPF_JMP32_REG_ZEXT(JNE),\n-\tBPF_JMP32_REG_ZEXT(JSET),\n-\tBPF_JMP32_REG_ZEXT(JGT),\n-\tBPF_JMP32_REG_ZEXT(JGE),\n-\tBPF_JMP32_REG_ZEXT(JLT),\n-\tBPF_JMP32_REG_ZEXT(JLE),\n-\tBPF_JMP32_REG_ZEXT(JSGT),\n-\tBPF_JMP32_REG_ZEXT(JSGE),\n-\tBPF_JMP32_REG_ZEXT(JSLT),\n-\tBPF_JMP32_REG_ZEXT(JSLE),\n-#undef BPF_JMP2_REG_ZEXT\n-\t/* ALU64 K register combinations */\n-\t{\n-\t\t\"ALU64_MOV_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_mov_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU64_AND_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_and_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU64_OR_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_or_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU64_XOR_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_xor_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_lsh_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_rsh_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_arsh_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU64_ADD_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_add_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU64_SUB_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_sub_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU64_MUL_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_mul_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU64_DIV_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_div_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU64_MOD_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_mod_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU64_SDIV_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_sdiv_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU64_SMOD_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_smod_imm_regs,\n-\t},\n-\t/* ALU32 K registers */\n-\t{\n-\t\t\"ALU32_MOV_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_mov_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU32_AND_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_and_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU32_OR_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_or_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU32_XOR_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_xor_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU32_LSH_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_lsh_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU32_RSH_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_rsh_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU32_ARSH_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_arsh_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU32_ADD_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_add_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU32_SUB_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_sub_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU32_MUL_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_mul_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU32_DIV_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_div_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU32_MOD_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_mod_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU32_SDIV_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_sdiv_imm_regs,\n-\t},\n-\t{\n-\t\t\"ALU32_SMOD_K: registers\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_smod_imm_regs,\n-\t},\n-\t/* ALU64 X register combinations */\n-\t{\n-\t\t\"ALU64_MOV_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_mov_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU64_AND_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_and_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU64_OR_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_or_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU64_XOR_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_xor_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_lsh_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_rsh_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_arsh_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU64_ADD_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_add_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU64_SUB_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_sub_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU64_MUL_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_mul_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU64_DIV_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_div_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU64_MOD_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_mod_reg_pairs,\n-\t},\n-\t/* ALU32 X register combinations */\n-\t{\n-\t\t\"ALU32_MOV_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_mov_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU32_AND_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_and_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU32_OR_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_or_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU32_XOR_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_xor_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU32_LSH_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_lsh_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU32_RSH_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_rsh_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU32_ARSH_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_arsh_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU32_ADD_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_add_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU32_SUB_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_sub_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU32_MUL_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_mul_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU32_DIV_X: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_div_reg_pairs,\n-\t},\n-\t{\n-\t\t\"ALU32_MOD_X register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_mod_reg_pairs,\n-\t},\n-\t/* Exhaustive test of ALU64 shift operations */\n-\t{\n-\t\t\"ALU64_LSH_K: all shift values\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_lsh_imm,\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_K: all shift values\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_rsh_imm,\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_K: all shift values\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_arsh_imm,\n-\t},\n-\t{\n-\t\t\"ALU64_LSH_X: all shift values\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_lsh_reg,\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_X: all shift values\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_rsh_reg,\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_X: all shift values\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_arsh_reg,\n-\t},\n-\t/* Exhaustive test of ALU32 shift operations */\n-\t{\n-\t\t\"ALU32_LSH_K: all shift values\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_lsh_imm,\n-\t},\n-\t{\n-\t\t\"ALU32_RSH_K: all shift values\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_rsh_imm,\n-\t},\n-\t{\n-\t\t\"ALU32_ARSH_K: all shift values\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_arsh_imm,\n-\t},\n-\t{\n-\t\t\"ALU32_LSH_X: all shift values\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_lsh_reg,\n-\t},\n-\t{\n-\t\t\"ALU32_RSH_X: all shift values\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_rsh_reg,\n-\t},\n-\t{\n-\t\t\"ALU32_ARSH_X: all shift values\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_arsh_reg,\n-\t},\n-\t/*\n-\t * Exhaustive test of ALU64 shift operations when\n-\t * source and destination register are the same.\n-\t */\n-\t{\n-\t\t\"ALU64_LSH_X: all shift values with the same register\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_lsh_same_reg,\n-\t},\n-\t{\n-\t\t\"ALU64_RSH_X: all shift values with the same register\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_rsh_same_reg,\n-\t},\n-\t{\n-\t\t\"ALU64_ARSH_X: all shift values with the same register\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_arsh_same_reg,\n-\t},\n-\t/*\n-\t * Exhaustive test of ALU32 shift operations when\n-\t * source and destination register are the same.\n-\t */\n-\t{\n-\t\t\"ALU32_LSH_X: all shift values with the same register\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_lsh_same_reg,\n-\t},\n-\t{\n-\t\t\"ALU32_RSH_X: all shift values with the same register\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_rsh_same_reg,\n-\t},\n-\t{\n-\t\t\"ALU32_ARSH_X: all shift values with the same register\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_arsh_same_reg,\n-\t},\n-\t/* ALU64 immediate magnitudes */\n-\t{\n-\t\t\"ALU64_MOV_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_mov_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU64_AND_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_and_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU64_OR_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_or_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU64_XOR_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_xor_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU64_ADD_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_add_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU64_SUB_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_sub_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU64_MUL_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_mul_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU64_DIV_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_div_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU64_MOD_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_mod_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU64_SDIV_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_sdiv_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU64_SMOD_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_smod_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t/* ALU32 immediate magnitudes */\n-\t{\n-\t\t\"ALU32_MOV_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_mov_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU32_AND_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_and_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU32_OR_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_or_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU32_XOR_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_xor_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU32_ADD_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_add_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU32_SUB_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_sub_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU32_MUL_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_mul_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU32_DIV_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_div_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU32_MOD_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_mod_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU32_SDIV_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_sdiv_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU32_SMOD_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_smod_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t/* ALU64 register magnitudes */\n-\t{\n-\t\t\"ALU64_MOV_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_mov_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU64_AND_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_and_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU64_OR_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_or_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU64_XOR_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_xor_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU64_ADD_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_add_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU64_SUB_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_sub_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU64_MUL_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_mul_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU64_DIV_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_div_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU64_MOD_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu64_mod_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t/* ALU32 register magnitudes */\n-\t{\n-\t\t\"ALU32_MOV_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_mov_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU32_AND_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_and_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU32_OR_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_or_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU32_XOR_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_xor_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU32_ADD_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_add_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU32_SUB_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_sub_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU32_MUL_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_mul_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU32_DIV_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_div_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ALU32_MOD_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_alu32_mod_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t/* LD_IMM64 immediate magnitudes and byte patterns */\n-\t{\n-\t\t\"LD_IMM64: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_ld_imm64_magn,\n-\t},\n-\t{\n-\t\t\"LD_IMM64: checker byte patterns\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_ld_imm64_checker,\n-\t},\n-\t{\n-\t\t\"LD_IMM64: random positive and zero byte patterns\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_ld_imm64_pos_zero,\n-\t},\n-\t{\n-\t\t\"LD_IMM64: random negative and zero byte patterns\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_ld_imm64_neg_zero,\n-\t},\n-\t{\n-\t\t\"LD_IMM64: random positive and negative byte patterns\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_ld_imm64_pos_neg,\n-\t},\n-\t/* 64-bit ATOMIC register combinations */\n-\t{\n-\t\t\"ATOMIC_DW_ADD: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_add_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"ATOMIC_DW_AND: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_and_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"ATOMIC_DW_OR: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_or_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"ATOMIC_DW_XOR: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_xor_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"ATOMIC_DW_ADD_FETCH: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_add_fetch_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"ATOMIC_DW_AND_FETCH: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_and_fetch_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"ATOMIC_DW_OR_FETCH: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_or_fetch_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"ATOMIC_DW_XOR_FETCH: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_xor_fetch_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"ATOMIC_DW_XCHG: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_xchg_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"ATOMIC_DW_CMPXCHG: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_cmpxchg_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t/* 32-bit ATOMIC register combinations */\n-\t{\n-\t\t\"ATOMIC_W_ADD: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_add_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"ATOMIC_W_AND: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_and_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"ATOMIC_W_OR: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_or_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"ATOMIC_W_XOR: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_xor_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"ATOMIC_W_ADD_FETCH: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_add_fetch_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"ATOMIC_W_AND_FETCH: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_and_fetch_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"ATOMIC_W_OR_FETCH: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_or_fetch_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"ATOMIC_W_XOR_FETCH: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_xor_fetch_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"ATOMIC_W_XCHG: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_xchg_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t{\n-\t\t\"ATOMIC_W_CMPXCHG: register combinations\",\n-\t\t{ },\n-\t\tINTERNAL,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_cmpxchg_reg_pairs,\n-\t\t.stack_depth = 8,\n-\t},\n-\t/* 64-bit ATOMIC magnitudes */\n-\t{\n-\t\t\"ATOMIC_DW_ADD: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_add,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ATOMIC_DW_AND: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_and,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ATOMIC_DW_OR: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_or,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ATOMIC_DW_XOR: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_xor,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ATOMIC_DW_ADD_FETCH: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_add_fetch,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ATOMIC_DW_AND_FETCH: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_and_fetch,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ATOMIC_DW_OR_FETCH: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_or_fetch,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ATOMIC_DW_XOR_FETCH: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_xor_fetch,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ATOMIC_DW_XCHG: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic64_xchg,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ATOMIC_DW_CMPXCHG: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_cmpxchg64,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t/* 32-bit atomic magnitudes */\n-\t{\n-\t\t\"ATOMIC_W_ADD: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_add,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ATOMIC_W_AND: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_and,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ATOMIC_W_OR: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_or,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ATOMIC_W_XOR: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_xor,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ATOMIC_W_ADD_FETCH: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_add_fetch,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ATOMIC_W_AND_FETCH: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_and_fetch,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ATOMIC_W_OR_FETCH: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_or_fetch,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ATOMIC_W_XOR_FETCH: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_xor_fetch,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ATOMIC_W_XCHG: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_atomic32_xchg,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"ATOMIC_W_CMPXCHG: all operand magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_cmpxchg32,\n-\t\t.stack_depth = 8,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t/* JMP immediate magnitudes */\n-\t{\n-\t\t\"JMP_JSET_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jset_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JEQ_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jeq_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JNE_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jne_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JGT_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jgt_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JGE_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jge_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JLT_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jlt_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JLE_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jle_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JSGT_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jsgt_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JSGE_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jsge_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JSLT_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jslt_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JSLE_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jsle_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t/* JMP register magnitudes */\n-\t{\n-\t\t\"JMP_JSET_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jset_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JEQ_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jeq_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JNE_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jne_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JGT_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jgt_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JGE_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jge_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JLT_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jlt_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JLE_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jle_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JSGT_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jsgt_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JSGE_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jsge_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JSLT_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jslt_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP_JSLE_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp_jsle_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t/* JMP32 immediate magnitudes */\n-\t{\n-\t\t\"JMP32_JSET_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jset_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JEQ_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jeq_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JNE_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jne_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JGT_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jgt_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JGE_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jge_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JLT_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jlt_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JLE_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jle_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JSGT_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jsgt_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JSGE_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jsge_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JSLT_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jslt_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JSLE_K: all immediate value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jsle_imm,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t/* JMP32 register magnitudes */\n-\t{\n-\t\t\"JMP32_JSET_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jset_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JEQ_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jeq_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JNE_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jne_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JGT_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jgt_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JGE_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jge_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JLT_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jlt_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JLE_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jle_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JSGT_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jsgt_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JSGE_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jsge_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JSLT_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jslt_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t{\n-\t\t\"JMP32_JSLE_X: all register value magnitudes\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_jmp32_jsle_reg,\n-\t\t.nr_testruns = NR_PATTERN_RUNS,\n-\t},\n-\t/* Conditional jumps with constant decision */\n-\t{\n-\t\t\"JMP_JSET_K: imm = 0 -\u003e never taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_IMM(BPF_JSET, R1, 0, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t},\n-\t{\n-\t\t\"JMP_JLT_K: imm = 0 -\u003e never taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_IMM(BPF_JLT, R1, 0, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t},\n-\t{\n-\t\t\"JMP_JGE_K: imm = 0 -\u003e always taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_IMM(BPF_JGE, R1, 0, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JGT_K: imm = 0xffffffff -\u003e never taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_IMM(BPF_JGT, R1, U32_MAX, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t},\n-\t{\n-\t\t\"JMP_JLE_K: imm = 0xffffffff -\u003e always taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_IMM(BPF_JLE, R1, U32_MAX, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP32_JSGT_K: imm = 0x7fffffff -\u003e never taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JSGT, R1, S32_MAX, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t},\n-\t{\n-\t\t\"JMP32_JSGE_K: imm = -0x80000000 -\u003e always taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JSGE, R1, S32_MIN, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP32_JSLT_K: imm = -0x80000000 -\u003e never taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JSLT, R1, S32_MIN, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t},\n-\t{\n-\t\t\"JMP32_JSLE_K: imm = 0x7fffffff -\u003e always taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP32_IMM(BPF_JSLE, R1, S32_MAX, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JEQ_X: dst = src -\u003e always taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_REG(BPF_JEQ, R1, R1, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JGE_X: dst = src -\u003e always taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_REG(BPF_JGE, R1, R1, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JLE_X: dst = src -\u003e always taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_REG(BPF_JLE, R1, R1, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JSGE_X: dst = src -\u003e always taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_REG(BPF_JSGE, R1, R1, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JSLE_X: dst = src -\u003e always taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_REG(BPF_JSLE, R1, R1, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t},\n-\t{\n-\t\t\"JMP_JNE_X: dst = src -\u003e never taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R1, R1, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t},\n-\t{\n-\t\t\"JMP_JGT_X: dst = src -\u003e never taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_REG(BPF_JGT, R1, R1, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t},\n-\t{\n-\t\t\"JMP_JLT_X: dst = src -\u003e never taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_REG(BPF_JLT, R1, R1, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t},\n-\t{\n-\t\t\"JMP_JSGT_X: dst = src -\u003e never taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_REG(BPF_JSGT, R1, R1, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t},\n-\t{\n-\t\t\"JMP_JSLT_X: dst = src -\u003e never taken\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 1),\n-\t\t\tBPF_JMP_REG(BPF_JSLT, R1, R1, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t},\n-\t/* Short relative jumps */\n-\t{\n-\t\t\"Short relative jump: offset=0\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R0, 0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -1),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA | FLAG_VERIFIER_ZEXT,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t},\n-\t{\n-\t\t\"Short relative jump: offset=1\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R0, 0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -1),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA | FLAG_VERIFIER_ZEXT,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t},\n-\t{\n-\t\t\"Short relative jump: offset=2\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R0, 0, 2),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -1),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA | FLAG_VERIFIER_ZEXT,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t},\n-\t{\n-\t\t\"Short relative jump: offset=3\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R0, 0, 3),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -1),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA | FLAG_VERIFIER_ZEXT,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t},\n-\t{\n-\t\t\"Short relative jump: offset=4\",\n-\t\t.u.insns_int = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_JMP_IMM(BPF_JEQ, R0, 0, 4),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R0, 1),\n-\t\t\tBPF_ALU32_IMM(BPF_ADD, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t\tBPF_ALU32_IMM(BPF_MOV, R0, -1),\n-\t\t},\n-\t\tINTERNAL | FLAG_NO_DATA | FLAG_VERIFIER_ZEXT,\n-\t\t{ },\n-\t\t{ { 0, 0 } },\n-\t},\n-\t/* Conditional branch conversions */\n-\t{\n-\t\t\"Long conditional jump: taken at runtime (32 bits)\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_max_jmp_taken_32,\n-\t},\n-\t{\n-\t\t\"Long conditional jump: not taken at runtime (32 bits)\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t\t.fill_helper = bpf_fill_max_jmp_not_taken_32,\n-\t},\n-\t{\n-\t\t\"Long conditional jump: always taken, known at JIT time (32 bits)\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_max_jmp_always_taken_32,\n-\t},\n-\t{\n-\t\t\"Long conditional jump: never taken, known at JIT time (32 bits)\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t\t.fill_helper = bpf_fill_max_jmp_never_taken_32,\n-\t},\n-\t{\n-\t\t\"Long conditional jump: taken at runtime\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_max_jmp_taken,\n-\t},\n-\t{\n-\t\t\"Long conditional jump: not taken at runtime\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t\t.fill_helper = bpf_fill_max_jmp_not_taken,\n-\t},\n-\t{\n-\t\t\"Long conditional jump: always taken, known at JIT time\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 1 } },\n-\t\t.fill_helper = bpf_fill_max_jmp_always_taken,\n-\t},\n-\t{\n-\t\t\"Long conditional jump: never taken, known at JIT time\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, 2 } },\n-\t\t.fill_helper = bpf_fill_max_jmp_never_taken,\n-\t},\n-\t/* Staggered jump sequences, immediate */\n-\t{\n-\t\t\"Staggered jumps: JMP_JA\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_ja,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JEQ_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jeq_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JNE_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jne_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JSET_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jset_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JGT_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jgt_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JGE_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jge_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JLT_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jlt_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JLE_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jle_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JSGT_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jsgt_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JSGE_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jsge_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JSLT_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jslt_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JSLE_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jsle_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t/* Staggered jump sequences, register */\n-\t{\n-\t\t\"Staggered jumps: JMP_JEQ_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jeq_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JNE_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jne_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JSET_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jset_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JGT_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jgt_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JGE_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jge_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JLT_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jlt_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JLE_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jle_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JSGT_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jsgt_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JSGE_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jsge_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JSLT_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jslt_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP_JSLE_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jsle_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t/* Staggered jump sequences, JMP32 immediate */\n-\t{\n-\t\t\"Staggered jumps: JMP32_JEQ_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jeq32_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JNE_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jne32_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JSET_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jset32_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JGT_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jgt32_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JGE_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jge32_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JLT_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jlt32_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JLE_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jle32_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JSGT_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jsgt32_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JSGE_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jsge32_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JSLT_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jslt32_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JSLE_K\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jsle32_imm,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t/* Staggered jump sequences, JMP32 register */\n-\t{\n-\t\t\"Staggered jumps: JMP32_JEQ_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jeq32_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JNE_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jne32_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JSET_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jset32_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JGT_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jgt32_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JGE_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jge32_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JLT_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jlt32_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JLE_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jle32_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JSGT_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jsgt32_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JSGE_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jsge32_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JSLT_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jslt32_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-\t{\n-\t\t\"Staggered jumps: JMP32_JSLE_X\",\n-\t\t{ },\n-\t\tINTERNAL | FLAG_NO_DATA,\n-\t\t{ },\n-\t\t{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },\n-\t\t.fill_helper = bpf_fill_staggered_jsle32_reg,\n-\t\t.nr_testruns = NR_STAGGERED_JMP_RUNS,\n-\t},\n-};\n-\n-static struct net_device dev;\n-\n-static struct sk_buff *populate_skb(char *buf, int size)\n-{\n-\tstruct sk_buff *skb;\n-\n-\tif (size \u003e= MAX_DATA)\n-\t\treturn NULL;\n-\n-\tskb = alloc_skb(MAX_DATA, GFP_KERNEL);\n-\tif (!skb)\n-\t\treturn NULL;\n-\n-\t__skb_put_data(skb, buf, size);\n-\n-\t/* Initialize a fake skb with test pattern. */\n-\tskb_reset_mac_header(skb);\n-\tskb-\u003eprotocol = htons(ETH_P_IP);\n-\tskb-\u003epkt_type = SKB_TYPE;\n-\tskb-\u003emark = SKB_MARK;\n-\tskb-\u003ehash = SKB_HASH;\n-\tskb-\u003equeue_mapping = SKB_QUEUE_MAP;\n-\tskb-\u003evlan_tci = SKB_VLAN_TCI;\n-\tskb-\u003evlan_proto = htons(ETH_P_IP);\n-\tdev_net_set(\u0026dev, \u0026init_net);\n-\tskb-\u003edev = \u0026dev;\n-\tskb-\u003edev-\u003eifindex = SKB_DEV_IFINDEX;\n-\tskb-\u003edev-\u003etype = SKB_DEV_TYPE;\n-\tskb_set_network_header(skb, min(size, ETH_HLEN));\n-\n-\treturn skb;\n-}\n-\n-static void *generate_test_data(struct bpf_test *test, int sub)\n-{\n-\tstruct sk_buff *skb;\n-\tstruct page *page;\n-\n-\tif (test-\u003eaux \u0026 FLAG_NO_DATA)\n-\t\treturn NULL;\n-\n-\tif (test-\u003eaux \u0026 FLAG_LARGE_MEM)\n-\t\treturn kmalloc(test-\u003etest[sub].data_size, GFP_KERNEL);\n-\n-\t/* Test case expects an skb, so populate one. Various\n-\t * subtests generate skbs of different sizes based on\n-\t * the same data.\n-\t */\n-\tskb = populate_skb(test-\u003edata, test-\u003etest[sub].data_size);\n-\tif (!skb)\n-\t\treturn NULL;\n-\n-\tif (test-\u003eaux \u0026 FLAG_SKB_FRAG) {\n-\t\t/*\n-\t\t * when the test requires a fragmented skb, add a\n-\t\t * single fragment to the skb, filled with\n-\t\t * test-\u003efrag_data.\n-\t\t */\n-\t\tpage = alloc_page(GFP_KERNEL);\n-\t\tif (!page)\n-\t\t\tgoto err_kfree_skb;\n-\n-\t\tmemcpy(page_address(page), test-\u003efrag_data, MAX_DATA);\n-\t\tskb_add_rx_frag(skb, 0, page, 0, MAX_DATA, MAX_DATA);\n-\t}\n-\n-\treturn skb;\n-err_kfree_skb:\n-\tkfree_skb(skb);\n-\treturn NULL;\n-}\n-\n-static void release_test_data(const struct bpf_test *test, void *data)\n-{\n-\tif (test-\u003eaux \u0026 FLAG_NO_DATA)\n-\t\treturn;\n-\n-\tif (test-\u003eaux \u0026 FLAG_LARGE_MEM)\n-\t\tkfree(data);\n-\telse\n-\t\tkfree_skb(data);\n-}\n-\n-static int filter_length(int which)\n-{\n-\tstruct sock_filter *fp;\n-\tint len;\n-\n-\tif (tests[which].fill_helper)\n-\t\treturn tests[which].u.ptr.len;\n-\n-\tfp = tests[which].u.insns;\n-\tfor (len = MAX_INSNS - 1; len \u003e 0; --len)\n-\t\tif (fp[len].code != 0 || fp[len].k != 0)\n-\t\t\tbreak;\n-\n-\treturn len + 1;\n-}\n-\n-static void *filter_pointer(int which)\n-{\n-\tif (tests[which].fill_helper)\n-\t\treturn tests[which].u.ptr.insns;\n-\telse\n-\t\treturn tests[which].u.insns;\n-}\n-\n-static struct bpf_prog *generate_filter(int which, int *err)\n-{\n-\t__u8 test_type = tests[which].aux \u0026 TEST_TYPE_MASK;\n-\tunsigned int flen = filter_length(which);\n-\tvoid *fptr = filter_pointer(which);\n-\tstruct sock_fprog_kern fprog;\n-\tstruct bpf_prog *fp;\n-\n-\tswitch (test_type) {\n-\tcase CLASSIC:\n-\t\tfprog.filter = fptr;\n-\t\tfprog.len = flen;\n-\n-\t\t*err = bpf_prog_create(\u0026fp, \u0026fprog);\n-\t\tif (tests[which].aux \u0026 FLAG_EXPECTED_FAIL) {\n-\t\t\tif (*err == tests[which].expected_errcode) {\n-\t\t\t\tpr_cont(\"PASS\\n\");\n-\t\t\t\t/* Verifier rejected filter as expected. */\n-\t\t\t\t*err = 0;\n-\t\t\t\treturn NULL;\n-\t\t\t} else {\n-\t\t\t\tpr_cont(\"UNEXPECTED_PASS\\n\");\n-\t\t\t\t/* Verifier didn't reject the test that's\n-\t\t\t\t * bad enough, just return!\n-\t\t\t\t */\n-\t\t\t\t*err = -EINVAL;\n-\t\t\t\treturn NULL;\n-\t\t\t}\n-\t\t}\n-\t\tif (*err) {\n-\t\t\tpr_cont(\"FAIL to prog_create err=%d len=%d\\n\",\n-\t\t\t\t*err, fprog.len);\n-\t\t\treturn NULL;\n-\t\t}\n-\t\tbreak;\n-\n-\tcase INTERNAL:\n-\t\tfp = bpf_prog_alloc(bpf_prog_size(flen), 0);\n-\t\tif (fp == NULL) {\n-\t\t\tpr_cont(\"UNEXPECTED_FAIL no memory left\\n\");\n-\t\t\t*err = -ENOMEM;\n-\t\t\treturn NULL;\n-\t\t}\n-\n-\t\tfp-\u003elen = flen;\n-\t\t/* Type doesn't really matter here as long as it's not unspec. */\n-\t\tfp-\u003etype = BPF_PROG_TYPE_SOCKET_FILTER;\n-\t\tmemcpy(fp-\u003einsnsi, fptr, fp-\u003elen * sizeof(struct bpf_insn));\n-\t\tfp-\u003eaux-\u003estack_depth = tests[which].stack_depth;\n-\t\tfp-\u003eaux-\u003everifier_zext = !!(tests[which].aux \u0026\n-\t\t\t\t\t    FLAG_VERIFIER_ZEXT);\n-\n-\t\t/* We cannot error here as we don't need type compatibility\n-\t\t * checks.\n-\t\t */\n-\t\tfp = bpf_prog_select_runtime(fp, err);\n-\t\tif (*err) {\n-\t\t\tpr_cont(\"FAIL to select_runtime err=%d\\n\", *err);\n-\t\t\treturn NULL;\n-\t\t}\n-\t\tbreak;\n-\t}\n-\n-\t*err = 0;\n-\treturn fp;\n-}\n-\n-static void release_filter(struct bpf_prog *fp, int which)\n-{\n-\t__u8 test_type = tests[which].aux \u0026 TEST_TYPE_MASK;\n-\n-\tswitch (test_type) {\n-\tcase CLASSIC:\n-\t\tbpf_prog_destroy(fp);\n-\t\tbreak;\n-\tcase INTERNAL:\n-\t\tbpf_prog_free(fp);\n-\t\tbreak;\n-\t}\n-}\n-\n-static int __run_one(const struct bpf_prog *fp, const void *data,\n-\t\t     int runs, u64 *duration)\n-{\n-\tu64 start, finish;\n-\tint ret = 0, i;\n-\n-\tmigrate_disable();\n-\tstart = ktime_get_ns();\n-\n-\tfor (i = 0; i \u003c runs; i++)\n-\t\tret = bpf_prog_run(fp, data);\n-\n-\tfinish = ktime_get_ns();\n-\tmigrate_enable();\n-\n-\t*duration = finish - start;\n-\tdo_div(*duration, runs);\n-\n-\treturn ret;\n-}\n-\n-static int run_one(const struct bpf_prog *fp, struct bpf_test *test)\n-{\n-\tint err_cnt = 0, i, runs = MAX_TESTRUNS;\n-\n-\tif (test-\u003enr_testruns)\n-\t\truns = min(test-\u003enr_testruns, MAX_TESTRUNS);\n-\n-\tfor (i = 0; i \u003c MAX_SUBTESTS; i++) {\n-\t\tvoid *data;\n-\t\tu64 duration;\n-\t\tu32 ret;\n-\n-\t\t/*\n-\t\t * NOTE: Several sub-tests may be present, in which case\n-\t\t * a zero {data_size, result} tuple indicates the end of\n-\t\t * the sub-test array. The first test is always run,\n-\t\t * even if both data_size and result happen to be zero.\n-\t\t */\n-\t\tif (i \u003e 0 \u0026\u0026\n-\t\t    test-\u003etest[i].data_size == 0 \u0026\u0026\n-\t\t    test-\u003etest[i].result == 0)\n-\t\t\tbreak;\n-\n-\t\tdata = generate_test_data(test, i);\n-\t\tif (!data \u0026\u0026 !(test-\u003eaux \u0026 FLAG_NO_DATA)) {\n-\t\t\tpr_cont(\"data generation failed \");\n-\t\t\terr_cnt++;\n-\t\t\tbreak;\n-\t\t}\n-\t\tret = __run_one(fp, data, runs, \u0026duration);\n-\t\trelease_test_data(test, data);\n-\n-\t\tif (ret == test-\u003etest[i].result) {\n-\t\t\tpr_cont(\"%lld \", duration);\n-\t\t} else {\n-\t\t\ts32 res = test-\u003etest[i].result;\n-\n-\t\t\tpr_cont(\"ret %d != %d (%#x != %#x)\",\n-\t\t\t\tret, res, ret, res);\n-\t\t\terr_cnt++;\n-\t\t}\n-\t}\n-\n-\treturn err_cnt;\n-}\n-\n-static char test_name[64];\n-module_param_string(test_name, test_name, sizeof(test_name), 0);\n-\n-static int test_id = -1;\n-module_param(test_id, int, 0);\n-\n-static int test_range[2] = { 0, INT_MAX };\n-module_param_array(test_range, int, NULL, 0);\n-\n-static bool exclude_test(int test_id)\n-{\n-\treturn test_id \u003c test_range[0] || test_id \u003e test_range[1];\n-}\n-\n-static __init struct sk_buff *build_test_skb(void)\n-{\n-\tu32 headroom = NET_SKB_PAD + NET_IP_ALIGN + ETH_HLEN;\n-\tstruct sk_buff *skb[2];\n-\tstruct page *page[2];\n-\tint i, data_size = 8;\n-\n-\tfor (i = 0; i \u003c 2; i++) {\n-\t\tpage[i] = alloc_page(GFP_KERNEL);\n-\t\tif (!page[i]) {\n-\t\t\tif (i == 0)\n-\t\t\t\tgoto err_page0;\n-\t\t\telse\n-\t\t\t\tgoto err_page1;\n-\t\t}\n-\n-\t\t/* this will set skb[i]-\u003ehead_frag */\n-\t\tskb[i] = dev_alloc_skb(headroom + data_size);\n-\t\tif (!skb[i]) {\n-\t\t\tif (i == 0)\n-\t\t\t\tgoto err_skb0;\n-\t\t\telse\n-\t\t\t\tgoto err_skb1;\n-\t\t}\n-\n-\t\tskb_reserve(skb[i], headroom);\n-\t\tskb_put(skb[i], data_size);\n-\t\tskb[i]-\u003eprotocol = htons(ETH_P_IP);\n-\t\tskb_reset_network_header(skb[i]);\n-\t\tskb_set_mac_header(skb[i], -ETH_HLEN);\n-\n-\t\tskb_add_rx_frag(skb[i], 0, page[i], 0, 64, 64);\n-\t\t// skb_headlen(skb[i]): 8, skb[i]-\u003ehead_frag = 1\n-\t}\n-\n-\t/* setup shinfo */\n-\tskb_shinfo(skb[0])-\u003egso_size = 1448;\n-\tskb_shinfo(skb[0])-\u003egso_type = SKB_GSO_TCPV4;\n-\tskb_shinfo(skb[0])-\u003egso_type |= SKB_GSO_DODGY;\n-\tskb_shinfo(skb[0])-\u003egso_segs = 0;\n-\tskb_shinfo(skb[0])-\u003efrag_list = skb[1];\n-\tskb_shinfo(skb[0])-\u003ehwtstamps.hwtstamp = 1000;\n-\n-\t/* adjust skb[0]'s len */\n-\tskb[0]-\u003elen += skb[1]-\u003elen;\n-\tskb[0]-\u003edata_len += skb[1]-\u003edata_len;\n-\tskb[0]-\u003etruesize += skb[1]-\u003etruesize;\n-\n-\treturn skb[0];\n-\n-err_skb1:\n-\t__free_page(page[1]);\n-err_page1:\n-\tkfree_skb(skb[0]);\n-err_skb0:\n-\t__free_page(page[0]);\n-err_page0:\n-\treturn NULL;\n-}\n-\n-static __init struct sk_buff *build_test_skb_linear_no_head_frag(void)\n-{\n-\tunsigned int alloc_size = 2000;\n-\tunsigned int headroom = 102, doffset = 72, data_size = 1308;\n-\tstruct sk_buff *skb[2];\n-\tint i;\n-\n-\t/* skbs linked in a frag_list, both with linear data, with head_frag=0\n-\t * (data allocated by kmalloc), both have tcp data of 1308 bytes\n-\t * (total payload is 2616 bytes).\n-\t * Data offset is 72 bytes (40 ipv6 hdr, 32 tcp hdr). Some headroom.\n-\t */\n-\tfor (i = 0; i \u003c 2; i++) {\n-\t\tskb[i] = alloc_skb(alloc_size, GFP_KERNEL);\n-\t\tif (!skb[i]) {\n-\t\t\tif (i == 0)\n-\t\t\t\tgoto err_skb0;\n-\t\t\telse\n-\t\t\t\tgoto err_skb1;\n-\t\t}\n-\n-\t\tskb[i]-\u003eprotocol = htons(ETH_P_IPV6);\n-\t\tskb_reserve(skb[i], headroom);\n-\t\tskb_put(skb[i], doffset + data_size);\n-\t\tskb_reset_network_header(skb[i]);\n-\t\tif (i == 0)\n-\t\t\tskb_reset_mac_header(skb[i]);\n-\t\telse\n-\t\t\tskb_set_mac_header(skb[i], -ETH_HLEN);\n-\t\t__skb_pull(skb[i], doffset);\n-\t}\n-\n-\t/* setup shinfo.\n-\t * mimic bpf_skb_proto_4_to_6, which resets gso_segs and assigns a\n-\t * reduced gso_size.\n-\t */\n-\tskb_shinfo(skb[0])-\u003egso_size = 1288;\n-\tskb_shinfo(skb[0])-\u003egso_type = SKB_GSO_TCPV6 | SKB_GSO_DODGY;\n-\tskb_shinfo(skb[0])-\u003egso_segs = 0;\n-\tskb_shinfo(skb[0])-\u003efrag_list = skb[1];\n-\n-\t/* adjust skb[0]'s len */\n-\tskb[0]-\u003elen += skb[1]-\u003elen;\n-\tskb[0]-\u003edata_len += skb[1]-\u003elen;\n-\tskb[0]-\u003etruesize += skb[1]-\u003etruesize;\n-\n-\treturn skb[0];\n-\n-err_skb1:\n-\tkfree_skb(skb[0]);\n-err_skb0:\n-\treturn NULL;\n-}\n-\n-struct skb_segment_test {\n-\tconst char *descr;\n-\tstruct sk_buff *(*build_skb)(void);\n-\tnetdev_features_t features;\n-};\n-\n-static struct skb_segment_test skb_segment_tests[] __initconst = {\n-\t{\n-\t\t.descr = \"gso_with_rx_frags\",\n-\t\t.build_skb = build_test_skb,\n-\t\t.features = NETIF_F_SG | NETIF_F_GSO_PARTIAL | NETIF_F_IP_CSUM |\n-\t\t\t    NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM\n-\t},\n-\t{\n-\t\t.descr = \"gso_linear_no_head_frag\",\n-\t\t.build_skb = build_test_skb_linear_no_head_frag,\n-\t\t.features = NETIF_F_SG | NETIF_F_FRAGLIST |\n-\t\t\t    NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_GSO |\n-\t\t\t    NETIF_F_GRO | NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM |\n-\t\t\t    NETIF_F_HW_VLAN_STAG_TX\n-\t}\n-};\n-\n-static __init int test_skb_segment_single(const struct skb_segment_test *test)\n-{\n-\tstruct sk_buff *skb, *segs;\n-\tint ret = -1;\n-\n-\tskb = test-\u003ebuild_skb();\n-\tif (!skb) {\n-\t\tpr_info(\"%s: failed to build_test_skb\", __func__);\n-\t\tgoto done;\n-\t}\n-\n-\tsegs = skb_segment(skb, test-\u003efeatures);\n-\tif (!IS_ERR(segs)) {\n-\t\tkfree_skb_list(segs);\n-\t\tret = 0;\n-\t}\n-\tkfree_skb(skb);\n-done:\n-\treturn ret;\n-}\n-\n-static __init int test_skb_segment(void)\n-{\n-\tint i, err_cnt = 0, pass_cnt = 0;\n-\n-\tfor (i = 0; i \u003c ARRAY_SIZE(skb_segment_tests); i++) {\n-\t\tconst struct skb_segment_test *test = \u0026skb_segment_tests[i];\n-\n-\t\tcond_resched();\n-\t\tif (exclude_test(i))\n-\t\t\tcontinue;\n-\n-\t\tpr_info(\"#%d %s \", i, test-\u003edescr);\n-\n-\t\tif (test_skb_segment_single(test)) {\n-\t\t\tpr_cont(\"FAIL\\n\");\n-\t\t\terr_cnt++;\n-\t\t} else {\n-\t\t\tpr_cont(\"PASS\\n\");\n-\t\t\tpass_cnt++;\n-\t\t}\n-\t}\n-\n-\tpr_info(\"%s: Summary: %d PASSED, %d FAILED\\n\", __func__,\n-\t\tpass_cnt, err_cnt);\n-\treturn err_cnt ? -EINVAL : 0;\n-}\n-\n-static __init int test_bpf(void)\n-{\n-\tint i, err_cnt = 0, pass_cnt = 0;\n-\tint jit_cnt = 0, run_cnt = 0;\n-\n-\tfor (i = 0; i \u003c ARRAY_SIZE(tests); i++) {\n-\t\tstruct bpf_prog *fp;\n-\t\tint err;\n-\n-\t\tcond_resched();\n-\t\tif (exclude_test(i))\n-\t\t\tcontinue;\n-\n-\t\tpr_info(\"#%d %s \", i, tests[i].descr);\n-\n-\t\tif (tests[i].fill_helper \u0026\u0026\n-\t\t    tests[i].fill_helper(\u0026tests[i]) \u003c 0) {\n-\t\t\tpr_cont(\"FAIL to prog_fill\\n\");\n-\t\t\tcontinue;\n-\t\t}\n-\n-\t\tfp = generate_filter(i, \u0026err);\n-\n-\t\tif (tests[i].fill_helper) {\n-\t\t\tkfree(tests[i].u.ptr.insns);\n-\t\t\ttests[i].u.ptr.insns = NULL;\n-\t\t}\n-\n-\t\tif (fp == NULL) {\n-\t\t\tif (err == 0) {\n-\t\t\t\tpass_cnt++;\n-\t\t\t\tcontinue;\n-\t\t\t}\n-\t\t\terr_cnt++;\n-\t\t\tcontinue;\n-\t\t}\n-\n-\t\tpr_cont(\"jited:%u \", fp-\u003ejited);\n-\n-\t\trun_cnt++;\n-\t\tif (fp-\u003ejited)\n-\t\t\tjit_cnt++;\n-\n-\t\terr = run_one(fp, \u0026tests[i]);\n-\t\trelease_filter(fp, i);\n-\n-\t\tif (err) {\n-\t\t\tpr_cont(\"FAIL (%d times)\\n\", err);\n-\t\t\terr_cnt++;\n-\t\t} else {\n-\t\t\tpr_cont(\"PASS\\n\");\n-\t\t\tpass_cnt++;\n-\t\t}\n-\t}\n-\n-\tpr_info(\"Summary: %d PASSED, %d FAILED, [%d/%d JIT'ed]\\n\",\n-\t\tpass_cnt, err_cnt, jit_cnt, run_cnt);\n-\n-\treturn err_cnt ? -EINVAL : 0;\n-}\n-\n-struct tail_call_test {\n-\tconst char *descr;\n-\tstruct bpf_insn insns[MAX_INSNS];\n-\tint flags;\n-\tint result;\n-\tint stack_depth;\n-\tbool has_tail_call;\n-};\n-\n-/* Flags that can be passed to tail call test cases */\n-#define FLAG_NEED_STATE\t\tBIT(0)\n-#define FLAG_RESULT_IN_STATE\tBIT(1)\n-\n-/*\n- * Magic marker used in test snippets for tail calls below.\n- * BPF_LD/MOV to R2 and R2 with this immediate value is replaced\n- * with the proper values by the test runner.\n- */\n-#define TAIL_CALL_MARKER 0x7a11ca11\n-\n-/* Special offset to indicate a NULL call target */\n-#define TAIL_CALL_NULL 0x7fff\n-\n-/* Special offset to indicate an out-of-range index */\n-#define TAIL_CALL_INVALID 0x7ffe\n-\n-#define TAIL_CALL(offset)\t\t\t       \\\n-\tBPF_LD_IMM64(R2, TAIL_CALL_MARKER),\t       \\\n-\tBPF_RAW_INSN(BPF_ALU | BPF_MOV | BPF_K, R3, 0, \\\n-\t\t     offset, TAIL_CALL_MARKER),\t       \\\n-\tBPF_JMP_IMM(BPF_TAIL_CALL, 0, 0, 0)\n-\n-/*\n- * A test function to be called from a BPF program, clobbering a lot of\n- * CPU registers in the process. A JITed BPF program calling this function\n- * must save and restore any caller-saved registers it uses for internal\n- * state, for example the current tail call count.\n- */\n-BPF_CALL_1(bpf_test_func, u64, arg)\n-{\n-\tchar buf[64];\n-\tlong a = 0;\n-\tlong b = 1;\n-\tlong c = 2;\n-\tlong d = 3;\n-\tlong e = 4;\n-\tlong f = 5;\n-\tlong g = 6;\n-\tlong h = 7;\n-\n-\treturn snprintf(buf, sizeof(buf),\n-\t\t\t\"%ld %lu %lx %ld %lu %lx %ld %lu %x\",\n-\t\t\ta, b, c, d, e, f, g, h, (int)arg);\n-}\n-#define BPF_FUNC_test_func __BPF_FUNC_MAX_ID\n-\n-/*\n- * Tail call tests. Each test case may call any other test in the table,\n- * including itself, specified as a relative index offset from the calling\n- * test. The index TAIL_CALL_NULL can be used to specify a NULL target\n- * function to test the JIT error path. Similarly, the index TAIL_CALL_INVALID\n- * results in a target index that is out of range.\n- */\n-static struct tail_call_test tail_call_tests[] = {\n-\t{\n-\t\t\"Tail call leaf\",\n-\t\t.insns = {\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R0, R1),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R0, 1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\t.result = 1,\n-\t},\n-\t{\n-\t\t\"Tail call 2\",\n-\t\t.insns = {\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R1, 2),\n-\t\t\tTAIL_CALL(-1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, -1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\t.result = 3,\n-\t\t.has_tail_call = true,\n-\t},\n-\t{\n-\t\t\"Tail call 3\",\n-\t\t.insns = {\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R1, 3),\n-\t\t\tTAIL_CALL(-1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, -1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\t.result = 6,\n-\t\t.has_tail_call = true,\n-\t},\n-\t{\n-\t\t\"Tail call 4\",\n-\t\t.insns = {\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R1, 4),\n-\t\t\tTAIL_CALL(-1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, -1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\t.result = 10,\n-\t\t.has_tail_call = true,\n-\t},\n-\t{\n-\t\t\"Tail call load/store leaf\",\n-\t\t.insns = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R1, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R2, 2),\n-\t\t\tBPF_ALU64_REG(BPF_MOV, R3, BPF_REG_FP),\n-\t\t\tBPF_STX_MEM(BPF_DW, R3, R1, -8),\n-\t\t\tBPF_STX_MEM(BPF_DW, R3, R2, -16),\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, BPF_REG_FP, -8),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R1, 3),\n-\t\t\tBPF_LDX_MEM(BPF_DW, R0, BPF_REG_FP, -16),\n-\t\t\tBPF_JMP_REG(BPF_JNE, R0, R2, 1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\t.result = 0,\n-\t\t.stack_depth = 32,\n-\t},\n-\t{\n-\t\t\"Tail call load/store\",\n-\t\t.insns = {\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, 3),\n-\t\t\tBPF_STX_MEM(BPF_DW, BPF_REG_FP, R0, -8),\n-\t\t\tTAIL_CALL(-1),\n-\t\t\tBPF_ALU64_IMM(BPF_MOV, R0, -1),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\t.result = 0,\n-\t\t.stack_depth = 16,\n-\t\t.has_tail_call = true,\n-\t},\n-\t{\n-\t\t\"Tail call error path, max count reached\",\n-\t\t.insns = {\n-\t\t\tBPF_LDX_MEM(BPF_W, R2, R1, 0),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R2, 1),\n-\t\t\tBPF_STX_MEM(BPF_W, R1, R2, 0),\n-\t\t\tTAIL_CALL(0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\t.flags = FLAG_NEED_STATE | FLAG_RESULT_IN_STATE,\n-\t\t.result = (MAX_TAIL_CALL_CNT + 1) * MAX_TESTRUNS,\n-\t\t.has_tail_call = true,\n-\t},\n-\t{\n-\t\t\"Tail call count preserved across function calls\",\n-\t\t.insns = {\n-\t\t\tBPF_LDX_MEM(BPF_W, R2, R1, 0),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R2, 1),\n-\t\t\tBPF_STX_MEM(BPF_W, R1, R2, 0),\n-\t\t\tBPF_STX_MEM(BPF_DW, R10, R1, -8),\n-\t\t\tBPF_CALL_REL(BPF_FUNC_get_numa_node_id),\n-\t\t\tBPF_CALL_REL(BPF_FUNC_ktime_get_ns),\n-\t\t\tBPF_CALL_REL(BPF_FUNC_ktime_get_boot_ns),\n-\t\t\tBPF_CALL_REL(BPF_FUNC_ktime_get_coarse_ns),\n-\t\t\tBPF_CALL_REL(BPF_FUNC_jiffies64),\n-\t\t\tBPF_CALL_REL(BPF_FUNC_test_func),\n-\t\t\tBPF_LDX_MEM(BPF_DW, R1, R10, -8),\n-\t\t\tBPF_ALU32_REG(BPF_MOV, R0, R1),\n-\t\t\tTAIL_CALL(0),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\t.stack_depth = 8,\n-\t\t.flags = FLAG_NEED_STATE | FLAG_RESULT_IN_STATE,\n-\t\t.result = (MAX_TAIL_CALL_CNT + 1) * MAX_TESTRUNS,\n-\t\t.has_tail_call = true,\n-\t},\n-\t{\n-\t\t\"Tail call error path, NULL target\",\n-\t\t.insns = {\n-\t\t\tBPF_LDX_MEM(BPF_W, R2, R1, 0),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R2, 1),\n-\t\t\tBPF_STX_MEM(BPF_W, R1, R2, 0),\n-\t\t\tTAIL_CALL(TAIL_CALL_NULL),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\t.flags = FLAG_NEED_STATE | FLAG_RESULT_IN_STATE,\n-\t\t.result = MAX_TESTRUNS,\n-\t\t.has_tail_call = true,\n-\t},\n-\t{\n-\t\t\"Tail call error path, index out of range\",\n-\t\t.insns = {\n-\t\t\tBPF_LDX_MEM(BPF_W, R2, R1, 0),\n-\t\t\tBPF_ALU64_IMM(BPF_ADD, R2, 1),\n-\t\t\tBPF_STX_MEM(BPF_W, R1, R2, 0),\n-\t\t\tTAIL_CALL(TAIL_CALL_INVALID),\n-\t\t\tBPF_EXIT_INSN(),\n-\t\t},\n-\t\t.flags = FLAG_NEED_STATE | FLAG_RESULT_IN_STATE,\n-\t\t.result = MAX_TESTRUNS,\n-\t\t.has_tail_call = true,\n-\t},\n-};\n-\n-static void __init destroy_tail_call_tests(struct bpf_array *progs)\n-{\n-\tint i;\n-\n-\tfor (i = 0; i \u003c ARRAY_SIZE(tail_call_tests); i++)\n-\t\tif (progs-\u003eptrs[i])\n-\t\t\tbpf_prog_free(progs-\u003eptrs[i]);\n-\tkfree(progs);\n-}\n-\n-static __init int prepare_tail_call_tests(struct bpf_array **pprogs)\n-{\n-\tint ntests = ARRAY_SIZE(tail_call_tests);\n-\tstruct bpf_array *progs;\n-\tint which, err;\n-\n-\t/* Allocate the table of programs to be used for tail calls */\n-\tprogs = kzalloc_flex(*progs, ptrs, ntests + 1);\n-\tif (!progs)\n-\t\tgoto out_nomem;\n-\n-\t/* Create all eBPF programs and populate the table */\n-\tfor (which = 0; which \u003c ntests; which++) {\n-\t\tstruct tail_call_test *test = \u0026tail_call_tests[which];\n-\t\tstruct bpf_prog *fp;\n-\t\tint len, i;\n-\n-\t\t/* Compute the number of program instructions */\n-\t\tfor (len = 0; len \u003c MAX_INSNS; len++) {\n-\t\t\tstruct bpf_insn *insn = \u0026test-\u003einsns[len];\n-\n-\t\t\tif (len \u003c MAX_INSNS - 1 \u0026\u0026\n-\t\t\t    insn-\u003ecode == (BPF_LD | BPF_DW | BPF_IMM))\n-\t\t\t\tlen++;\n-\t\t\tif (insn-\u003ecode == 0)\n-\t\t\t\tbreak;\n-\t\t}\n-\n-\t\t/* Allocate and initialize the program */\n-\t\tfp = bpf_prog_alloc(bpf_prog_size(len), 0);\n-\t\tif (!fp)\n-\t\t\tgoto out_nomem;\n-\n-\t\tfp-\u003elen = len;\n-\t\tfp-\u003etype = BPF_PROG_TYPE_SOCKET_FILTER;\n-\t\tfp-\u003eaux-\u003estack_depth = test-\u003estack_depth;\n-\t\tfp-\u003eaux-\u003etail_call_reachable = test-\u003ehas_tail_call;\n-\t\tmemcpy(fp-\u003einsnsi, test-\u003einsns, len * sizeof(struct bpf_insn));\n-\n-\t\t/* Relocate runtime tail call offsets and addresses */\n-\t\tfor (i = 0; i \u003c len; i++) {\n-\t\t\tstruct bpf_insn *insn = \u0026fp-\u003einsnsi[i];\n-\t\t\tlong addr = 0;\n-\n-\t\t\tswitch (insn-\u003ecode) {\n-\t\t\tcase BPF_LD | BPF_DW | BPF_IMM:\n-\t\t\t\tif (insn-\u003eimm != TAIL_CALL_MARKER)\n-\t\t\t\t\tbreak;\n-\t\t\t\tinsn[0].imm = (u32)(long)progs;\n-\t\t\t\tinsn[1].imm = ((u64)(long)progs) \u003e\u003e 32;\n-\t\t\t\tbreak;\n-\n-\t\t\tcase BPF_ALU | BPF_MOV | BPF_K:\n-\t\t\t\tif (insn-\u003eimm != TAIL_CALL_MARKER)\n-\t\t\t\t\tbreak;\n-\t\t\t\tif (insn-\u003eoff == TAIL_CALL_NULL)\n-\t\t\t\t\tinsn-\u003eimm = ntests;\n-\t\t\t\telse if (insn-\u003eoff == TAIL_CALL_INVALID)\n-\t\t\t\t\tinsn-\u003eimm = ntests + 1;\n-\t\t\t\telse\n-\t\t\t\t\tinsn-\u003eimm = which + insn-\u003eoff;\n-\t\t\t\tinsn-\u003eoff = 0;\n-\t\t\t\tbreak;\n-\n-\t\t\tcase BPF_JMP | BPF_CALL:\n-\t\t\t\tif (insn-\u003esrc_reg != BPF_PSEUDO_CALL)\n-\t\t\t\t\tbreak;\n-\t\t\t\tswitch (insn-\u003eimm) {\n-\t\t\t\tcase BPF_FUNC_get_numa_node_id:\n-\t\t\t\t\taddr = (long)\u0026numa_node_id;\n-\t\t\t\t\tbreak;\n-\t\t\t\tcase BPF_FUNC_ktime_get_ns:\n-\t\t\t\t\taddr = (long)\u0026ktime_get_ns;\n-\t\t\t\t\tbreak;\n-\t\t\t\tcase BPF_FUNC_ktime_get_boot_ns:\n-\t\t\t\t\taddr = (long)\u0026ktime_get_boot_fast_ns;\n-\t\t\t\t\tbreak;\n-\t\t\t\tcase BPF_FUNC_ktime_get_coarse_ns:\n-\t\t\t\t\taddr = (long)\u0026ktime_get_coarse_ns;\n-\t\t\t\t\tbreak;\n-\t\t\t\tcase BPF_FUNC_jiffies64:\n-\t\t\t\t\taddr = (long)\u0026get_jiffies_64;\n-\t\t\t\t\tbreak;\n-\t\t\t\tcase BPF_FUNC_test_func:\n-\t\t\t\t\taddr = (long)\u0026bpf_test_func;\n-\t\t\t\t\tbreak;\n-\t\t\t\tdefault:\n-\t\t\t\t\terr = -EFAULT;\n-\t\t\t\t\tgoto out_err;\n-\t\t\t\t}\n-\t\t\t\t*insn = BPF_EMIT_CALL(addr);\n-\t\t\t\tif ((long)__bpf_call_base + insn-\u003eimm != addr)\n-\t\t\t\t\t*insn = BPF_JMP_A(0); /* Skip: NOP */\n-\t\t\t\tbreak;\n-\t\t\t}\n-\t\t}\n-\n-\t\tfp = bpf_prog_select_runtime(fp, \u0026err);\n-\t\tif (err)\n-\t\t\tgoto out_err;\n-\n-\t\tprogs-\u003eptrs[which] = fp;\n-\t}\n-\n-\t/* The last entry contains a NULL program pointer */\n-\tprogs-\u003emap.max_entries = ntests + 1;\n-\t*pprogs = progs;\n-\treturn 0;\n-\n-out_nomem:\n-\terr = -ENOMEM;\n-\n-out_err:\n-\tif (progs)\n-\t\tdestroy_tail_call_tests(progs);\n-\treturn err;\n-}\n-\n-static __init int test_tail_calls(struct bpf_array *progs)\n-{\n-\tint i, err_cnt = 0, pass_cnt = 0;\n-\tint jit_cnt = 0, run_cnt = 0;\n-\n-\tfor (i = 0; i \u003c ARRAY_SIZE(tail_call_tests); i++) {\n-\t\tstruct tail_call_test *test = \u0026tail_call_tests[i];\n-\t\tstruct bpf_prog *fp = progs-\u003eptrs[i];\n-\t\tint *data = NULL;\n-\t\tint state = 0;\n-\t\tu64 duration;\n-\t\tint ret;\n-\n-\t\tcond_resched();\n-\t\tif (exclude_test(i))\n-\t\t\tcontinue;\n-\n-\t\tpr_info(\"#%d %s \", i, test-\u003edescr);\n-\t\tif (!fp) {\n-\t\t\terr_cnt++;\n-\t\t\tcontinue;\n-\t\t}\n-\t\tpr_cont(\"jited:%u \", fp-\u003ejited);\n-\n-\t\trun_cnt++;\n-\t\tif (fp-\u003ejited)\n-\t\t\tjit_cnt++;\n-\n-\t\tif (test-\u003eflags \u0026 FLAG_NEED_STATE)\n-\t\t\tdata = \u0026state;\n-\t\tret = __run_one(fp, data, MAX_TESTRUNS, \u0026duration);\n-\t\tif (test-\u003eflags \u0026 FLAG_RESULT_IN_STATE)\n-\t\t\tret = state;\n-\t\tif (ret == test-\u003eresult) {\n-\t\t\tpr_cont(\"%lld PASS\", duration);\n-\t\t\tpass_cnt++;\n-\t\t} else {\n-\t\t\tpr_cont(\"ret %d != %d FAIL\", ret, test-\u003eresult);\n-\t\t\terr_cnt++;\n-\t\t}\n-\t}\n-\n-\tpr_info(\"%s: Summary: %d PASSED, %d FAILED, [%d/%d JIT'ed]\\n\",\n-\t\t__func__, pass_cnt, err_cnt, jit_cnt, run_cnt);\n-\n-\treturn err_cnt ? -EINVAL : 0;\n-}\n-\n-static char test_suite[32];\n-module_param_string(test_suite, test_suite, sizeof(test_suite), 0);\n-\n-static __init int find_test_index(const char *test_name)\n-{\n-\tint i;\n-\n-\tif (!strcmp(test_suite, \"test_bpf\")) {\n-\t\tfor (i = 0; i \u003c ARRAY_SIZE(tests); i++) {\n-\t\t\tif (!strcmp(tests[i].descr, test_name))\n-\t\t\t\treturn i;\n-\t\t}\n-\t}\n-\n-\tif (!strcmp(test_suite, \"test_tail_calls\")) {\n-\t\tfor (i = 0; i \u003c ARRAY_SIZE(tail_call_tests); i++) {\n-\t\t\tif (!strcmp(tail_call_tests[i].descr, test_name))\n-\t\t\t\treturn i;\n-\t\t}\n-\t}\n-\n-\tif (!strcmp(test_suite, \"test_skb_segment\")) {\n-\t\tfor (i = 0; i \u003c ARRAY_SIZE(skb_segment_tests); i++) {\n-\t\t\tif (!strcmp(skb_segment_tests[i].descr, test_name))\n-\t\t\t\treturn i;\n-\t\t}\n-\t}\n-\n-\treturn -1;\n-}\n-\n-static __init int prepare_test_range(void)\n-{\n-\tint valid_range;\n-\n-\tif (!strcmp(test_suite, \"test_bpf\"))\n-\t\tvalid_range = ARRAY_SIZE(tests);\n-\telse if (!strcmp(test_suite, \"test_tail_calls\"))\n-\t\tvalid_range = ARRAY_SIZE(tail_call_tests);\n-\telse if (!strcmp(test_suite, \"test_skb_segment\"))\n-\t\tvalid_range = ARRAY_SIZE(skb_segment_tests);\n-\telse\n-\t\treturn 0;\n-\n-\tif (test_id \u003e= 0) {\n-\t\t/*\n-\t\t * if a test_id was specified, use test_range to\n-\t\t * cover only that test.\n-\t\t */\n-\t\tif (test_id \u003e= valid_range) {\n-\t\t\tpr_err(\"test_bpf: invalid test_id specified for '%s' suite.\\n\",\n-\t\t\t       test_suite);\n-\t\t\treturn -EINVAL;\n-\t\t}\n-\n-\t\ttest_range[0] = test_id;\n-\t\ttest_range[1] = test_id;\n-\t} else if (*test_name) {\n-\t\t/*\n-\t\t * if a test_name was specified, find it and setup\n-\t\t * test_range to cover only that test.\n-\t\t */\n-\t\tint idx = find_test_index(test_name);\n-\n-\t\tif (idx \u003c 0) {\n-\t\t\tpr_err(\"test_bpf: no test named '%s' found for '%s' suite.\\n\",\n-\t\t\t       test_name, test_suite);\n-\t\t\treturn -EINVAL;\n-\t\t}\n-\t\ttest_range[0] = idx;\n-\t\ttest_range[1] = idx;\n-\t} else if (test_range[0] != 0 || test_range[1] != INT_MAX) {\n-\t\t/*\n-\t\t * check that the supplied test_range is valid.\n-\t\t */\n-\t\tif (test_range[0] \u003c 0 || test_range[1] \u003e= valid_range) {\n-\t\t\tpr_err(\"test_bpf: test_range is out of bound for '%s' suite.\\n\",\n-\t\t\t       test_suite);\n-\t\t\treturn -EINVAL;\n-\t\t}\n-\n-\t\tif (test_range[1] \u003c test_range[0]) {\n-\t\t\tpr_err(\"test_bpf: test_range is ending before it starts.\\n\");\n-\t\t\treturn -EINVAL;\n-\t\t}\n-\t}\n-\n-\treturn 0;\n-}\n-\n-static int __init test_bpf_init(void)\n-{\n-\tstruct bpf_array *progs = NULL;\n-\tint ret;\n-\n-\tif (strlen(test_suite) \u0026\u0026\n-\t    strcmp(test_suite, \"test_bpf\") \u0026\u0026\n-\t    strcmp(test_suite, \"test_tail_calls\") \u0026\u0026\n-\t    strcmp(test_suite, \"test_skb_segment\")) {\n-\t\tpr_err(\"test_bpf: invalid test_suite '%s' specified.\\n\", test_suite);\n-\t\treturn -EINVAL;\n-\t}\n-\n-\t/*\n-\t * if test_suite is not specified, but test_id, test_name or test_range\n-\t * is specified, set 'test_bpf' as the default test suite.\n-\t */\n-\tif (!strlen(test_suite) \u0026\u0026\n-\t    (test_id != -1 || strlen(test_name) ||\n-\t    (test_range[0] != 0 || test_range[1] != INT_MAX))) {\n-\t\tpr_info(\"test_bpf: set 'test_bpf' as the default test_suite.\\n\");\n-\t\tstrscpy(test_suite, \"test_bpf\", sizeof(test_suite));\n-\t}\n-\n-\tret = prepare_test_range();\n-\tif (ret \u003c 0)\n-\t\treturn ret;\n-\n-\tif (!strlen(test_suite) || !strcmp(test_suite, \"test_bpf\")) {\n-\t\tret = test_bpf();\n-\t\tif (ret)\n-\t\t\treturn ret;\n-\t}\n-\n-\tif (!strlen(test_suite) || !strcmp(test_suite, \"test_tail_calls\")) {\n-\t\tret = prepare_tail_call_tests(\u0026progs);\n-\t\tif (ret)\n-\t\t\treturn ret;\n-\t\tret = test_tail_calls(progs);\n-\t\tdestroy_tail_call_tests(progs);\n-\t\tif (ret)\n-\t\t\treturn ret;\n-\t}\n-\n-\tif (!strlen(test_suite) || !strcmp(test_suite, \"test_skb_segment\"))\n-\t\treturn test_skb_segment();\n-\n-\treturn 0;\n-}\n-\n-static void __exit test_bpf_exit(void)\n-{\n-}\n-\n-module_init(test_bpf_init);\n-module_exit(test_bpf_exit);\n-\n-MODULE_DESCRIPTION(\"Testsuite for BPF interpreter and BPF JIT compiler\");\n-MODULE_LICENSE(\"GPL\");\ndiff --git a/tools/bpf/bpftool/feature.c b/tools/bpf/bpftool/feature.c\nindex 0f6070a0c8e71..846a58e562034 100644\n--- a/tools/bpf/bpftool/feature.c\n+++ b/tools/bpf/bpftool/feature.c\n@@ -394,9 +394,6 @@ static void probe_kernel_image_config(const char *define_prefix)\n \t\t/* xt_bpf module for passing BPF programs to netfilter  */\n \t\t{ \"CONFIG_NETFILTER_XT_MATCH_BPF\", },\n \n-\t\t/* test_bpf module for BPF tests */\n-\t\t{ \"CONFIG_TEST_BPF\", },\n-\n \t\t/* Misc configs useful in BPF C programs */\n \t\t/* jiffies \u003c-\u003e sec conversion for bpf_jiffies64() helper */\n \t\t{ \"CONFIG_HZ\", true, }\ndiff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile\nindex 80d8bbbc3084a..1e4af62e8312e 100644\n--- a/tools/testing/selftests/bpf/Makefile\n+++ b/tools/testing/selftests/bpf/Makefile\n@@ -38,8 +38,7 @@ TEST_FILES = xsk_prereqs.sh $(wildcard progs/btf_dump_test_case_*.c)\t\\\n \t     bpftool_btf_dump_unsorted.expected\n \n # Order correspond to 'make run_tests' order\n-TEST_PROGS := test_kmod.sh \\\n-\ttest_bpftool_build.sh \\\n+TEST_PROGS := test_bpftool_build.sh \\\n \ttest_doc_build.sh \\\n \ttest_xsk.sh \\\n \ttest_xdp_features.sh\ndiff --git a/tools/testing/selftests/bpf/config b/tools/testing/selftests/bpf/config\nindex 2b883b388f90c..1f41283ae2f0f 100644\n--- a/tools/testing/selftests/bpf/config\n+++ b/tools/testing/selftests/bpf/config\n@@ -123,7 +123,6 @@ CONFIG_SAMPLE_LIVEPATCH=m\n CONFIG_SECURITY=y\n CONFIG_SECURITYFS=y\n CONFIG_SYN_COOKIES=y\n-CONFIG_TEST_BPF=m\n CONFIG_TMPFS=y\n CONFIG_TMPFS_XATTR=y\n CONFIG_UDMABUF=y\ndiff --git a/tools/testing/selftests/bpf/prog_tests/jit_insns.c b/tools/testing/selftests/bpf/prog_tests/jit_insns.c\nnew file mode 100644\nindex 0000000000000..dabf8a4abdfe2\n--- /dev/null\n+++ b/tools/testing/selftests/bpf/prog_tests/jit_insns.c\n@@ -0,0 +1,2433 @@\n+// SPDX-License-Identifier: GPL-2.0\n+/* Copyright (c) 2026 Isovalent */\n+\n+#include \u003cendian.h\u003e\n+#include \u003cstdint.h\u003e\n+#include \u003ctest_progs.h\u003e\n+#include \u003cbpf/btf.h\u003e\n+#include \u003clinux/filter.h\u003e\n+\n+#include \"sysctl_helpers.h\"\n+#include \"jit_insns_arena.skel.h\"\n+\n+#define NR_CASES\t512\n+#define CTX_SPILL\t-16\t/* stack slot holding the ctx pointer */\n+#define MEM_SLOT\t-8\t/* stack slot for the atomic operations */\n+\n+struct sweep_ctx {\n+\t__u64 in[NR_CASES][2];\n+\t__u64 out[NR_CASES][3];\n+};\n+\n+#define IN_OFF(k, j)\t(offsetof(struct sweep_ctx, in) + ((k) * 2 + (j)) * 8)\n+#define OUT_OFF(k, j)\t(offsetof(struct sweep_ctx, out) + ((k) * 3 + (j)) * 8)\n+\n+/* The cases of one program: operands in, results out, expected results */\n+struct batch {\n+\tstruct bpf_insn *insns;\n+\tint cnt, cap;\n+\tstruct sweep_ctx ctx;\n+\t__u64 exp[NR_CASES][3];\n+\t__u8 nr_out[NR_CASES];\n+\tint nr;\n+\tchar desc[80];\n+};\n+\n+static char log[1 \u003c\u003c 16];\n+\n+#define EMIT(b, insn)\t((b)-\u003einsns[(b)-\u003ecnt++] = (insn))\n+\n+static void emit_ld_imm64(struct batch *b, int reg, __u64 imm)\n+{\n+\tEMIT(b, BPF_RAW_INSN(BPF_LD | BPF_DW | BPF_IMM, reg, 0, 0, (__u32)imm));\n+\tEMIT(b, BPF_RAW_INSN(0, 0, 0, 0, imm \u003e\u003e 32));\n+}\n+\n+static void batch_reset(struct batch *b)\n+{\n+\tb-\u003ecnt = 0;\n+\tb-\u003enr = 0;\n+\t/* The ctx pointer lives on the stack, every register is an operand */\n+\tEMIT(b, BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_1, CTX_SPILL));\n+}\n+\n+static bool batch_init(struct batch *b)\n+{\n+\tb-\u003ecap = NR_CASES * 24 + 8;\n+\tb-\u003einsns = malloc(b-\u003ecap * sizeof(*b-\u003einsns));\n+\tif (!ASSERT_OK_PTR(b-\u003einsns, \"insns\"))\n+\t\treturn false;\n+\tbatch_reset(b);\n+\treturn true;\n+}\n+\n+static void batch_fini(struct batch *b)\n+{\n+\tfree(b-\u003einsns);\n+}\n+\n+static int load_prog(struct bpf_insn *insns, int cnt, const char *desc)\n+{\n+\tLIBBPF_OPTS(bpf_prog_load_opts, lopts,\n+\t\t.prog_flags = BPF_F_SLEEPABLE,\n+\t\t.log_buf = log,\n+\t\t.log_size = sizeof(log),\n+\t);\n+\tint fd;\n+\n+\tfd = bpf_prog_load(BPF_PROG_TYPE_SYSCALL, NULL, \"GPL\", insns, cnt, \u0026lopts);\n+\tif (!ASSERT_GE(fd, 0, desc))\n+\t\tfprintf(stderr, \"%s\", log);\n+\treturn fd;\n+}\n+\n+/* Run the batch, check the results, start a new one */\n+static void batch_flush(struct batch *b)\n+{\n+\tLIBBPF_OPTS(bpf_test_run_opts, opts,\n+\t\t.ctx_in = \u0026b-\u003ectx,\n+\t\t.ctx_size_in = sizeof(b-\u003ectx),\n+\t);\n+\tchar buf[160];\n+\tint fd, k, j;\n+\n+\tif (!b-\u003enr)\n+\t\treturn;\n+\tEMIT(b, BPF_MOV64_IMM(BPF_REG_0, 0));\n+\tEMIT(b, BPF_EXIT_INSN());\n+\tsnprintf(buf, sizeof(buf), \"%s: load %d cases\", b-\u003edesc, b-\u003enr);\n+\tfd = load_prog(b-\u003einsns, b-\u003ecnt, buf);\n+\tif (fd \u003e= 0 \u0026\u0026 ASSERT_OK(bpf_prog_test_run_opts(fd, \u0026opts), b-\u003edesc)) {\n+\t\tfor (k = 0; k \u003c b-\u003enr; k++) {\n+\t\t\tfor (j = 0; j \u003c b-\u003enr_out[k]; j++) {\n+\t\t\t\tif (b-\u003ectx.out[k][j] == b-\u003eexp[k][j])\n+\t\t\t\t\tcontinue;\n+\t\t\t\tsnprintf(buf, sizeof(buf), \"%s: in0=0x%llx in1=0x%llx out%d\",\n+\t\t\t\t\t b-\u003edesc, b-\u003ectx.in[k][0], b-\u003ectx.in[k][1], j);\n+\t\t\t\tASSERT_EQ(b-\u003ectx.out[k][j], b-\u003eexp[k][j], buf);\n+\t\t\t}\n+\t\t}\n+\t}\n+\tif (fd \u003e= 0)\n+\t\tclose(fd);\n+\tbatch_reset(b);\n+}\n+\n+/* Add a case: record the operands and load the ctx pointer into rc */\n+static int batch_case(struct batch *b, int rc, __u64 in0, __u64 in1)\n+{\n+\tint k;\n+\n+\tif (b-\u003enr == NR_CASES)\n+\t\tbatch_flush(b);\n+\tk = b-\u003enr++;\n+\tb-\u003ectx.in[k][0] = in0;\n+\tb-\u003ectx.in[k][1] = in1;\n+\tb-\u003enr_out[k] = 0;\n+\tEMIT(b, BPF_LDX_MEM(BPF_DW, rc, BPF_REG_10, CTX_SPILL));\n+\treturn k;\n+}\n+\n+static void batch_expect(struct batch *b, int k, int j, __u64 val)\n+{\n+\tb-\u003eexp[k][j] = val;\n+\tif (b-\u003enr_out[k] \u003c= j)\n+\t\tb-\u003enr_out[k] = j + 1;\n+}\n+\n+#define LD_IN(b, k, j, rc, reg)\t\tEMIT(b, BPF_LDX_MEM(BPF_DW, reg, rc, IN_OFF(k, j)))\n+#define ST_OUT(b, k, j, rc, reg)\tEMIT(b, BPF_STX_MEM(BPF_DW, rc, reg, OUT_OFF(k, j)))\n+\n+/* A register that is neither of the two operand registers nor r0 */\n+static int scratch_reg(int r1, int r2)\n+{\n+\tint r;\n+\n+\tfor (r = BPF_REG_1; r \u003c= BPF_REG_9; r++)\n+\t\tif (r != r1 \u0026\u0026 r != r2)\n+\t\t\treturn r;\n+\treturn BPF_REG_9;\n+}\n+\n+static const char *alu_name(int op)\n+{\n+\tswitch (BPF_OP(op)) {\n+\tcase BPF_MOV: return \"mov\";\n+\tcase BPF_NEG: return \"neg\";\n+\tcase BPF_AND: return \"and\";\n+\tcase BPF_OR: return \"or\";\n+\tcase BPF_XOR: return \"xor\";\n+\tcase BPF_LSH: return \"lsh\";\n+\tcase BPF_RSH: return \"rsh\";\n+\tcase BPF_ARSH: return \"arsh\";\n+\tcase BPF_ADD: return \"add\";\n+\tcase BPF_SUB: return \"sub\";\n+\tcase BPF_MUL: return \"mul\";\n+\tcase BPF_DIV: return \"div\";\n+\tcase BPF_MOD: return \"mod\";\n+\tcase BPF_OP(BPF_XCHG): return \"xchg\";\n+\tcase BPF_OP(BPF_CMPXCHG): return \"cmpxchg\";\n+\tdefault: return \"?\";\n+\t}\n+}\n+\n+static const char *jmp_name(int op)\n+{\n+\tswitch (op) {\n+\tcase BPF_JSET: return \"jset\";\n+\tcase BPF_JEQ: return \"jeq\";\n+\tcase BPF_JNE: return \"jne\";\n+\tcase BPF_JGT: return \"jgt\";\n+\tcase BPF_JGE: return \"jge\";\n+\tcase BPF_JLT: return \"jlt\";\n+\tcase BPF_JLE: return \"jle\";\n+\tcase BPF_JSGT: return \"jsgt\";\n+\tcase BPF_JSGE: return \"jsge\";\n+\tcase BPF_JSLT: return \"jslt\";\n+\tcase BPF_JSLE: return \"jsle\";\n+\tdefault: return \"?\";\n+\t}\n+}\n+\n+/* ALU result computation, false when the operands are not valid */\n+enum { F_ALU32 = 1, F_SIGNED = 2 };\n+\n+static bool alu_result(__u64 *res, __u64 v1, __u64 v2, __u8 op, __u32 flags)\n+{\n+\tbool is_signed = flags \u0026 F_SIGNED;\n+\n+\t/* Narrow operands for ALU32 */\n+\tif (flags \u0026 F_ALU32) {\n+\t\tif (is_signed) {\n+\t\t\tv1 = (__u64)(__s32)v1;\n+\t\t\tv2 = (__u64)(__s32)v2;\n+\t\t} else {\n+\t\t\tv1 = (__u32)v1;\n+\t\t\tv2 = (__u32)v2;\n+\t\t}\n+\t}\n+\n+\t*res = 0;\n+\tswitch (op) {\n+\tcase BPF_MOV:\n+\t\t*res = v2;\n+\t\tbreak;\n+\tcase BPF_NEG:\n+\t\t*res = -v1;\n+\t\tbreak;\n+\tcase BPF_AND:\n+\t\t*res = v1 \u0026 v2;\n+\t\tbreak;\n+\tcase BPF_OR:\n+\t\t*res = v1 | v2;\n+\t\tbreak;\n+\tcase BPF_XOR:\n+\t\t*res = v1 ^ v2;\n+\t\tbreak;\n+\tcase BPF_LSH:\n+\t\t*res = v1 \u003c\u003c v2;\n+\t\tbreak;\n+\tcase BPF_RSH:\n+\t\t*res = v1 \u003e\u003e v2;\n+\t\tbreak;\n+\tcase BPF_ARSH:\n+\t\t*res = v1 \u003e\u003e v2;\n+\t\tif (v2 \u003e 0 \u0026\u0026 v1 \u003e INT64_MAX)\n+\t\t\t*res |= ~0ULL \u003c\u003c (64 - v2);\n+\t\tbreak;\n+\tcase BPF_ADD:\n+\t\t*res = v1 + v2;\n+\t\tbreak;\n+\tcase BPF_SUB:\n+\t\t*res = v1 - v2;\n+\t\tbreak;\n+\tcase BPF_MUL:\n+\t\t*res = v1 * v2;\n+\t\tbreak;\n+\tcase BPF_DIV:\n+\t\tif (v2 == 0)\n+\t\t\treturn false;\n+\t\tif (!is_signed) {\n+\t\t\t*res = v1 / v2;\n+\t\t} else {\n+\t\t\tif ((__s64)v2 == -1) /* Handled by the verifier */\n+\t\t\t\treturn false;\n+\t\t\t*res = (__u64)((__s64)v1 / (__s64)v2);\n+\t\t}\n+\t\tbreak;\n+\tcase BPF_MOD:\n+\t\tif (v2 == 0)\n+\t\t\treturn false;\n+\t\tif (!is_signed) {\n+\t\t\t*res = v1 % v2;\n+\t\t} else {\n+\t\t\tif ((__s64)v2 == -1)\n+\t\t\t\treturn false;\n+\t\t\t*res = (__u64)((__s64)v1 % (__s64)v2);\n+\t\t}\n+\t\tbreak;\n+\t}\n+\treturn true;\n+}\n+\n+/*\n+ * Operand pattern generator for the power-of-two magnitude tests: all\n+ * combinations of magnitudes and signs with a block of contiguous values\n+ * around each magnitude, with every dstep'th magnitude of the destination,\n+ * and a larger block for the same magnitude of both operands. The first\n+ * pattern is where the immediates take every encoding a JIT has, the\n+ * second where the sign and overflow boundaries of both operands meet.\n+ */\n+static __s64 value(int msb, int delta, int sign)\n+{\n+\treturn sign * (1LL \u003c\u003c msb) + delta;\n+}\n+\n+#define PATTERN_BLOCK1 1\n+#define PATTERN_BLOCK2 3\n+\n+typedef void (*emit_fn)(struct batch *b, void *arg, __s64 dst, __s64 src);\n+\n+static void fill_pattern(struct batch *b, void *arg, int dbits, int sbits,\n+\t\t\t int block1, int dstep, int block2, emit_fn emit)\n+{\n+\tstatic const int sgn[][2] = { { 1, 1 }, { 1, -1 }, { -1, 1 }, { -1, -1 } };\n+\tint di, si, bt, db, sb, k;\n+\n+\tfor (di = 0; di \u003c dbits - 1; di += dstep)\n+\t\tfor (si = 0; si \u003c sbits - 1; si++)\n+\t\t\tfor (k = 0; k \u003c ARRAY_SIZE(sgn); k++)\n+\t\t\t\tfor (db = -(block1 / 2); db \u003c (block1 + 1) / 2; db++)\n+\t\t\t\t\tfor (sb = -(block1 / 2); sb \u003c (block1 + 1) / 2; sb++)\n+\t\t\t\t\t\temit(b, arg, value(di, db, sgn[k][0]),\n+\t\t\t\t\t\t     value(si, sb, sgn[k][1]));\n+\n+\tfor (bt = 0; bt \u003c (dbits \u003e sbits ? dbits : sbits) - 1; bt++)\n+\t\tfor (k = 0; k \u003c ARRAY_SIZE(sgn); k++)\n+\t\t\tfor (db = -(block2 / 2); db \u003c (block2 + 1) / 2; db++)\n+\t\t\t\tfor (sb = -(block2 / 2); sb \u003c (block2 + 1) / 2; sb++)\n+\t\t\t\t\temit(b, arg, value(bt % dbits, db, sgn[k][0]),\n+\t\t\t\t\t     value(bt % sbits, sb, sgn[k][1]));\n+\tbatch_flush(b);\n+}\n+\n+/* ALU operations with an immediate and with a register for all magnitudes */\n+static const int alu_ops[] = {\n+\tBPF_MOV, BPF_AND, BPF_OR, BPF_XOR, BPF_ADD, BPF_SUB, BPF_MUL, BPF_DIV, BPF_MOD,\n+};\n+\n+struct alu_arg {\n+\tint op;\n+\t__u32 flags;\n+};\n+\n+static void emit_alu_imm(struct batch *b, void *arg, __s64 dst, __s64 imm)\n+{\n+\tstruct alu_arg *a = arg;\n+\tbool alu32 = a-\u003eflags \u0026 F_ALU32;\n+\t__u64 res;\n+\tint k;\n+\n+\tif (!alu_result(\u0026res, dst, (__s32)imm, a-\u003eop, a-\u003eflags))\n+\t\treturn;\n+\tk = batch_case(b, BPF_REG_3, dst, 0);\n+\tLD_IN(b, k, 0, BPF_REG_3, BPF_REG_1);\n+\tEMIT(b, BPF_RAW_INSN((alu32 ? BPF_ALU : BPF_ALU64) | BPF_OP(a-\u003eop) | BPF_K,\n+\t\t\t     BPF_REG_1, 0, a-\u003eflags \u0026 F_SIGNED ? 1 : 0, imm));\n+\tST_OUT(b, k, 0, BPF_REG_3, BPF_REG_1);\n+\tbatch_expect(b, k, 0, alu32 ? (__u32)res : res);\n+}\n+\n+static void emit_alu_reg(struct batch *b, void *arg, __s64 dst, __s64 src)\n+{\n+\tstruct alu_arg *a = arg;\n+\tbool alu32 = a-\u003eflags \u0026 F_ALU32;\n+\t__u64 res;\n+\tint k;\n+\n+\tif (!alu_result(\u0026res, dst, src, a-\u003eop, a-\u003eflags))\n+\t\treturn;\n+\tk = batch_case(b, BPF_REG_3, dst, src);\n+\tLD_IN(b, k, 0, BPF_REG_3, BPF_REG_1);\n+\tLD_IN(b, k, 1, BPF_REG_3, BPF_REG_2);\n+\tEMIT(b, BPF_RAW_INSN((alu32 ? BPF_ALU : BPF_ALU64) | BPF_OP(a-\u003eop) | BPF_X,\n+\t\t\t     BPF_REG_1, BPF_REG_2, a-\u003eflags \u0026 F_SIGNED ? 1 : 0, 0));\n+\tST_OUT(b, k, 0, BPF_REG_3, BPF_REG_1);\n+\tbatch_expect(b, k, 0, alu32 ? (__u32)res : res);\n+}\n+\n+static void test_alu_magnitudes(bool reg)\n+{\n+\tstruct batch b;\n+\tint o, f;\n+\n+\tif (!batch_init(\u0026b))\n+\t\treturn;\n+\tfor (f = 0; f \u003c 2; f++) {\n+\t\tfor (o = 0; o \u003c ARRAY_SIZE(alu_ops); o++) {\n+\t\t\tstruct alu_arg a = { alu_ops[o], f ? F_ALU32 : 0 };\n+\n+\t\t\tsnprintf(b.desc, sizeof(b.desc), \"alu%d_%s_%c magnitudes\",\n+\t\t\t\t f ? 32 : 64, alu_name(a.op), reg ? 'x' : 'k');\n+\t\t\tif (reg)\n+\t\t\t\tfill_pattern(\u0026b, \u0026a, 64, 64, 0, 1, PATTERN_BLOCK2, emit_alu_reg);\n+\t\t\telse\n+\t\t\t\tfill_pattern(\u0026b, \u0026a, 64, 32, PATTERN_BLOCK1, 1, 5, emit_alu_imm);\n+\t\t}\n+\t\tfor (o = 0; o \u003c 2; o++) {\n+\t\t\tstruct alu_arg a = { o ? BPF_MOD : BPF_DIV, F_SIGNED | (f ? F_ALU32 : 0) };\n+\n+\t\t\tsnprintf(b.desc, sizeof(b.desc), \"alu%d_s%s_%c magnitudes\",\n+\t\t\t\t f ? 32 : 64, alu_name(a.op), reg ? 'x' : 'k');\n+\t\t\tif (reg)\n+\t\t\t\tfill_pattern(\u0026b, \u0026a, 64, 64, 0, 1, PATTERN_BLOCK2, emit_alu_reg);\n+\t\t\telse\n+\t\t\t\tfill_pattern(\u0026b, \u0026a, 64, 32, PATTERN_BLOCK1, 1, 5, emit_alu_imm);\n+\t\t}\n+\t}\n+\tbatch_fini(\u0026b);\n+}\n+\n+static void test_alu_imm(void)\n+{\n+\ttest_alu_magnitudes(false);\n+}\n+\n+static void test_alu_reg(void)\n+{\n+\ttest_alu_magnitudes(true);\n+}\n+\n+/* ALU operations with an immediate for every destination register */\n+static const int alu_reg_ops[] = {\n+\tBPF_MOV, BPF_AND, BPF_OR, BPF_XOR, BPF_LSH, BPF_RSH, BPF_ARSH,\n+\tBPF_ADD, BPF_SUB, BPF_MUL, BPF_DIV, BPF_MOD,\n+};\n+\n+static void alu_imm_regs(struct batch *b, int op, __u32 flags)\n+{\n+\tbool alu32 = flags \u0026 F_ALU32;\n+\t__u32 imm = 0x01234567U;\n+\t__u64 dst, res;\n+\tint rd, rc, k;\n+\n+\tif (flags \u0026 F_SIGNED)\n+\t\tdst = alu32 ? (__u64)-76543210LL : (__u64)-7654321076543210LL;\n+\telse\n+\t\tdst = alu32 ? 0x76543210ULL : 0x7edcba9876543210ULL;\n+\tif (op == BPF_LSH || op == BPF_RSH || op == BPF_ARSH)\n+\t\timm \u0026= 31;\n+\tif (op == BPF_NEG)\n+\t\timm = 0;\n+\talu_result(\u0026res, dst, imm, op, flags);\n+\tif (alu32)\n+\t\tres = (__u32)res;\n+\n+\tsnprintf(b-\u003edesc, sizeof(b-\u003edesc), \"alu%d_%s%s_k registers\", alu32 ? 32 : 64,\n+\t\t flags \u0026 F_SIGNED ? \"s\" : \"\", alu_name(op));\n+\tfor (rd = BPF_REG_0; rd \u003c= BPF_REG_9; rd++) {\n+\t\trc = scratch_reg(rd, rd);\n+\t\tk = batch_case(b, rc, dst, 0);\n+\t\tLD_IN(b, k, 0, rc, rd);\n+\t\tEMIT(b, BPF_RAW_INSN((alu32 ? BPF_ALU : BPF_ALU64) | BPF_OP(op) | BPF_K,\n+\t\t\t\t     rd, 0, flags \u0026 F_SIGNED ? 1 : 0, imm));\n+\t\tST_OUT(b, k, 0, rc, rd);\n+\t\tbatch_expect(b, k, 0, res);\n+\t}\n+\tbatch_flush(b);\n+}\n+\n+static void test_alu_imm_regs(void)\n+{\n+\tstruct batch b;\n+\tint o, f;\n+\n+\tif (!batch_init(\u0026b))\n+\t\treturn;\n+\tfor (f = 0; f \u003c 2; f++) {\n+\t\tfor (o = 0; o \u003c ARRAY_SIZE(alu_reg_ops); o++)\n+\t\t\talu_imm_regs(\u0026b, alu_reg_ops[o], f ? F_ALU32 : 0);\n+\t\talu_imm_regs(\u0026b, BPF_NEG, f ? F_ALU32 : 0);\n+\t\talu_imm_regs(\u0026b, BPF_DIV, F_SIGNED | (f ? F_ALU32 : 0));\n+\t\talu_imm_regs(\u0026b, BPF_MOD, F_SIGNED | (f ? F_ALU32 : 0));\n+\t}\n+\tbatch_fini(\u0026b);\n+}\n+\n+/*\n+ * Division and modulo by constants for every width, signedness and\n+ * destination register with a set of divisors and dividends around the\n+ * multiple boundaries and the extremes of each range. This covers a JIT\n+ * replacing the division with a multiplication by a magic number in all\n+ * of its forms: magic numbers needing the extra add step, zero shifts,\n+ * both signed corrections, and the divisors like 1, -1 and the ones\n+ * above 2^63 that are still emitted as a real division. The dividends\n+ * of the 32-bit operations carry garbage in the upper 32 bits.\n+ */\n+static const __s32 unsigned_divisors[] = {\n+\t2, 3, 7, 10, 25, 641, 1000, 4096, 65536, 1000000007, 0x7fffffff,\n+\t-2, -10, -0x7fffffff - 1, -1, 1,\n+};\n+\n+static const __s32 signed_divisors[] = {\n+\t2, 3, 7, 25, 1000, 0x40000000, 0x7fffffff,\n+\t-2, -3, -5, -7, -1000, -0x7fffffff, -0x7fffffff - 1, 1, -1,\n+};\n+\n+static int dividends(__u32 flags, __s32 imm, __u64 *n)\n+{\n+\tbool alu32 = flags \u0026 F_ALU32, is_signed = flags \u0026 F_SIGNED;\n+\t__u64 d = is_signed ? (imm \u003c 0 ? -(__s64)imm : imm) :\n+\t\t  alu32 ? (__u32)imm : (__u64)(__s64)imm;\n+\tint cnt = 0, i;\n+\n+\tn[cnt++] = 0;\n+\tn[cnt++] = d - 1;\n+\tn[cnt++] = d + 1;\n+\tn[cnt++] = 3 * d + 2;\n+\tif (!alu32) {\n+\t\tn[cnt++] = (d \u003c\u003c 40) - 1;\n+\t\tn[cnt++] = (d \u003c\u003c 40) + 1;\n+\t\tn[cnt++] = (1ULL \u003c\u003c 63) - 1;\n+\t\tn[cnt++] = 1ULL \u003c\u003c 63;\n+\t\tn[cnt++] = ~0ULL;\n+\t\tn[cnt++] = 0xdaeb8ebd244a330cULL;\n+\t} else {\n+\t\tn[cnt++] = (d \u003c\u003c 16) - 1;\n+\t\tn[cnt++] = (d \u003c\u003c 16) + 1;\n+\t\tn[cnt++] = (1ULL \u003c\u003c 31) - 1;\n+\t\tn[cnt++] = 1ULL \u003c\u003c 31;\n+\t\tn[cnt++] = ~0U;\n+\t\tn[cnt++] = 0x8c1e86f1;\n+\t}\n+\tif (is_signed) {\n+\t\tn[cnt++] = -1;\n+\t\tn[cnt++] = -d - 1;\n+\t\tn[cnt++] = -3 * d - 2;\n+\t\tn[cnt++] = alu32 ? -(1ULL \u003c\u003c 31) + 1 : -(1ULL \u003c\u003c 63) + 1;\n+\t}\n+\tif (alu32)\n+\t\tfor (i = 0; i \u003c cnt; i++)\n+\t\t\tn[i] = (__u32)n[i] | ((0xa5a50000ULL + i) \u003c\u003c 32);\n+\treturn cnt;\n+}\n+\n+static __u64 div_result(int op, __u32 flags, __s32 imm, __u64 n)\n+{\n+\t__u64 res;\n+\n+\t/* LLONG_MIN / -1 == LLONG_MIN, LLONG_MIN % -1 == 0, same for INT_MIN */\n+\tif ((flags \u0026 F_SIGNED) \u0026\u0026 imm == -1)\n+\t\tres = op == BPF_MOD ? 0 : -n;\n+\telse\n+\t\talu_result(\u0026res, n, (__s32)imm, op, flags);\n+\treturn flags \u0026 F_ALU32 ? (__u32)res : res;\n+}\n+\n+static void div_const(struct batch *b, int op, __u32 flags)\n+{\n+\tbool alu32 = flags \u0026 F_ALU32, is_signed = flags \u0026 F_SIGNED;\n+\tconst __s32 *divs = is_signed ? signed_divisors : unsigned_divisors;\n+\tint cnt = is_signed ? ARRAY_SIZE(signed_divisors) : ARRAY_SIZE(unsigned_divisors);\n+\tint code = (alu32 ? BPF_ALU : BPF_ALU64) | BPF_OP(op) | BPF_K;\n+\tint i, j, nr, rd, rc, k;\n+\t__u64 n[16];\n+\n+\tsnprintf(b-\u003edesc, sizeof(b-\u003edesc), \"alu%d_%s%s_k constants\", alu32 ? 32 : 64,\n+\t\t is_signed ? \"s\" : \"\", alu_name(op));\n+\tfor (i = 0; i \u003c cnt; i++) {\n+\t\tnr = dividends(flags, divs[i], n);\n+\t\tfor (rd = BPF_REG_0; rd \u003c= BPF_REG_9; rd++) {\n+\t\t\trc = scratch_reg(rd, rd);\n+\t\t\tfor (j = 0; j \u003c nr; j++) {\n+\t\t\t\tk = batch_case(b, rc, n[j], divs[i]);\n+\t\t\t\tLD_IN(b, k, 0, rc, rd);\n+\t\t\t\tEMIT(b, BPF_RAW_INSN(code, rd, 0, is_signed, divs[i]));\n+\t\t\t\tST_OUT(b, k, 0, rc, rd);\n+\t\t\t\tbatch_expect(b, k, 0, div_result(op, flags, divs[i], n[j]));\n+\t\t\t}\n+\t\t}\n+\t}\n+\tbatch_flush(b);\n+}\n+\n+static void test_div_const(void)\n+{\n+\tstruct batch b;\n+\tint f;\n+\n+\tif (!batch_init(\u0026b))\n+\t\treturn;\n+\tfor (f = 0; f \u003c 2; f++) {\n+\t\tdiv_const(\u0026b, BPF_DIV, f ? F_ALU32 : 0);\n+\t\tdiv_const(\u0026b, BPF_MOD, f ? F_ALU32 : 0);\n+\t\tdiv_const(\u0026b, BPF_DIV, F_SIGNED | (f ? F_ALU32 : 0));\n+\t\tdiv_const(\u0026b, BPF_MOD, F_SIGNED | (f ? F_ALU32 : 0));\n+\t}\n+\tbatch_fini(\u0026b);\n+}\n+\n+/* ALU operations for all combinations of operand registers */\n+static void alu_reg_pairs(struct batch *b, int op, __u32 flags)\n+{\n+\tbool alu32 = flags \u0026 F_ALU32;\n+\t__u64 dst, src, res, same;\n+\tint rd, rs, rc, k;\n+\n+\tif (flags \u0026 F_SIGNED)\n+\t\tdst = alu32 ? (__u64)-76543210LL : (__u64)-7654321076543210LL;\n+\telse\n+\t\tdst = alu32 ? 0x76543210ULL : 0x7edcba9876543210ULL;\n+\tsrc = alu32 ? 0x01234567ULL : 0x0123456789abcdefULL;\n+\tif (op == BPF_LSH || op == BPF_RSH || op == BPF_ARSH)\n+\t\tsrc \u0026= 31;\n+\talu_result(\u0026res, dst, src, op, flags);\n+\talu_result(\u0026same, src, src, op, flags);\n+\tif (alu32) {\n+\t\tres = (__u32)res;\n+\t\tsame = (__u32)same;\n+\t}\n+\n+\tsnprintf(b-\u003edesc, sizeof(b-\u003edesc), \"alu%d_%s%s_x register pairs\", alu32 ? 32 : 64,\n+\t\t flags \u0026 F_SIGNED ? \"s\" : \"\", alu_name(op));\n+\tfor (rd = BPF_REG_0; rd \u003c= BPF_REG_9; rd++) {\n+\t\tfor (rs = BPF_REG_0; rs \u003c= BPF_REG_9; rs++) {\n+\t\t\trc = scratch_reg(rd, rs);\n+\t\t\tk = batch_case(b, rc, rd == rs ? src : dst, src);\n+\t\t\tLD_IN(b, k, 0, rc, rd);\n+\t\t\tif (rs != rd)\n+\t\t\t\tLD_IN(b, k, 1, rc, rs);\n+\t\t\tEMIT(b, BPF_RAW_INSN((alu32 ? BPF_ALU : BPF_ALU64) | BPF_OP(op) | BPF_X,\n+\t\t\t\t\t     rd, rs, flags \u0026 F_SIGNED ? 1 : 0, 0));\n+\t\t\tST_OUT(b, k, 0, rc, rd);\n+\t\t\tbatch_expect(b, k, 0, rd == rs ? same : res);\n+\t\t}\n+\t}\n+\tbatch_flush(b);\n+}\n+\n+static void test_alu_reg_pairs(void)\n+{\n+\tstruct batch b;\n+\tint o, f;\n+\n+\tif (!batch_init(\u0026b))\n+\t\treturn;\n+\tfor (f = 0; f \u003c 2; f++) {\n+\t\tfor (o = 0; o \u003c ARRAY_SIZE(alu_reg_ops); o++)\n+\t\t\talu_reg_pairs(\u0026b, alu_reg_ops[o], f ? F_ALU32 : 0);\n+\t\talu_reg_pairs(\u0026b, BPF_DIV, F_SIGNED | (f ? F_ALU32 : 0));\n+\t\talu_reg_pairs(\u0026b, BPF_MOD, F_SIGNED | (f ? F_ALU32 : 0));\n+\t}\n+\tbatch_fini(\u0026b);\n+}\n+\n+/* Shifts for all shift counts, by immediate, by register and by the shifted register */\n+static void test_shifts(void)\n+{\n+\tstatic const __s64 vals[] = {\n+\t\t0x0123456789abcdefLL, /* dword \u003e 0, word \u003c 0 */\n+\t\t0xfedcba9876543210LL, /* dword \u003c 0, word \u003e 0 */\n+\t\t0xfedcba0198765432LL, /* dword \u003c 0, word \u003c 0 */\n+\t\t0x0123458967abcdefLL, /* dword \u003e 0, word \u003e 0 */\n+\t};\n+\tstatic const int ops[] = { BPF_LSH, BPF_RSH, BPF_ARSH };\n+\tstruct batch b;\n+\tint o, f, v, imm, k;\n+\n+\tif (!batch_init(\u0026b))\n+\t\treturn;\n+\tfor (f = 0; f \u003c 2; f++) {\n+\t\tint bits = f ? 32 : 64;\n+\n+\t\tfor (o = 0; o \u003c ARRAY_SIZE(ops); o++) {\n+\t\t\tint op = ops[o];\n+\n+\t\t\tsnprintf(b.desc, sizeof(b.desc), \"alu%d_%s all shift counts\", bits,\n+\t\t\t\t alu_name(op));\n+\t\t\tfor (v = 0; v \u003c ARRAY_SIZE(vals); v++) {\n+\t\t\t\tfor (imm = 0; imm \u003c bits; imm++) {\n+\t\t\t\t\t__u64 reg = vals[v], res;\n+\n+\t\t\t\t\tif (f)\n+\t\t\t\t\t\treg = op == BPF_ARSH ? (__u64)(__s32)reg :\n+\t\t\t\t\t\t      (__u32)reg;\n+\t\t\t\t\talu_result(\u0026res, reg, imm, op, 0);\n+\t\t\t\t\tif (f)\n+\t\t\t\t\t\tres = (__u32)res;\n+\n+\t\t\t\t\tk = batch_case(\u0026b, BPF_REG_3, vals[v], imm);\n+\t\t\t\t\tLD_IN(\u0026b, k, 0, BPF_REG_3, BPF_REG_1);\n+\t\t\t\t\tif (f)\n+\t\t\t\t\t\tEMIT(\u0026b, BPF_ALU32_IMM(op, BPF_REG_1, imm));\n+\t\t\t\t\telse\n+\t\t\t\t\t\tEMIT(\u0026b, BPF_ALU64_IMM(op, BPF_REG_1, imm));\n+\t\t\t\t\tST_OUT(\u0026b, k, 0, BPF_REG_3, BPF_REG_1);\n+\t\t\t\t\tbatch_expect(\u0026b, k, 0, res);\n+\n+\t\t\t\t\tk = batch_case(\u0026b, BPF_REG_3, vals[v], imm);\n+\t\t\t\t\tLD_IN(\u0026b, k, 0, BPF_REG_3, BPF_REG_1);\n+\t\t\t\t\tLD_IN(\u0026b, k, 1, BPF_REG_3, BPF_REG_2);\n+\t\t\t\t\tif (f)\n+\t\t\t\t\t\tEMIT(\u0026b, BPF_ALU32_REG(op, BPF_REG_1, BPF_REG_2));\n+\t\t\t\t\telse\n+\t\t\t\t\t\tEMIT(\u0026b, BPF_ALU64_REG(op, BPF_REG_1, BPF_REG_2));\n+\t\t\t\t\tST_OUT(\u0026b, k, 0, BPF_REG_3, BPF_REG_1);\n+\t\t\t\t\tbatch_expect(\u0026b, k, 0, res);\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\t/* The count in the shifted register */\n+\t\t\tfor (imm = 0; imm \u003c bits; imm++) {\n+\t\t\t\t__u64 res;\n+\n+\t\t\t\talu_result(\u0026res, imm, imm, op, 0);\n+\t\t\t\tk = batch_case(\u0026b, BPF_REG_3, imm, 0);\n+\t\t\t\tLD_IN(\u0026b, k, 0, BPF_REG_3, BPF_REG_1);\n+\t\t\t\tif (f)\n+\t\t\t\t\tEMIT(\u0026b, BPF_ALU32_REG(op, BPF_REG_1, BPF_REG_1));\n+\t\t\t\telse\n+\t\t\t\t\tEMIT(\u0026b, BPF_ALU64_REG(op, BPF_REG_1, BPF_REG_1));\n+\t\t\t\tST_OUT(\u0026b, k, 0, BPF_REG_3, BPF_REG_1);\n+\t\t\t\tbatch_expect(\u0026b, k, 0, f ? (__u32)res : res);\n+\t\t\t}\n+\t\t\tbatch_flush(\u0026b);\n+\t\t}\n+\t}\n+\tbatch_fini(\u0026b);\n+}\n+\n+/* Atomic operations on the stack for all magnitudes of memory and source operand */\n+static const int atomic_ops[] = {\n+\tBPF_ADD, BPF_AND, BPF_OR, BPF_XOR,\n+\tBPF_ADD | BPF_FETCH, BPF_AND | BPF_FETCH, BPF_OR | BPF_FETCH, BPF_XOR | BPF_FETCH,\n+\tBPF_XCHG,\n+};\n+\n+struct atomic_arg {\n+\tint op;\n+\tint size;\n+};\n+\n+static void emit_atomic(struct batch *b, void *arg, __s64 dst, __s64 src)\n+{\n+\tstruct atomic_arg *a = arg;\n+\tbool w = a-\u003esize == BPF_W;\n+\t__u64 keep = 0x0123456789abcdefULL, res, fetch;\n+\tint k;\n+\n+\tif (a-\u003eop == BPF_XCHG)\n+\t\tres = src;\n+\telse\n+\t\talu_result(\u0026res, w ? (__u32)dst : dst, w ? (__u32)src : src, BPF_OP(a-\u003eop), 0);\n+\t/* The source register gets the old value with fetch, keeps its own without */\n+\tfetch = a-\u003eop \u0026 BPF_FETCH ? (w ? (__u32)dst : dst) : src;\n+\n+\tk = batch_case(b, BPF_REG_3, dst, src);\n+\tLD_IN(b, k, 0, BPF_REG_3, BPF_REG_1);\n+\tEMIT(b, BPF_STX_MEM(a-\u003esize, BPF_REG_10, BPF_REG_1, MEM_SLOT));\n+\tLD_IN(b, k, 1, BPF_REG_3, BPF_REG_2);\n+\temit_ld_imm64(b, BPF_REG_0, keep);\n+\tEMIT(b, BPF_ATOMIC_OP(a-\u003esize, a-\u003eop, BPF_REG_10, BPF_REG_2, MEM_SLOT));\n+\tEMIT(b, BPF_LDX_MEM(a-\u003esize, BPF_REG_1, BPF_REG_10, MEM_SLOT));\n+\tST_OUT(b, k, 0, BPF_REG_3, BPF_REG_1);\n+\tST_OUT(b, k, 1, BPF_REG_3, BPF_REG_2);\n+\tST_OUT(b, k, 2, BPF_REG_3, BPF_REG_0);\n+\tbatch_expect(b, k, 0, w ? (__u32)res : res);\n+\tbatch_expect(b, k, 1, fetch);\n+\tbatch_expect(b, k, 2, keep);\n+}\n+\n+static void emit_cmpxchg(struct batch *b, void *arg, __s64 dst, __s64 src)\n+{\n+\tint size = *(int *)arg;\n+\tbool w = size == BPF_W;\n+\t__u64 old = w ? (__u32)dst : dst;\n+\tint k;\n+\n+\tk = batch_case(b, BPF_REG_3, dst, src);\n+\tLD_IN(b, k, 0, BPF_REG_3, BPF_REG_1);\n+\tEMIT(b, BPF_STX_MEM(size, BPF_REG_10, BPF_REG_1, MEM_SLOT));\n+\tLD_IN(b, k, 1, BPF_REG_3, BPF_REG_2);\n+\t/* Mismatch: the memory keeps its value, r0 gets it */\n+\tEMIT(b, BPF_MOV64_REG(BPF_REG_0, BPF_REG_1));\n+\tEMIT(b, BPF_ALU64_IMM(BPF_XOR, BPF_REG_0, -1));\n+\tEMIT(b, BPF_ATOMIC_OP(size, BPF_CMPXCHG, BPF_REG_10, BPF_REG_2, MEM_SLOT));\n+\tST_OUT(b, k, 0, BPF_REG_3, BPF_REG_0);\n+\t/* Match: the memory gets the source, r0 the old value */\n+\tEMIT(b, BPF_ATOMIC_OP(size, BPF_CMPXCHG, BPF_REG_10, BPF_REG_2, MEM_SLOT));\n+\tEMIT(b, BPF_LDX_MEM(size, BPF_REG_1, BPF_REG_10, MEM_SLOT));\n+\tST_OUT(b, k, 1, BPF_REG_3, BPF_REG_1);\n+\tST_OUT(b, k, 2, BPF_REG_3, BPF_REG_0);\n+\tbatch_expect(b, k, 0, old);\n+\tbatch_expect(b, k, 1, w ? (__u32)src : src);\n+\tbatch_expect(b, k, 2, old);\n+}\n+\n+static void test_atomics(void)\n+{\n+\tstatic const int sizes[] = { BPF_DW, BPF_W };\n+\tstruct batch b;\n+\tint o, s;\n+\n+\tif (!batch_init(\u0026b))\n+\t\treturn;\n+\tfor (s = 0; s \u003c ARRAY_SIZE(sizes); s++) {\n+\t\tint size = sizes[s];\n+\n+\t\tfor (o = 0; o \u003c ARRAY_SIZE(atomic_ops); o++) {\n+\t\t\tstruct atomic_arg a = { atomic_ops[o], size };\n+\n+\t\t\tsnprintf(b.desc, sizeof(b.desc), \"atomic%d_%s%s magnitudes\",\n+\t\t\t\t size == BPF_DW ? 64 : 32, alu_name(a.op),\n+\t\t\t\t a.op == BPF_XCHG ? \"\" : a.op \u0026 BPF_FETCH ? \"_fetch\" : \"\");\n+\t\t\tfill_pattern(\u0026b, \u0026a, 64, 64, 0, 1, PATTERN_BLOCK2, emit_atomic);\n+\t\t}\n+\t\tsnprintf(b.desc, sizeof(b.desc), \"atomic%d_cmpxchg magnitudes\",\n+\t\t\t size == BPF_DW ? 64 : 32);\n+\t\tfill_pattern(\u0026b, \u0026size, 64, 64, 0, 1, PATTERN_BLOCK2, emit_cmpxchg);\n+\t}\n+\tbatch_fini(\u0026b);\n+}\n+\n+/* Atomic operations for all combinations of pointer and source register */\n+static void atomic_reg_pairs(struct batch *b, int size, int op)\n+{\n+\tbool w = size == BPF_W;\n+\t__u64 mem, upd;\n+\tint rd, rs, rc, k, n;\n+\n+\tif (w) {\n+\t\tmem = 0x01234567U;\n+\t\tupd = 0x76543210U;\n+\t} else {\n+\t\tmem = 0x0123456789abcdefULL;\n+\t\tupd = 0xfedcba9876543210ULL;\n+\t}\n+\n+\tsnprintf(b-\u003edesc, sizeof(b-\u003edesc), \"atomic%d_%s%s register pairs\", w ? 32 : 64,\n+\t\t alu_name(op), op == BPF_XCHG || op == BPF_CMPXCHG ? \"\" :\n+\t\t op \u0026 BPF_FETCH ? \"_fetch\" : \"\");\n+\tfor (rd = BPF_REG_0; rd \u003c= BPF_REG_9; rd++) {\n+\t\tfor (rs = BPF_REG_0; rs \u003c= BPF_REG_9; rs++) {\n+\t\t\t__u64 regs[10], old = mem, new, src, cmp;\n+\n+\t\t\t/* The source would be the pointer, r0 the compare value */\n+\t\t\tif (rs == rd || (op == BPF_CMPXCHG \u0026\u0026 rd == BPF_REG_0))\n+\t\t\t\tcontinue;\n+\t\t\trc = scratch_reg(rd, rs);\n+\t\t\tk = batch_case(b, rc, mem, upd);\n+\t\t\t/* Memory from in0, r0 inverted, source from in1, pointer */\n+\t\t\tLD_IN(b, k, 0, rc, rs);\n+\t\t\tEMIT(b, BPF_STX_MEM(size, BPF_REG_10, rs, MEM_SLOT));\n+\t\t\tLD_IN(b, k, 0, rc, BPF_REG_0);\n+\t\t\tEMIT(b, BPF_ALU64_IMM(BPF_XOR, BPF_REG_0, -1));\n+\t\t\tLD_IN(b, k, 1, rc, rs);\n+\t\t\tEMIT(b, BPF_MOV64_REG(rd, BPF_REG_10));\n+\t\t\tEMIT(b, BPF_ATOMIC_OP(size, op, rd, rs, MEM_SLOT));\n+\t\t\t/* r0 holds the pointer when it is the destination */\n+\t\t\tn = 0;\n+\t\t\tif (rd != BPF_REG_0)\n+\t\t\t\tST_OUT(b, k, n++, rc, BPF_REG_0);\n+\t\t\tST_OUT(b, k, n++, rc, rs);\n+\t\t\tEMIT(b, BPF_LDX_MEM(size, rs, BPF_REG_10, MEM_SLOT));\n+\t\t\tST_OUT(b, k, n, rc, rs);\n+\n+\t\t\t/* Model with the register aliasing of r0 */\n+\t\t\tregs[BPF_REG_0] = ~mem;\n+\t\t\tregs[rs] = upd;\n+\t\t\tsrc = w ? (__u32)regs[rs] : regs[rs];\n+\t\t\tif (op == BPF_XCHG) {\n+\t\t\t\tnew = src;\n+\t\t\t\tregs[rs] = old;\n+\t\t\t} else if (op == BPF_CMPXCHG) {\n+\t\t\t\tcmp = w ? (__u32)regs[BPF_REG_0] : regs[BPF_REG_0];\n+\t\t\t\tnew = cmp == old ? src : old;\n+\t\t\t\tregs[BPF_REG_0] = old;\n+\t\t\t} else {\n+\t\t\t\talu_result(\u0026new, old, src, BPF_OP(op), 0);\n+\t\t\t\tif (w)\n+\t\t\t\t\tnew = (__u32)new;\n+\t\t\t\tif (op \u0026 BPF_FETCH)\n+\t\t\t\t\tregs[rs] = old;\n+\t\t\t}\n+\t\t\tn = 0;\n+\t\t\tif (rd != BPF_REG_0)\n+\t\t\t\tbatch_expect(b, k, n++, regs[BPF_REG_0]);\n+\t\t\tbatch_expect(b, k, n++, regs[rs]);\n+\t\t\tbatch_expect(b, k, n, new);\n+\t\t}\n+\t}\n+\tbatch_flush(b);\n+}\n+\n+static void test_atomic_reg_pairs(void)\n+{\n+\tstatic const int sizes[] = { BPF_DW, BPF_W };\n+\tstruct batch b;\n+\tint o, s;\n+\n+\tif (!batch_init(\u0026b))\n+\t\treturn;\n+\tfor (s = 0; s \u003c ARRAY_SIZE(sizes); s++) {\n+\t\tfor (o = 0; o \u003c ARRAY_SIZE(atomic_ops); o++)\n+\t\t\tatomic_reg_pairs(\u0026b, sizes[s], atomic_ops[o]);\n+\t\tatomic_reg_pairs(\u0026b, sizes[s], BPF_CMPXCHG);\n+\t}\n+\tbatch_fini(\u0026b);\n+}\n+\n+/* A maximal chain of atomic adds on one stack slot */\n+static void test_xadd_chain(void)\n+{\n+\tstatic const int sizes[] = { BPF_DW, BPF_W };\n+\tLIBBPF_OPTS(bpf_test_run_opts, opts);\n+\tstruct bpf_insn *insns;\n+\tint len = BPF_MAXINSNS, s, i, fd;\n+\n+\tinsns = malloc(len * sizeof(*insns));\n+\tif (!ASSERT_OK_PTR(insns, \"insns\"))\n+\t\treturn;\n+\tfor (s = 0; s \u003c ARRAY_SIZE(sizes); s++) {\n+\t\tinsns[0] = BPF_MOV32_IMM(BPF_REG_0, 1);\n+\t\tinsns[1] = BPF_ST_MEM(sizes[s], BPF_REG_10, -40, 42);\n+\t\tfor (i = 2; i \u003c len - 2; i++)\n+\t\t\tinsns[i] = BPF_STX_XADD(sizes[s], BPF_REG_10, BPF_REG_0, -40);\n+\t\tinsns[len - 2] = BPF_LDX_MEM(sizes[s], BPF_REG_0, BPF_REG_10, -40);\n+\t\tinsns[len - 1] = BPF_EXIT_INSN();\n+\n+\t\tfd = load_prog(insns, len, \"xadd chain\");\n+\t\tif (fd \u003c 0)\n+\t\t\tbreak;\n+\t\tif (ASSERT_OK(bpf_prog_test_run_opts(fd, \u0026opts), \"xadd chain run\"))\n+\t\t\tASSERT_EQ(opts.retval, 42 + len - 4, \"xadd chain result\");\n+\t\tclose(fd);\n+\t}\n+\tfree(insns);\n+}\n+\n+/* 64-bit immediate loads for all magnitudes and byte patterns */\n+static void ld_imm64_case(struct batch *b, __u64 imm)\n+{\n+\tint k = batch_case(b, BPF_REG_3, imm, 0);\n+\n+\temit_ld_imm64(b, BPF_REG_1, imm);\n+\tST_OUT(b, k, 0, BPF_REG_3, BPF_REG_1);\n+\tbatch_expect(b, k, 0, imm);\n+}\n+\n+static void test_ld_imm64(void)\n+{\n+\tstatic const struct {\n+\t\t__u8 base1, mask1, base2, mask2;\n+\t} bytes[] = {\n+\t\t{ 0, 0xff, 0xff, 0xff },\t/* checker */\n+\t\t{ 1, 0x81, 0x80, 0x80 },\t/* positive and negative */\n+\t\t{ 1, 0x81, 0, 0xff },\t\t/* positive and zero */\n+\t\t{ 0x80, 0x80, 0, 0xff },\t/* negative and zero */\n+\t};\n+\tint block = 64, bit, adj, sign, p, pattern, index;\n+\tstruct batch b;\n+\n+\tif (!batch_init(\u0026b))\n+\t\treturn;\n+\tsnprintf(b.desc, sizeof(b.desc), \"ld_imm64 magnitudes\");\n+\tfor (bit = 0; bit \u003c= 62; bit++)\n+\t\tfor (adj = -block / 2; adj \u003c block / 2; adj++)\n+\t\t\tfor (sign = -1; sign \u003c= 1; sign += 2)\n+\t\t\t\tld_imm64_case(\u0026b, sign * ((1LL \u003c\u003c bit) + adj));\n+\tbatch_flush(\u0026b);\n+\n+\tfor (p = 0; p \u003c ARRAY_SIZE(bytes); p++) {\n+\t\t__u32 rand = 1;\n+\n+\t\tsnprintf(b.desc, sizeof(b.desc), \"ld_imm64 byte pattern %d\", p);\n+\t\tfor (pattern = 0; pattern \u003c 256; pattern++) {\n+\t\t\t__u64 imm = 0;\n+\n+\t\t\tfor (index = 0; index \u003c 8; index++) {\n+\t\t\t\tint byte;\n+\n+\t\t\t\tif (pattern \u0026 (1 \u003c\u003c index))\n+\t\t\t\t\tbyte = (bytes[p].base1 \u0026 bytes[p].mask1) |\n+\t\t\t\t\t       (rand \u0026 ~bytes[p].mask1);\n+\t\t\t\telse\n+\t\t\t\t\tbyte = (bytes[p].base2 \u0026 bytes[p].mask2) |\n+\t\t\t\t\t       (rand \u0026 ~bytes[p].mask2);\n+\t\t\t\timm = (imm \u003c\u003c 8) | (__u8)byte;\n+\t\t\t}\n+\t\t\trand = rand * 1664525 + 1013904223;\n+\t\t\tld_imm64_case(\u0026b, imm);\n+\t\t}\n+\t\tbatch_flush(\u0026b);\n+\t}\n+\tbatch_fini(\u0026b);\n+}\n+\n+/* Conditional jumps with an immediate and with a register for all magnitudes */\n+static const int jmp_ops[] = {\n+\tBPF_JSET, BPF_JEQ, BPF_JNE, BPF_JGT, BPF_JGE, BPF_JLT, BPF_JLE,\n+\tBPF_JSGT, BPF_JSGE, BPF_JSLT, BPF_JSLE,\n+};\n+\n+static bool jmp_match(__s64 v1, __s64 v2, __u8 op)\n+{\n+\tswitch (op) {\n+\tcase BPF_JSET:\n+\t\treturn !!(v1 \u0026 v2);\n+\tcase BPF_JEQ:\n+\t\treturn v1 == v2;\n+\tcase BPF_JNE:\n+\t\treturn v1 != v2;\n+\tcase BPF_JGT:\n+\t\treturn (__u64)v1 \u003e (__u64)v2;\n+\tcase BPF_JGE:\n+\t\treturn (__u64)v1 \u003e= (__u64)v2;\n+\tcase BPF_JLT:\n+\t\treturn (__u64)v1 \u003c (__u64)v2;\n+\tcase BPF_JLE:\n+\t\treturn (__u64)v1 \u003c= (__u64)v2;\n+\tcase BPF_JSGT:\n+\t\treturn v1 \u003e v2;\n+\tcase BPF_JSGE:\n+\t\treturn v1 \u003e= v2;\n+\tcase BPF_JSLT:\n+\t\treturn v1 \u003c v2;\n+\tcase BPF_JSLE:\n+\t\treturn v1 \u003c= v2;\n+\t}\n+\treturn false;\n+}\n+\n+struct jmp_arg {\n+\tint op;\n+\tbool is32;\n+\tbool reg;\n+};\n+\n+static void emit_jmp(struct batch *b, void *arg, __s64 dst, __s64 src)\n+{\n+\tstruct jmp_arg *a = arg;\n+\tbool match;\n+\tint k;\n+\n+\tif (a-\u003eis32)\n+\t\tmatch = jmp_match((__s32)dst, (__s32)src, a-\u003eop);\n+\telse\n+\t\tmatch = jmp_match(dst, a-\u003ereg ? src : (__s32)src, a-\u003eop);\n+\n+\tk = batch_case(b, BPF_REG_3, dst, src);\n+\tLD_IN(b, k, 0, BPF_REG_3, BPF_REG_1);\n+\tif (a-\u003ereg)\n+\t\tLD_IN(b, k, 1, BPF_REG_3, BPF_REG_2);\n+\tEMIT(b, BPF_MOV64_IMM(BPF_REG_4, 1));\n+\tif (a-\u003ereg \u0026\u0026 a-\u003eis32)\n+\t\tEMIT(b, BPF_JMP32_REG(a-\u003eop, BPF_REG_1, BPF_REG_2, 1));\n+\telse if (a-\u003ereg)\n+\t\tEMIT(b, BPF_JMP_REG(a-\u003eop, BPF_REG_1, BPF_REG_2, 1));\n+\telse if (a-\u003eis32)\n+\t\tEMIT(b, BPF_JMP32_IMM(a-\u003eop, BPF_REG_1, src, 1));\n+\telse\n+\t\tEMIT(b, BPF_JMP_IMM(a-\u003eop, BPF_REG_1, src, 1));\n+\tEMIT(b, BPF_MOV64_IMM(BPF_REG_4, 0));\n+\tST_OUT(b, k, 0, BPF_REG_3, BPF_REG_4);\n+\tbatch_expect(b, k, 0, match);\n+}\n+\n+static void test_jmp_magnitudes(bool reg)\n+{\n+\tstruct batch b;\n+\tint o, f;\n+\n+\tif (!batch_init(\u0026b))\n+\t\treturn;\n+\tfor (f = 0; f \u003c 2; f++) {\n+\t\tfor (o = 0; o \u003c ARRAY_SIZE(jmp_ops); o++) {\n+\t\t\tstruct jmp_arg a = { jmp_ops[o], f, reg };\n+\n+\t\t\tsnprintf(b.desc, sizeof(b.desc), \"jmp%s_%s_%c magnitudes\", f ? \"32\" : \"\",\n+\t\t\t\t jmp_name(a.op), reg ? 'x' : 'k');\n+\t\t\tif (reg)\n+\t\t\t\tfill_pattern(\u0026b, \u0026a, 64, 64, 0, 1, PATTERN_BLOCK2, emit_jmp);\n+\t\t\telse\n+\t\t\t\tfill_pattern(\u0026b, \u0026a, 64, 32, PATTERN_BLOCK1, 8, PATTERN_BLOCK2,\n+\t\t\t\t\t     emit_jmp);\n+\t\t}\n+\t}\n+\tbatch_fini(\u0026b);\n+}\n+\n+static void test_jmp_imm(void)\n+{\n+\ttest_jmp_magnitudes(false);\n+}\n+\n+static void test_jmp_reg(void)\n+{\n+\ttest_jmp_magnitudes(true);\n+}\n+\n+/* A conditional jump on two registers, with the operands swapped for n == 1 */\n+static void jmp_reg_pair(struct batch *b, bool is32, int op, int rd, int rs, int n)\n+{\n+\tconst __u64 a = 0x7edcba9876543210ULL, c = 0x0123456789abcdefULL;\n+\t__u64 v1 = n ? c : a, v2 = n ? a : c;\n+\tint rc, rt, k;\n+\tbool match;\n+\n+\t/* Two scratch registers besides the operands */\n+\trc = scratch_reg(rd, rs);\n+\tfor (rt = BPF_REG_1; rt \u003c BPF_REG_9; rt++)\n+\t\tif (rt != rd \u0026\u0026 rt != rs \u0026\u0026 rt != rc)\n+\t\t\tbreak;\n+\tif (rd == rs)\n+\t\tv2 = v1;\n+\tmatch = is32 ? jmp_match((__s32)v1, (__s32)v2, op) : jmp_match(v1, v2, op);\n+\n+\tk = batch_case(b, rc, v1, v2);\n+\tLD_IN(b, k, 0, rc, rd);\n+\tif (rs != rd)\n+\t\tLD_IN(b, k, 1, rc, rs);\n+\tEMIT(b, BPF_MOV64_IMM(rt, 1));\n+\tif (is32)\n+\t\tEMIT(b, BPF_JMP32_REG(op, rd, rs, 1));\n+\telse\n+\t\tEMIT(b, BPF_JMP_REG(op, rd, rs, 1));\n+\tEMIT(b, BPF_MOV64_IMM(rt, 0));\n+\tST_OUT(b, k, 0, rc, rt);\n+\tbatch_expect(b, k, 0, match);\n+}\n+\n+/* Conditional jumps for all combinations of operand registers, taken and not */\n+static void test_jmp_reg_pairs(void)\n+{\n+\tstruct batch b;\n+\tint o, f, rd, rs, n;\n+\n+\tif (!batch_init(\u0026b))\n+\t\treturn;\n+\tfor (f = 0; f \u003c 2; f++) {\n+\t\tfor (o = 0; o \u003c ARRAY_SIZE(jmp_ops); o++) {\n+\t\t\tsnprintf(b.desc, sizeof(b.desc), \"jmp%s_%s_x register pairs\",\n+\t\t\t\t f ? \"32\" : \"\", jmp_name(jmp_ops[o]));\n+\t\t\tfor (rd = BPF_REG_0; rd \u003c= BPF_REG_9; rd++)\n+\t\t\t\tfor (rs = BPF_REG_0; rs \u003c= BPF_REG_9; rs++)\n+\t\t\t\t\tfor (n = 0; n \u003c 2; n++)\n+\t\t\t\t\t\tjmp_reg_pair(\u0026b, f, jmp_ops[o], rd, rs, n);\n+\t\t\tbatch_flush(\u0026b);\n+\t\t}\n+\t}\n+\tbatch_fini(\u0026b);\n+}\n+\n+/* The offset of a jump instruction, which the 32-bit unconditional jump keeps in imm */\n+static void set_jmp_off(struct bpf_insn *insn, bool ja32, int off)\n+{\n+\tif (ja32)\n+\t\tinsn-\u003eimm = off;\n+\telse\n+\t\tinsn-\u003eoff = off;\n+}\n+\n+static struct bpf_insn jmp_insn(bool ja32)\n+{\n+\treturn ja32 ? BPF_RAW_INSN(BPF_JMP32 | BPF_JA, 0, 0, 0, 0) : BPF_JMP_IMM(BPF_JA, 0, 0, 0);\n+}\n+\n+/*\n+ * Taken jumps over regions of doubling length, forward or backward, up to\n+ * the maximal offset of the jump: 16 bits, or 2^17 for the 32-bit\n+ * unconditional jump. The not taken path of a conditional jump and the\n+ * guard of an unconditional one lead to an exit with the region number, so\n+ * the verifier sees every instruction reachable and a jump landing anywhere\n+ * else than on its target fails the run.\n+ */\n+static void staggered_jumps(const struct bpf_insn *jmp, __s64 r1, __s64 r2, bool backward,\n+\t\t\t    const char *desc)\n+{\n+\tbool ja32 = BPF_CLASS(jmp-\u003ecode) == BPF_JMP32 \u0026\u0026 BPF_OP(jmp-\u003ecode) == BPF_JA;\n+\tbool ja = BPF_OP(jmp-\u003ecode) == BPF_JA;\n+\tstruct { __u64 r1, r2; } ctx = { r1, r2 };\n+\tLIBBPF_OPTS(bpf_test_run_opts, opts,\n+\t\t.ctx_in = \u0026ctx,\n+\t\t.ctx_size_in = sizeof(ctx),\n+\t);\n+\tint max = ja32 ? 1 \u003c\u003c 17 : INT16_MAX;\n+\tint len = 128 + 2 * max, i = 0, n = 0, gap, fd;\n+\tstruct bpf_insn *insns;\n+\n+\tinsns = malloc(len * sizeof(*insns));\n+\tif (!ASSERT_OK_PTR(insns, \"insns\"))\n+\t\treturn;\n+\tinsns[i++] = BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_1, 8);\n+\tinsns[i++] = BPF_LDX_MEM(BPF_DW, BPF_REG_1, BPF_REG_1, 0);\n+\tinsns[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_0, 0);\n+\tfor (gap = backward ? 4 : 2; gap \u003c= max; gap = gap \u003c max / 2 ? gap * 2 : max) {\n+\t\tint k, a, t, x, g, j;\n+\n+\t\tif (backward) {\n+\t\t\t/*\n+\t\t\t * Over the region to its guard and jump, which comes back\n+\t\t\t * to the start of the region, from where it leads on to\n+\t\t\t * the next one.\n+\t\t\t */\n+\t\t\ta = i++;\n+\t\t\tt = i;\n+\t\t\tfor (k = 0; k \u003c gap - 3; k++)\n+\t\t\t\tinsns[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_3, 0);\n+\t\t\tx = i++;\n+\t\t\tg = i;\n+\t\t\tif (ja)\n+\t\t\t\tinsns[i++] = BPF_JMP_IMM(BPF_JEQ, BPF_REG_2, 0, 1);\n+\t\t\tj = i;\n+\t\t\tinsns[i] = *jmp;\n+\t\t\tset_jmp_off(\u0026insns[i++], ja32, t - (j + 1));\n+\t\t\tinsns[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_0, ++n);\n+\t\t\tinsns[i++] = BPF_EXIT_INSN();\n+\t\t\tinsns[a] = jmp_insn(ja32);\n+\t\t\tset_jmp_off(\u0026insns[a], ja32, g - (a + 1));\n+\t\t\tinsns[x] = jmp_insn(ja32);\n+\t\t\tset_jmp_off(\u0026insns[x], ja32, i - (x + 1));\n+\t\t} else {\n+\t\t\t/* An unconditional jump needs a way into its region */\n+\t\t\tif (ja)\n+\t\t\t\tinsns[i++] = BPF_JMP_IMM(BPF_JEQ, BPF_REG_2, 0, 1);\n+\t\t\tinsns[i] = *jmp;\n+\t\t\tset_jmp_off(\u0026insns[i++], ja32, gap);\n+\t\t\tinsns[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_0, ++n);\n+\t\t\tfor (k = 0; k \u003c gap - 2; k++)\n+\t\t\t\tinsns[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_3, 0);\n+\t\t\tinsns[i++] = BPF_EXIT_INSN();\n+\t\t}\n+\t\tif (gap == max)\n+\t\t\tbreak;\n+\t}\n+\tinsns[i++] = BPF_EXIT_INSN();\n+\tif (!ASSERT_LE(i, len, \"insn count\"))\n+\t\tgoto out;\n+\n+\tfd = load_prog(insns, i, desc);\n+\tif (fd \u003e= 0) {\n+\t\tif (ASSERT_OK(bpf_prog_test_run_opts(fd, \u0026opts), desc))\n+\t\t\tASSERT_EQ(opts.retval, 0, desc);\n+\t\tclose(fd);\n+\t}\n+out:\n+\tfree(insns);\n+}\n+\n+static void test_staggered_jumps(void)\n+{\n+\t/* A representative set, with operands which make the jump taken */\n+\tstatic const struct {\n+\t\tconst char *desc;\n+\t\tstruct bpf_insn jmp;\n+\t\t__s64 r1, r2;\n+\t} kinds[] = {\n+\t\t{ \"staggered ja\",\n+\t\t  BPF_JMP_IMM(BPF_JA, 0, 0, 0), 0, 1 },\n+\t\t{ \"staggered gotol\",\n+\t\t  BPF_RAW_INSN(BPF_JMP32 | BPF_JA, 0, 0, 0, 0), 0, 1 },\n+\t\t{ \"staggered jmp_jeq_k\",\n+\t\t  BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 1234, 0), 1234, 0 },\n+\t\t{ \"staggered jmp_jne_x\",\n+\t\t  BPF_JMP_REG(BPF_JNE, BPF_REG_1, BPF_REG_2, 0), 4321, 1234 },\n+\t\t{ \"staggered jmp_jset_k\",\n+\t\t  BPF_JMP_IMM(BPF_JSET, BPF_REG_1, 0x82, 0), 0x86, 0 },\n+\t\t{ \"staggered jmp_jsgt_x\",\n+\t\t  BPF_JMP_REG(BPF_JSGT, BPF_REG_1, BPF_REG_2, 0), -1, -2 },\n+\t\t{ \"staggered jmp32_jlt_k\",\n+\t\t  BPF_JMP32_IMM(BPF_JLT, BPF_REG_1, 0x80000000, 0), 1234, 0 },\n+\t\t{ \"staggered jmp32_jsge_x\",\n+\t\t  BPF_JMP32_REG(BPF_JSGE, BPF_REG_1, BPF_REG_2, 0), -2, -2 },\n+\t};\n+\tchar desc[64];\n+\tint i, d;\n+\n+\tfor (i = 0; i \u003c ARRAY_SIZE(kinds); i++) {\n+\t\tfor (d = 0; d \u003c 2; d++) {\n+\t\t\tsnprintf(desc, sizeof(desc), \"%s %s\", kinds[i].desc,\n+\t\t\t\t d ? \"backward\" : \"forward\");\n+\t\t\tstaggered_jumps(\u0026kinds[i].jmp, kinds[i].r1, kinds[i].r2, d, desc);\n+\t\t}\n+\t}\n+}\n+\n+/*\n+ * The pattern sweeps: one program per pattern and register choice, run\n+ * once per input with the operands in the ctx and the result handed back\n+ * through it.\n+ */\n+struct pat_ctx {\n+\t__u64 in0;\n+\t__u64 in1;\n+\t__u64 res;\n+};\n+\n+#define IN0\toffsetof(struct pat_ctx, in0)\n+#define IN1\toffsetof(struct pat_ctx, in1)\n+#define RES\toffsetof(struct pat_ctx, res)\n+\n+/* r6 holds the ctx */\n+static const int pat_regs[] = {\n+\tBPF_REG_0, BPF_REG_1, BPF_REG_2, BPF_REG_3, BPF_REG_4,\n+\tBPF_REG_5, BPF_REG_7, BPF_REG_8, BPF_REG_9,\n+};\n+\n+/* The second register of a pattern: the same one, the next and a far one */\n+#define NR_PAIRS 3\n+static const int pair_off[NR_PAIRS] = { 0, 1, 5 };\n+\n+static int pair_reg(int i, int k)\n+{\n+\treturn pat_regs[(i + pair_off[k]) % ARRAY_SIZE(pat_regs)];\n+}\n+\n+static const __u64 inputs[] = {\n+\t0, 0x1122334455667788ULL, 0xfedcba9876543210ULL, 0x80, 0xffffffffffffff7fULL,\n+};\n+\n+struct prog {\n+\tstruct bpf_insn insns[16];\n+\tint cnt;\n+};\n+\n+static void prog_start(struct prog *p)\n+{\n+\tp-\u003ecnt = 0;\n+\tEMIT(p, BPF_MOV64_REG(BPF_REG_6, BPF_REG_1));\n+}\n+\n+/* Hand the result in reg back and return */\n+static void prog_end(struct prog *p, int reg)\n+{\n+\tEMIT(p, BPF_STX_MEM(BPF_DW, BPF_REG_6, reg, RES));\n+\tEMIT(p, BPF_MOV64_IMM(BPF_REG_0, 0));\n+\tEMIT(p, BPF_EXIT_INSN());\n+}\n+\n+static int prog_load(struct prog *p, const char *desc)\n+{\n+\tLIBBPF_OPTS(bpf_prog_load_opts, lopts,\n+\t\t.prog_flags = BPF_F_SLEEPABLE,\n+\t\t.log_buf = log,\n+\t\t.log_size = sizeof(log),\n+\t);\n+\tint fd;\n+\n+\tfd = bpf_prog_load(BPF_PROG_TYPE_SYSCALL, NULL, \"GPL\", p-\u003einsns, p-\u003ecnt, \u0026lopts);\n+\tif (!ASSERT_GE(fd, 0, desc))\n+\t\tfprintf(stderr, \"%s\", log);\n+\treturn fd;\n+}\n+\n+static void prog_run(int fd, __u64 in0, __u64 in1, __u64 expected, const char *desc)\n+{\n+\tstruct pat_ctx ctx = { .in0 = in0, .in1 = in1 };\n+\tLIBBPF_OPTS(bpf_test_run_opts, opts,\n+\t\t.ctx_in = \u0026ctx,\n+\t\t.ctx_size_in = sizeof(ctx),\n+\t);\n+\tchar buf[128];\n+\n+\tsnprintf(buf, sizeof(buf), \"%s in0=0x%llx in1=0x%llx\", desc, in0, in1);\n+\tif (ASSERT_OK(bpf_prog_test_run_opts(fd, \u0026opts), buf))\n+\t\tASSERT_EQ(ctx.res, expected, buf);\n+}\n+\n+static int size_bits(int size)\n+{\n+\tswitch (size) {\n+\tcase BPF_B:\n+\t\treturn 8;\n+\tcase BPF_H:\n+\t\treturn 16;\n+\tcase BPF_W:\n+\t\treturn 32;\n+\tdefault:\n+\t\treturn 64;\n+\t}\n+}\n+\n+/* The first size bytes of v in memory, as a load of that size reads them */\n+static __u64 head_bytes(__u64 v, int size)\n+{\n+\tint bits = size_bits(size);\n+\n+\tif (bits == 64)\n+\t\treturn v;\n+#if __BYTE_ORDER == __BIG_ENDIAN\n+\treturn v \u003e\u003e (64 - bits);\n+#else\n+\treturn v \u0026 ((1ULL \u003c\u003c bits) - 1);\n+#endif\n+}\n+\n+/* v with its first size bytes in memory replaced by those of w */\n+static __u64 head_merge(__u64 v, __u64 w, int size)\n+{\n+\tint bits = size_bits(size);\n+\t__u64 mask;\n+\n+\tif (bits == 64)\n+\t\treturn w;\n+\tmask = (1ULL \u003c\u003c bits) - 1;\n+#if __BYTE_ORDER == __BIG_ENDIAN\n+\treturn (v \u0026 ~(mask \u003c\u003c (64 - bits))) | ((w \u0026 mask) \u003c\u003c (64 - bits));\n+#else\n+\treturn (v \u0026 ~mask) | (w \u0026 mask);\n+#endif\n+}\n+\n+static void test_ldst_zero_off(void)\n+{\n+\tstatic const int sizes[] = { BPF_B, BPF_H, BPF_W, BPF_DW };\n+\tstatic const int aops[] = {\n+\t\tBPF_ADD, BPF_ADD | BPF_FETCH, BPF_OR, BPF_XCHG, BPF_CMPXCHG,\n+\t};\n+\tstatic const __s32 imms[] = { 0x5a, -1 };\n+\tstruct prog p;\n+\tchar desc[64];\n+\tint b, k, s, j, fd;\n+\n+\tfor (b = 0; b \u003c ARRAY_SIZE(pat_regs); b++) {\n+\t\tint rb = pat_regs[b];\n+\n+\t\tfor (s = 0; s \u003c ARRAY_SIZE(sizes); s++) {\n+\t\t\tint size = sizes[s];\n+\n+\t\t\tfor (k = 0; k \u003c NR_PAIRS; k++) {\n+\t\t\t\tint rd = pair_reg(b, k);\n+\n+\t\t\t\t/* Load with a zero offset, also into the base */\n+\t\t\t\tprog_start(\u0026p);\n+\t\t\t\tEMIT(\u0026p, BPF_MOV64_REG(rb, BPF_REG_6));\n+\t\t\t\tEMIT(\u0026p, BPF_LDX_MEM(size, rd, rb, 0));\n+\t\t\t\tprog_end(\u0026p, rd);\n+\t\t\t\tsnprintf(desc, sizeof(desc), \"ldx size=%d base=r%d dst=r%d\",\n+\t\t\t\t\t size, rb, rd);\n+\t\t\t\tfd = prog_load(\u0026p, desc);\n+\t\t\t\tif (fd \u003c 0)\n+\t\t\t\t\treturn;\n+\t\t\t\tfor (j = 0; j \u003c ARRAY_SIZE(inputs); j++)\n+\t\t\t\t\tprog_run(fd, inputs[j], 0,\n+\t\t\t\t\t\t head_bytes(inputs[j], size), desc);\n+\t\t\t\tclose(fd);\n+\n+\t\t\t\t/* Sign extending load with a zero offset from the stack */\n+\t\t\t\tif (size != BPF_DW) {\n+\t\t\t\t\tprog_start(\u0026p);\n+\t\t\t\t\tEMIT(\u0026p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));\n+\t\t\t\t\tEMIT(\u0026p, BPF_STX_MEM(BPF_DW, BPF_REG_10, rd, -8));\n+\t\t\t\t\tEMIT(\u0026p, BPF_MOV64_REG(rb, BPF_REG_10));\n+\t\t\t\t\tEMIT(\u0026p, BPF_ALU64_IMM(BPF_ADD, rb, -8));\n+\t\t\t\t\tEMIT(\u0026p, BPF_RAW_INSN(BPF_LDX | BPF_MEMSX | size,\n+\t\t\t\t\t\t\t      rd, rb, 0, 0));\n+\t\t\t\t\tprog_end(\u0026p, rd);\n+\t\t\t\t\tsnprintf(desc, sizeof(desc),\n+\t\t\t\t\t\t \"ldsx size=%d base=r%d dst=r%d\", size, rb, rd);\n+\t\t\t\t\tfd = prog_load(\u0026p, desc);\n+\t\t\t\t\tif (fd \u003c 0)\n+\t\t\t\t\t\treturn;\n+\t\t\t\t\tfor (j = 0; j \u003c ARRAY_SIZE(inputs); j++) {\n+\t\t\t\t\t\t__s64 v = head_bytes(inputs[j], size);\n+\n+\t\t\t\t\t\tv = size == BPF_B ? (__s8)v :\n+\t\t\t\t\t\t    size == BPF_H ? (__s16)v : (__s32)v;\n+\t\t\t\t\t\tprog_run(fd, inputs[j], 0, v, desc);\n+\t\t\t\t\t}\n+\t\t\t\t\tclose(fd);\n+\t\t\t\t}\n+\n+\t\t\t\tif (rd == rb)\n+\t\t\t\t\tcontinue;\n+\t\t\t\t/* Store with a zero offset over in0 */\n+\t\t\t\tprog_start(\u0026p);\n+\t\t\t\tEMIT(\u0026p, BPF_MOV64_REG(rb, BPF_REG_6));\n+\t\t\t\tEMIT(\u0026p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN1));\n+\t\t\t\tEMIT(\u0026p, BPF_STX_MEM(size, rb, rd, 0));\n+\t\t\t\tEMIT(\u0026p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));\n+\t\t\t\tprog_end(\u0026p, rd);\n+\t\t\t\tsnprintf(desc, sizeof(desc), \"stx size=%d base=r%d src=r%d\",\n+\t\t\t\t\t size, rb, rd);\n+\t\t\t\tfd = prog_load(\u0026p, desc);\n+\t\t\t\tif (fd \u003c 0)\n+\t\t\t\t\treturn;\n+\t\t\t\tfor (j = 0; j \u003c ARRAY_SIZE(inputs); j++) {\n+\t\t\t\t\t__u64 in1 = inputs[(j + 1) % ARRAY_SIZE(inputs)];\n+\n+\t\t\t\t\tprog_run(fd, inputs[j], in1,\n+\t\t\t\t\t\t head_merge(inputs[j], in1, size), desc);\n+\t\t\t\t}\n+\t\t\t\tclose(fd);\n+\t\t\t}\n+\n+\t\t\t/* Store an immediate with a zero offset into a zeroed stack slot */\n+\t\t\tfor (k = 0; k \u003c ARRAY_SIZE(imms); k++) {\n+\t\t\t\tint rd = pair_reg(b, 1);\n+\n+\t\t\t\tprog_start(\u0026p);\n+\t\t\t\tEMIT(\u0026p, BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0));\n+\t\t\t\tEMIT(\u0026p, BPF_MOV64_REG(rb, BPF_REG_10));\n+\t\t\t\tEMIT(\u0026p, BPF_ALU64_IMM(BPF_ADD, rb, -8));\n+\t\t\t\tEMIT(\u0026p, BPF_ST_MEM(size, rb, 0, imms[k]));\n+\t\t\t\tEMIT(\u0026p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_10, -8));\n+\t\t\t\tprog_end(\u0026p, rd);\n+\t\t\t\tsnprintf(desc, sizeof(desc), \"st size=%d base=r%d imm=%d\",\n+\t\t\t\t\t size, rb, imms[k]);\n+\t\t\t\tfd = prog_load(\u0026p, desc);\n+\t\t\t\tif (fd \u003c 0)\n+\t\t\t\t\treturn;\n+\t\t\t\tprog_run(fd, 0, 0,\n+\t\t\t\t\t head_merge(0, (__u64)(__s64)imms[k], size), desc);\n+\t\t\t\tclose(fd);\n+\t\t\t}\n+\n+\t\t\t/* Atomics with a zero offset on a stack slot holding in0 */\n+\t\t\tfor (k = 0; k \u003c ARRAY_SIZE(aops); k++) {\n+\t\t\t\tint rd = pair_reg(b, 1), op = aops[k];\n+\n+\t\t\t\tif (size == BPF_B || size == BPF_H)\n+\t\t\t\t\tbreak;\n+\t\t\t\t/* cmpxchg compares with r0 */\n+\t\t\t\tif (op == BPF_CMPXCHG \u0026\u0026 (rb == BPF_REG_0 || rd == BPF_REG_0))\n+\t\t\t\t\tcontinue;\n+\t\t\t\tprog_start(\u0026p);\n+\t\t\t\tEMIT(\u0026p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));\n+\t\t\t\tEMIT(\u0026p, BPF_STX_MEM(BPF_DW, BPF_REG_10, rd, -8));\n+\t\t\t\tEMIT(\u0026p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN1));\n+\t\t\t\tEMIT(\u0026p, BPF_MOV64_REG(rb, BPF_REG_10));\n+\t\t\t\tEMIT(\u0026p, BPF_ALU64_IMM(BPF_ADD, rb, -8));\n+\t\t\t\tif (op == BPF_CMPXCHG)\n+\t\t\t\t\tEMIT(\u0026p, BPF_LDX_MEM(size, BPF_REG_0, BPF_REG_10, -8));\n+\t\t\t\tEMIT(\u0026p, BPF_ATOMIC_OP(size, op, rb, rd, 0));\n+\t\t\t\tEMIT(\u0026p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_10, -8));\n+\t\t\t\tprog_end(\u0026p, rd);\n+\t\t\t\tsnprintf(desc, sizeof(desc), \"atomic 0x%x size=%d base=r%d src=r%d\",\n+\t\t\t\t\t op, size, rb, rd);\n+\t\t\t\tfd = prog_load(\u0026p, desc);\n+\t\t\t\tif (fd \u003c 0)\n+\t\t\t\t\treturn;\n+\t\t\t\tfor (j = 0; j \u003c ARRAY_SIZE(inputs); j++) {\n+\t\t\t\t\t__u64 in1 = inputs[(j + 1) % ARRAY_SIZE(inputs)];\n+\t\t\t\t\t__u64 v = head_bytes(inputs[j], size);\n+\t\t\t\t\t/* The source is the low half, whichever the byte order */\n+\t\t\t\t\t__u64 w = size == BPF_W ? (__u32)in1 : in1;\n+\t\t\t\t\t__u64 r = BPF_OP(op) == BPF_ADD ? v + w :\n+\t\t\t\t\t\t  BPF_OP(op) == BPF_OR ? v | w : w;\n+\n+\t\t\t\t\tprog_run(fd, inputs[j], in1,\n+\t\t\t\t\t\t head_merge(inputs[j], r, size), desc);\n+\t\t\t\t}\n+\t\t\t\tclose(fd);\n+\t\t\t}\n+\t\t}\n+\t}\n+}\n+\n+/*\n+ * Loads, stores and stores of an immediate with the offsets around the\n+ * limits of the short displacement forms, negative, large and unaligned\n+ * ones, with every register as base. The memory is an array map value with\n+ * the base register pointing at its middle, the loads hand their results\n+ * back through a second value and the stores are checked against a copy\n+ * kept here. The unaligned offsets are left out where the verifier insists\n+ * on aligned accesses.\n+ */\n+#define MEM_SIZE\t65536\n+#define MEM_BASE\t(MEM_SIZE / 2)\n+#define MEM_KEY\t\t0\n+#define RES_KEY\t\t1\n+#define SLOT_KEY\t-4\t/* stack slots: map key, results and base pointer */\n+#define SLOT_RES\t-16\n+#define SLOT_BASE\t-24\n+#define STORE_VAL\t0x8899aabbccddeeffULL\n+\n+struct off_prog {\n+\tstruct bpf_insn insns[128];\n+\tint cnt;\n+};\n+\n+/* The map holding the memory and the results, a copy of the memory and a buffer */\n+struct off_mem {\n+\tint map_fd;\n+\t__u8 *mem, *exp, *res;\n+};\n+\n+enum { K_LDX, K_LDSX, K_STX, K_ST };\n+\n+/* The offsets for an access of size, aligned unless unaligned ones are ok */\n+static int offsets_for(int size, bool unaligned, int *off)\n+{\n+\tint n = size_bits(size) / 8, cnt = 0;\n+\n+\toff[cnt++] = n;\n+\toff[cnt++] = 128 - n;\n+\toff[cnt++] = 128;\n+\toff[cnt++] = 256 - n;\n+\toff[cnt++] = 256;\n+\toff[cnt++] = 4096;\n+\toff[cnt++] = MEM_BASE - n;\n+\toff[cnt++] = -n;\n+\toff[cnt++] = -128;\n+\toff[cnt++] = -128 - n;\n+\toff[cnt++] = -256;\n+\toff[cnt++] = -4096;\n+\toff[cnt++] = -MEM_BASE;\n+\tif (n \u003e 1 \u0026\u0026 unaligned) {\n+\t\toff[cnt++] = 13;\n+\t\toff[cnt++] = 127;\n+\t\toff[cnt++] = -13;\n+\t\toff[cnt++] = -129;\n+\t}\n+\treturn cnt;\n+}\n+\n+/* The bytes a store of size writes from the register value v */\n+static void store_bytes(__u8 *dst, __u64 v, int size)\n+{\n+\tint n = size_bits(size) / 8;\n+\n+#if __BYTE_ORDER == __BIG_ENDIAN\n+\tmemcpy(dst, (__u8 *)\u0026v + 8 - n, n);\n+#else\n+\tmemcpy(dst, \u0026v, n);\n+#endif\n+}\n+\n+/* The value a load of size reads from the bytes at src */\n+static __u64 load_bytes(const __u8 *src, int size)\n+{\n+\t__u64 v = 0;\n+\n+\tmemcpy(\u0026v, src, size_bits(size) / 8);\n+\treturn head_bytes(v, size);\n+}\n+\n+/* A register that is neither of the two given ones */\n+static int other_reg(int r1, int r2)\n+{\n+\tint i;\n+\n+\tfor (i = 0; i \u003c ARRAY_SIZE(pat_regs); i++)\n+\t\tif (pat_regs[i] != r1 \u0026\u0026 pat_regs[i] != r2)\n+\t\t\treturn pat_regs[i];\n+\treturn BPF_REG_9;\n+}\n+\n+/* Look up the value of key into r0, exit with 1 when the lookup fails */\n+static void off_prog_lookup(struct off_prog *p, int map_fd, int key)\n+{\n+\tEMIT(p, BPF_ST_MEM(BPF_W, BPF_REG_10, SLOT_KEY, key));\n+\tEMIT(p, BPF_RAW_INSN(BPF_LD | BPF_DW | BPF_IMM, BPF_REG_1, BPF_PSEUDO_MAP_FD, 0, map_fd));\n+\tEMIT(p, BPF_RAW_INSN(0, 0, 0, 0, 0));\n+\tEMIT(p, BPF_MOV64_REG(BPF_REG_2, BPF_REG_10));\n+\tEMIT(p, BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, SLOT_KEY));\n+\tEMIT(p, BPF_EMIT_CALL(BPF_FUNC_map_lookup_elem));\n+\tEMIT(p, BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 2));\n+\tEMIT(p, BPF_MOV64_IMM(BPF_REG_0, 1));\n+\tEMIT(p, BPF_EXIT_INSN());\n+}\n+\n+/* rb points at the middle of the memory, the results value is spilled */\n+static void off_prog_start(struct off_prog *p, int map_fd, int rb)\n+{\n+\tp-\u003ecnt = 0;\n+\toff_prog_lookup(p, map_fd, RES_KEY);\n+\tEMIT(p, BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_0, SLOT_RES));\n+\toff_prog_lookup(p, map_fd, MEM_KEY);\n+\tEMIT(p, BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, MEM_BASE));\n+\tEMIT(p, BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_0, SLOT_BASE));\n+\tif (rb != BPF_REG_0)\n+\t\tEMIT(p, BPF_MOV64_REG(rb, BPF_REG_0));\n+}\n+\n+static int off_prog_load(struct off_prog *p, const char *desc, bool quiet)\n+{\n+\tLIBBPF_OPTS(bpf_prog_load_opts, lopts,\n+\t\t.prog_flags = BPF_F_SLEEPABLE,\n+\t\t.log_buf = log,\n+\t\t.log_size = sizeof(log),\n+\t);\n+\tint fd;\n+\n+\tEMIT(p, BPF_MOV64_IMM(BPF_REG_0, 0));\n+\tEMIT(p, BPF_EXIT_INSN());\n+\tfd = bpf_prog_load(BPF_PROG_TYPE_SYSCALL, NULL, \"GPL\", p-\u003einsns, p-\u003ecnt, \u0026lopts);\n+\tif (quiet)\n+\t\treturn fd;\n+\tif (!ASSERT_GE(fd, 0, desc))\n+\t\tfprintf(stderr, \"%s\", log);\n+\treturn fd;\n+}\n+\n+static int off_prog_run(int fd, const char *desc)\n+{\n+\tLIBBPF_OPTS(bpf_test_run_opts, opts);\n+\tint err;\n+\n+\terr = bpf_prog_test_run_opts(fd, \u0026opts);\n+\tclose(fd);\n+\tif (!ASSERT_OK(err, desc) || !ASSERT_EQ(opts.retval, 0, desc))\n+\t\treturn -1;\n+\treturn 0;\n+}\n+\n+/* Whether the verifier accepts a halfword load from an odd offset */\n+static bool unaligned_ok(int map_fd)\n+{\n+\tstruct off_prog p;\n+\tint fd;\n+\n+\toff_prog_start(\u0026p, map_fd, BPF_REG_1);\n+\tEMIT(\u0026p, BPF_LDX_MEM(BPF_H, BPF_REG_0, BPF_REG_1, 1));\n+\tfd = off_prog_load(\u0026p, \"unaligned probe\", true);\n+\tif (fd \u003c 0)\n+\t\treturn false;\n+\tclose(fd);\n+\treturn true;\n+}\n+\n+/* One program loading from all the offsets of size through rb into rd */\n+static void load_offsets(struct off_mem *m, int kind, int size, int rb, int rd,\n+\t\t\t const int *off, int nr)\n+{\n+\t__u32 mem_key = MEM_KEY, res_key = RES_KEY;\n+\tint rs = other_reg(rb, rd), fd, i;\n+\t__u64 *res = (__u64 *)m-\u003eres;\n+\tint map_fd = m-\u003emap_fd;\n+\tstruct off_prog p;\n+\tchar desc[64];\n+\n+\toff_prog_start(\u0026p, map_fd, rb);\n+\tfor (i = 0; i \u003c nr; i++) {\n+\t\tif (rd == rb)\n+\t\t\tEMIT(\u0026p, BPF_LDX_MEM(BPF_DW, rb, BPF_REG_10, SLOT_BASE));\n+\t\tif (kind == K_LDX)\n+\t\t\tEMIT(\u0026p, BPF_LDX_MEM(size, rd, rb, off[i]));\n+\t\telse\n+\t\t\tEMIT(\u0026p, BPF_RAW_INSN(BPF_LDX | BPF_MEMSX | size, rd, rb, off[i], 0));\n+\t\tEMIT(\u0026p, BPF_LDX_MEM(BPF_DW, rs, BPF_REG_10, SLOT_RES));\n+\t\tEMIT(\u0026p, BPF_STX_MEM(BPF_DW, rs, rd, i * 8));\n+\t}\n+\tsnprintf(desc, sizeof(desc), \"%s size=%d base=r%d dst=r%d\",\n+\t\t kind == K_LDX ? \"ldx\" : \"ldsx\", size, rb, rd);\n+\tif (!ASSERT_OK(bpf_map_update_elem(map_fd, \u0026mem_key, m-\u003emem, 0), desc))\n+\t\treturn;\n+\tfd = off_prog_load(\u0026p, desc, false);\n+\tif (fd \u003c 0)\n+\t\treturn;\n+\tif (off_prog_run(fd, desc) || !ASSERT_OK(bpf_map_lookup_elem(map_fd, \u0026res_key, res), desc))\n+\t\treturn;\n+\tfor (i = 0; i \u003c nr; i++) {\n+\t\t__u64 v = load_bytes(m-\u003emem + MEM_BASE + off[i], size);\n+\n+\t\tif (kind == K_LDSX)\n+\t\t\tv = size == BPF_B ? (__s8)v : size == BPF_H ? (__s16)v : (__s32)v;\n+\t\tif (res[i] != v) {\n+\t\t\tsnprintf(desc, sizeof(desc), \"%s size=%d base=r%d dst=r%d off=%d\",\n+\t\t\t\t kind == K_LDX ? \"ldx\" : \"ldsx\", size, rb, rd, off[i]);\n+\t\t\tASSERT_EQ(res[i], v, desc);\n+\t\t}\n+\t}\n+}\n+\n+/* One program storing rd, or the immediate imm when rd \u003c 0, at all the offsets */\n+static void store_offsets(struct off_mem *m, int size, int rb, int rd, __s32 imm,\n+\t\t\t  const int *off, int nr)\n+{\n+\t__u64 val = rd \u003e= 0 ? STORE_VAL : (__u64)(__s64)imm;\n+\t__u8 *mem = m-\u003emem, *exp = m-\u003eexp, *res = m-\u003eres;\n+\t__u32 mem_key = MEM_KEY;\n+\tint map_fd = m-\u003emap_fd;\n+\tchar desc[64], buf[96];\n+\tstruct off_prog p;\n+\tint fd, i;\n+\n+\toff_prog_start(\u0026p, map_fd, rb);\n+\tif (rd \u003e= 0) {\n+\t\tEMIT(\u0026p, BPF_RAW_INSN(BPF_LD | BPF_DW | BPF_IMM, rd, 0, 0, (__u32)STORE_VAL));\n+\t\tEMIT(\u0026p, BPF_RAW_INSN(0, 0, 0, 0, STORE_VAL \u003e\u003e 32));\n+\t}\n+\tmemcpy(exp, mem, MEM_SIZE);\n+\tfor (i = 0; i \u003c nr; i++) {\n+\t\tif (rd \u003e= 0)\n+\t\t\tEMIT(\u0026p, BPF_STX_MEM(size, rb, rd, off[i]));\n+\t\telse\n+\t\t\tEMIT(\u0026p, BPF_ST_MEM(size, rb, off[i], imm));\n+\t\tstore_bytes(exp + MEM_BASE + off[i], val, size);\n+\t}\n+\tif (rd \u003e= 0)\n+\t\tsnprintf(desc, sizeof(desc), \"stx size=%d base=r%d src=r%d\", size, rb, rd);\n+\telse\n+\t\tsnprintf(desc, sizeof(desc), \"st size=%d base=r%d imm=%d\", size, rb, imm);\n+\tif (!ASSERT_OK(bpf_map_update_elem(map_fd, \u0026mem_key, mem, 0), desc))\n+\t\treturn;\n+\tfd = off_prog_load(\u0026p, desc, false);\n+\tif (fd \u003c 0)\n+\t\treturn;\n+\tif (off_prog_run(fd, desc) || !ASSERT_OK(bpf_map_lookup_elem(map_fd, \u0026mem_key, res), desc))\n+\t\treturn;\n+\tfor (i = 0; i \u003c MEM_SIZE \u0026\u0026 res[i] == exp[i]; i++)\n+\t\t;\n+\tif (i \u003c MEM_SIZE) {\n+\t\tsnprintf(buf, sizeof(buf), \"%s: byte at offset %d\", desc, i - MEM_BASE);\n+\t\tASSERT_EQ(res[i], exp[i], buf);\n+\t}\n+}\n+\n+static void test_ldst_offsets(void)\n+{\n+\tstatic const int sizes[] = { BPF_B, BPF_H, BPF_W, BPF_DW };\n+\tstatic const __s32 imms[] = { -1, 0x7fffffff, -0x7fffffff - 1 };\n+\tint b, k, s, i, nr, off[32];\n+\tstruct off_mem m = {};\n+\tbool unaligned;\n+\n+\tm.map_fd = bpf_map_create(BPF_MAP_TYPE_ARRAY, \"ldst_mem\", sizeof(__u32), MEM_SIZE, 2, NULL);\n+\tif (!ASSERT_GE(m.map_fd, 0, \"ldst_mem map\"))\n+\t\treturn;\n+\tm.mem = malloc(MEM_SIZE);\n+\tm.exp = malloc(MEM_SIZE);\n+\tm.res = malloc(MEM_SIZE);\n+\tif (!ASSERT_OK_PTR(m.mem, \"mem\") || !ASSERT_OK_PTR(m.exp, \"exp\") ||\n+\t    !ASSERT_OK_PTR(m.res, \"res\"))\n+\t\tgoto out;\n+\tfor (i = 0; i \u003c MEM_SIZE; i++)\n+\t\tm.mem[i] = (i * 7 + 3) ^ (i \u003e\u003e 8);\n+\tunaligned = unaligned_ok(m.map_fd);\n+\n+\tfor (b = 0; b \u003c ARRAY_SIZE(pat_regs); b++) {\n+\t\tfor (s = 0; s \u003c ARRAY_SIZE(sizes); s++) {\n+\t\t\tint rb = pat_regs[b], size = sizes[s];\n+\n+\t\t\tnr = offsets_for(size, unaligned, off);\n+\t\t\t/* Loads and sign extending loads, also into the base */\n+\t\t\tfor (k = 0; k \u003c NR_PAIRS; k++) {\n+\t\t\t\tint rd = pair_reg(b, k);\n+\n+\t\t\t\tload_offsets(\u0026m, K_LDX, size, rb, rd, off, nr);\n+\t\t\t\tif (size != BPF_DW)\n+\t\t\t\t\tload_offsets(\u0026m, K_LDSX, size, rb, rd, off, nr);\n+\t\t\t}\n+\t\t\t/* Stores of a register and of an immediate */\n+\t\t\tfor (k = 1; k \u003c NR_PAIRS; k++)\n+\t\t\t\tstore_offsets(\u0026m, size, rb, pair_reg(b, k), 0, off, nr);\n+\t\t\tfor (k = 0; k \u003c ARRAY_SIZE(imms); k++)\n+\t\t\t\tstore_offsets(\u0026m, size, rb, -1, imms[k], off, nr);\n+\t\t}\n+\t}\n+out:\n+\tfree(m.mem);\n+\tfree(m.exp);\n+\tfree(m.res);\n+\tclose(m.map_fd);\n+}\n+\n+static void test_movsx(void)\n+{\n+\tstatic const struct {\n+\t\tbool is64;\n+\t\tint off;\n+\t} ops[] = {\n+\t\t{ true, 8 }, { true, 16 }, { true, 32 }, { false, 8 }, { false, 16 },\n+\t};\n+\tstruct prog p;\n+\tchar desc[64];\n+\tint s, k, o, j, fd;\n+\n+\tfor (s = 0; s \u003c ARRAY_SIZE(pat_regs); s++) {\n+\t\tint rs = pat_regs[s];\n+\n+\t\tfor (k = 0; k \u003c NR_PAIRS; k++) {\n+\t\t\tint rd = pair_reg(s, k);\n+\n+\t\t\tfor (o = 0; o \u003c ARRAY_SIZE(ops); o++) {\n+\t\t\t\tprog_start(\u0026p);\n+\t\t\t\tEMIT(\u0026p, BPF_LDX_MEM(BPF_DW, rs, BPF_REG_6, IN0));\n+\t\t\t\tif (ops[o].is64)\n+\t\t\t\t\tEMIT(\u0026p, BPF_MOVSX64_REG(rd, rs, ops[o].off));\n+\t\t\t\telse\n+\t\t\t\t\tEMIT(\u0026p, BPF_MOVSX32_REG(rd, rs, ops[o].off));\n+\t\t\t\tprog_end(\u0026p, rd);\n+\t\t\t\tsnprintf(desc, sizeof(desc), \"movsx%d off=%d dst=r%d src=r%d\",\n+\t\t\t\t\t ops[o].is64 ? 64 : 32, ops[o].off, rd, rs);\n+\t\t\t\tfd = prog_load(\u0026p, desc);\n+\t\t\t\tif (fd \u003c 0)\n+\t\t\t\t\treturn;\n+\t\t\t\tfor (j = 0; j \u003c ARRAY_SIZE(inputs); j++) {\n+\t\t\t\t\t__s64 v = inputs[j];\n+\n+\t\t\t\t\tif (ops[o].off == 8)\n+\t\t\t\t\t\tv = (__s8)v;\n+\t\t\t\t\telse if (ops[o].off == 16)\n+\t\t\t\t\t\tv = (__s16)v;\n+\t\t\t\t\telse\n+\t\t\t\t\t\tv = (__s32)v;\n+\t\t\t\t\tprog_run(fd, inputs[j], 0,\n+\t\t\t\t\t\t ops[o].is64 ? (__u64)v : (__u32)v, desc);\n+\t\t\t\t}\n+\t\t\t\tclose(fd);\n+\t\t\t}\n+\t\t}\n+\t}\n+}\n+\n+/* Branch on dst and imm, with 1 in res when taken and 0 otherwise */\n+static void jmp_prog(struct prog *p, bool is64, int op, int d, __s32 imm)\n+{\n+\tint rd = pat_regs[d], rt = pair_reg(d, 1);\n+\n+\tprog_start(p);\n+\tEMIT(p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));\n+\tEMIT(p, BPF_MOV64_IMM(rt, 1));\n+\tif (is64)\n+\t\tEMIT(p, BPF_JMP_IMM(op, rd, imm, 1));\n+\telse\n+\t\tEMIT(p, BPF_JMP32_IMM(op, rd, imm, 1));\n+\tEMIT(p, BPF_MOV64_IMM(rt, 0));\n+\tprog_end(p, rt);\n+}\n+\n+static void test_jset_imm(void)\n+{\n+\tstatic const __s32 masks[] = {\n+\t\t0x1, 0x40, 0x80, 0xff, 0x100, 0x7fff, 0x7fffffff, -1, -0x7fffffff - 1,\n+\t};\n+\tstruct prog p;\n+\tchar desc[64];\n+\tint d, m, j, fd;\n+\tbool is64;\n+\n+\tfor (d = 0; d \u003c ARRAY_SIZE(pat_regs); d++) {\n+\t\tint rd = pat_regs[d];\n+\n+\t\tfor (is64 = false; ; is64 = true) {\n+\t\t\tfor (m = 0; m \u003c ARRAY_SIZE(masks); m++) {\n+\t\t\t\tjmp_prog(\u0026p, is64, BPF_JSET, d, masks[m]);\n+\t\t\t\tsnprintf(desc, sizeof(desc), \"jset%d dst=r%d mask=0x%x\",\n+\t\t\t\t\t is64 ? 64 : 32, rd, masks[m]);\n+\t\t\t\tfd = prog_load(\u0026p, desc);\n+\t\t\t\tif (fd \u003c 0)\n+\t\t\t\t\treturn;\n+\t\t\t\tfor (j = 0; j \u003c ARRAY_SIZE(inputs); j++) {\n+\t\t\t\t\t__u64 v = inputs[j];\n+\t\t\t\t\tbool taken;\n+\n+\t\t\t\t\tif (is64)\n+\t\t\t\t\t\ttaken = v \u0026 (__u64)(__s64)masks[m];\n+\t\t\t\t\telse\n+\t\t\t\t\t\ttaken = (__u32)v \u0026 (__u32)masks[m];\n+\t\t\t\t\tprog_run(fd, v, 0, taken, desc);\n+\t\t\t\t}\n+\t\t\t\tclose(fd);\n+\t\t\t}\n+\t\t\tif (is64)\n+\t\t\t\tbreak;\n+\t\t}\n+\t}\n+}\n+\n+static bool cmp_taken(int op, bool is64, __u64 v, __u64 c)\n+{\n+\t__s64 sv = is64 ? (__s64)v : (__s32)v, sc = is64 ? (__s64)c : (__s32)c;\n+\n+\tswitch (op) {\n+\tcase BPF_JEQ:\n+\t\treturn v == c;\n+\tcase BPF_JNE:\n+\t\treturn v != c;\n+\tcase BPF_JGT:\n+\t\treturn v \u003e c;\n+\tcase BPF_JGE:\n+\t\treturn v \u003e= c;\n+\tcase BPF_JLT:\n+\t\treturn v \u003c c;\n+\tcase BPF_JLE:\n+\t\treturn v \u003c= c;\n+\tcase BPF_JSGT:\n+\t\treturn sv \u003e sc;\n+\tcase BPF_JSGE:\n+\t\treturn sv \u003e= sc;\n+\tcase BPF_JSLT:\n+\t\treturn sv \u003c sc;\n+\tdefault:\n+\t\treturn sv \u003c= sc;\n+\t}\n+}\n+\n+static void test_cmp_imm(void)\n+{\n+\tstatic const __s32 imms[] = {\n+\t\t1, -1, 0x7f, 0x80, -0x80, -0x81, 0x1000, 0x7fffffff,\n+\t};\n+\tstatic const int ops[] = {\n+\t\tBPF_JEQ, BPF_JNE, BPF_JGT, BPF_JGE, BPF_JLT, BPF_JLE,\n+\t\tBPF_JSGT, BPF_JSGE, BPF_JSLT, BPF_JSLE,\n+\t};\n+\tstruct prog p;\n+\tchar desc[64];\n+\tint d, o, m, j, fd;\n+\tbool is64;\n+\n+\tfor (d = 0; d \u003c ARRAY_SIZE(pat_regs); d++) {\n+\t\tint rd = pat_regs[d];\n+\n+\t\tfor (is64 = false; ; is64 = true) {\n+\t\t\tfor (o = 0; o \u003c ARRAY_SIZE(ops); o++) {\n+\t\t\t\tfor (m = 0; m \u003c ARRAY_SIZE(imms); m++) {\n+\t\t\t\t\tjmp_prog(\u0026p, is64, ops[o], d, imms[m]);\n+\t\t\t\t\tsnprintf(desc, sizeof(desc), \"jmp%d op=0x%x dst=r%d imm=%d\",\n+\t\t\t\t\t\t is64 ? 64 : 32, ops[o], rd, imms[m]);\n+\t\t\t\t\tfd = prog_load(\u0026p, desc);\n+\t\t\t\t\tif (fd \u003c 0)\n+\t\t\t\t\t\treturn;\n+\t\t\t\t\tfor (j = 0; j \u003c ARRAY_SIZE(inputs); j++) {\n+\t\t\t\t\t\t__u64 v = is64 ? inputs[j] : (__u32)inputs[j];\n+\t\t\t\t\t\t__u64 c = is64 ? (__u64)(__s64)imms[m] :\n+\t\t\t\t\t\t\t  (__u32)imms[m];\n+\t\t\t\t\t\t__u64 taken = cmp_taken(ops[o], is64, v, c);\n+\n+\t\t\t\t\t\tprog_run(fd, inputs[j], 0, taken, desc);\n+\t\t\t\t\t}\n+\t\t\t\t\tclose(fd);\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tif (is64)\n+\t\t\t\tbreak;\n+\t\t}\n+\t}\n+}\n+\n+static __u64 alu_model(int op, __u64 v, __u64 c)\n+{\n+\tswitch (op) {\n+\tcase BPF_ADD:\n+\t\treturn v + c;\n+\tcase BPF_SUB:\n+\t\treturn v - c;\n+\tcase BPF_AND:\n+\t\treturn v \u0026 c;\n+\tcase BPF_OR:\n+\t\treturn v | c;\n+\tcase BPF_XOR:\n+\t\treturn v ^ c;\n+\tdefault:\n+\t\treturn v * c;\n+\t}\n+}\n+\n+static void test_alu_consts(void)\n+{\n+\tstatic const struct {\n+\t\tint op;\n+\t\t__s32 imm;\n+\t} ops[] = {\n+\t\t{ BPF_ADD, 1 }, { BPF_ADD, -1 }, { BPF_SUB, 1 }, { BPF_SUB, -1 },\n+\t\t{ BPF_ADD, 128 }, { BPF_SUB, 128 }, { BPF_ADD, -128 },\n+\t\t{ BPF_AND, 0xff }, { BPF_AND, 0xffff }, { BPF_AND, 0x7f },\n+\t\t{ BPF_AND, 0x3ff }, { BPF_AND, 0x7fffffff },\n+\t\t{ BPF_OR, 0xff }, { BPF_XOR, -1 }, { BPF_XOR, 0x80 },\n+\t\t{ BPF_MUL, 2 }, { BPF_MUL, 3 }, { BPF_MUL, 4 }, { BPF_MUL, 5 },\n+\t\t{ BPF_MUL, 7 }, { BPF_MUL, 8 }, { BPF_MUL, 9 }, { BPF_MUL, 16 },\n+\t\t{ BPF_MUL, 0x40000000 }, { BPF_MUL, -3 }, { BPF_MUL, -0x7fffffff - 1 },\n+\t\t{ BPF_MUL, 0 }, { BPF_MUL, 1 }, { BPF_MUL, -1 },\n+\t};\n+\tstruct prog p;\n+\tchar desc[64];\n+\tint d, o, j, fd;\n+\tbool is64;\n+\n+\tfor (d = 0; d \u003c ARRAY_SIZE(pat_regs); d++) {\n+\t\tint rd = pat_regs[d];\n+\n+\t\tfor (is64 = false; ; is64 = true) {\n+\t\t\tfor (o = 0; o \u003c ARRAY_SIZE(ops); o++) {\n+\t\t\t\tprog_start(\u0026p);\n+\t\t\t\tEMIT(\u0026p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));\n+\t\t\t\tif (is64)\n+\t\t\t\t\tEMIT(\u0026p, BPF_ALU64_IMM(ops[o].op, rd, ops[o].imm));\n+\t\t\t\telse\n+\t\t\t\t\tEMIT(\u0026p, BPF_ALU32_IMM(ops[o].op, rd, ops[o].imm));\n+\t\t\t\tprog_end(\u0026p, rd);\n+\t\t\t\tsnprintf(desc, sizeof(desc), \"alu%d op=0x%x dst=r%d imm=%d\",\n+\t\t\t\t\t is64 ? 64 : 32, ops[o].op, rd, ops[o].imm);\n+\t\t\t\tfd = prog_load(\u0026p, desc);\n+\t\t\t\tif (fd \u003c 0)\n+\t\t\t\t\treturn;\n+\t\t\t\tfor (j = 0; j \u003c ARRAY_SIZE(inputs); j++) {\n+\t\t\t\t\t__u64 v = is64 ? inputs[j] : (__u32)inputs[j];\n+\t\t\t\t\t__u64 c = is64 ? (__u64)(__s64)ops[o].imm :\n+\t\t\t\t\t\t  (__u32)ops[o].imm;\n+\t\t\t\t\t__u64 r = alu_model(ops[o].op, v, c);\n+\n+\t\t\t\t\tprog_run(fd, inputs[j], 0, is64 ? r : (__u32)r, desc);\n+\t\t\t\t}\n+\t\t\t\tclose(fd);\n+\t\t\t}\n+\t\t\tif (is64)\n+\t\t\t\tbreak;\n+\t\t}\n+\t}\n+}\n+\n+static void test_bswap(void)\n+{\n+\tstatic const int widths[] = { 16, 32, 64 };\n+\tstruct prog p;\n+\tchar desc[64];\n+\tint d, w, o, j, fd;\n+\n+\tfor (d = 0; d \u003c ARRAY_SIZE(pat_regs); d++) {\n+\t\tint rd = pat_regs[d];\n+\n+\t\tfor (w = 0; w \u003c ARRAY_SIZE(widths); w++) {\n+\t\t\tint bits = widths[w];\n+\n+\t\t\t/* To big endian, to little endian, and the unconditional swap */\n+\t\t\tfor (o = 0; o \u003c 3; o++) {\n+\t\t\t\tprog_start(\u0026p);\n+\t\t\t\tEMIT(\u0026p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));\n+\t\t\t\tif (o == 0)\n+\t\t\t\t\tEMIT(\u0026p, BPF_ENDIAN(BPF_TO_BE, rd, bits));\n+\t\t\t\telse if (o == 1)\n+\t\t\t\t\tEMIT(\u0026p, BPF_ENDIAN(BPF_TO_LE, rd, bits));\n+\t\t\t\telse\n+\t\t\t\t\tEMIT(\u0026p, BPF_RAW_INSN(BPF_ALU64 | BPF_END | BPF_TO_LE,\n+\t\t\t\t\t\t\t      rd, 0, 0, bits));\n+\t\t\t\tprog_end(\u0026p, rd);\n+\t\t\t\tsnprintf(desc, sizeof(desc), \"%s%d dst=r%d\",\n+\t\t\t\t\t o == 0 ? \"be\" : o == 1 ? \"le\" : \"bswap\", bits, rd);\n+\t\t\t\tfd = prog_load(\u0026p, desc);\n+\t\t\t\tif (fd \u003c 0)\n+\t\t\t\t\treturn;\n+\t\t\t\tfor (j = 0; j \u003c ARRAY_SIZE(inputs); j++) {\n+\t\t\t\t\t__u64 v = inputs[j], r;\n+\n+\t\t\t\t\tif (bits == 16)\n+\t\t\t\t\t\tr = o == 0 ? htobe16(v) : o == 1 ? htole16(v) :\n+\t\t\t\t\t\t    __builtin_bswap16(v);\n+\t\t\t\t\telse if (bits == 32)\n+\t\t\t\t\t\tr = o == 0 ? htobe32(v) : o == 1 ? htole32(v) :\n+\t\t\t\t\t\t    __builtin_bswap32(v);\n+\t\t\t\t\telse\n+\t\t\t\t\t\tr = o == 0 ? htobe64(v) : o == 1 ? htole64(v) :\n+\t\t\t\t\t\t    __builtin_bswap64(v);\n+\t\t\t\t\tprog_run(fd, v, 0, r, desc);\n+\t\t\t\t}\n+\t\t\t\tclose(fd);\n+\t\t\t}\n+\t\t}\n+\t}\n+}\n+\n+static void test_probe_mem(void)\n+{\n+\tint kfunc_id, type_id, b, k, j, fd;\n+\tstruct btf *btf;\n+\tstruct prog p;\n+\tchar desc[64];\n+\n+\tbtf = btf__load_vmlinux_btf();\n+\tif (!ASSERT_OK_PTR(btf, \"vmlinux btf\"))\n+\t\treturn;\n+\tkfunc_id = btf__find_by_name_kind(btf, \"bpf_rdonly_cast\", BTF_KIND_FUNC);\n+\ttype_id = btf__find_by_name_kind(btf, \"timespec64\", BTF_KIND_STRUCT);\n+\tbtf__free(btf);\n+\tif (!ASSERT_GT(kfunc_id, 0, \"bpf_rdonly_cast id\") ||\n+\t    !ASSERT_GT(type_id, 0, \"timespec64 id\"))\n+\t\treturn;\n+\n+\t/* The kernel copy of the ctx through an untrusted pointer in every register */\n+\tfor (b = 0; b \u003c ARRAY_SIZE(pat_regs); b++) {\n+\t\tint rb = pat_regs[b];\n+\n+\t\tfor (k = 0; k \u003c NR_PAIRS; k++) {\n+\t\t\tint rd = pair_reg(b, k);\n+\n+\t\t\tprog_start(\u0026p);\n+\t\t\tEMIT(\u0026p, BPF_MOV64_REG(BPF_REG_1, BPF_REG_6));\n+\t\t\tEMIT(\u0026p, BPF_MOV32_IMM(BPF_REG_2, type_id));\n+\t\t\tEMIT(\u0026p, BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, BPF_PSEUDO_KFUNC_CALL,\n+\t\t\t\t\t      0, kfunc_id));\n+\t\t\tif (rb != BPF_REG_0)\n+\t\t\t\tEMIT(\u0026p, BPF_MOV64_REG(rb, BPF_REG_0));\n+\t\t\tEMIT(\u0026p, BPF_LDX_MEM(BPF_DW, rd, rb, 0));\n+\t\t\tprog_end(\u0026p, rd);\n+\t\t\tsnprintf(desc, sizeof(desc), \"probe_mem base=r%d dst=r%d\", rb, rd);\n+\t\t\tfd = prog_load(\u0026p, desc);\n+\t\t\tif (fd \u003c 0)\n+\t\t\t\treturn;\n+\t\t\tfor (j = 0; j \u003c ARRAY_SIZE(inputs); j++)\n+\t\t\t\tprog_run(fd, inputs[j], 0, inputs[j], desc);\n+\t\t\tclose(fd);\n+\t\t}\n+\t}\n+\n+\t/* NULL and a user address are not touched and read as zero */\n+\tfor (j = 0; j \u003c 2; j++) {\n+\t\t__u64 addr = j ? 0x00007ffffffff000ULL : 0;\n+\n+\t\tprog_start(\u0026p);\n+\t\tEMIT(\u0026p, BPF_RAW_INSN(BPF_LD | BPF_DW | BPF_IMM, BPF_REG_1, 0, 0, (__u32)addr));\n+\t\tEMIT(\u0026p, BPF_RAW_INSN(0, 0, 0, 0, addr \u003e\u003e 32));\n+\t\tEMIT(\u0026p, BPF_MOV32_IMM(BPF_REG_2, type_id));\n+\t\tEMIT(\u0026p, BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, BPF_PSEUDO_KFUNC_CALL,\n+\t\t\t\t      0, kfunc_id));\n+\t\tEMIT(\u0026p, BPF_LDX_MEM(BPF_DW, BPF_REG_3, BPF_REG_0, 0));\n+\t\tprog_end(\u0026p, BPF_REG_3);\n+\t\tsnprintf(desc, sizeof(desc), \"probe_mem addr=0x%llx\", addr);\n+\t\tfd = prog_load(\u0026p, desc);\n+\t\tif (fd \u003c 0)\n+\t\t\treturn;\n+\t\tprog_run(fd, 0, 0, 0, desc);\n+\t\tclose(fd);\n+\t}\n+}\n+\n+/* Whether the JIT supports load-acquire and store-release */\n+static bool acq_rel_ok(void)\n+{\n+\tLIBBPF_OPTS(bpf_prog_load_opts, lopts, .prog_flags = BPF_F_SLEEPABLE);\n+\tstruct prog p;\n+\tint fd;\n+\n+\tprog_start(\u0026p);\n+\tEMIT(\u0026p, BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0));\n+\tEMIT(\u0026p, BPF_ATOMIC_OP(BPF_DW, BPF_LOAD_ACQ, BPF_REG_0, BPF_REG_10, -8));\n+\tprog_end(\u0026p, BPF_REG_0);\n+\tfd = bpf_prog_load(BPF_PROG_TYPE_SYSCALL, NULL, \"GPL\", p.insns, p.cnt, \u0026lopts);\n+\tif (fd \u003c 0)\n+\t\treturn false;\n+\tclose(fd);\n+\treturn true;\n+}\n+\n+/*\n+ * Load-acquire and store-release of every size with every register as\n+ * base, on a stack slot holding in0: the loads zero extend like the plain\n+ * loads and the stores replace the first bytes of the slot like the plain\n+ * stores.\n+ */\n+static void test_acq_rel(void)\n+{\n+\tstatic const int sizes[] = { BPF_B, BPF_H, BPF_W, BPF_DW };\n+\tstruct prog p;\n+\tchar desc[64];\n+\tint b, k, s, j, fd;\n+\n+\tif (!acq_rel_ok()) {\n+\t\ttest__skip();\n+\t\treturn;\n+\t}\n+\tfor (b = 0; b \u003c ARRAY_SIZE(pat_regs); b++) {\n+\t\tint rb = pat_regs[b];\n+\n+\t\tfor (s = 0; s \u003c ARRAY_SIZE(sizes); s++) {\n+\t\t\tint size = sizes[s];\n+\n+\t\t\tfor (k = 0; k \u003c NR_PAIRS; k++) {\n+\t\t\t\tint rd = pair_reg(b, k);\n+\n+\t\t\t\t/* Load-acquire from the slot, also into the base */\n+\t\t\t\tprog_start(\u0026p);\n+\t\t\t\tEMIT(\u0026p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));\n+\t\t\t\tEMIT(\u0026p, BPF_STX_MEM(BPF_DW, BPF_REG_10, rd, -8));\n+\t\t\t\tEMIT(\u0026p, BPF_MOV64_REG(rb, BPF_REG_10));\n+\t\t\t\tEMIT(\u0026p, BPF_ALU64_IMM(BPF_ADD, rb, -8));\n+\t\t\t\tEMIT(\u0026p, BPF_ATOMIC_OP(size, BPF_LOAD_ACQ, rd, rb, 0));\n+\t\t\t\tprog_end(\u0026p, rd);\n+\t\t\t\tsnprintf(desc, sizeof(desc), \"load_acq size=%d base=r%d dst=r%d\",\n+\t\t\t\t\t size, rb, rd);\n+\t\t\t\tfd = prog_load(\u0026p, desc);\n+\t\t\t\tif (fd \u003c 0)\n+\t\t\t\t\treturn;\n+\t\t\t\tfor (j = 0; j \u003c ARRAY_SIZE(inputs); j++)\n+\t\t\t\t\tprog_run(fd, inputs[j], 0,\n+\t\t\t\t\t\t head_bytes(inputs[j], size), desc);\n+\t\t\t\tclose(fd);\n+\n+\t\t\t\tif (rd == rb)\n+\t\t\t\t\tcontinue;\n+\t\t\t\t/* Store-release of in1 over the slot holding in0 */\n+\t\t\t\tprog_start(\u0026p);\n+\t\t\t\tEMIT(\u0026p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));\n+\t\t\t\tEMIT(\u0026p, BPF_STX_MEM(BPF_DW, BPF_REG_10, rd, -8));\n+\t\t\t\tEMIT(\u0026p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN1));\n+\t\t\t\tEMIT(\u0026p, BPF_MOV64_REG(rb, BPF_REG_10));\n+\t\t\t\tEMIT(\u0026p, BPF_ALU64_IMM(BPF_ADD, rb, -8));\n+\t\t\t\tEMIT(\u0026p, BPF_ATOMIC_OP(size, BPF_STORE_REL, rb, rd, 0));\n+\t\t\t\tEMIT(\u0026p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_10, -8));\n+\t\t\t\tprog_end(\u0026p, rd);\n+\t\t\t\tsnprintf(desc, sizeof(desc), \"store_rel size=%d base=r%d src=r%d\",\n+\t\t\t\t\t size, rb, rd);\n+\t\t\t\tfd = prog_load(\u0026p, desc);\n+\t\t\t\tif (fd \u003c 0)\n+\t\t\t\t\treturn;\n+\t\t\t\tfor (j = 0; j \u003c ARRAY_SIZE(inputs); j++) {\n+\t\t\t\t\t__u64 in1 = inputs[(j + 1) % ARRAY_SIZE(inputs)];\n+\n+\t\t\t\t\tprog_run(fd, inputs[j], in1,\n+\t\t\t\t\t\t head_merge(inputs[j], in1, size), desc);\n+\t\t\t\t}\n+\t\t\t\tclose(fd);\n+\t\t\t}\n+\t\t}\n+\t}\n+}\n+\n+/*\n+ * A jump with the maximal offset over instructions which expand to several\n+ * native ones, so that the native offset outgrows the field of a short\n+ * branch and takes the JITs through their branch conversion. The region\n+ * must not grow in the verifier, or the jump could not reach over it any\n+ * more: the divisions are by constants, as a division by a register gets\n+ * a zero check in front, and the region sticks to one width, as a 32-bit\n+ * result read by a 64-bit instruction gets a zero extension on the JITs\n+ * which need one. The region is the not taken path and ends with a result\n+ * different from the taken one, so a jump landing inside it fails the run.\n+ */\n+static void max_jmp(bool alu32, bool taken)\n+{\n+\tstatic const int ops[] = {\n+\t\tBPF_LSH, BPF_RSH, BPF_ARSH, BPF_ADD, BPF_SUB, BPF_MUL, BPF_DIV, BPF_MOD,\n+\t};\n+\tstruct { __u64 r0, r2; } ctx = { taken, 0x0123456789abcdefULL };\n+\tLIBBPF_OPTS(bpf_test_run_opts, opts,\n+\t\t.ctx_in = \u0026ctx,\n+\t\t.ctx_size_in = sizeof(ctx),\n+\t);\n+\tint len = INT16_MAX + 5, i = 0, fd;\n+\tstruct bpf_insn *insns;\n+\tchar desc[64];\n+\n+\tsnprintf(desc, sizeof(desc), \"max jump alu%d %s\", alu32 ? 32 : 64,\n+\t\t taken ? \"taken\" : \"not taken\");\n+\tinsns = malloc(len * sizeof(*insns));\n+\tif (!ASSERT_OK_PTR(insns, \"insns\"))\n+\t\treturn;\n+\tinsns[i++] = BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_1, 8);\n+\tinsns[i++] = BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_1, 0);\n+\tinsns[i++] = BPF_MOV64_REG(BPF_REG_3, BPF_REG_2);\n+\tinsns[i++] = BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 1, INT16_MAX);\n+\twhile (i \u003c len - 2) {\n+\t\tint op = ops[(i \u003e\u003e 1) % ARRAY_SIZE(ops)];\n+\n+\t\tif (op == BPF_DIV || op == BPF_MOD)\n+\t\t\tinsns[i++] = alu32 ? BPF_ALU32_IMM(op, BPF_REG_3, 7) :\n+\t\t\t\t\t     BPF_ALU64_IMM(op, BPF_REG_3, 7);\n+\t\telse\n+\t\t\tinsns[i++] = alu32 ? BPF_ALU32_REG(op, BPF_REG_3, BPF_REG_2) :\n+\t\t\t\t\t     BPF_ALU64_REG(op, BPF_REG_3, BPF_REG_2);\n+\t}\n+\tinsns[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_0, 2);\n+\tinsns[i++] = BPF_EXIT_INSN();\n+\tASSERT_EQ(i, len, \"insn count\");\n+\n+\tfd = load_prog(insns, i, desc);\n+\tif (fd \u003e= 0) {\n+\t\tif (ASSERT_OK(bpf_prog_test_run_opts(fd, \u0026opts), desc))\n+\t\t\tASSERT_EQ(opts.retval, taken ? 1 : 2, desc);\n+\t\tclose(fd);\n+\t}\n+\tfree(insns);\n+}\n+\n+static void test_max_jmp(void)\n+{\n+\tmax_jmp(false, true);\n+\tmax_jmp(false, false);\n+\tmax_jmp(true, true);\n+\tmax_jmp(true, false);\n+}\n+\n+void test_jit_insns(void)\n+{\n+\tRUN_TESTS(jit_insns_arena);\n+\tif (test__start_subtest(\"alu_imm\"))\n+\t\ttest_alu_imm();\n+\tif (test__start_subtest(\"alu_reg\"))\n+\t\ttest_alu_reg();\n+\tif (test__start_subtest(\"alu_imm_regs\"))\n+\t\ttest_alu_imm_regs();\n+\tif (test__start_subtest(\"div_const\"))\n+\t\ttest_div_const();\n+\tif (test__start_subtest(\"alu_reg_pairs\"))\n+\t\ttest_alu_reg_pairs();\n+\tif (test__start_subtest(\"shifts\"))\n+\t\ttest_shifts();\n+\tif (test__start_subtest(\"atomics\"))\n+\t\ttest_atomics();\n+\tif (test__start_subtest(\"atomic_reg_pairs\"))\n+\t\ttest_atomic_reg_pairs();\n+\tif (test__start_subtest(\"xadd_chain\"))\n+\t\ttest_xadd_chain();\n+\tif (test__start_subtest(\"ld_imm64\"))\n+\t\ttest_ld_imm64();\n+\tif (test__start_subtest(\"jmp_imm\"))\n+\t\ttest_jmp_imm();\n+\tif (test__start_subtest(\"jmp_reg\"))\n+\t\ttest_jmp_reg();\n+\tif (test__start_subtest(\"jmp_reg_pairs\"))\n+\t\ttest_jmp_reg_pairs();\n+\tif (test__start_subtest(\"staggered_jumps\"))\n+\t\ttest_staggered_jumps();\n+\tif (test__start_subtest(\"max_jmp\"))\n+\t\ttest_max_jmp();\n+\tif (test__start_subtest(\"ldst_zero_off\"))\n+\t\ttest_ldst_zero_off();\n+\tif (test__start_subtest(\"ldst_offsets\"))\n+\t\ttest_ldst_offsets();\n+\tif (test__start_subtest(\"acq_rel\"))\n+\t\ttest_acq_rel();\n+\tif (test__start_subtest(\"movsx\"))\n+\t\ttest_movsx();\n+\tif (test__start_subtest(\"jset_imm\"))\n+\t\ttest_jset_imm();\n+\tif (test__start_subtest(\"cmp_imm\"))\n+\t\ttest_cmp_imm();\n+\tif (test__start_subtest(\"alu_consts\"))\n+\t\ttest_alu_consts();\n+\tif (test__start_subtest(\"bswap\"))\n+\t\ttest_bswap();\n+\tif (test__start_subtest(\"probe_mem\"))\n+\t\ttest_probe_mem();\n+}\n+\n+/* The families with an immediate once more with the constants blinded */\n+void serial_test_jit_insns_blinded(void)\n+{\n+\tconst char *harden = \"/proc/sys/net/core/bpf_jit_harden\";\n+\tchar old[16] = {};\n+\n+\tif (!is_jit_enabled()) {\n+\t\ttest__skip();\n+\t\treturn;\n+\t}\n+\tif (sysctl_set_or_fail(harden, old, \"2\"))\n+\t\treturn;\n+\tif (test__start_subtest(\"alu_imm\"))\n+\t\ttest_alu_imm();\n+\tif (test__start_subtest(\"alu_imm_regs\"))\n+\t\ttest_alu_imm_regs();\n+\tif (test__start_subtest(\"div_const\"))\n+\t\ttest_div_const();\n+\tif (test__start_subtest(\"shifts\"))\n+\t\ttest_shifts();\n+\tif (test__start_subtest(\"xadd_chain\"))\n+\t\ttest_xadd_chain();\n+\tif (test__start_subtest(\"ld_imm64\"))\n+\t\ttest_ld_imm64();\n+\tif (test__start_subtest(\"jmp_imm\"))\n+\t\ttest_jmp_imm();\n+\tif (test__start_subtest(\"ldst_zero_off\"))\n+\t\ttest_ldst_zero_off();\n+\tif (test__start_subtest(\"ldst_offsets\"))\n+\t\ttest_ldst_offsets();\n+\tif (test__start_subtest(\"jset_imm\"))\n+\t\ttest_jset_imm();\n+\tif (test__start_subtest(\"cmp_imm\"))\n+\t\ttest_cmp_imm();\n+\tif (test__start_subtest(\"alu_consts\"))\n+\t\ttest_alu_consts();\n+\tsysctl_set_or_fail(harden, NULL, old);\n+}\ndiff --git a/tools/testing/selftests/bpf/progs/jit_insns_arena.c b/tools/testing/selftests/bpf/progs/jit_insns_arena.c\nnew file mode 100644\nindex 0000000000000..b396d5aefb5a6\n--- /dev/null\n+++ b/tools/testing/selftests/bpf/progs/jit_insns_arena.c\n@@ -0,0 +1,113 @@\n+// SPDX-License-Identifier: GPL-2.0\n+/*\n+ * The arena accesses of jit_insns in their own object, so that a kernel\n+ * without arena support fails only these programs.\n+ */\n+#define BPF_NO_KFUNC_PROTOTYPES\n+#include \u003cvmlinux.h\u003e\n+#include \u003cbpf/bpf_helpers.h\u003e\n+#include \"bpf_misc.h\"\n+#include \"bpf_experimental.h\"\n+#include \"bpf_arena_common.h\"\n+\n+struct {\n+\t__uint(type, BPF_MAP_TYPE_ARENA);\n+\t__uint(map_flags, BPF_F_MMAPABLE);\n+\t__uint(max_entries, 1);\n+} arena SEC(\".maps\");\n+\n+/*\n+ * The first bytes in memory of the test value and its sum with the slot\n+ * after the u32 store depend on the byte order.\n+ */\n+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__\n+#define VAL_B0\t0x88\n+#define VAL_H0\t0x7788\n+#define VAL_W0\t0x55667788\n+#define VAL_SUM\t0x22446688556689bc\n+#else\n+#define VAL_B0\t0x11\n+#define VAL_H0\t0x1122\n+#define VAL_W0\t0x11223344\n+#define VAL_SUM\t0x11224578aaccef10\n+#endif\n+\n+#if defined(__BPF_FEATURE_ADDR_SPACE_CAST)\n+SEC(\"syscall\")\n+__description(\"arena access with zero offset\")\n+__success __retval(0)\n+int arena_zero_off(void *ctx)\n+{\n+\tvoid __arena *page;\n+\t__u64 res;\n+\n+\tpage = bpf_arena_alloc_pages(\u0026arena, NULL, 1, NUMA_NO_NODE, 0);\n+\tif (!page)\n+\t\treturn 1;\n+\tres = (__u32)(__u64)page;\n+\t/* Accesses through two base registers */\n+\tasm volatile (\"\t\t\t\t\t\\\n+\tr7 = %[res];\t\t\t\t\t\\\n+\tr7 = addr_space_cast(r7, 0x0, 0x1);\t\t\\\n+\tr1 = r7;\t\t\t\t\t\\\n+\tr8 = 0x1122334455667788 ll;\t\t\t\\\n+\t*(u64 *)(r7 + 0) = r8;\t\t\t\t\\\n+\tr9 = *(u64 *)(r7 + 0);\t\t\t\t\\\n+\tr9 ^= r8;\t\t\t\t\t\\\n+\t*(u64 *)(r1 + 0) = r8;\t\t\t\t\\\n+\tr2 = *(u64 *)(r1 + 0);\t\t\t\t\\\n+\tr2 ^= r8;\t\t\t\t\t\\\n+\tr9 |= r2;\t\t\t\t\t\\\n+\tr3 = *(u8 *)(r1 + 0);\t\t\t\t\\\n+\tr3 ^= %[b0];\t\t\t\t\t\\\n+\tr9 |= r3;\t\t\t\t\t\\\n+\tr4 = *(u16 *)(r1 + 0);\t\t\t\t\\\n+\tr4 ^= %[h0];\t\t\t\t\t\\\n+\tr9 |= r4;\t\t\t\t\t\\\n+\tr5 = *(u32 *)(r1 + 0);\t\t\t\t\\\n+\tr5 ^= %[w0];\t\t\t\t\t\\\n+\tr9 |= r5;\t\t\t\t\t\\\n+\t*(u32 *)(r1 + 0) = 0x1234;\t\t\t\\\n+\tlock *(u64 *)(r7 + 0) += r8;\t\t\t\\\n+\tr2 = *(u64 *)(r1 + 0);\t\t\t\t\\\n+\tr8 = %[sum] ll;\t\t\t\t\t\\\n+\tr2 ^= r8;\t\t\t\t\t\\\n+\tr9 |= r2;\t\t\t\t\t\\\n+\t%[res] = r9;\t\t\t\t\t\\\n+\"\t: [res]\"+r\"(res)\n+\t: __imm_const(b0, VAL_B0), __imm_const(h0, VAL_H0),\n+\t  __imm_const(w0, VAL_W0), __imm_const(sum, VAL_SUM)\n+\t: \"r1\", \"r2\", \"r3\", \"r4\", \"r5\", \"r7\", \"r8\", \"r9\");\n+\treturn res != 0;\n+}\n+\n+SEC(\"syscall\")\n+__description(\"cast to a user address\")\n+__success __retval(0)\n+int cast_to_user(void *ctx)\n+{\n+\tvoid __arena *page;\n+\t__u64 res;\n+\n+\tpage = bpf_arena_alloc_pages(\u0026arena, NULL, 1, NUMA_NO_NODE, 0);\n+\tif (!page)\n+\t\treturn 1;\n+\t/* The user address comes back from the kernel one, NULL stays NULL */\n+\tasm volatile (\"\t\t\t\t\t\\\n+\tr7 = %[page];\t\t\t\t\t\\\n+\tr1 = addr_space_cast(r7, 0x0, 0x1);\t\t\\\n+\tr1 = addr_space_cast(r1, 0x1, 0x0);\t\t\\\n+\tr9 = r1;\t\t\t\t\t\\\n+\tr9 ^= r7;\t\t\t\t\t\\\n+\tr2 = 0;\t\t\t\t\t\t\\\n+\tr2 = addr_space_cast(r2, 0x1, 0x0);\t\t\\\n+\tr9 |= r2;\t\t\t\t\t\\\n+\t%[res] = r9;\t\t\t\t\t\\\n+\"\t: [res]\"=r\"(res)\n+\t: [page]\"r\"(page)\n+\t: \"r1\", \"r2\", \"r7\", \"r9\");\n+\treturn res != 0;\n+}\n+#endif\n+\n+char _license[] SEC(\"license\") = \"GPL\";\ndiff --git a/tools/testing/selftests/bpf/test_kmod.sh b/tools/testing/selftests/bpf/test_kmod.sh\ndeleted file mode 100755\nindex 50dca53ac536a..0000000000000\n--- a/tools/testing/selftests/bpf/test_kmod.sh\n+++ /dev/null\n@@ -1,73 +0,0 @@\n-#!/bin/sh\n-# SPDX-License-Identifier: GPL-2.0\n-\n-# Usage:\n-# ./test_kmod.sh [module_param]...\n-# Ex.: ./test_kmod.sh test_range=1,3\n-# All the parameters are passed to the kernel module.\n-\n-# Kselftest framework requirement - SKIP code is 4.\n-ksft_skip=4\n-\n-msg=\"skip all tests:\"\n-if [ \"$(id -u)\" != \"0\" ]; then\n-\techo $msg please run this as root \u003e\u00262\n-\texit $ksft_skip\n-fi\n-\n-if [ \"$building_out_of_srctree\" ]; then\n-\t# We are in linux-build/kselftest/bpf\n-\tOUTPUT=../../\n-else\n-\t# We are in linux/tools/testing/selftests/bpf\n-\tOUTPUT=../../../../\n-fi\n-\n-test_run()\n-{\n-\tsysctl -w net.core.bpf_jit_enable=$1 2\u003e\u00261 \u003e /dev/null\n-\tsysctl -w net.core.bpf_jit_harden=$2 2\u003e\u00261 \u003e /dev/null\n-\n-\techo \"[ JIT enabled:$1 hardened:$2 ]\"\n-\tshift 2\n-\tdmesg -C\n-\tif [ -f ${OUTPUT}/lib/test_bpf.ko ]; then\n-\t\tinsmod ${OUTPUT}/lib/test_bpf.ko \"$@\" 2\u003e /dev/null\n-\t\tif [ $? -ne 0 ]; then\n-\t\t\trc=1\n-\t\tfi\n-\telse\n-\t\t# Use modprobe dry run to check for missing test_bpf module\n-\t\tif ! /sbin/modprobe -q -n test_bpf \"$@\"; then\n-\t\t\techo \"test_bpf: [SKIP]\"\n-\t\telif /sbin/modprobe -q test_bpf \"$@\"; then\n-\t\t\techo \"test_bpf: ok\"\n-\t\telse\n-\t\t\techo \"test_bpf: [FAIL]\"\n-\t\t\trc=1\n-\t\tfi\n-\tfi\n-\trmmod  test_bpf 2\u003e /dev/null\n-\tdmesg | grep FAIL\n-}\n-\n-test_save()\n-{\n-\tJE=`sysctl -n net.core.bpf_jit_enable`\n-\tJH=`sysctl -n net.core.bpf_jit_harden`\n-}\n-\n-test_restore()\n-{\n-\tsysctl -w net.core.bpf_jit_enable=$JE 2\u003e\u00261 \u003e /dev/null\n-\tsysctl -w net.core.bpf_jit_harden=$JH 2\u003e\u00261 \u003e /dev/null\n-}\n-\n-rc=0\n-test_save\n-test_run 0 0 \"$@\"\n-test_run 1 0 \"$@\"\n-test_run 1 1 \"$@\"\n-test_run 1 2 \"$@\"\n-test_restore\n-exit $rc\ndiff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile\nindex 590b33e16d9fb..0ffce8efc6d0b 100644\n--- a/tools/testing/selftests/net/Makefile\n+++ b/tools/testing/selftests/net/Makefile\n@@ -104,7 +104,6 @@ TEST_PROGS := \\\n \tstress_reuseport_listen.sh \\\n \ttcp_ecmp_failover.sh \\\n \ttcp_fastopen_backup_key.sh \\\n-\ttest_bpf.sh \\\n \ttest_bridge_backup_port.sh \\\n \ttest_bridge_neigh_suppress.sh \\\n \ttest_ingress_egress_chaining.sh \\\ndiff --git a/tools/testing/selftests/net/config b/tools/testing/selftests/net/config\nindex 737e7e6327b37..6223b00516fe9 100644\n--- a/tools/testing/selftests/net/config\n+++ b/tools/testing/selftests/net/config\n@@ -127,7 +127,6 @@ CONFIG_TAP=m\n CONFIG_TCP_CONG_DCTCP=y\n CONFIG_TCP_MD5SIG=y\n CONFIG_TEST_BLACKHOLE_DEV=m\n-CONFIG_TEST_BPF=m\n CONFIG_TLS=m\n CONFIG_TRACEPOINTS=y\n CONFIG_TUN=y\ndiff --git a/tools/testing/selftests/net/test_bpf.sh b/tools/testing/selftests/net/test_bpf.sh\ndeleted file mode 100755\nindex 65677909c574d..0000000000000\n--- a/tools/testing/selftests/net/test_bpf.sh\n+++ /dev/null\n@@ -1,11 +0,0 @@\n-#!/bin/sh\n-# SPDX-License-Identifier: GPL-2.0\n-# Runs bpf test using test_bpf kernel module\n-\n-if /sbin/modprobe -q test_bpf ; then\n-\t/sbin/modprobe -q -r test_bpf;\n-\techo \"test_bpf: ok\";\n-else\n-\techo \"test_bpf: [FAIL]\";\n-\texit 1;\n-fi\n"
}

2/1 2026/10/13 22:49 agent patch-evaluator
3m Model:
core

Args:
null

Results:
{
  "EnableConfigs": [
    "BPF_JIT",
    "BPF_SYSCALL"
  ],
  "FocusSymbols": [
    "bpf_int_jit_compile",
    "do_jit",
    "emit_div_const",
    "bpf_magic_udiv",
    "bpf_magic_sdiv",
    "adjust_cmp_imm",
    "arch_prepare_bpf_trampoline"
  ],
  "Reasoning": "The patch series introduces major optimizations and instruction encoding rewrites in the x86-64 BPF JIT compiler (arch/x86/net/bpf_jit_comp.c). Specifically, it adds constant division and modulo strength-reduction using magic multipliers (Hacker's Delight algorithms), comparison immediate adjustment, rewritten instruction suffix encodings, user address casting sequences, probe memory checks, and ALU immediate fast-paths. This code executes on amd64 when compiling eBPF programs via the bpf() syscall or socket filters, making it highly relevant and valuable for fuzzing to detect JIT encoding defects or arithmetic bugs.",
  "WorthFuzzing": true
}

Instruction:
You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.

IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.

================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.

- REACHABILITY IS THE PRIMARY GATE:
  Fuzzing can only discover bugs in code that can actually execute in standard virtualized
  environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
  If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
  regardless of whether it adds assertions or complex logic.

- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
  Patch authors routinely label changes as "cleanups", "refactorings", or state
  "No functional change intended". Do NOT take these claims at face value.
  Code refactorings that rearrange logic, introduce helper functions, or alter state management
  in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
  If reachable executable code is modified or refactored, it MUST be fuzzed.

- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
  When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
  BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
  Even if the author believes the invariant always holds, fuzzing is essential to verify whether
  an unusual sequence of operations can violate it.

================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:

- Non-kernel and non-executable changes:
  * Modifications to Documentation/, comments, or spelling fixes.
  * User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
    that do not affect the compiled kernel image (vmlinux) or kernel modules.
  * Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
    that do not alter control flow or data structures.
  * Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
  * Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
    ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
  * Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
    physical PCI hot-unplug or manual sysfs driver unbinding.
  * Code paths exclusive to architectures other than the target architecture.

================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
  * Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
    BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
  * Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
  * Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
  * Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).

================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:

- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
  Do NOT list generic, ubiquitous functions called by almost every program in the corpus
  (including, but not limited to: general memory allocators and deallocators, page fault
  and trap handlers, or core synchronization primitives; this is not an exhaustive list).
  Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
  which severely dilutes fuzzing effort away from the actual changes.

- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
  List functions that specifically implement the logic being added or altered, or direct API entrypoints
  for the subsystem feature under review.

- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
  Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
  distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
  If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
  functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).

================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
Target architecture: amd64

For your convenience, here is the diff of the changes:
commit 84bac3838b12fe759c77e84095010fd4940a7bfb
Author: syz-cluster <triage@syzkaller.com>
Date:   Tue Oct 13 22:49:47 2026 +0000

    syz-cluster: applied patch under review

diff --git a/Documentation/bpf/bpf_devel_QA.rst b/Documentation/bpf/bpf_devel_QA.rst
index edf8107a7beba..4729efd657c33 100644
--- a/Documentation/bpf/bpf_devel_QA.rst
+++ b/Documentation/bpf/bpf_devel_QA.rst
@@ -374,9 +374,10 @@ developers in order to get the feature implemented in a timely manner.
 Please refer to the git log (``arch/*/net/``) to locate the necessary
 people for helping out.
 
-Also always make sure to add BPF test cases (e.g. test_bpf.c and
-test_verifier.c) for new instructions, so that they can receive
-broad test coverage and help run-time testing the various BPF JITs.
+Also always make sure to add BPF test cases (e.g. the jit_insns test
+in test_progs and test_verifier.c) for new instructions, so that they
+can receive broad test coverage and help run-time testing the various
+BPF JITs.
 
 In case of new BPF instructions, once the changes have been accepted
 into the Linux kernel, please implement support into LLVM's BPF back
@@ -514,10 +515,11 @@ A: If you run a kernel ``xyz``, then always run the BPF kernel selftests
 from that kernel ``xyz`` as well. Do not expect that the BPF selftest
 from the latest mainline tree will pass all the time.
 
-In particular, test_bpf.c and test_verifier.c have a large number of
-test cases and are constantly updated with new BPF test sequences, or
-existing ones are adapted to verifier changes e.g. due to verifier
-becoming smarter and being able to better track certain things.
+In particular, test_verifier.c and the instruction tests in test_progs
+have a large number of test cases and are constantly updated with new
+BPF test sequences, or existing ones are adapted to verifier changes
+e.g. due to verifier becoming smarter and being able to better track
+certain things.
 
 LLVM
 ====
diff --git a/Documentation/networking/filter.rst b/Documentation/networking/filter.rst
index 8eb9a5d40f31b..e0b9dc14a9bf2 100644
--- a/Documentation/networking/filter.rst
+++ b/Documentation/networking/filter.rst
@@ -656,16 +656,11 @@ from eBPF instruction set.
 Testing
 -------
 
-Next to the BPF toolchain, the kernel also ships a test module that contains
-various test cases for classic and eBPF that can be executed against
-the BPF interpreter and JIT compiler. It can be found in lib/test_bpf.c and
-enabled via Kconfig::
-
-  CONFIG_TEST_BPF=m
-
-After the module has been built and installed, the test suite can be executed
-via insmod or modprobe against 'test_bpf' module. Results of the test cases
-including timings in nsec can be found in the kernel log (dmesg).
+Next to the BPF toolchain, the BPF selftests under tools/testing/selftests/bpf
+ship instruction tests in test_progs, see jit_insns, which runs the eBPF
+instructions over a range of operand magnitudes and signs, register
+combinations, memory offsets and jump offsets against the BPF interpreter
+or the JIT compiler, depending on the net.core.bpf_jit_enable setting.
 
 Misc
 ----
diff --git a/MAINTAINERS b/MAINTAINERS
index fe99b7437a2dc..80845ba7dfb56 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4981,7 +4981,6 @@ F:	include/uapi/linux/filter.h
 F:	kernel/bpf/
 F:	kernel/trace/bpf_trace.c
 F:	lib/buildid.c
-F:	lib/test_bpf.c
 F:	net/bpf/
 F:	net/core/filter.c
 F:	net/sched/act_bpf.c
diff --git a/arch/m68k/configs/amiga_defconfig b/arch/m68k/configs/amiga_defconfig
index 8b7efe20dd128..0efd78d64a901 100644
--- a/arch/m68k/configs/amiga_defconfig
+++ b/arch/m68k/configs/amiga_defconfig
@@ -576,7 +576,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/apollo_defconfig b/arch/m68k/configs/apollo_defconfig
index c7f7705806f97..35b54dc7e79c7 100644
--- a/arch/m68k/configs/apollo_defconfig
+++ b/arch/m68k/configs/apollo_defconfig
@@ -531,7 +531,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/atari_defconfig b/arch/m68k/configs/atari_defconfig
index 2fb213161baec..265588b71b820 100644
--- a/arch/m68k/configs/atari_defconfig
+++ b/arch/m68k/configs/atari_defconfig
@@ -554,7 +554,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/bvme6000_defconfig b/arch/m68k/configs/bvme6000_defconfig
index 6730242d4d486..595601e229718 100644
--- a/arch/m68k/configs/bvme6000_defconfig
+++ b/arch/m68k/configs/bvme6000_defconfig
@@ -523,7 +523,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/hp300_defconfig b/arch/m68k/configs/hp300_defconfig
index 2b3ff26ac8fdf..568d80e3db22d 100644
--- a/arch/m68k/configs/hp300_defconfig
+++ b/arch/m68k/configs/hp300_defconfig
@@ -533,7 +533,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/mac_defconfig b/arch/m68k/configs/mac_defconfig
index 61f32ef2547e0..da1f4677aa6d3 100644
--- a/arch/m68k/configs/mac_defconfig
+++ b/arch/m68k/configs/mac_defconfig
@@ -552,7 +552,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig
index 2cbd6bf20a687..8e6466c514847 100644
--- a/arch/m68k/configs/multi_defconfig
+++ b/arch/m68k/configs/multi_defconfig
@@ -639,7 +639,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/mvme147_defconfig b/arch/m68k/configs/mvme147_defconfig
index 019f8b8070be8..8e7882354e530 100644
--- a/arch/m68k/configs/mvme147_defconfig
+++ b/arch/m68k/configs/mvme147_defconfig
@@ -523,7 +523,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig
index 3891632874258..d3e7049c2e433 100644
--- a/arch/m68k/configs/mvme16x_defconfig
+++ b/arch/m68k/configs/mvme16x_defconfig
@@ -524,7 +524,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/q40_defconfig b/arch/m68k/configs/q40_defconfig
index cbc41443cffa6..c517c32dbdc7c 100644
--- a/arch/m68k/configs/q40_defconfig
+++ b/arch/m68k/configs/q40_defconfig
@@ -542,7 +542,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/sun3_defconfig b/arch/m68k/configs/sun3_defconfig
index 273e840dc8d6a..924f5f05906fb 100644
--- a/arch/m68k/configs/sun3_defconfig
+++ b/arch/m68k/configs/sun3_defconfig
@@ -520,7 +520,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/sun3x_defconfig b/arch/m68k/configs/sun3x_defconfig
index 843d72924bcb2..f63c6392d92ed 100644
--- a/arch/m68k/configs/sun3x_defconfig
+++ b/arch/m68k/configs/sun3x_defconfig
@@ -521,7 +521,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig
index 1eb8e3457e8bf..e0b7901add11b 100644
--- a/arch/powerpc/configs/ppc64_defconfig
+++ b/arch/powerpc/configs/ppc64_defconfig
@@ -442,7 +442,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_USER_COPY=m
-CONFIG_TEST_BPF=m
 CONFIG_TEST_BLACKHOLE_DEV=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
diff --git a/arch/s390/configs/debug_defconfig b/arch/s390/configs/debug_defconfig
index 3dae714743330..d597b4b532a34 100644
--- a/arch/s390/configs/debug_defconfig
+++ b/arch/s390/configs/debug_defconfig
@@ -927,6 +927,5 @@ CONFIG_INTERVAL_TREE_TEST=m
 CONFIG_PERCPU_TEST=m
 CONFIG_ATOMIC64_SELFTEST=y
 CONFIG_TEST_BITOPS=m
-CONFIG_TEST_BPF=m
 CONFIG_PAGE_TABLE_CHECK=y
 CONFIG_PAGE_TABLE_CHECK_ENFORCED=y
diff --git a/arch/s390/configs/defconfig b/arch/s390/configs/defconfig
index 6f5722634b4d3..c417b1717e895 100644
--- a/arch/s390/configs/defconfig
+++ b/arch/s390/configs/defconfig
@@ -851,4 +851,3 @@ CONFIG_LKDTM=m
 CONFIG_KPROBES_SANITY_TEST=m
 CONFIG_PERCPU_TEST=m
 CONFIG_ATOMIC64_SELFTEST=y
-CONFIG_TEST_BPF=m
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 083fcd6cf15b7..3975a94ac812d 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -421,7 +421,7 @@ static void pop_callee_regs(u8 **pprog, bool *callee_regs_used)
 }
 
 /* add rsp, depth */
-static void emit_add_rsp(u8 **pprog, u16 depth)
+static void emit_add_rsp(u8 **pprog, u32 depth)
 {
 	u8 *prog = *pprog;
 
@@ -435,7 +435,7 @@ static void emit_add_rsp(u8 **pprog, u16 depth)
 }
 
 /* sub rsp, depth */
-static void emit_sub_rsp(u8 **pprog, u16 depth)
+static void emit_sub_rsp(u8 **pprog, u32 depth)
 {
 	u8 *prog = *pprog;
 
@@ -472,6 +472,9 @@ static void emit_nops(u8 **pprog, int len)
  * in arch/x86/kernel/alternative.c
  */
 static int emit_call(u8 **prog, void *func, void *ip);
+static void emit_ldx(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, int off);
+static void emit_mov_reg(u8 **pprog, bool is64, u32 dst_reg, u32 src_reg);
+static void emit_alu_imm(u8 **pprog, u32 op, u32 dst_reg, s32 imm, bool is64);
 
 static void emit_fineibt(u8 **pprog, u8 *ip, u32 hash, int arity)
 {
@@ -607,8 +610,7 @@ static void emit_prologue(u8 **pprog, u8 *ip, u32 stack_depth, bool ebpf_from_cb
 	EMIT_ENDBR();
 
 	/* sub rsp, rounded_stack_depth */
-	if (stack_depth)
-		EMIT3_off32(0x48, 0x81, 0xEC, round_up(stack_depth, 8));
+	emit_sub_rsp(&prog, round_up(stack_depth, 8));
 	if (tail_call_reachable)
 		emit_prologue_tail_call(&prog, is_subprog);
 	*pprog = prog;
@@ -840,7 +842,7 @@ static void emit_bpf_tail_call_indirect(struct bpf_prog *bpf_prog,
 	 * if (index >= array->map.max_entries)
 	 *	goto out;
 	 */
-	EMIT2(0x89, 0xD2);                        /* mov edx, edx */
+	emit_mov_reg(&prog, false, BPF_REG_3, BPF_REG_3); /* mov edx, edx */
 	EMIT3(0x39, 0x56,                         /* cmp dword ptr [rsi + 16], edx */
 	      offsetof(struct bpf_array, map.max_entries));
 
@@ -851,7 +853,8 @@ static void emit_bpf_tail_call_indirect(struct bpf_prog *bpf_prog,
 	 * if ((*tcc_ptr)++ >= MAX_TAIL_CALL_CNT)
 	 *	goto out;
 	 */
-	EMIT3_off32(0x48, 0x8B, 0x85, tcc_ptr_off); /* mov rax, qword ptr [rbp - tcc_ptr_off] */
+	/* mov rax, qword ptr [rbp - tcc_ptr_off] */
+	emit_ldx(&prog, BPF_DW, BPF_REG_0, BPF_REG_FP, tcc_ptr_off);
 	EMIT4(0x48, 0x83, 0x38, MAX_TAIL_CALL_CNT); /* cmp qword ptr [rax], MAX_TAIL_CALL_CNT */
 
 	offset = ctx->tail_call_indirect_label - (prog + 2 - start);
@@ -888,15 +891,13 @@ static void emit_bpf_tail_call_indirect(struct bpf_prog *bpf_prog,
 	 * Pop tail_call_cnt_ptr, if it's subprog.
 	 */
 	EMIT1(0x58);                              /* pop rax */
-	if (stack_depth)
-		EMIT3_off32(0x48, 0x81, 0xC4,     /* add rsp, sd */
-			    round_up(stack_depth, 8));
+	emit_add_rsp(&prog, round_up(stack_depth, 8)); /* add rsp, sd */
 
 	/* goto *(prog->bpf_func + X86_TAIL_CALL_OFFSET); */
 	EMIT4(0x48, 0x8B, 0x49,                   /* mov rcx, qword ptr [rcx + 32] */
 	      offsetof(struct bpf_prog, bpf_func));
-	EMIT4(0x48, 0x83, 0xC1,                   /* add rcx, X86_TAIL_CALL_OFFSET */
-	      X86_TAIL_CALL_OFFSET);
+	/* add rcx, X86_TAIL_CALL_OFFSET */
+	emit_alu_imm(&prog, BPF_ADD, BPF_REG_4, X86_TAIL_CALL_OFFSET, true);
 	/*
 	 * Now we're ready to jump into next BPF program
 	 * rdi == ctx (1st arg)
@@ -923,7 +924,8 @@ static void emit_bpf_tail_call_direct(struct bpf_prog *bpf_prog,
 	 * if ((*tcc_ptr)++ >= MAX_TAIL_CALL_CNT)
 	 *	goto out;
 	 */
-	EMIT3_off32(0x48, 0x8B, 0x85, tcc_ptr_off);   /* mov rax, qword ptr [rbp - tcc_ptr_off] */
+	/* mov rax, qword ptr [rbp - tcc_ptr_off] */
+	emit_ldx(&prog, BPF_DW, BPF_REG_0, BPF_REG_FP, tcc_ptr_off);
 	EMIT4(0x48, 0x83, 0x38, MAX_TAIL_CALL_CNT);   /* cmp qword ptr [rax], MAX_TAIL_CALL_CNT */
 
 	offset = ctx->tail_call_direct_label - (prog + 2 - start);
@@ -955,8 +957,7 @@ static void emit_bpf_tail_call_direct(struct bpf_prog *bpf_prog,
 	 * Pop tail_call_cnt_ptr, if it's subprog.
 	 */
 	EMIT1(0x58);                                  /* pop rax */
-	if (stack_depth)
-		EMIT3_off32(0x48, 0x81, 0xC4, round_up(stack_depth, 8));
+	emit_add_rsp(&prog, round_up(stack_depth, 8));
 
 	emit_nops(&prog, X86_PATCH_SIZE);
 
@@ -1106,8 +1107,9 @@ static void emit_movsx_reg(u8 **pprog, int num_bits, bool is64, u32 dst_reg,
 	} else {
 		/* movs[b,w]l dst, src */
 		if (num_bits == 8) {
-			EMIT4(add_2mod(0x40, src_reg, dst_reg), 0x0f, 0xbe,
-			      add_2reg(0xC0, src_reg, dst_reg));
+			if (is_ereg(dst_reg) || is_ereg_8l(src_reg))
+				EMIT1(add_2mod(0x40, src_reg, dst_reg));
+			EMIT3(0x0f, 0xbe, add_2reg(0xC0, src_reg, dst_reg));
 		} else if (num_bits == 16) {
 			if (is_ereg(dst_reg) || is_ereg(src_reg))
 				EMIT1(add_2mod(0x40, src_reg, dst_reg));
@@ -1119,18 +1121,40 @@ static void emit_movsx_reg(u8 **pprog, int num_bits, bool is64, u32 dst_reg,
 	*pprog = prog;
 }
 
+/*
+ * rbp and r13 as base register always need a displacement, since mod 00
+ * with r/m 101 encodes a RIP-relative disp32 and with SIB base 101 a
+ * disp32 without base instead.
+ */
+static bool base_needs_disp(u32 reg)
+{
+	return reg2hex[reg] == 5;
+}
+
+static void emit_movzx_reg(u8 **pprog, int num_bits, u32 dst_reg, u32 src_reg)
+{
+	u8 *prog = *pprog;
+
+	/* movz[b,w]l dst, src */
+	if (is_ereg(dst_reg) ||
+	    (num_bits == 8 ? is_ereg_8l(src_reg) : is_ereg(src_reg)))
+		EMIT1(add_2mod(0x40, src_reg, dst_reg));
+	EMIT3(0x0F, num_bits == 8 ? 0xB6 : 0xB7,
+	      add_2reg(0xC0, src_reg, dst_reg));
+
+	*pprog = prog;
+}
+
 /* Emit the suffix (ModR/M etc) for addressing *(ptr_reg + off) and val_reg */
 static void emit_insn_suffix(u8 **pprog, u32 ptr_reg, u32 val_reg, int off)
 {
 	u8 *prog = *pprog;
 
-	if (is_imm8(off)) {
-		/* 1-byte signed displacement.
-		 *
-		 * If off == 0 we could skip this and save one extra byte, but
-		 * special case of x86 R13 which always needs an offset is not
-		 * worth the hassle
-		 */
+	if (!off && !base_needs_disp(ptr_reg)) {
+		/* No displacement */
+		EMIT1(add_2reg(0x00, ptr_reg, val_reg));
+	} else if (is_imm8(off)) {
+		/* 1-byte signed displacement */
 		EMIT2(add_2reg(0x40, ptr_reg, val_reg), off);
 	} else {
 		/* 4-byte signed displacement */
@@ -1139,14 +1163,22 @@ static void emit_insn_suffix(u8 **pprog, u32 ptr_reg, u32 val_reg, int off)
 	*pprog = prog;
 }
 
-static void emit_insn_suffix_SIB(u8 **pprog, u32 ptr_reg, u32 val_reg, u32 index_reg, int off)
+/*
+ * Emit the suffix for addressing *(ptr_reg + (index_reg << scale) + off)
+ * and val_reg, with a SIB byte
+ */
+static void emit_insn_suffix_SIB(u8 **pprog, u32 ptr_reg, u32 val_reg, u32 index_reg, int off,
+				 u8 scale)
 {
+	u8 sib = (scale << 6) | add_2reg(0, ptr_reg, index_reg);
 	u8 *prog = *pprog;
 
-	if (is_imm8(off)) {
-		EMIT3(add_2reg(0x44, BPF_REG_0, val_reg), add_2reg(0, ptr_reg, index_reg) /* SIB */, off);
+	if (!off && !base_needs_disp(ptr_reg)) {
+		EMIT2(add_2reg(0x04, BPF_REG_0, val_reg), sib);
+	} else if (is_imm8(off)) {
+		EMIT3(add_2reg(0x44, BPF_REG_0, val_reg), sib, off);
 	} else {
-		EMIT2_off32(add_2reg(0x84, BPF_REG_0, val_reg), add_2reg(0, ptr_reg, index_reg) /* SIB */, off);
+		EMIT2_off32(add_2reg(0x84, BPF_REG_0, val_reg), sib, off);
 	}
 	*pprog = prog;
 }
@@ -1179,6 +1211,85 @@ static void maybe_emit_1mod(u8 **pprog, u32 reg, bool is64)
 	*pprog = prog;
 }
 
+/* add/sub/and/or/xor dst_reg, imm with the imm8 and the rax short forms */
+static void emit_alu_imm(u8 **pprog, u32 op, u32 dst_reg, s32 imm, bool is64)
+{
+	/* ModR/M opcode extension and rax short form per operation */
+	static const u8 modrm[] = {
+		[BPF_ADD] = 0xC0, [BPF_SUB] = 0xE8, [BPF_AND] = 0xE0,
+		[BPF_OR] = 0xC8, [BPF_XOR] = 0xF0,
+	};
+	static const u8 short_op[] = {
+		[BPF_ADD] = 0x05, [BPF_SUB] = 0x2D, [BPF_AND] = 0x25,
+		[BPF_OR] = 0x0D, [BPF_XOR] = 0x35,
+	};
+	u8 *prog = *pprog;
+	bool inc;
+
+	/* A non-negative mask clears the upper half like the 32-bit and does */
+	if (op == BPF_AND && imm >= 0)
+		is64 = false;
+	/* add 128 is sub -128 and the other way round, which fit into an imm8 */
+	if ((op == BPF_ADD || op == BPF_SUB) && imm == 128) {
+		op = op == BPF_ADD ? BPF_SUB : BPF_ADD;
+		imm = -128;
+	}
+	inc = op == BPF_ADD ? imm == 1 : imm == -1;
+	maybe_emit_1mod(&prog, dst_reg, is64);
+	/* inc or dec for +-1, the flags are not read across instructions */
+	if ((op == BPF_ADD || op == BPF_SUB) && (imm == 1 || imm == -1))
+		EMIT2(0xFF, add_1reg(inc ? 0xC0 : 0xC8, dst_reg));
+	else if (is_imm8(imm))
+		EMIT3(0x83, add_1reg(modrm[op], dst_reg), imm);
+	else if (is_axreg(dst_reg))
+		EMIT1_off32(short_op[op], imm);
+	else
+		EMIT2_off32(0x81, add_1reg(modrm[op], dst_reg), imm);
+
+	*pprog = prog;
+}
+
+/* add/sub/and/or/xor dst_reg, src_reg */
+static void emit_alu_reg(u8 **pprog, u32 op, u32 dst_reg, u32 src_reg, bool is64)
+{
+	u8 *prog = *pprog;
+
+	maybe_emit_mod(&prog, dst_reg, src_reg, is64);
+	EMIT2(simple_alu_opcodes[op], add_2reg(0xC0, dst_reg, src_reg));
+
+	*pprog = prog;
+}
+
+/* shl/shr/sar reg, imm */
+static void emit_shift_imm(u8 **pprog, u32 op, u32 reg, u8 imm, bool is64)
+{
+	u8 *prog = *pprog;
+
+	/* The shift left by one is an add of the register to itself */
+	if (op == BPF_LSH && imm == 1) {
+		emit_alu_reg(&prog, BPF_ADD, reg, reg, is64);
+	} else {
+		maybe_emit_1mod(&prog, reg, is64);
+		if (imm == 1)
+			EMIT2(0xD1, add_1reg(simple_alu_opcodes[op], reg));
+		else
+			EMIT3(0xC1, add_1reg(simple_alu_opcodes[op], reg), imm);
+	}
+
+	*pprog = prog;
+}
+
+/* neg dst_reg */
+static void emit_neg(u8 **pprog, u32 dst_reg, bool is64)
+{
+	u8 *prog = *pprog;
+
+	maybe_emit_1mod(&prog, dst_reg, is64);
+	EMIT2(0xF7, add_1reg(0xD8, dst_reg));
+
+	*pprog = prog;
+}
+
 static int emit_kasan_check(struct bpf_verifier_env *env, u8 **pprog,
 			    u32 addr_reg, s32 off, u32 bpf_size, u8 *ip,
 			    bool is_write)
@@ -1233,15 +1344,8 @@ static int emit_kasan_check(struct bpf_verifier_env *env, u8 **pprog,
 	EMIT_mov(BPF_REG_1, addr_reg);
 
 	/* add rdi, off (if offset is non-zero) */
-	if (off) {
-		if (is_imm8(off)) {
-			/* add rdi, imm8 */
-			EMIT4(0x48, 0x83, 0xC7, (u8)off);
-		} else {
-			/* add rdi, imm32 */
-			EMIT3_off32(0x48, 0x81, 0xC7, off);
-		}
-	}
+	if (off)
+		emit_alu_imm(&prog, BPF_ADD, BPF_REG_1, off, true);
 
 	/* Adjust ip to account for the instrumentation generated so far */
 	ip += (prog - *pprog);
@@ -1273,12 +1377,16 @@ static void emit_ldx(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, int off)
 
 	switch (size) {
 	case BPF_B:
-		/* Emit 'movzx rax, byte ptr [rax + off]' */
-		EMIT3(add_2mod(0x48, src_reg, dst_reg), 0x0F, 0xB6);
+		/* Emit 'movzx eax, byte ptr [rax + off]' */
+		if (is_ereg(dst_reg) || is_ereg(src_reg))
+			EMIT1(add_2mod(0x40, src_reg, dst_reg));
+		EMIT2(0x0F, 0xB6);
 		break;
 	case BPF_H:
-		/* Emit 'movzx rax, word ptr [rax + off]' */
-		EMIT3(add_2mod(0x48, src_reg, dst_reg), 0x0F, 0xB7);
+		/* Emit 'movzx eax, word ptr [rax + off]' */
+		if (is_ereg(dst_reg) || is_ereg(src_reg))
+			EMIT1(add_2mod(0x40, src_reg, dst_reg));
+		EMIT2(0x0F, 0xB7);
 		break;
 	case BPF_W:
 		/* Emit 'mov eax, dword ptr [rax+0x14]' */
@@ -1341,7 +1449,7 @@ static void emit_ldx_index(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, u32 i
 		EMIT2(add_3mod(0x48, src_reg, dst_reg, index_reg), 0x8B);
 		break;
 	}
-	emit_insn_suffix_SIB(&prog, src_reg, dst_reg, index_reg, off);
+	emit_insn_suffix_SIB(&prog, src_reg, dst_reg, index_reg, off, 0);
 	*pprog = prog;
 }
 
@@ -1363,7 +1471,7 @@ static void emit_ldsx_index(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, u32
 		EMIT2(add_3mod(0x48, src_reg, dst_reg, index_reg), 0x63);
 		break;
 	}
-	emit_insn_suffix_SIB(&prog, src_reg, dst_reg, index_reg, off);
+	emit_insn_suffix_SIB(&prog, src_reg, dst_reg, index_reg, off, 0);
 	*pprog = prog;
 }
 
@@ -1434,7 +1542,7 @@ static void emit_stx_index(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, u32 i
 		EMIT2(add_3mod(0x48, dst_reg, src_reg, index_reg), 0x89);
 		break;
 	}
-	emit_insn_suffix_SIB(&prog, dst_reg, src_reg, index_reg, off);
+	emit_insn_suffix_SIB(&prog, dst_reg, src_reg, index_reg, off, 0);
 	*pprog = prog;
 }
 
@@ -1466,7 +1574,7 @@ static void emit_st_index(u8 **pprog, u32 size, u32 dst_reg, u32 index_reg, int
 		EMIT2(add_3mod(0x48, dst_reg, 0, index_reg), 0xC7);
 		break;
 	}
-	emit_insn_suffix_SIB(&prog, dst_reg, 0, index_reg, off);
+	emit_insn_suffix_SIB(&prog, dst_reg, 0, index_reg, off, 0);
 	EMIT(imm, bpf_size_to_x86_bytes(size));
 	*pprog = prog;
 }
@@ -1502,11 +1610,7 @@ static void emit_st(u8 **pprog, struct bpf_insn *insn, u32 dst_reg,
 		break;
 	}
 
-	if (is_imm8(insn_off))
-		EMIT2(add_1reg(0x40, dst_reg), insn_off);
-	else
-		EMIT1_off32(add_1reg(0x80, dst_reg), insn_off);
-
+	emit_insn_suffix(&prog, dst_reg, BPF_REG_0, insn_off);
 	EMIT(imm32, bpf_size_to_x86_bytes(BPF_SIZE(insn->code)));
 	*pprog = prog;
 }
@@ -1614,7 +1718,7 @@ static int emit_atomic_rmw_index(u8 **pprog, u32 atomic_op, u32 size,
 		pr_err("bpf_jit: unknown atomic opcode %02x\n", atomic_op);
 		return -EFAULT;
 	}
-	emit_insn_suffix_SIB(&prog, dst_reg, src_reg, index_reg, off);
+	emit_insn_suffix_SIB(&prog, dst_reg, src_reg, index_reg, off, 0);
 	*pprog = prog;
 	return 0;
 }
@@ -1824,6 +1928,218 @@ static void emit_shiftx(u8 **pprog, u32 dst_reg, u8 src_reg, bool is64, u8 op)
 	*pprog = prog;
 }
 
+struct bpf_div_magic {
+	u64 m;		/* multiplier, sign extended for signed division */
+	int s;		/* shift of the high half of the product */
+	bool add;	/* multiplier has 65 bits, use the add sequence */
+};
+
+/*
+ * Multiplier and shift for an unsigned division by the constant d, with
+ * 2 <= d < 2^64 and a dividend below 2^(64 - lz): n / d == (mulhu(n, m)
+ * >> s), or with the add sequence when m needs 65 bits, (((n - t) >> 1)
+ * + t) >> (s - 1) with t = mulhu(n, m). Hacker's Delight, 2nd ed., figure
+ * 10-2.
+ */
+static void bpf_magic_udiv(u64 d, int lz, struct bpf_div_magic *mag)
+{
+	u64 mask = ~0ULL >> lz;
+	u64 nc, delta, q1, r1, q2, r2;
+	int p;
+
+	mag->add = false;
+	/* Largest value with nc mod d == d - 1 */
+	nc = mask - (mask % d + 1) % d;
+	p = 63;
+	q1 = (1ULL << 63) / nc;			/* 2^p / nc */
+	r1 = (1ULL << 63) - q1 * nc;		/* 2^p mod nc */
+	q2 = (~0ULL >> 1) / d;			/* (2^p - 1) / d */
+	r2 = (~0ULL >> 1) - q2 * d;		/* (2^p - 1) mod d */
+	do {
+		p++;
+		if (r1 >= nc - r1) {
+			q1 = 2 * q1 + 1;
+			r1 = 2 * r1 - nc;
+		} else {
+			q1 = 2 * q1;
+			r1 = 2 * r1;
+		}
+		if (r2 + 1 >= d - r2) {
+			if (q2 >= (~0ULL >> 1))
+				mag->add = true;
+			q2 = 2 * q2 + 1;
+			r2 = 2 * r2 + 1 - d;
+		} else {
+			if (q2 >= (1ULL << 63))
+				mag->add = true;
+			q2 = 2 * q2;
+			r2 = 2 * r2 + 1;
+		}
+		delta = d - 1 - r2;
+	} while (p < 128 && (q1 < delta || (q1 == delta && r1 == 0)));
+
+	mag->m = q2 + 1;
+	mag->s = p - 64;
+}
+
+/*
+ * Multiplier and shift for a signed division by the constant d, with
+ * 2 <= |d| < 2^63: q = mulhs(n, m), q += n if d > 0 and m < 0, q -= n
+ * if d < 0 and m > 0, q >>= s (arithmetic), n / d == q + (q >>> 63).
+ * Hacker's Delight, 2nd ed., figure 10-1.
+ */
+static void bpf_magic_sdiv(s64 d, struct bpf_div_magic *mag)
+{
+	u64 ad = d < 0 ? -(u64)d : (u64)d;
+	u64 t, anc, delta, q1, r1, q2, r2;
+	int p;
+
+	t = (1ULL << 63) + (d < 0);
+	anc = t - 1 - t % ad;			/* |nc| */
+	p = 63;
+	q1 = (1ULL << 63) / anc;		/* 2^p / |nc| */
+	r1 = (1ULL << 63) - q1 * anc;		/* 2^p mod |nc| */
+	q2 = (1ULL << 63) / ad;			/* 2^p / |d| */
+	r2 = (1ULL << 63) - q2 * ad;		/* 2^p mod |d| */
+	do {
+		p++;
+		q1 = 2 * q1;
+		r1 = 2 * r1;
+		if (r1 >= anc) {
+			q1++;
+			r1 -= anc;
+		}
+		q2 = 2 * q2;
+		r2 = 2 * r2;
+		if (r2 >= ad) {
+			q2++;
+			r2 -= ad;
+		}
+		delta = ad - r2;
+	} while (q1 < delta || (q1 == delta && r1 == 0));
+
+	mag->m = q2 + 1;
+	if (d < 0)
+		mag->m = -mag->m;
+	mag->s = p - 64;
+	mag->add = false;
+}
+
+/*
+ * Divide dst_reg by the constant in insn->imm of a 64-bit division through
+ * a multiplication with the magic number from bpf_magic_udiv() or
+ * bpf_magic_sdiv(). The dividend goes through rax and the multiplier
+ * through r11, the caller saves rax and rdx unless they are dst_reg, and
+ * r10 is scratch. Returns false for the divisors left to div/idiv.
+ */
+static bool emit_div_const(u8 **pprog, const struct bpf_insn *insn, u32 dst_reg)
+{
+	bool is_mod = BPF_OP(insn->code) == BPF_MOD;
+	bool is_signed = insn->off == 1;
+	u32 n_reg = dst_reg, q_reg;
+	s32 imm32 = insn->imm;
+	struct bpf_div_magic mag;
+	u8 *prog = *pprog;
+	int corr = 0, pre = 0, s;
+
+	if (is_signed) {
+		/* |d| >= 2, the verifier already rewrote d == -1 */
+		if (imm32 >= -1 && imm32 <= 1)
+			return false;
+		bpf_magic_sdiv(imm32, &mag);
+		/* q += n for d > 0 and m < 0, q -= n for d < 0 and m > 0 */
+		if (imm32 > 0 && (s64)mag.m < 0)
+			corr = 1;
+		else if (imm32 < 0 && (s64)mag.m > 0)
+			corr = -1;
+	} else {
+		/* d >= 2, a negative imm32 is a divisor above 2^63 */
+		if (imm32 < 2)
+			return false;
+		bpf_magic_udiv(imm32, 0, &mag);
+		/*
+		 * Shift the dividend by the trailing zeros of an even divisor
+		 * first, the magic number of the odd part then fits without
+		 * the add sequence.
+		 */
+		if (mag.add && !(imm32 & 1)) {
+			pre = __ffs(imm32);
+			bpf_magic_udiv(imm32 >> pre, pre, &mag);
+			if (mag.add)
+				return false;
+		}
+	}
+	s = mag.s;
+	/*
+	 * The shift is at most 63, or 64 with the add sequence which shifts
+	 * by s - 1 and needs s >= 1. Never hit for d >= 2, kept as a guard
+	 * against an unencodable count.
+	 */
+	if (s > 64 - !mag.add || (mag.add && !s))
+		return false;
+
+	/* Keep the dividend when the multiplication clobbers it */
+	if ((is_mod || mag.add || corr) &&
+	    (dst_reg == BPF_REG_0 || dst_reg == BPF_REG_3)) {
+		emit_mov_reg(&prog, true, BPF_REG_AX, dst_reg);
+		n_reg = BPF_REG_AX;
+	}
+
+	/* mov rax, dst_reg; shr rax, pre; mov r11, m; mul r11 or imul r11 */
+	if (dst_reg != BPF_REG_0)
+		emit_mov_reg(&prog, true, BPF_REG_0, dst_reg);
+	if (pre)
+		emit_shift_imm(&prog, BPF_RSH, BPF_REG_0, pre, true);
+	emit_mov_imm64(&prog, AUX_REG, mag.m >> 32, (u32)mag.m);
+	EMIT3(0x49, 0xF7, is_signed ? 0xEB : 0xE3);
+	if (is_signed) {
+		/* add rdx, n_reg or sub rdx, n_reg */
+		if (corr)
+			emit_alu_reg(&prog, corr > 0 ? BPF_ADD : BPF_SUB,
+				     BPF_REG_3, n_reg, true);
+		/* sar rdx, s */
+		if (s)
+			emit_shift_imm(&prog, BPF_ARSH, BPF_REG_3, s, true);
+		/* mov rax, rdx; shr rax, 63; add rdx, rax */
+		emit_mov_reg(&prog, true, BPF_REG_0, BPF_REG_3);
+		emit_shift_imm(&prog, BPF_RSH, BPF_REG_0, 63, true);
+		emit_alu_reg(&prog, BPF_ADD, BPF_REG_3, BPF_REG_0, true);
+		q_reg = BPF_REG_3;
+	} else if (!mag.add) {
+		/* shr rdx, s */
+		if (s)
+			emit_shift_imm(&prog, BPF_RSH, BPF_REG_3, s, true);
+		q_reg = BPF_REG_3;
+	} else {
+		/* mov rax, n_reg; sub rax, rdx; shr rax, 1 */
+		emit_mov_reg(&prog, true, BPF_REG_0, n_reg);
+		emit_alu_reg(&prog, BPF_SUB, BPF_REG_0, BPF_REG_3, true);
+		emit_shift_imm(&prog, BPF_RSH, BPF_REG_0, 1, true);
+		/* add rax, rdx; shr rax, s - 1 */
+		emit_alu_reg(&prog, BPF_ADD, BPF_REG_0, BPF_REG_3, true);
+		if (s > 1)
+			emit_shift_imm(&prog, BPF_RSH, BPF_REG_0, s - 1, true);
+		q_reg = BPF_REG_0;
+	}
+
+	if (is_mod) {
+		/* imul q_reg, q_reg, imm32 */
+		maybe_emit_mod(&prog, q_reg, q_reg, true);
+		if (is_imm8(imm32))
+			EMIT3(0x6B, add_2reg(0xC0, q_reg, q_reg), imm32);
+		else
+			EMIT2_off32(0x69, add_2reg(0xC0, q_reg, q_reg), imm32);
+		/* sub n_reg, q_reg */
+		emit_alu_reg(&prog, BPF_SUB, n_reg, q_reg, true);
+		q_reg = n_reg;
+	}
+	if (q_reg != dst_reg)
+		emit_mov_reg(&prog, true, dst_reg, q_reg);
+
+	*pprog = prog;
+	return true;
+}
+
 static void emit_priv_frame_ptr(u8 **pprog, void __percpu *priv_frame_ptr)
 {
 	u8 *prog = *pprog;
@@ -1845,7 +2161,7 @@ static void emit_priv_frame_ptr(u8 **pprog, void __percpu *priv_frame_ptr)
 #define INSN_SZ_DIFF (((addrs[i] - addrs[i - 1]) - (prog - temp)))
 
 #define __LOAD_TCC_PTR(off)			\
-	EMIT3_off32(0x48, 0x8B, 0x85, off)
+	emit_ldx(&prog, BPF_DW, BPF_REG_0, BPF_REG_FP, off)
 /* mov rax, qword ptr [rbp - rounded_stack_depth - 16] */
 #define LOAD_TAIL_CALL_CNT_PTR(stack)				\
 	__LOAD_TCC_PTR(BPF_TAIL_CALL_CNT_PTR_STACK_OFF(stack))
@@ -2000,6 +2316,54 @@ static int emit_kfunc_arena_args(struct bpf_prog *bpf_prog,
 	return prog - start;
 }
 
+/*
+ * A strict compare against 1 or 128 is the non-strict one against 0 or
+ * 127, a strict one against -129 or, with a signed condition, -1 the
+ * non-strict one against -128 or 0: the compare against 0 is a test
+ * without immediate, 127 and -128 fit into an imm8.
+ */
+static void adjust_cmp_imm(u32 *op, s32 *imm)
+{
+	if (*imm == 1 || *imm == 128) {
+		switch (*op) {
+		case BPF_JLT:
+			*op = BPF_JLE;
+			break;
+		case BPF_JGE:
+			*op = BPF_JGT;
+			break;
+		case BPF_JSLT:
+			*op = BPF_JSLE;
+			break;
+		case BPF_JSGE:
+			*op = BPF_JSGT;
+			break;
+		default:
+			return;
+		}
+		*imm -= 1;
+	} else if (*imm == -1 || *imm == -129) {
+		switch (*op) {
+		case BPF_JGT:
+		case BPF_JLE:
+			/* -1 is the largest unsigned value */
+			if (*imm == -1)
+				return;
+			*op = *op == BPF_JGT ? BPF_JGE : BPF_JLT;
+			break;
+		case BPF_JSGT:
+			*op = BPF_JSGE;
+			break;
+		case BPF_JSLE:
+			*op = BPF_JSLT;
+			break;
+		default:
+			return;
+		}
+		*imm += 1;
+	}
+}
+
 static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *addrs, u8 *image,
 		  u8 *rw_image, int oldproglen, struct jit_context *ctx, bool jmp_padding)
 {
@@ -2134,7 +2498,7 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 		u32 dst_reg = insn->dst_reg;
 		u32 src_reg = insn->src_reg;
 		bool accesses_stack_only;
-		u8 b2 = 0, b3 = 0;
+		u8 b3 = 0;
 		u8 *start_of_ldx;
 		s64 jmp_offset;
 		s32 insn_off;
@@ -2142,6 +2506,8 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 		u8 jmp_cond;
 		u8 *func;
 		int nops;
+		u32 jmp_op = BPF_OP(insn->code);
+		s32 cmp_imm;
 
 		if (priv_frame_ptr) {
 			if (src_reg == BPF_REG_FP)
@@ -2172,43 +2538,24 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 		case BPF_ALU64 | BPF_AND | BPF_X:
 		case BPF_ALU64 | BPF_OR | BPF_X:
 		case BPF_ALU64 | BPF_XOR | BPF_X:
-			maybe_emit_mod(&prog, dst_reg, src_reg,
-				       BPF_CLASS(insn->code) == BPF_ALU64);
-			b2 = simple_alu_opcodes[BPF_OP(insn->code)];
-			EMIT2(b2, add_2reg(0xC0, dst_reg, src_reg));
+			emit_alu_reg(&prog, BPF_OP(insn->code), dst_reg, src_reg,
+				     BPF_CLASS(insn->code) == BPF_ALU64);
 			break;
 
 		case BPF_ALU64 | BPF_MOV | BPF_X:
 			if (insn_is_cast_user(insn)) {
-				if (dst_reg != src_reg)
-					/* 32-bit mov */
-					emit_mov_reg(&prog, false, dst_reg, src_reg);
-				/* shl dst_reg, 32 */
-				maybe_emit_1mod(&prog, dst_reg, true);
-				EMIT3(0xC1, add_1reg(0xE0, dst_reg), 32);
-
-				/* or dst_reg, user_vm_start */
-				maybe_emit_1mod(&prog, dst_reg, true);
-				if (is_axreg(dst_reg))
-					EMIT1_off32(0x0D,  user_vm_start >> 32);
-				else
-					EMIT2_off32(0x81, add_1reg(0xC8, dst_reg),  user_vm_start >> 32);
-
-				/* rol dst_reg, 32 */
-				maybe_emit_1mod(&prog, dst_reg, true);
-				EMIT3(0xC1, add_1reg(0xC0, dst_reg), 32);
-
-				/* xor r11, r11 */
-				EMIT3(0x4D, 0x31, 0xDB);
-
-				/* test dst_reg32, dst_reg32; check if lower 32-bit are zero */
+				/* mov dst_reg32, src_reg32 to zero extend the low half */
+				emit_mov_reg(&prog, false, dst_reg, src_reg);
+				/* mov r11, the high half of user_vm_start; or r11, dst_reg */
+				emit_mov_imm64(&prog, AUX_REG, user_vm_start >> 32, 0);
+				emit_alu_reg(&prog, BPF_OR, AUX_REG, dst_reg, true);
+				/* test dst_reg32, dst_reg32; a NULL pointer stays NULL */
 				maybe_emit_mod(&prog, dst_reg, dst_reg, false);
 				EMIT2(0x85, add_2reg(0xC0, dst_reg, dst_reg));
-
-				/* cmove r11, dst_reg; if so, set dst_reg to zero */
+				/* cmovne dst_reg, r11 */
 				/* WARNING: Intel swapped src/dst register encoding in CMOVcc !!! */
 				maybe_emit_mod(&prog, AUX_REG, dst_reg, true);
-				EMIT3(0x0F, 0x44, add_2reg(0xC0, AUX_REG, dst_reg));
+				EMIT3(0x0F, 0x45, add_2reg(0xC0, AUX_REG, dst_reg));
 				break;
 			} else if (insn_is_mov_percpu_addr(insn)) {
 				/* mov <dst>, <src> (if necessary) */
@@ -2236,9 +2583,7 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 			/* neg dst */
 		case BPF_ALU | BPF_NEG:
 		case BPF_ALU64 | BPF_NEG:
-			maybe_emit_1mod(&prog, dst_reg,
-					BPF_CLASS(insn->code) == BPF_ALU64);
-			EMIT2(0xF7, add_1reg(0xD8, dst_reg));
+			emit_neg(&prog, dst_reg, BPF_CLASS(insn->code) == BPF_ALU64);
 			break;
 
 		case BPF_ALU | BPF_ADD | BPF_K:
@@ -2251,42 +2596,23 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 		case BPF_ALU64 | BPF_AND | BPF_K:
 		case BPF_ALU64 | BPF_OR | BPF_K:
 		case BPF_ALU64 | BPF_XOR | BPF_K:
-			maybe_emit_1mod(&prog, dst_reg,
-					BPF_CLASS(insn->code) == BPF_ALU64);
-
-			/*
-			 * b3 holds 'normal' opcode, b2 short form only valid
-			 * in case dst is eax/rax.
-			 */
-			switch (BPF_OP(insn->code)) {
-			case BPF_ADD:
-				b3 = 0xC0;
-				b2 = 0x05;
-				break;
-			case BPF_SUB:
-				b3 = 0xE8;
-				b2 = 0x2D;
-				break;
-			case BPF_AND:
-				b3 = 0xE0;
-				b2 = 0x25;
+			if (BPF_OP(insn->code) == BPF_AND &&
+			    (imm32 == 0xff || imm32 == 0xffff)) {
+				/* movzx dst_reg, dst_reg8/16 */
+				emit_movzx_reg(&prog, imm32 == 0xff ? 8 : 16,
+					       dst_reg, dst_reg);
 				break;
-			case BPF_OR:
-				b3 = 0xC8;
-				b2 = 0x0D;
-				break;
-			case BPF_XOR:
-				b3 = 0xF0;
-				b2 = 0x35;
+			}
+			if (BPF_OP(insn->code) == BPF_XOR && imm32 == -1) {
+				/* not dst_reg */
+				maybe_emit_1mod(&prog, dst_reg,
+						BPF_CLASS(insn->code) == BPF_ALU64);
+				EMIT2(0xF7, add_1reg(0xD0, dst_reg));
 				break;
 			}
 
-			if (is_imm8(imm32))
-				EMIT3(0x83, add_1reg(b3, dst_reg), imm32);
-			else if (is_axreg(dst_reg))
-				EMIT1_off32(b2, imm32);
-			else
-				EMIT2_off32(0x81, add_1reg(b3, dst_reg), imm32);
+			emit_alu_imm(&prog, BPF_OP(insn->code), dst_reg, imm32,
+				     BPF_CLASS(insn->code) == BPF_ALU64);
 			break;
 
 		case BPF_ALU64 | BPF_MOV | BPF_K:
@@ -2317,6 +2643,11 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 			if (dst_reg != BPF_REG_3)
 				EMIT1(0x52); /* push rdx */
 
+			/* LLVM strength-reduces the 32-bit ones itself */
+			if (is64 && BPF_SRC(insn->code) == BPF_K &&
+			    emit_div_const(&prog, insn, dst_reg))
+				goto div_done;
+
 			if (BPF_SRC(insn->code) == BPF_X) {
 				if (src_reg == BPF_REG_0 ||
 				    src_reg == BPF_REG_3) {
@@ -2339,7 +2670,7 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 				 * xor edx, edx
 				 * equivalent to 'xor rdx, rdx', but one byte less
 				 */
-				EMIT2(0x31, 0xd2);
+				emit_mov_imm32(&prog, false, BPF_REG_3, 0);
 
 				/* div src_reg */
 				maybe_emit_1mod(&prog, src_reg, is64);
@@ -2363,7 +2694,7 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 				 dst_reg != BPF_REG_0)
 				/* mov dst_reg, rax */
 				emit_mov_reg(&prog, is64, dst_reg, BPF_REG_0);
-
+div_done:
 			if (dst_reg != BPF_REG_3)
 				EMIT1(0x5A); /* pop rdx */
 			if (dst_reg != BPF_REG_0)
@@ -2373,6 +2704,25 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 
 		case BPF_ALU | BPF_MUL | BPF_K:
 		case BPF_ALU64 | BPF_MUL | BPF_K:
+			/*
+			 * lea for 3, 5 and 9, which LLVM leaves as a
+			 * multiplication, but not for r13, which needs a
+			 * displacement as base and makes the lea a slow three
+			 * operand form on Intel.
+			 */
+			if ((imm32 == 3 || imm32 == 5 || imm32 == 9) &&
+			    !base_needs_disp(dst_reg)) {
+				/* lea dst_reg, [dst_reg + dst_reg * (imm32 - 1)] */
+				if (BPF_CLASS(insn->code) == BPF_ALU64)
+					EMIT1(add_3mod(0x48, dst_reg, dst_reg, dst_reg));
+				else if (is_ereg(dst_reg))
+					EMIT1(add_3mod(0x40, dst_reg, dst_reg, dst_reg));
+				EMIT1(0x8D);
+				emit_insn_suffix_SIB(&prog, dst_reg, dst_reg, dst_reg, 0,
+						     ilog2(imm32 - 1));
+				break;
+			}
+
 			maybe_emit_mod(&prog, dst_reg, dst_reg,
 				       BPF_CLASS(insn->code) == BPF_ALU64);
 
@@ -2403,14 +2753,8 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 		case BPF_ALU64 | BPF_LSH | BPF_K:
 		case BPF_ALU64 | BPF_RSH | BPF_K:
 		case BPF_ALU64 | BPF_ARSH | BPF_K:
-			maybe_emit_1mod(&prog, dst_reg,
-					BPF_CLASS(insn->code) == BPF_ALU64);
-
-			b3 = simple_alu_opcodes[BPF_OP(insn->code)];
-			if (imm32 == 1)
-				EMIT2(0xD1, add_1reg(b3, dst_reg));
-			else
-				EMIT3(0xC1, add_1reg(b3, dst_reg), imm32);
+			emit_shift_imm(&prog, BPF_OP(insn->code), dst_reg,
+				       imm32, BPF_CLASS(insn->code) == BPF_ALU64);
 			break;
 
 		case BPF_ALU | BPF_LSH | BPF_X:
@@ -2419,8 +2763,12 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 		case BPF_ALU64 | BPF_LSH | BPF_X:
 		case BPF_ALU64 | BPF_RSH | BPF_X:
 		case BPF_ALU64 | BPF_ARSH | BPF_X:
-			/* BMI2 shifts aren't better when shift count is already in rcx */
-			if (boot_cpu_has(X86_FEATURE_BMI2) && src_reg != BPF_REG_4) {
+			/*
+			 * BMI2 shifts take the count from any register and,
+			 * unlike the cl forms, are a single uop on Intel, so
+			 * prefer them also when the count already is in rcx.
+			 */
+			if (boot_cpu_has(X86_FEATURE_BMI2)) {
 				/* shrx/sarx/shlx dst_reg, dst_reg, src_reg */
 				bool w = (BPF_CLASS(insn->code) == BPF_ALU64);
 				u8 op;
@@ -2476,18 +2824,16 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 		case BPF_ALU64 | BPF_END | BPF_FROM_LE:
 			switch (imm32) {
 			case 16:
-				/* Emit 'ror %ax, 8' to swap lower 2 bytes */
-				EMIT1(0x66);
+				/* Emit 'bswap eax' to swap lower 4 bytes */
 				if (is_ereg(dst_reg))
 					EMIT1(0x41);
-				EMIT3(0xC1, add_1reg(0xC8, dst_reg), 8);
+				EMIT2(0x0F, add_1reg(0xC8, dst_reg));
 
-				/* Emit 'movzwl eax, ax' */
-				if (is_ereg(dst_reg))
-					EMIT3(0x45, 0x0F, 0xB7);
-				else
-					EMIT2(0x0F, 0xB7);
-				EMIT1(add_2reg(0xC0, dst_reg, dst_reg));
+				/*
+				 * Emit 'shr eax, 16' to move the swapped lower
+				 * 2 bytes back down and zero extend
+				 */
+				emit_shift_imm(&prog, BPF_RSH, dst_reg, 16, false);
 				break;
 			case 32:
 				/* Emit 'bswap eax' to swap lower 4 bytes */
@@ -2512,11 +2858,7 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 				 * Emit 'movzwl eax, ax' to zero extend 16-bit
 				 * into 64 bit
 				 */
-				if (is_ereg(dst_reg))
-					EMIT3(0x45, 0x0F, 0xB7);
-				else
-					EMIT2(0x0F, 0xB7);
-				EMIT1(add_2reg(0xC0, dst_reg, dst_reg));
+				emit_movzx_reg(&prog, 16, dst_reg, dst_reg);
 				break;
 			case 32:
 				/* Emit 'mov eax, eax' to clear upper 32-bits */
@@ -2730,38 +3072,32 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 				 *   src_reg + insn->off > TASK_SIZE_MAX + PAGE_SIZE
 				 *   and
 				 *   src_reg + insn->off < VSYSCALL_ADDR
+				 *
+				 * The check is done on src_reg + insn->off - VSYSCALL_ADDR
+				 * against the next power of two above the limit. Addresses
+				 * between the limit and that power of two are non-canonical
+				 * and would fault anyway, so they get zeroed a bit earlier.
 				 */
 
 				u64 limit = TASK_SIZE_MAX + PAGE_SIZE - VSYSCALL_ADDR;
 				u8 *end_of_jmp;
 
-				/* movabsq r10, VSYSCALL_ADDR */
-				emit_mov_imm64(&prog, BPF_REG_AX, (long)VSYSCALL_ADDR >> 32,
-					       (u32)(long)VSYSCALL_ADDR);
-
-				/* mov src_reg, r11 */
-				EMIT_mov(AUX_REG, src_reg);
-
-				if (insn->off) {
-					/* add r11, insn->off */
-					maybe_emit_1mod(&prog, AUX_REG, true);
-					EMIT2_off32(0x81, add_1reg(0xC0, AUX_REG), insn->off);
-				}
-
-				/* sub r11, r10 */
-				maybe_emit_mod(&prog, AUX_REG, BPF_REG_AX, true);
-				EMIT2(0x29, add_2reg(0xC0, AUX_REG, BPF_REG_AX));
-
-				/* movabsq r10, limit */
-				emit_mov_imm64(&prog, BPF_REG_AX, (long)limit >> 32,
-					       (u32)(long)limit);
+				/*
+				 * lea r11, [src_reg + insn->off - VSYSCALL_ADDR]
+				 *
+				 * VSYSCALL_ADDR is a small negative number, so the
+				 * whole offset fits into the 32-bit displacement.
+				 */
+				BUILD_BUG_ON((long)(s32)VSYSCALL_ADDR != (long)VSYSCALL_ADDR);
+				EMIT2(add_2mod(0x48, src_reg, AUX_REG), 0x8D);
+				emit_insn_suffix(&prog, src_reg, AUX_REG,
+						 insn->off - (s32)VSYSCALL_ADDR);
 
-				/* cmp r10, r11 */
-				maybe_emit_mod(&prog, AUX_REG, BPF_REG_AX, true);
-				EMIT2(0x39, add_2reg(0xC0, AUX_REG, BPF_REG_AX));
+				/* shr r11, fls64(limit) */
+				emit_shift_imm(&prog, BPF_RSH, AUX_REG, fls64(limit), true);
 
-				/* if unsigned '>', goto load */
-				EMIT2(X86_JA, 0);
+				/* if not zero, goto load */
+				EMIT2(X86_JNE, 0);
 				end_of_jmp = prog;
 
 				/* xor dst_reg, dst_reg */
@@ -2769,7 +3105,7 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 				/* jmp byte_after_ldx */
 				EMIT2(0xEB, 0);
 
-				/* populate jmp_offset for JAE above to jump to start_of_ldx */
+				/* populate jmp_offset for JNE above to jump to start_of_ldx */
 				start_of_ldx = prog;
 				end_of_jmp[-1] = start_of_ldx - end_of_jmp;
 			} else if (!accesses_stack_only) {
@@ -2946,8 +3282,10 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 
 			func = (u8 *) __bpf_call_base + imm32;
 			if (src_reg == BPF_PSEUDO_CALL && tail_call_reachable) {
+				u8 *tcc_load = prog;
+
 				LOAD_TAIL_CALL_CNT_PTR(stack_depth);
-				ip += 7;
+				ip += prog - tcc_load;
 			}
 			if (!imm32)
 				return -EINVAL;
@@ -3067,10 +3405,26 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 
 		case BPF_JMP | BPF_JSET | BPF_K:
 		case BPF_JMP32 | BPF_JSET | BPF_K:
+			if ((u32)imm32 <= U8_MAX) {
+				/*
+				 * test dst_reg8, imm8: with the upper bits of the
+				 * mask clear the result only depends on the low byte.
+				 */
+				if (is_ereg_8l(dst_reg))
+					EMIT1(add_1mod(0x40, dst_reg));
+				if (is_axreg(dst_reg))
+					EMIT2(0xA8, imm32);
+				else
+					EMIT3(0xF6, add_1reg(0xC0, dst_reg), imm32);
+				goto emit_cond_jmp;
+			}
 			/* test dst_reg, imm32 */
 			maybe_emit_1mod(&prog, dst_reg,
 					BPF_CLASS(insn->code) == BPF_JMP);
-			EMIT2_off32(0xF7, add_1reg(0xC0, dst_reg), imm32);
+			if (is_axreg(dst_reg))
+				EMIT1_off32(0xA9, imm32);
+			else
+				EMIT2_off32(0xF7, add_1reg(0xC0, dst_reg), imm32);
 			goto emit_cond_jmp;
 
 		case BPF_JMP | BPF_JEQ | BPF_K:
@@ -3093,8 +3447,11 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 		case BPF_JMP32 | BPF_JSLT | BPF_K:
 		case BPF_JMP32 | BPF_JSGE | BPF_K:
 		case BPF_JMP32 | BPF_JSLE | BPF_K:
+			cmp_imm = imm32;
+			adjust_cmp_imm(&jmp_op, &cmp_imm);
+
 			/* test dst_reg, dst_reg to save one extra byte */
-			if (imm32 == 0) {
+			if (cmp_imm == 0) {
 				maybe_emit_mod(&prog, dst_reg, dst_reg,
 					       BPF_CLASS(insn->code) == BPF_JMP);
 				EMIT2(0x85, add_2reg(0xC0, dst_reg, dst_reg));
@@ -3105,13 +3462,15 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 			maybe_emit_1mod(&prog, dst_reg,
 					BPF_CLASS(insn->code) == BPF_JMP);
 
-			if (is_imm8(imm32))
-				EMIT3(0x83, add_1reg(0xF8, dst_reg), imm32);
+			if (is_imm8(cmp_imm))
+				EMIT3(0x83, add_1reg(0xF8, dst_reg), cmp_imm);
+			else if (is_axreg(dst_reg))
+				EMIT1_off32(0x3D, cmp_imm);
 			else
-				EMIT2_off32(0x81, add_1reg(0xF8, dst_reg), imm32);
+				EMIT2_off32(0x81, add_1reg(0xF8, dst_reg), cmp_imm);
 
 emit_cond_jmp:		/* Convert BPF opcode to x86 */
-			switch (BPF_OP(insn->code)) {
+			switch (jmp_op) {
 			case BPF_JEQ:
 				jmp_cond = X86_JE;
 				break;
@@ -3949,13 +4308,8 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im
 	if (im)
 		im->ksym.fp_start = prog - (u8 *)rw_image;
 
-	if (!is_imm8(stack_size)) {
-		/* sub rsp, stack_size */
-		EMIT3_off32(0x48, 0x81, 0xEC, stack_size);
-	} else {
-		/* sub rsp, stack_size */
-		EMIT4(0x48, 0x83, 0xEC, stack_size);
-	}
+	/* sub rsp, stack_size */
+	emit_sub_rsp(&prog, stack_size);
 	if (flags & BPF_TRAMP_F_TAIL_CALL_CTX)
 		EMIT1(0x50);		/* push rax */
 	/* mov QWORD PTR [rbp - rbx_off], rbx */
@@ -4097,7 +4451,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im
 
 	if (flags & BPF_TRAMP_F_SKIP_FRAME) {
 		/* skip our return address and return to parent */
-		EMIT4(0x48, 0x83, 0xC4, 8); /* add rsp, 8 */
+		emit_add_rsp(&prog, 8); /* add rsp, 8 */
 	}
 	emit_return(&prog, image + (prog - (u8 *)rw_image));
 	/* Make sure the trampoline generation logic doesn't overflow */
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 05c89396119ad..642f0ab8eb2d8 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -172,7 +172,6 @@ struct bpf_prog *bpf_prog_alloc(unsigned int size, gfp_t gfp_extra_flags)
 	}
 	return prog;
 }
-EXPORT_SYMBOL_GPL(bpf_prog_alloc);
 
 int bpf_prog_alloc_jited_linfo(struct bpf_prog *prog)
 {
@@ -1681,7 +1680,6 @@ noinline u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)
 {
 	return 0;
 }
-EXPORT_SYMBOL_GPL(__bpf_call_base);
 
 /* All UAPI available opcodes. */
 #define BPF_INSN_MAP(INSN_2, INSN_3)		\
@@ -2747,7 +2745,6 @@ struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err)
 {
 	return __bpf_prog_select_runtime(NULL, fp, err);
 }
-EXPORT_SYMBOL_GPL(bpf_prog_select_runtime);
 
 static unsigned int __bpf_prog_ret1(const void *ctx,
 				    const struct bpf_insn *insn)
@@ -3138,7 +3135,6 @@ void bpf_prog_free(struct bpf_prog *fp)
 	INIT_WORK(&aux->work, bpf_prog_free_deferred);
 	schedule_work(&aux->work);
 }
-EXPORT_SYMBOL_GPL(bpf_prog_free);
 
 /* RNG for unprivileged user space with separated state from prandom_u32(). */
 static DEFINE_PER_CPU(struct rnd_state, bpf_user_rnd_state);
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 2f34619905b60..d3d3604bedcff 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -2638,19 +2638,6 @@ config TEST_WORKQUEUE
 
 	  If unsure, say N.
 
-config TEST_BPF
-	tristate "Test BPF filter functionality"
-	depends on m && NET
-	help
-	  This builds the "test_bpf" module that runs various test vectors
-	  against the BPF interpreter or BPF JIT compiler depending on the
-	  current setting. This is in particular useful for BPF JIT compiler
-	  development, but also to run regression tests against changes in
-	  the interpreter code. It also enables test stubs for eBPF maps and
-	  verifier used by user space verifier testsuite.
-
-	  If unsure, say N.
-
 config FIND_BIT_BENCHMARK
 	tristate "Test find_bit functions"
 	help
diff --git a/lib/Makefile b/lib/Makefile
index dfab958327c5c..361b02903bef0 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -66,7 +66,6 @@ obj-y += kstrtox.o
 obj-$(CONFIG_FIND_BIT_BENCHMARK) += find_bit_benchmark.o
 obj-$(CONFIG_REGION_ALLOC_BENCHMARK) += region_alloc_benchmark.o
 obj-$(CONFIG_FIND_BIT_BENCHMARK_RUST) += find_bit_benchmark_rust.o
-obj-$(CONFIG_TEST_BPF) += test_bpf.o
 test_dhry-objs := dhry_1.o dhry_2.o dhry_run.o
 obj-$(CONFIG_TEST_DHRY) += test_dhry.o
 obj-$(CONFIG_TEST_FIRMWARE) += test_firmware.o
diff --git a/lib/test_bpf.c b/lib/test_bpf.c
deleted file mode 100644
index af6f3340c034f..0000000000000
--- a/lib/test_bpf.c
+++ /dev/null
@@ -1,15934 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Testsuite for BPF interpreter and BPF JIT compiler
- *
- * Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
- */
-
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/filter.h>
-#include <linux/bpf.h>
-#include <linux/skbuff.h>
-#include <linux/netdevice.h>
-#include <linux/if_vlan.h>
-#include <linux/prandom.h>
-#include <linux/highmem.h>
-#include <linux/sched.h>
-
-/* General test specific settings */
-#define MAX_SUBTESTS	3
-#define MAX_TESTRUNS	1000
-#define MAX_DATA	128
-#define MAX_INSNS	512
-#define MAX_K		0xffffFFFF
-
-/* Few constants used to init test 'skb' */
-#define SKB_TYPE	3
-#define SKB_MARK	0x1234aaaa
-#define SKB_HASH	0x1234aaab
-#define SKB_QUEUE_MAP	123
-#define SKB_VLAN_TCI	0xffff
-#define SKB_VLAN_PRESENT	1
-#define SKB_DEV_IFINDEX	577
-#define SKB_DEV_TYPE	588
-
-/* Redefine REGs to make tests less verbose */
-#define R0		BPF_REG_0
-#define R1		BPF_REG_1
-#define R2		BPF_REG_2
-#define R3		BPF_REG_3
-#define R4		BPF_REG_4
-#define R5		BPF_REG_5
-#define R6		BPF_REG_6
-#define R7		BPF_REG_7
-#define R8		BPF_REG_8
-#define R9		BPF_REG_9
-#define R10		BPF_REG_10
-
-/* Flags that can be passed to test cases */
-#define FLAG_NO_DATA		BIT(0)
-#define FLAG_EXPECTED_FAIL	BIT(1)
-#define FLAG_SKB_FRAG		BIT(2)
-#define FLAG_VERIFIER_ZEXT	BIT(3)
-#define FLAG_LARGE_MEM		BIT(4)
-
-enum {
-	CLASSIC  = BIT(6),	/* Old BPF instructions only. */
-	INTERNAL = BIT(7),	/* Extended instruction set.  */
-};
-
-#define TEST_TYPE_MASK		(CLASSIC | INTERNAL)
-
-struct bpf_test {
-	const char *descr;
-	union {
-		struct sock_filter insns[MAX_INSNS];
-		struct bpf_insn insns_int[MAX_INSNS];
-		struct {
-			void *insns;
-			unsigned int len;
-		} ptr;
-	} u;
-	__u8 aux;
-	__u8 data[MAX_DATA];
-	struct {
-		int data_size;
-		__u32 result;
-	} test[MAX_SUBTESTS];
-	int (*fill_helper)(struct bpf_test *self);
-	int expected_errcode; /* used when FLAG_EXPECTED_FAIL is set in the aux */
-	__u8 frag_data[MAX_DATA];
-	int stack_depth; /* for eBPF only, since tests don't call verifier */
-	int nr_testruns; /* Custom run count, defaults to MAX_TESTRUNS if 0 */
-};
-
-/* Large test cases need separate allocation and fill handler. */
-
-static int bpf_fill_maxinsns1(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	__u32 k = ~0;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	for (i = 0; i < len; i++, k--)
-		insn[i] = __BPF_STMT(BPF_RET | BPF_K, k);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns2(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	for (i = 0; i < len; i++)
-		insn[i] = __BPF_STMT(BPF_RET | BPF_K, 0xfefefefe);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns3(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	struct rnd_state rnd;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	prandom_seed_state(&rnd, 3141592653589793238ULL);
-
-	for (i = 0; i < len - 1; i++) {
-		__u32 k = prandom_u32_state(&rnd);
-
-		insn[i] = __BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, k);
-	}
-
-	insn[len - 1] = __BPF_STMT(BPF_RET | BPF_A, 0);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns4(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS + 1;
-	struct sock_filter *insn;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	for (i = 0; i < len; i++)
-		insn[i] = __BPF_STMT(BPF_RET | BPF_K, 0xfefefefe);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns5(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	insn[0] = __BPF_JUMP(BPF_JMP | BPF_JA, len - 2, 0, 0);
-
-	for (i = 1; i < len - 1; i++)
-		insn[i] = __BPF_STMT(BPF_RET | BPF_K, 0xfefefefe);
-
-	insn[len - 1] = __BPF_STMT(BPF_RET | BPF_K, 0xabababab);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns6(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	for (i = 0; i < len - 1; i++)
-		insn[i] = __BPF_STMT(BPF_LD | BPF_W | BPF_ABS, SKF_AD_OFF +
-				     SKF_AD_VLAN_TAG_PRESENT);
-
-	insn[len - 1] = __BPF_STMT(BPF_RET | BPF_A, 0);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns7(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	for (i = 0; i < len - 4; i++)
-		insn[i] = __BPF_STMT(BPF_LD | BPF_W | BPF_ABS, SKF_AD_OFF +
-				     SKF_AD_CPU);
-
-	insn[len - 4] = __BPF_STMT(BPF_MISC | BPF_TAX, 0);
-	insn[len - 3] = __BPF_STMT(BPF_LD | BPF_W | BPF_ABS, SKF_AD_OFF +
-				   SKF_AD_CPU);
-	insn[len - 2] = __BPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0);
-	insn[len - 1] = __BPF_STMT(BPF_RET | BPF_A, 0);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns8(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	int i, jmp_off = len - 3;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	insn[0] = __BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff);
-
-	for (i = 1; i < len - 1; i++)
-		insn[i] = __BPF_JUMP(BPF_JMP | BPF_JGT, 0xffffffff, jmp_off--, 0);
-
-	insn[len - 1] = __BPF_STMT(BPF_RET | BPF_A, 0);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns9(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct bpf_insn *insn;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	insn[0] = BPF_JMP_IMM(BPF_JA, 0, 0, len - 2);
-	insn[1] = BPF_ALU32_IMM(BPF_MOV, R0, 0xcbababab);
-	insn[2] = BPF_EXIT_INSN();
-
-	for (i = 3; i < len - 2; i++)
-		insn[i] = BPF_ALU32_IMM(BPF_MOV, R0, 0xfefefefe);
-
-	insn[len - 2] = BPF_EXIT_INSN();
-	insn[len - 1] = BPF_JMP_IMM(BPF_JA, 0, 0, -(len - 1));
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns10(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS, hlen = len - 2;
-	struct bpf_insn *insn;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	for (i = 0; i < hlen / 2; i++)
-		insn[i] = BPF_JMP_IMM(BPF_JA, 0, 0, hlen - 2 - 2 * i);
-	for (i = hlen - 1; i > hlen / 2; i--)
-		insn[i] = BPF_JMP_IMM(BPF_JA, 0, 0, hlen - 1 - 2 * i);
-
-	insn[hlen / 2] = BPF_JMP_IMM(BPF_JA, 0, 0, hlen / 2 - 1);
-	insn[hlen]     = BPF_ALU32_IMM(BPF_MOV, R0, 0xabababac);
-	insn[hlen + 1] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int __bpf_fill_ja(struct bpf_test *self, unsigned int len,
-			 unsigned int plen)
-{
-	struct sock_filter *insn;
-	unsigned int rlen;
-	int i, j;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	rlen = (len % plen) - 1;
-
-	for (i = 0; i + plen < len; i += plen)
-		for (j = 0; j < plen; j++)
-			insn[i + j] = __BPF_JUMP(BPF_JMP | BPF_JA,
-						 plen - 1 - j, 0, 0);
-	for (j = 0; j < rlen; j++)
-		insn[i + j] = __BPF_JUMP(BPF_JMP | BPF_JA, rlen - 1 - j,
-					 0, 0);
-
-	insn[len - 1] = __BPF_STMT(BPF_RET | BPF_K, 0xababcbac);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns11(struct bpf_test *self)
-{
-	/* Hits 70 passes on x86_64 and triggers NOPs padding. */
-	return __bpf_fill_ja(self, BPF_MAXINSNS, 68);
-}
-
-static int bpf_fill_maxinsns12(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	int i = 0;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	insn[0] = __BPF_JUMP(BPF_JMP | BPF_JA, len - 2, 0, 0);
-
-	for (i = 1; i < len - 1; i++)
-		insn[i] = __BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0);
-
-	insn[len - 1] = __BPF_STMT(BPF_RET | BPF_K, 0xabababab);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns13(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	int i = 0;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	for (i = 0; i < len - 3; i++)
-		insn[i] = __BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0);
-
-	insn[len - 3] = __BPF_STMT(BPF_LD | BPF_IMM, 0xabababab);
-	insn[len - 2] = __BPF_STMT(BPF_ALU | BPF_XOR | BPF_X, 0);
-	insn[len - 1] = __BPF_STMT(BPF_RET | BPF_A, 0);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_ja(struct bpf_test *self)
-{
-	/* Hits exactly 11 passes on x86_64 JIT. */
-	return __bpf_fill_ja(self, 12, 9);
-}
-
-static int bpf_fill_ld_abs_get_processor_id(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	for (i = 0; i < len - 1; i += 2) {
-		insn[i] = __BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 0);
-		insn[i + 1] = __BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-					 SKF_AD_OFF + SKF_AD_CPU);
-	}
-
-	insn[len - 1] = __BPF_STMT(BPF_RET | BPF_K, 0xbee);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int __bpf_fill_stxdw(struct bpf_test *self, int size)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct bpf_insn *insn;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	insn[0] = BPF_ALU32_IMM(BPF_MOV, R0, 1);
-	insn[1] = BPF_ST_MEM(size, R10, -40, 42);
-
-	for (i = 2; i < len - 2; i++)
-		insn[i] = BPF_STX_XADD(size, R10, R0, -40);
-
-	insn[len - 2] = BPF_LDX_MEM(size, R0, R10, -40);
-	insn[len - 1] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-	self->stack_depth = 40;
-
-	return 0;
-}
-
-static int bpf_fill_stxw(struct bpf_test *self)
-{
-	return __bpf_fill_stxdw(self, BPF_W);
-}
-
-static int bpf_fill_stxdw(struct bpf_test *self)
-{
-	return __bpf_fill_stxdw(self, BPF_DW);
-}
-
-static int __bpf_ld_imm64(struct bpf_insn insns[2], u8 reg, s64 imm64)
-{
-	struct bpf_insn tmp[] = {BPF_LD_IMM64(reg, imm64)};
-
-	memcpy(insns, tmp, sizeof(tmp));
-	return 2;
-}
-
-/*
- * Branch conversion tests. Complex operations can expand to a lot
- * of instructions when JITed. This in turn may cause jump offsets
- * to overflow the field size of the native instruction, triggering
- * a branch conversion mechanism in some JITs.
- */
-static int __bpf_fill_max_jmp(struct bpf_test *self, int jmp, int imm, bool alu32)
-{
-	struct bpf_insn *insns;
-	int len = S16_MAX + 5;
-	int i;
-
-	insns = kmalloc_objs(*insns, len);
-	if (!insns)
-		return -ENOMEM;
-
-	i = __bpf_ld_imm64(insns, R1, 0x0123456789abcdefULL);
-	insns[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 1);
-	insns[i++] = BPF_JMP_IMM(jmp, R0, imm, S16_MAX);
-	insns[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 2);
-	insns[i++] = BPF_EXIT_INSN();
-
-	while (i < len - 1) {
-		static const int ops[] = {
-			BPF_LSH, BPF_RSH, BPF_ARSH, BPF_ADD,
-			BPF_SUB, BPF_MUL, BPF_DIV, BPF_MOD,
-		};
-		int op = ops[(i >> 1) % ARRAY_SIZE(ops)];
-
-		if ((i & 1) || alu32)
-			insns[i++] = BPF_ALU32_REG(op, R0, R1);
-		else
-			insns[i++] = BPF_ALU64_REG(op, R0, R1);
-	}
-
-	insns[i++] = BPF_EXIT_INSN();
-	self->u.ptr.insns = insns;
-	self->u.ptr.len = len;
-	BUG_ON(i != len);
-
-	return 0;
-}
-
-/* Branch taken by runtime decision */
-static int bpf_fill_max_jmp_taken_32(struct bpf_test *self)
-{
-	return __bpf_fill_max_jmp(self, BPF_JEQ, 1, true);
-}
-
-static int bpf_fill_max_jmp_taken(struct bpf_test *self)
-{
-	return __bpf_fill_max_jmp(self, BPF_JEQ, 1, false);
-}
-
-/* Branch not taken by runtime decision */
-static int bpf_fill_max_jmp_not_taken_32(struct bpf_test *self)
-{
-	return __bpf_fill_max_jmp(self, BPF_JEQ, 0, true);
-}
-
-static int bpf_fill_max_jmp_not_taken(struct bpf_test *self)
-{
-	return __bpf_fill_max_jmp(self, BPF_JEQ, 0, false);
-}
-
-/* Branch always taken, known at JIT time */
-static int bpf_fill_max_jmp_always_taken_32(struct bpf_test *self)
-{
-	return __bpf_fill_max_jmp(self, BPF_JGE, 0, true);
-}
-
-static int bpf_fill_max_jmp_always_taken(struct bpf_test *self)
-{
-	return __bpf_fill_max_jmp(self, BPF_JGE, 0, false);
-}
-
-/* Branch never taken, known at JIT time */
-static int bpf_fill_max_jmp_never_taken_32(struct bpf_test *self)
-{
-	return __bpf_fill_max_jmp(self, BPF_JLT, 0, true);
-}
-
-static int bpf_fill_max_jmp_never_taken(struct bpf_test *self)
-{
-	return __bpf_fill_max_jmp(self, BPF_JLT, 0, false);
-}
-
-/* ALU result computation used in tests */
-enum { F_ALU32 = 1, F_SIGNED = 2 };
-
-static bool __bpf_alu_result(u64 *res, u64 v1, u64 v2, u8 op, u32 flags)
-{
-	bool is_signed = flags & F_SIGNED;
-
-	/* Narrow operands for ALU32 */
-	if (flags & F_ALU32) {
-		if (is_signed) {
-			v1 = (u64)(s32)v1;
-			v2 = (u64)(s32)v2;
-		} else {
-			v1 = (u32)v1;
-			v2 = (u32)v2;
-		}
-	}
-
-	*res = 0;
-	switch (op) {
-	case BPF_MOV:
-		*res = v2;
-		break;
-	case BPF_AND:
-		*res = v1 & v2;
-		break;
-	case BPF_OR:
-		*res = v1 | v2;
-		break;
-	case BPF_XOR:
-		*res = v1 ^ v2;
-		break;
-	case BPF_LSH:
-		*res = v1 << v2;
-		break;
-	case BPF_RSH:
-		*res = v1 >> v2;
-		break;
-	case BPF_ARSH:
-		*res = v1 >> v2;
-		if (v2 > 0 && v1 > S64_MAX)
-			*res |= ~0ULL << (64 - v2);
-		break;
-	case BPF_ADD:
-		*res = v1 + v2;
-		break;
-	case BPF_SUB:
-		*res = v1 - v2;
-		break;
-	case BPF_MUL:
-		*res = v1 * v2;
-		break;
-	case BPF_DIV:
-		if (v2 == 0)
-			return false;
-		if (!is_signed) {
-			*res = div64_u64(v1, v2);
-		} else {
-			if ((s64)v2 == -1) /* Handled by verifier */
-				return false;
-			*res = (u64)div64_s64(v1, v2);
-		}
-		break;
-	case BPF_MOD:
-		if (v2 == 0)
-			return false;
-		if (!is_signed) {
-			div64_u64_rem(v1, v2, res);
-		} else {
-			if ((s64)v2 == -1)
-				return false;
-			/*
-			 * Avoid s64 % s64 which generates __moddi3 on
-			 * 32-bit architectures. Use div64_s64 instead.
-			 */
-			*res = (u64)((s64)v1 - div64_s64(v1, v2) * (s64)v2);
-		}
-		break;
-	}
-	return true;
-}
-
-/* Test an ALU shift operation for all valid shift values */
-static int __bpf_fill_alu_shift(struct bpf_test *self, u8 op,
-				u8 mode, u32 flags)
-{
-	static const s64 regs[] = {
-		0x0123456789abcdefLL, /* dword > 0, word < 0 */
-		0xfedcba9876543210LL, /* dword < 0, word > 0 */
-		0xfedcba0198765432LL, /* dword < 0, word < 0 */
-		0x0123458967abcdefLL, /* dword > 0, word > 0 */
-	};
-	int bits = (flags & F_ALU32) ? 32 : 64;
-	int len = (2 + 7 * bits) * ARRAY_SIZE(regs) + 3;
-	struct bpf_insn *insn;
-	int imm, k;
-	int i = 0;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	insn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 0);
-
-	for (k = 0; k < ARRAY_SIZE(regs); k++) {
-		s64 reg = regs[k];
-
-		i += __bpf_ld_imm64(&insn[i], R3, reg);
-
-		for (imm = 0; imm < bits; imm++) {
-			u64 val;
-
-			/* Perform operation */
-			insn[i++] = BPF_ALU64_REG(BPF_MOV, R1, R3);
-			insn[i++] = BPF_ALU64_IMM(BPF_MOV, R2, imm);
-			if (flags & F_ALU32) {
-				if (mode == BPF_K)
-					insn[i++] = BPF_ALU32_IMM(op, R1, imm);
-				else
-					insn[i++] = BPF_ALU32_REG(op, R1, R2);
-
-				if (op == BPF_ARSH)
-					reg = (s32)reg;
-				else
-					reg = (u32)reg;
-				__bpf_alu_result(&val, reg, imm, op, 0);
-				val = (u32)val;
-			} else {
-				if (mode == BPF_K)
-					insn[i++] = BPF_ALU64_IMM(op, R1, imm);
-				else
-					insn[i++] = BPF_ALU64_REG(op, R1, R2);
-				__bpf_alu_result(&val, reg, imm, op, 0);
-			}
-
-			/*
-			 * When debugging a JIT that fails this test, one
-			 * can write the immediate value to R0 here to find
-			 * out which operand values that fail.
-			 */
-
-			/* Load reference and check the result */
-			i += __bpf_ld_imm64(&insn[i], R4, val);
-			insn[i++] = BPF_JMP_REG(BPF_JEQ, R1, R4, 1);
-			insn[i++] = BPF_EXIT_INSN();
-		}
-	}
-
-	insn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 1);
-	insn[i++] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-	BUG_ON(i != len);
-
-	return 0;
-}
-
-static int bpf_fill_alu64_lsh_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_LSH, BPF_K, 0);
-}
-
-static int bpf_fill_alu64_rsh_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_RSH, BPF_K, 0);
-}
-
-static int bpf_fill_alu64_arsh_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_ARSH, BPF_K, 0);
-}
-
-static int bpf_fill_alu64_lsh_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_LSH, BPF_X, 0);
-}
-
-static int bpf_fill_alu64_rsh_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_RSH, BPF_X, 0);
-}
-
-static int bpf_fill_alu64_arsh_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_ARSH, BPF_X, 0);
-}
-
-static int bpf_fill_alu32_lsh_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_LSH, BPF_K, F_ALU32);
-}
-
-static int bpf_fill_alu32_rsh_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_RSH, BPF_K, F_ALU32);
-}
-
-static int bpf_fill_alu32_arsh_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_ARSH, BPF_K, F_ALU32);
-}
-
-static int bpf_fill_alu32_lsh_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_LSH, BPF_X, F_ALU32);
-}
-
-static int bpf_fill_alu32_rsh_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_RSH, BPF_X, F_ALU32);
-}
-
-static int bpf_fill_alu32_arsh_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_ARSH, BPF_X, F_ALU32);
-}
-
-/*
- * Test an ALU register shift operation for all valid shift values
- * for the case when the source and destination are the same.
- */
-static int __bpf_fill_alu_shift_same_reg(struct bpf_test *self, u8 op,
-					 u32 flags)
-{
-	int bits = (flags & F_ALU32) ? 32 : 64;
-	int len = 3 + 6 * bits;
-	struct bpf_insn *insn;
-	int i = 0;
-	u64 val;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	insn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 0);
-
-	for (val = 0; val < bits; val++) {
-		u64 res;
-
-		/* Perform operation */
-		insn[i++] = BPF_ALU64_IMM(BPF_MOV, R1, val);
-		if (flags & F_ALU32)
-			insn[i++] = BPF_ALU32_REG(op, R1, R1);
-		else
-			insn[i++] = BPF_ALU64_REG(op, R1, R1);
-
-		/* Compute the reference result */
-		__bpf_alu_result(&res, val, val, op, 0);
-		if (flags & F_ALU32)
-			res = (u32)res;
-		i += __bpf_ld_imm64(&insn[i], R2, res);
-
-		/* Check the actual result */
-		insn[i++] = BPF_JMP_REG(BPF_JEQ, R1, R2, 1);
-		insn[i++] = BPF_EXIT_INSN();
-	}
-
-	insn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 1);
-	insn[i++] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-	BUG_ON(i != len);
-
-	return 0;
-}
-
-static int bpf_fill_alu64_lsh_same_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift_same_reg(self, BPF_LSH, 0);
-}
-
-static int bpf_fill_alu64_rsh_same_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift_same_reg(self, BPF_RSH, 0);
-}
-
-static int bpf_fill_alu64_arsh_same_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift_same_reg(self, BPF_ARSH, 0);
-}
-
-static int bpf_fill_alu32_lsh_same_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift_same_reg(self, BPF_LSH, F_ALU32);
-}
-
-static int bpf_fill_alu32_rsh_same_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift_same_reg(self, BPF_RSH, F_ALU32);
-}
-
-static int bpf_fill_alu32_arsh_same_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift_same_reg(self, BPF_ARSH, F_ALU32);
-}
-
-/*
- * Common operand pattern generator for exhaustive power-of-two magnitudes
- * tests. The block size parameters can be adjusted to increase/reduce the
- * number of combinatons tested and thereby execution speed and memory
- * footprint.
- */
-
-static inline s64 value(int msb, int delta, int sign)
-{
-	return sign * (1LL << msb) + delta;
-}
-
-static int __bpf_fill_pattern(struct bpf_test *self, void *arg,
-			      int dbits, int sbits, int block1, int block2,
-			      int (*emit)(struct bpf_test*, void*,
-					  struct bpf_insn*, s64, s64))
-{
-	static const int sgn[][2] = {{1, 1}, {1, -1}, {-1, 1}, {-1, -1}};
-	struct bpf_insn *insns;
-	int di, si, bt, db, sb;
-	int count, len, k;
-	int extra = 1 + 2;
-	int i = 0;
-
-	/* Total number of iterations for the two pattern */
-	count = (dbits - 1) * (sbits - 1) * block1 * block1 * ARRAY_SIZE(sgn);
-	count += (max(dbits, sbits) - 1) * block2 * block2 * ARRAY_SIZE(sgn);
-
-	/* Compute the maximum number of insns and allocate the buffer */
-	len = extra + count * (*emit)(self, arg, NULL, 0, 0);
-	insns = kmalloc_array(len, sizeof(*insns), GFP_KERNEL);
-	if (!insns)
-		return -ENOMEM;
-
-	/* Add head instruction(s) */
-	insns[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 0);
-
-	/*
-	 * Pattern 1: all combinations of power-of-two magnitudes and sign,
-	 * and with a block of contiguous values around each magnitude.
-	 */
-	for (di = 0; di < dbits - 1; di++)                 /* Dst magnitudes */
-		for (si = 0; si < sbits - 1; si++)         /* Src magnitudes */
-			for (k = 0; k < ARRAY_SIZE(sgn); k++) /* Sign combos */
-				for (db = -(block1 / 2);
-				     db < (block1 + 1) / 2; db++)
-					for (sb = -(block1 / 2);
-					     sb < (block1 + 1) / 2; sb++) {
-						s64 dst, src;
-
-						dst = value(di, db, sgn[k][0]);
-						src = value(si, sb, sgn[k][1]);
-						i += (*emit)(self, arg,
-							     &insns[i],
-							     dst, src);
-					}
-	/*
-	 * Pattern 2: all combinations for a larger block of values
-	 * for each power-of-two magnitude and sign, where the magnitude is
-	 * the same for both operands.
-	 */
-	for (bt = 0; bt < max(dbits, sbits) - 1; bt++)        /* Magnitude   */
-		for (k = 0; k < ARRAY_SIZE(sgn); k++)         /* Sign combos */
-			for (db = -(block2 / 2); db < (block2 + 1) / 2; db++)
-				for (sb = -(block2 / 2);
-				     sb < (block2 + 1) / 2; sb++) {
-					s64 dst, src;
-
-					dst = value(bt % dbits, db, sgn[k][0]);
-					src = value(bt % sbits, sb, sgn[k][1]);
-					i += (*emit)(self, arg, &insns[i],
-						     dst, src);
-				}
-
-	/* Append tail instructions */
-	insns[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 1);
-	insns[i++] = BPF_EXIT_INSN();
-	BUG_ON(i > len);
-
-	self->u.ptr.insns = insns;
-	self->u.ptr.len = i;
-
-	return 0;
-}
-
-/*
- * Block size parameters used in pattern tests below. une as needed to
- * increase/reduce the number combinations tested, see following examples.
- *        block   values per operand MSB
- * ----------------------------------------
- *           0     none
- *           1     (1 << MSB)
- *           2     (1 << MSB) + [-1, 0]
- *           3     (1 << MSB) + [-1, 0, 1]
- */
-#define PATTERN_BLOCK1 1
-#define PATTERN_BLOCK2 5
-
-/* Number of test runs for a pattern test */
-#define NR_PATTERN_RUNS 1
-
-/*
- * Exhaustive tests of ALU operations for all combinations of power-of-two
- * magnitudes of the operands, both for positive and negative values. The
- * test is designed to verify e.g. the ALU and ALU64 operations for JITs that
- * emit different code depending on the magnitude of the immediate value.
- */
-static int __bpf_emit_alu64_imm(struct bpf_test *self, void *arg,
-				struct bpf_insn *insns, s64 dst, s64 imm)
-{
-	int *a = arg;
-	int op = a[0];
-	u32 flags = a[1];
-	s16 off = (flags & F_SIGNED) ? 1 : 0;
-	int i = 0;
-	u64 res;
-
-	if (!insns)
-		return 7;
-
-	if (__bpf_alu_result(&res, dst, (s32)imm, op, flags)) {
-		i += __bpf_ld_imm64(&insns[i], R1, dst);
-		i += __bpf_ld_imm64(&insns[i], R3, res);
-		insns[i++] = BPF_ALU64_IMM_OFF(op, R1, imm, off);
-		insns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 1);
-		insns[i++] = BPF_EXIT_INSN();
-	}
-
-	return i;
-}
-
-static int __bpf_emit_alu32_imm(struct bpf_test *self, void *arg,
-				struct bpf_insn *insns, s64 dst, s64 imm)
-{
-	int *a = arg;
-	int op = a[0];
-	u32 flags = a[1];
-	s16 off = (flags & F_SIGNED) ? 1 : 0;
-	int i = 0;
-	u64 res;
-
-	if (!insns)
-		return 7;
-
-	if (__bpf_alu_result(&res, dst, (s32)imm, op, flags | F_ALU32)) {
-		i += __bpf_ld_imm64(&insns[i], R1, dst);
-		i += __bpf_ld_imm64(&insns[i], R3, (u32)res);
-		insns[i++] = BPF_ALU32_IMM_OFF(op, R1, imm, off);
-		insns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 1);
-		insns[i++] = BPF_EXIT_INSN();
-	}
-
-	return i;
-}
-
-static int __bpf_emit_alu64_reg(struct bpf_test *self, void *arg,
-				struct bpf_insn *insns, s64 dst, s64 src)
-{
-	int op = *(int *)arg;
-	int i = 0;
-	u64 res;
-
-	if (!insns)
-		return 9;
-
-	if (__bpf_alu_result(&res, dst, src, op, 0)) {
-		i += __bpf_ld_imm64(&insns[i], R1, dst);
-		i += __bpf_ld_imm64(&insns[i], R2, src);
-		i += __bpf_ld_imm64(&insns[i], R3, res);
-		insns[i++] = BPF_ALU64_REG(op, R1, R2);
-		insns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 1);
-		insns[i++] = BPF_EXIT_INSN();
-	}
-
-	return i;
-}
-
-static int __bpf_emit_alu32_reg(struct bpf_test *self, void *arg,
-				struct bpf_insn *insns, s64 dst, s64 src)
-{
-	int op = *(int *)arg;
-	int i = 0;
-	u64 res;
-
-	if (!insns)
-		return 9;
-
-	if (__bpf_alu_result(&res, (u32)dst, (u32)src, op, 0)) {
-		i += __bpf_ld_imm64(&insns[i], R1, dst);
-		i += __bpf_ld_imm64(&insns[i], R2, src);
-		i += __bpf_ld_imm64(&insns[i], R3, (u32)res);
-		insns[i++] = BPF_ALU32_REG(op, R1, R2);
-		insns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 1);
-		insns[i++] = BPF_EXIT_INSN();
-	}
-
-	return i;
-}
-
-static int __bpf_fill_alu64_imm(struct bpf_test *self, int op, u32 flags)
-{
-	int arg[2] = {op, flags};
-
-	return __bpf_fill_pattern(self, &arg, 64, 32,
-				  PATTERN_BLOCK1, PATTERN_BLOCK2,
-				  &__bpf_emit_alu64_imm);
-}
-
-static int __bpf_fill_alu32_imm(struct bpf_test *self, int op, u32 flags)
-{
-	int arg[2] = {op, flags};
-
-	return __bpf_fill_pattern(self, &arg, 64, 32,
-				  PATTERN_BLOCK1, PATTERN_BLOCK2,
-				  &__bpf_emit_alu32_imm);
-}
-
-static int __bpf_fill_alu64_reg(struct bpf_test *self, int op)
-{
-	return __bpf_fill_pattern(self, &op, 64, 64,
-				  PATTERN_BLOCK1, PATTERN_BLOCK2,
-				  &__bpf_emit_alu64_reg);
-}
-
-static int __bpf_fill_alu32_reg(struct bpf_test *self, int op)
-{
-	return __bpf_fill_pattern(self, &op, 64, 64,
-				  PATTERN_BLOCK1, PATTERN_BLOCK2,
-				  &__bpf_emit_alu32_reg);
-}
-
-/* ALU64 immediate operations */
-static int bpf_fill_alu64_mov_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_MOV, 0);
-}
-
-static int bpf_fill_alu64_and_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_AND, 0);
-}
-
-static int bpf_fill_alu64_or_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_OR, 0);
-}
-
-static int bpf_fill_alu64_xor_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_XOR, 0);
-}
-
-static int bpf_fill_alu64_add_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_ADD, 0);
-}
-
-static int bpf_fill_alu64_sub_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_SUB, 0);
-}
-
-static int bpf_fill_alu64_mul_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_MUL, 0);
-}
-
-static int bpf_fill_alu64_div_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_DIV, 0);
-}
-
-static int bpf_fill_alu64_mod_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_MOD, 0);
-}
-
-/* Signed ALU64 immediate operations */
-static int bpf_fill_alu64_sdiv_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_DIV, F_SIGNED);
-}
-
-static int bpf_fill_alu64_smod_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_MOD, F_SIGNED);
-}
-
-/* Signed ALU32 immediate operations */
-static int bpf_fill_alu32_sdiv_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_DIV, F_SIGNED);
-}
-
-static int bpf_fill_alu32_smod_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_MOD, F_SIGNED);
-}
-
-/* ALU32 immediate operations */
-static int bpf_fill_alu32_mov_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_MOV, 0);
-}
-
-static int bpf_fill_alu32_and_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_AND, 0);
-}
-
-static int bpf_fill_alu32_or_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_OR, 0);
-}
-
-static int bpf_fill_alu32_xor_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_XOR, 0);
-}
-
-static int bpf_fill_alu32_add_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_ADD, 0);
-}
-
-static int bpf_fill_alu32_sub_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_SUB, 0);
-}
-
-static int bpf_fill_alu32_mul_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_MUL, 0);
-}
-
-static int bpf_fill_alu32_div_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_DIV, 0);
-}
-
-static int bpf_fill_alu32_mod_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_MOD, 0);
-}
-
-/* ALU64 register operations */
-static int bpf_fill_alu64_mov_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_reg(self, BPF_MOV);
-}
-
-static int bpf_fill_alu64_and_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_reg(self, BPF_AND);
-}
-
-static int bpf_fill_alu64_or_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_reg(self, BPF_OR);
-}
-
-static int bpf_fill_alu64_xor_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_reg(self, BPF_XOR);
-}
-
-static int bpf_fill_alu64_add_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_reg(self, BPF_ADD);
-}
-
-static int bpf_fill_alu64_sub_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_reg(self, BPF_SUB);
-}
-
-static int bpf_fill_alu64_mul_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_reg(self, BPF_MUL);
-}
-
-static int bpf_fill_alu64_div_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_reg(self, BPF_DIV);
-}
-
-static int bpf_fill_alu64_mod_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_reg(self, BPF_MOD);
-}
-
-/* ALU32 register operations */
-static int bpf_fill_alu32_mov_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_reg(self, BPF_MOV);
-}
-
-static int bpf_fill_alu32_and_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_reg(self, BPF_AND);
-}
-
-static int bpf_fill_alu32_or_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_reg(self, BPF_OR);
-}
-
-static int bpf_fill_alu32_xor_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_reg(self, BPF_XOR);
-}
-
-static int bpf_fill_alu32_add_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_reg(self, BPF_ADD);
-}
-
-static int bpf_fill_alu32_sub_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_reg(self, BPF_SUB);
-}
-
-static int bpf_fill_alu32_mul_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_reg(self, BPF_MUL);
-}
-
-static int bpf_fill_alu32_div_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_reg(self, BPF_DIV);
-}
-
-static int bpf_fill_alu32_mod_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_reg(self, BPF_MOD);
-}
-
-/*
- * Test JITs that implement complex ALU operations as function
- * calls, and must re-arrange operands for argument passing.
- */
-static int __bpf_fill_alu_imm_regs(struct bpf_test *self, u8 op,
-				    u32 flags)
-{
-	int len = 2 + 10 * 10;
-	struct bpf_insn *insns;
-	u64 dst, res;
-	int i = 0;
-	u32 imm;
-	int rd;
-
-	insns = kmalloc_objs(*insns, len);
-	if (!insns)
-		return -ENOMEM;
-
-	/* Operand and result values according to operation */
-	if (flags & F_SIGNED) {
-		if (flags & F_ALU32)
-			dst = -76543210;
-		else
-			dst = -7654321076543210LL;
-	} else {
-		if (flags & F_ALU32)
-			dst = 0x76543210U;
-		else
-			dst = 0x7edcba9876543210ULL;
-	}
-	imm = 0x01234567U;
-
-	if (op == BPF_LSH || op == BPF_RSH || op == BPF_ARSH)
-		imm &= 31;
-
-	__bpf_alu_result(&res, dst, imm, op, flags);
-
-	if (flags & F_ALU32)
-		res = (u32)res;
-
-	/* Check all operand registers */
-	for (rd = R0; rd <= R9; rd++) {
-		i += __bpf_ld_imm64(&insns[i], rd, dst);
-
-		s16 off = (flags & F_SIGNED) ? 1 : 0;
-
-		if (flags & F_ALU32)
-			insns[i++] = BPF_ALU32_IMM_OFF(op, rd, imm, off);
-		else
-			insns[i++] = BPF_ALU64_IMM_OFF(op, rd, imm, off);
-
-		insns[i++] = BPF_JMP32_IMM(BPF_JEQ, rd, res, 2);
-		insns[i++] = BPF_MOV64_IMM(R0, __LINE__);
-		insns[i++] = BPF_EXIT_INSN();
-
-		insns[i++] = BPF_ALU64_IMM(BPF_RSH, rd, 32);
-		insns[i++] = BPF_JMP32_IMM(BPF_JEQ, rd, res >> 32, 2);
-		insns[i++] = BPF_MOV64_IMM(R0, __LINE__);
-		insns[i++] = BPF_EXIT_INSN();
-	}
-
-	insns[i++] = BPF_MOV64_IMM(R0, 1);
-	insns[i++] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insns;
-	self->u.ptr.len = len;
-	BUG_ON(i != len);
-
-	return 0;
-}
-
-/* ALU64 K registers */
-static int bpf_fill_alu64_mov_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_MOV, 0);
-}
-
-static int bpf_fill_alu64_and_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_AND, 0);
-}
-
-static int bpf_fill_alu64_or_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_OR, 0);
-}
-
-static int bpf_fill_alu64_xor_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_XOR, 0);
-}
-
-static int bpf_fill_alu64_lsh_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_LSH, 0);
-}
-
-static int bpf_fill_alu64_rsh_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_RSH, 0);
-}
-
-static int bpf_fill_alu64_arsh_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_ARSH, 0);
-}
-
-static int bpf_fill_alu64_add_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_ADD, 0);
-}
-
-static int bpf_fill_alu64_sub_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_SUB, 0);
-}
-
-static int bpf_fill_alu64_mul_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_MUL, 0);
-}
-
-static int bpf_fill_alu64_div_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_DIV, 0);
-}
-
-static int bpf_fill_alu64_mod_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_MOD, 0);
-}
-
-/* Signed ALU64 K registers */
-static int bpf_fill_alu64_sdiv_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_DIV, F_SIGNED);
-}
-
-static int bpf_fill_alu64_smod_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_MOD, F_SIGNED);
-}
-
-/* ALU32 K registers */
-static int bpf_fill_alu32_mov_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_MOV, F_ALU32);
-}
-
-static int bpf_fill_alu32_and_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_AND, F_ALU32);
-}
-
-static int bpf_fill_alu32_or_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_OR, F_ALU32);
-}
-
-static int bpf_fill_alu32_xor_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_XOR, F_ALU32);
-}
-
-static int bpf_fill_alu32_lsh_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_LSH, F_ALU32);
-}
-
-static int bpf_fill_alu32_rsh_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_RSH, F_ALU32);
-}
-
-static int bpf_fill_alu32_arsh_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_ARSH, F_ALU32);
-}
-
-static int bpf_fill_alu32_add_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_ADD, F_ALU32);
-}
-
-static int bpf_fill_alu32_sub_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_SUB, F_ALU32);
-}
-
-static int bpf_fill_alu32_mul_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_MUL, F_ALU32);
-}
-
-static int bpf_fill_alu32_div_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_DIV, F_ALU32);
-}
-
-static int bpf_fill_alu32_mod_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_MOD, F_ALU32);
-}
-
-/* Signed ALU32 K registers */
-static int bpf_fill_alu32_sdiv_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_DIV, F_ALU32 | F_SIGNED);
-}
-
-static int bpf_fill_alu32_smod_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_MOD, F_ALU32 | F_SIGNED);
-}
-
-/*
- * Test JITs that implement complex ALU operations as function
- * calls, and must re-arrange operands for argument passing.
- */
-static int __bpf_fill_alu_reg_pairs(struct bpf_test *self, u8 op, bool alu32)
-{
-	int len = 2 + 10 * 10 * 12;
-	u64 dst, src, res, same;
-	struct bpf_insn *insns;
-	int rd, rs;
-	int i = 0;
-
-	insns = kmalloc_objs(*insns, len);
-	if (!insns)
-		return -ENOMEM;
-
-	/* Operand and result values according to operation */
-	if (alu32) {
-		dst = 0x76543210U;
-		src = 0x01234567U;
-	} else {
-		dst = 0x7edcba9876543210ULL;
-		src = 0x0123456789abcdefULL;
-	}
-
-	if (op == BPF_LSH || op == BPF_RSH || op == BPF_ARSH)
-		src &= 31;
-
-	__bpf_alu_result(&res, dst, src, op, 0);
-	__bpf_alu_result(&same, src, src, op, 0);
-
-	if (alu32) {
-		res = (u32)res;
-		same = (u32)same;
-	}
-
-	/* Check all combinations of operand registers */
-	for (rd = R0; rd <= R9; rd++) {
-		for (rs = R0; rs <= R9; rs++) {
-			u64 val = rd == rs ? same : res;
-
-			i += __bpf_ld_imm64(&insns[i], rd, dst);
-			i += __bpf_ld_imm64(&insns[i], rs, src);
-
-			if (alu32)
-				insns[i++] = BPF_ALU32_REG(op, rd, rs);
-			else
-				insns[i++] = BPF_ALU64_REG(op, rd, rs);
-
-			insns[i++] = BPF_JMP32_IMM(BPF_JEQ, rd, val, 2);
-			insns[i++] = BPF_MOV64_IMM(R0, __LINE__);
-			insns[i++] = BPF_EXIT_INSN();
-
-			insns[i++] = BPF_ALU64_IMM(BPF_RSH, rd, 32);
-			insns[i++] = BPF_JMP32_IMM(BPF_JEQ, rd, val >> 32, 2);
-			insns[i++] = BPF_MOV64_IMM(R0, __LINE__);
-			insns[i++] = BPF_EXIT_INSN();
-		}
-	}
-
-	insns[i++] = BPF_MOV64_IMM(R0, 1);
-	insns[i++] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insns;
-	self->u.ptr.len = len;
-	BUG_ON(i != len);
-
-	return 0;
-}
-
-/* ALU64 X register combinations */
-static int bpf_fill_alu64_mov_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_MOV, false);
-}
-
-static int bpf_fill_alu64_and_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_AND, false);
-}
-
-static int bpf_fill_alu64_or_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_OR, false);
-}
-
-static int bpf_fill_alu64_xor_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_XOR, false);
-}
-
-static int bpf_fill_alu64_lsh_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_LSH, false);
-}
-
-static int bpf_fill_alu64_rsh_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_RSH, false);
-}
-
-static int bpf_fill_alu64_arsh_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_ARSH, false);
-}
-
-static int bpf_fill_alu64_add_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_ADD, false);
-}
-
-static int bpf_fill_alu64_sub_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_SUB, false);
-}
-
-static int bpf_fill_alu64_mul_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_MUL, false);
-}
-
-static int bpf_fill_alu64_div_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_DIV, false);
-}
-
-static int bpf_fill_alu64_mod_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_MOD, false);
-}
-
-/* ALU32 X register combinations */
-static int bpf_fill_alu32_mov_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_MOV, true);
-}
-
-static int bpf_fill_alu32_and_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_AND, true);
-}
-
-static int bpf_fill_alu32_or_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_OR, true);
-}
-
-static int bpf_fill_alu32_xor_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_XOR, true);
-}
-
-static int bpf_fill_alu32_lsh_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_LSH, true);
-}
-
-static int bpf_fill_alu32_rsh_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_RSH, true);
-}
-
-static int bpf_fill_alu32_arsh_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_ARSH, true);
-}
-
-static int bpf_fill_alu32_add_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_ADD, true);
-}
-
-static int bpf_fill_alu32_sub_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_SUB, true);
-}
-
-static int bpf_fill_alu32_mul_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_MUL, true);
-}
-
-static int bpf_fill_alu32_div_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_DIV, true);
-}
-
-static int bpf_fill_alu32_mod_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_MOD, true);
-}
-
-/*
- * Exhaustive tests of atomic operations for all power-of-two operand
- * magnitudes, both for positive and negative values.
- */
-
-static int __bpf_emit_atomic64(struct bpf_test *self, void *arg,
-			       struct bpf_insn *insns, s64 dst, s64 src)
-{
-	int op = *(int *)arg;
-	u64 keep, fetch, res;
-	int i = 0;
-
-	if (!insns)
-		return 21;
-
-	switch (op) {
-	case BPF_XCHG:
-		res = src;
-		break;
-	default:
-		__bpf_alu_result(&res, dst, src, BPF_OP(op), 0);
-	}
-
-	keep = 0x0123456789abcdefULL;
-	if (op & BPF_FETCH)
-		fetch = dst;
-	else
-		fetch = src;
-
-	i += __bpf_ld_imm64(&insns[i], R0, keep);
-	i += __bpf_ld_imm64(&insns[i], R1, dst);
-	i += __bpf_ld_imm64(&insns[i], R2, src);
-	i += __bpf_ld_imm64(&insns[i], R3, res);
-	i += __bpf_ld_imm64(&insns[i], R4, fetch);
-	i += __bpf_ld_imm64(&insns[i], R5, keep);
-
-	insns[i++] = BPF_STX_MEM(BPF_DW, R10, R1, -8);
-	insns[i++] = BPF_ATOMIC_OP(BPF_DW, op, R10, R2, -8);
-	insns[i++] = BPF_LDX_MEM(BPF_DW, R1, R10, -8);
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 1);
-	insns[i++] = BPF_EXIT_INSN();
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R2, R4, 1);
-	insns[i++] = BPF_EXIT_INSN();
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R0, R5, 1);
-	insns[i++] = BPF_EXIT_INSN();
-
-	return i;
-}
-
-static int __bpf_emit_atomic32(struct bpf_test *self, void *arg,
-			       struct bpf_insn *insns, s64 dst, s64 src)
-{
-	int op = *(int *)arg;
-	u64 keep, fetch, res;
-	int i = 0;
-
-	if (!insns)
-		return 21;
-
-	switch (op) {
-	case BPF_XCHG:
-		res = src;
-		break;
-	default:
-		__bpf_alu_result(&res, (u32)dst, (u32)src, BPF_OP(op), 0);
-	}
-
-	keep = 0x0123456789abcdefULL;
-	if (op & BPF_FETCH)
-		fetch = (u32)dst;
-	else
-		fetch = src;
-
-	i += __bpf_ld_imm64(&insns[i], R0, keep);
-	i += __bpf_ld_imm64(&insns[i], R1, (u32)dst);
-	i += __bpf_ld_imm64(&insns[i], R2, src);
-	i += __bpf_ld_imm64(&insns[i], R3, (u32)res);
-	i += __bpf_ld_imm64(&insns[i], R4, fetch);
-	i += __bpf_ld_imm64(&insns[i], R5, keep);
-
-	insns[i++] = BPF_STX_MEM(BPF_W, R10, R1, -4);
-	insns[i++] = BPF_ATOMIC_OP(BPF_W, op, R10, R2, -4);
-	insns[i++] = BPF_LDX_MEM(BPF_W, R1, R10, -4);
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 1);
-	insns[i++] = BPF_EXIT_INSN();
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R2, R4, 1);
-	insns[i++] = BPF_EXIT_INSN();
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R0, R5, 1);
-	insns[i++] = BPF_EXIT_INSN();
-
-	return i;
-}
-
-static int __bpf_emit_cmpxchg64(struct bpf_test *self, void *arg,
-				struct bpf_insn *insns, s64 dst, s64 src)
-{
-	int i = 0;
-
-	if (!insns)
-		return 23;
-
-	i += __bpf_ld_imm64(&insns[i], R0, ~dst);
-	i += __bpf_ld_imm64(&insns[i], R1, dst);
-	i += __bpf_ld_imm64(&insns[i], R2, src);
-
-	/* Result unsuccessful */
-	insns[i++] = BPF_STX_MEM(BPF_DW, R10, R1, -8);
-	insns[i++] = BPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -8);
-	insns[i++] = BPF_LDX_MEM(BPF_DW, R3, R10, -8);
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 2);
-	insns[i++] = BPF_MOV64_IMM(R0, __LINE__);
-	insns[i++] = BPF_EXIT_INSN();
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R0, R3, 2);
-	insns[i++] = BPF_MOV64_IMM(R0, __LINE__);
-	insns[i++] = BPF_EXIT_INSN();
-
-	/* Result successful */
-	insns[i++] = BPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -8);
-	insns[i++] = BPF_LDX_MEM(BPF_DW, R3, R10, -8);
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R2, R3, 2);
-	insns[i++] = BPF_MOV64_IMM(R0, __LINE__);
-	insns[i++] = BPF_EXIT_INSN();
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R0, R1, 2);
-	insns[i++] = BPF_MOV64_IMM(R0, __LINE__);
-	insns[i++] = BPF_EXIT_INSN();
-
-	return i;
-}
-
-static int __bpf_emit_cmpxchg32(struct bpf_test *self, void *arg,
-				struct bpf_insn *insns, s64 dst, s64 src)
-{
-	int i = 0;
-
-	if (!insns)
-		return 27;
-
-	i += __bpf_ld_imm64(&insns[i], R0, ~dst);
-	i += __bpf_ld_imm64(&insns[i], R1, (u32)dst);
-	i += __bpf_ld_imm64(&insns[i], R2, src);
-
-	/* Result unsuccessful */
-	insns[i++] = BPF_STX_MEM(BPF_W, R10, R1, -4);
-	insns[i++] = BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R2, -4);
-	insns[i++] = BPF_ZEXT_REG(R0); /* Zext always inserted by verifier */
-	insns[i++] = BPF_LDX_MEM(BPF_W, R3, R10, -4);
-
-	insns[i++] = BPF_JMP32_REG(BPF_JEQ, R1, R3, 2);
-	insns[i++] = BPF_MOV32_IMM(R0, __LINE__);
-	insns[i++] = BPF_EXIT_INSN();
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R0, R3, 2);
-	insns[i++] = BPF_MOV32_IMM(R0, __LINE__);
-	insns[i++] = BPF_EXIT_INSN();
-
-	/* Result successful */
-	i += __bpf_ld_imm64(&insns[i], R0, dst);
-	insns[i++] = BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R2, -4);
-	insns[i++] = BPF_ZEXT_REG(R0); /* Zext always inserted by verifier */
-	insns[i++] = BPF_LDX_MEM(BPF_W, R3, R10, -4);
-
-	insns[i++] = BPF_JMP32_REG(BPF_JEQ, R2, R3, 2);
-	insns[i++] = BPF_MOV32_IMM(R0, __LINE__);
-	insns[i++] = BPF_EXIT_INSN();
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R0, R1, 2);
-	insns[i++] = BPF_MOV32_IMM(R0, __LINE__);
-	insns[i++] = BPF_EXIT_INSN();
-
-	return i;
-}
-
-static int __bpf_fill_atomic64(struct bpf_test *self, int op)
-{
-	return __bpf_fill_pattern(self, &op, 64, 64,
-				  0, PATTERN_BLOCK2,
-				  &__bpf_emit_atomic64);
-}
-
-static int __bpf_fill_atomic32(struct bpf_test *self, int op)
-{
-	return __bpf_fill_pattern(self, &op, 64, 64,
-				  0, PATTERN_BLOCK2,
-				  &__bpf_emit_atomic32);
-}
-
-/* 64-bit atomic operations */
-static int bpf_fill_atomic64_add(struct bpf_test *self)
-{
-	return __bpf_fill_atomic64(self, BPF_ADD);
-}
-
-static int bpf_fill_atomic64_and(struct bpf_test *self)
-{
-	return __bpf_fill_atomic64(self, BPF_AND);
-}
-
-static int bpf_fill_atomic64_or(struct bpf_test *self)
-{
-	return __bpf_fill_atomic64(self, BPF_OR);
-}
-
-static int bpf_fill_atomic64_xor(struct bpf_test *self)
-{
-	return __bpf_fill_atomic64(self, BPF_XOR);
-}
-
-static int bpf_fill_atomic64_add_fetch(struct bpf_test *self)
-{
-	return __bpf_fill_atomic64(self, BPF_ADD | BPF_FETCH);
-}
-
-static int bpf_fill_atomic64_and_fetch(struct bpf_test *self)
-{
-	return __bpf_fill_atomic64(self, BPF_AND | BPF_FETCH);
-}
-
-static int bpf_fill_atomic64_or_fetch(struct bpf_test *self)
-{
-	return __bpf_fill_atomic64(self, BPF_OR | BPF_FETCH);
-}
-
-static int bpf_fill_atomic64_xor_fetch(struct bpf_test *self)
-{
-	return __bpf_fill_atomic64(self, BPF_XOR | BPF_FETCH);
-}
-
-static int bpf_fill_atomic64_xchg(struct bpf_test *self)
-{
-	return __bpf_fill_atomic64(self, BPF_XCHG);
-}
-
-static int bpf_fill_cmpxchg64(struct bpf_test *self)
-{
-	return __bpf_fill_pattern(self, NULL, 64, 64, 0, PATTERN_BLOCK2,
-				  &__bpf_emit_cmpxchg64);
-}
-
-/* 32-bit atomic operations */
-static int bpf_fill_atomic32_add(struct bpf_test *self)
-{
-	return __bpf_fill_atomic32(self, BPF_ADD);
-}
-
-static int bpf_fill_atomic32_and(struct bpf_test *self)
-{
-	return __bpf_fill_atomic32(self, BPF_AND);
-}
-
-static int bpf_fill_atomic32_or(struct bpf_test *self)
-{
-	return __bpf_fill_atomic32(self, BPF_OR);
-}
-
-static int bpf_fill_atomic32_xor(struct bpf_test *self)
-{
-	return __bpf_fill_atomic32(self, BPF_XOR);
-}
-
-static int bpf_fill_atomic32_add_fetch(struct bpf_test *self)
-{
-	return __bpf_fill_atomic32(self, BPF_ADD | BPF_FETCH);
-}
-
-static int bpf_fill_atomic32_and_fetch(struct bpf_test *self)
-{
-	return __bpf_fill_atomic32(self, BPF_AND | BPF_FETCH);
-}
-
-static int bpf_fill_atomic32_or_fetch(struct bpf_test *self)
-{
-	return __bpf_fill_atomic32(self, BPF_OR | BPF_FETCH);
-}
-
-static int bpf_fill_atomic32_xor_fetch(struct bpf_test *self)
-{
-	return __bpf_fill_atomic32(self, BPF_XOR | BPF_FETCH);
-}
-
-static int bpf_fill_atomic32_xchg(struct bpf_test *self)
-{
-	return __bpf_fill_atomic32(self, BPF_XCHG);
-}
-
-static int bpf_fill_cmpxchg32(struct bpf_test *self)
-{
-	return __bpf_fill_pattern(self, NULL, 64, 64, 0, PATTERN_BLOCK2,
-				  &__bpf_emit_cmpxchg32);
-}
-
-/*
- * Test JITs that implement ATOMIC operations as function calls or
- * other primitives, and must re-arrange operands for argument passing.
- */
-static int __bpf_fill_atomic_reg_pairs(struct bpf_test *self, u8 width, u8 op)
-{
-	struct bpf_insn *insn;
-	int len = 2 + 34 * 10 * 10;
-	u64 mem, upd, res;
-	int rd, rs, i = 0;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	/* Operand and memory values */
-	if (width == BPF_DW) {
-		mem = 0x0123456789abcdefULL;
-		upd = 0xfedcba9876543210ULL;
-	} else { /* BPF_W */
-		mem = 0x01234567U;
-		upd = 0x76543210U;
-	}
-
-	/* Memory updated according to operation */
-	switch (op) {
-	case BPF_XCHG:
-		res = upd;
-		break;
-	case BPF_CMPXCHG:
-		res = mem;
-		break;
-	default:
-		__bpf_alu_result(&res, mem, upd, BPF_OP(op), 0);
-	}
-
-	/* Test all operand registers */
-	for (rd = R0; rd <= R9; rd++) {
-		for (rs = R0; rs <= R9; rs++) {
-			u64 cmp, src;
-
-			/* Initialize value in memory */
-			i += __bpf_ld_imm64(&insn[i], R0, mem);
-			insn[i++] = BPF_STX_MEM(width, R10, R0, -8);
-
-			/* Initialize registers in order */
-			i += __bpf_ld_imm64(&insn[i], R0, ~mem);
-			i += __bpf_ld_imm64(&insn[i], rs, upd);
-			insn[i++] = BPF_MOV64_REG(rd, R10);
-
-			/* Perform atomic operation */
-			insn[i++] = BPF_ATOMIC_OP(width, op, rd, rs, -8);
-			if (op == BPF_CMPXCHG && width == BPF_W)
-				insn[i++] = BPF_ZEXT_REG(R0);
-
-			/* Check R0 register value */
-			if (op == BPF_CMPXCHG)
-				cmp = mem;  /* Expect value from memory */
-			else if (R0 == rd || R0 == rs)
-				cmp = 0;    /* Aliased, checked below */
-			else
-				cmp = ~mem; /* Expect value to be preserved */
-			if (cmp) {
-				insn[i++] = BPF_JMP32_IMM(BPF_JEQ, R0,
-							   (u32)cmp, 2);
-				insn[i++] = BPF_MOV32_IMM(R0, __LINE__);
-				insn[i++] = BPF_EXIT_INSN();
-				insn[i++] = BPF_ALU64_IMM(BPF_RSH, R0, 32);
-				insn[i++] = BPF_JMP32_IMM(BPF_JEQ, R0,
-							   cmp >> 32, 2);
-				insn[i++] = BPF_MOV32_IMM(R0, __LINE__);
-				insn[i++] = BPF_EXIT_INSN();
-			}
-
-			/* Check source register value */
-			if (rs == R0 && op == BPF_CMPXCHG)
-				src = 0;   /* Aliased with R0, checked above */
-			else if (rs == rd && (op == BPF_CMPXCHG ||
-					      !(op & BPF_FETCH)))
-				src = 0;   /* Aliased with rd, checked below */
-			else if (op == BPF_CMPXCHG)
-				src = upd; /* Expect value to be preserved */
-			else if (op & BPF_FETCH)
-				src = mem; /* Expect fetched value from mem */
-			else /* no fetch */
-				src = upd; /* Expect value to be preserved */
-			if (src) {
-				insn[i++] = BPF_JMP32_IMM(BPF_JEQ, rs,
-							   (u32)src, 2);
-				insn[i++] = BPF_MOV32_IMM(R0, __LINE__);
-				insn[i++] = BPF_EXIT_INSN();
-				insn[i++] = BPF_ALU64_IMM(BPF_RSH, rs, 32);
-				insn[i++] = BPF_JMP32_IMM(BPF_JEQ, rs,
-							   src >> 32, 2);
-				insn[i++] = BPF_MOV32_IMM(R0, __LINE__);
-				insn[i++] = BPF_EXIT_INSN();
-			}
-
-			/* Check destination register value */
-			if (!(rd == R0 && op == BPF_CMPXCHG) &&
-			    !(rd == rs && (op & BPF_FETCH))) {
-				insn[i++] = BPF_JMP_REG(BPF_JEQ, rd, R10, 2);
-				insn[i++] = BPF_MOV32_IMM(R0, __LINE__);
-				insn[i++] = BPF_EXIT_INSN();
-			}
-
-			/* Check value in memory */
-			if (rs != rd) {                  /* No aliasing */
-				i += __bpf_ld_imm64(&insn[i], R1, res);
-			} else if (op == BPF_XCHG) {     /* Aliased, XCHG */
-				insn[i++] = BPF_MOV64_REG(R1, R10);
-			} else if (op == BPF_CMPXCHG) {  /* Aliased, CMPXCHG */
-				i += __bpf_ld_imm64(&insn[i], R1, mem);
-			} else {                        /* Aliased, ALU oper */
-				i += __bpf_ld_imm64(&insn[i], R1, mem);
-				insn[i++] = BPF_ALU64_REG(BPF_OP(op), R1, R10);
-			}
-
-			insn[i++] = BPF_LDX_MEM(width, R0, R10, -8);
-			if (width == BPF_DW)
-				insn[i++] = BPF_JMP_REG(BPF_JEQ, R0, R1, 2);
-			else /* width == BPF_W */
-				insn[i++] = BPF_JMP32_REG(BPF_JEQ, R0, R1, 2);
-			insn[i++] = BPF_MOV32_IMM(R0, __LINE__);
-			insn[i++] = BPF_EXIT_INSN();
-		}
-	}
-
-	insn[i++] = BPF_MOV64_IMM(R0, 1);
-	insn[i++] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = i;
-	BUG_ON(i > len);
-
-	return 0;
-}
-
-/* 64-bit atomic register tests */
-static int bpf_fill_atomic64_add_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_ADD);
-}
-
-static int bpf_fill_atomic64_and_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_AND);
-}
-
-static int bpf_fill_atomic64_or_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_OR);
-}
-
-static int bpf_fill_atomic64_xor_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_XOR);
-}
-
-static int bpf_fill_atomic64_add_fetch_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_ADD | BPF_FETCH);
-}
-
-static int bpf_fill_atomic64_and_fetch_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_AND | BPF_FETCH);
-}
-
-static int bpf_fill_atomic64_or_fetch_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_OR | BPF_FETCH);
-}
-
-static int bpf_fill_atomic64_xor_fetch_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_XOR | BPF_FETCH);
-}
-
-static int bpf_fill_atomic64_xchg_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_XCHG);
-}
-
-static int bpf_fill_atomic64_cmpxchg_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_CMPXCHG);
-}
-
-/* 32-bit atomic register tests */
-static int bpf_fill_atomic32_add_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_ADD);
-}
-
-static int bpf_fill_atomic32_and_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_AND);
-}
-
-static int bpf_fill_atomic32_or_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_OR);
-}
-
-static int bpf_fill_atomic32_xor_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_XOR);
-}
-
-static int bpf_fill_atomic32_add_fetch_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_ADD | BPF_FETCH);
-}
-
-static int bpf_fill_atomic32_and_fetch_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_AND | BPF_FETCH);
-}
-
-static int bpf_fill_atomic32_or_fetch_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_OR | BPF_FETCH);
-}
-
-static int bpf_fill_atomic32_xor_fetch_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_XOR | BPF_FETCH);
-}
-
-static int bpf_fill_atomic32_xchg_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_XCHG);
-}
-
-static int bpf_fill_atomic32_cmpxchg_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_CMPXCHG);
-}
-
-/*
- * Test the two-instruction 64-bit immediate load operation for all
- * power-of-two magnitudes of the immediate operand. For each MSB, a block
- * of immediate values centered around the power-of-two MSB are tested,
- * both for positive and negative values. The test is designed to verify
- * the operation for JITs that emit different code depending on the magnitude
- * of the immediate value. This is often the case if the native instruction
- * immediate field width is narrower than 32 bits.
- */
-static int bpf_fill_ld_imm64_magn(struct bpf_test *self)
-{
-	int block = 64; /* Increase for more tests per MSB position */
-	int len = 3 + 8 * 63 * block * 2;
-	struct bpf_insn *insn;
-	int bit, adj, sign;
-	int i = 0;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	insn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 0);
-
-	for (bit = 0; bit <= 62; bit++) {
-		for (adj = -block / 2; adj < block / 2; adj++) {
-			for (sign = -1; sign <= 1; sign += 2) {
-				s64 imm = sign * ((1LL << bit) + adj);
-
-				/* Perform operation */
-				i += __bpf_ld_imm64(&insn[i], R1, imm);
-
-				/* Load reference */
-				insn[i++] = BPF_ALU32_IMM(BPF_MOV, R2, imm);
-				insn[i++] = BPF_ALU32_IMM(BPF_MOV, R3,
-							  (u32)(imm >> 32));
-				insn[i++] = BPF_ALU64_IMM(BPF_LSH, R3, 32);
-				insn[i++] = BPF_ALU64_REG(BPF_OR, R2, R3);
-
-				/* Check result */
-				insn[i++] = BPF_JMP_REG(BPF_JEQ, R1, R2, 1);
-				insn[i++] = BPF_EXIT_INSN();
-			}
-		}
-	}
-
-	insn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 1);
-	insn[i++] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-	BUG_ON(i != len);
-
-	return 0;
-}
-
-/*
- * Test the two-instruction 64-bit immediate load operation for different
- * combinations of bytes. Each byte in the 64-bit word is constructed as
- * (base & mask) | (rand() & ~mask), where rand() is a deterministic LCG.
- * All patterns (base1, mask1) and (base2, mask2) bytes are tested.
- */
-static int __bpf_fill_ld_imm64_bytes(struct bpf_test *self,
-				     u8 base1, u8 mask1,
-				     u8 base2, u8 mask2)
-{
-	struct bpf_insn *insn;
-	int len = 3 + 8 * BIT(8);
-	int pattern, index;
-	u32 rand = 1;
-	int i = 0;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	insn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 0);
-
-	for (pattern = 0; pattern < BIT(8); pattern++) {
-		u64 imm = 0;
-
-		for (index = 0; index < 8; index++) {
-			int byte;
-
-			if (pattern & BIT(index))
-				byte = (base1 & mask1) | (rand & ~mask1);
-			else
-				byte = (base2 & mask2) | (rand & ~mask2);
-			imm = (imm << 8) | byte;
-		}
-
-		/* Update our LCG */
-		rand = rand * 1664525 + 1013904223;
-
-		/* Perform operation */
-		i += __bpf_ld_imm64(&insn[i], R1, imm);
-
-		/* Load reference */
-		insn[i++] = BPF_ALU32_IMM(BPF_MOV, R2, imm);
-		insn[i++] = BPF_ALU32_IMM(BPF_MOV, R3, (u32)(imm >> 32));
-		insn[i++] = BPF_ALU64_IMM(BPF_LSH, R3, 32);
-		insn[i++] = BPF_ALU64_REG(BPF_OR, R2, R3);
-
-		/* Check result */
-		insn[i++] = BPF_JMP_REG(BPF_JEQ, R1, R2, 1);
-		insn[i++] = BPF_EXIT_INSN();
-	}
-
-	insn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 1);
-	insn[i++] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-	BUG_ON(i != len);
-
-	return 0;
-}
-
-static int bpf_fill_ld_imm64_checker(struct bpf_test *self)
-{
-	return __bpf_fill_ld_imm64_bytes(self, 0, 0xff, 0xff, 0xff);
-}
-
-static int bpf_fill_ld_imm64_pos_neg(struct bpf_test *self)
-{
-	return __bpf_fill_ld_imm64_bytes(self, 1, 0x81, 0x80, 0x80);
-}
-
-static int bpf_fill_ld_imm64_pos_zero(struct bpf_test *self)
-{
-	return __bpf_fill_ld_imm64_bytes(self, 1, 0x81, 0, 0xff);
-}
-
-static int bpf_fill_ld_imm64_neg_zero(struct bpf_test *self)
-{
-	return __bpf_fill_ld_imm64_bytes(self, 0x80, 0x80, 0, 0xff);
-}
-
-/*
- * Exhaustive tests of JMP operations for all combinations of power-of-two
- * magnitudes of the operands, both for positive and negative values. The
- * test is designed to verify e.g. the JMP and JMP32 operations for JITs that
- * emit different code depending on the magnitude of the immediate value.
- */
-
-static bool __bpf_match_jmp_cond(s64 v1, s64 v2, u8 op)
-{
-	switch (op) {
-	case BPF_JSET:
-		return !!(v1 & v2);
-	case BPF_JEQ:
-		return v1 == v2;
-	case BPF_JNE:
-		return v1 != v2;
-	case BPF_JGT:
-		return (u64)v1 > (u64)v2;
-	case BPF_JGE:
-		return (u64)v1 >= (u64)v2;
-	case BPF_JLT:
-		return (u64)v1 < (u64)v2;
-	case BPF_JLE:
-		return (u64)v1 <= (u64)v2;
-	case BPF_JSGT:
-		return v1 > v2;
-	case BPF_JSGE:
-		return v1 >= v2;
-	case BPF_JSLT:
-		return v1 < v2;
-	case BPF_JSLE:
-		return v1 <= v2;
-	}
-	return false;
-}
-
-static int __bpf_emit_jmp_imm(struct bpf_test *self, void *arg,
-			      struct bpf_insn *insns, s64 dst, s64 imm)
-{
-	int op = *(int *)arg;
-
-	if (insns) {
-		bool match = __bpf_match_jmp_cond(dst, (s32)imm, op);
-		int i = 0;
-
-		insns[i++] = BPF_ALU32_IMM(BPF_MOV, R0, match);
-
-		i += __bpf_ld_imm64(&insns[i], R1, dst);
-		insns[i++] = BPF_JMP_IMM(op, R1, imm, 1);
-		if (!match)
-			insns[i++] = BPF_JMP_IMM(BPF_JA, 0, 0, 1);
-		insns[i++] = BPF_EXIT_INSN();
-
-		return i;
-	}
-
-	return 5 + 1;
-}
-
-static int __bpf_emit_jmp32_imm(struct bpf_test *self, void *arg,
-				struct bpf_insn *insns, s64 dst, s64 imm)
-{
-	int op = *(int *)arg;
-
-	if (insns) {
-		bool match = __bpf_match_jmp_cond((s32)dst, (s32)imm, op);
-		int i = 0;
-
-		i += __bpf_ld_imm64(&insns[i], R1, dst);
-		insns[i++] = BPF_JMP32_IMM(op, R1, imm, 1);
-		if (!match)
-			insns[i++] = BPF_JMP_IMM(BPF_JA, 0, 0, 1);
-		insns[i++] = BPF_EXIT_INSN();
-
-		return i;
-	}
-
-	return 5;
-}
-
-static int __bpf_emit_jmp_reg(struct bpf_test *self, void *arg,
-			      struct bpf_insn *insns, s64 dst, s64 src)
-{
-	int op = *(int *)arg;
-
-	if (insns) {
-		bool match = __bpf_match_jmp_cond(dst, src, op);
-		int i = 0;
-
-		i += __bpf_ld_imm64(&insns[i], R1, dst);
-		i += __bpf_ld_imm64(&insns[i], R2, src);
-		insns[i++] = BPF_JMP_REG(op, R1, R2, 1);
-		if (!match)
-			insns[i++] = BPF_JMP_IMM(BPF_JA, 0, 0, 1);
-		insns[i++] = BPF_EXIT_INSN();
-
-		return i;
-	}
-
-	return 7;
-}
-
-static int __bpf_emit_jmp32_reg(struct bpf_test *self, void *arg,
-				struct bpf_insn *insns, s64 dst, s64 src)
-{
-	int op = *(int *)arg;
-
-	if (insns) {
-		bool match = __bpf_match_jmp_cond((s32)dst, (s32)src, op);
-		int i = 0;
-
-		i += __bpf_ld_imm64(&insns[i], R1, dst);
-		i += __bpf_ld_imm64(&insns[i], R2, src);
-		insns[i++] = BPF_JMP32_REG(op, R1, R2, 1);
-		if (!match)
-			insns[i++] = BPF_JMP_IMM(BPF_JA, 0, 0, 1);
-		insns[i++] = BPF_EXIT_INSN();
-
-		return i;
-	}
-
-	return 7;
-}
-
-static int __bpf_fill_jmp_imm(struct bpf_test *self, int op)
-{
-	return __bpf_fill_pattern(self, &op, 64, 32,
-				  PATTERN_BLOCK1, PATTERN_BLOCK2,
-				  &__bpf_emit_jmp_imm);
-}
-
-static int __bpf_fill_jmp32_imm(struct bpf_test *self, int op)
-{
-	return __bpf_fill_pattern(self, &op, 64, 32,
-				  PATTERN_BLOCK1, PATTERN_BLOCK2,
-				  &__bpf_emit_jmp32_imm);
-}
-
-static int __bpf_fill_jmp_reg(struct bpf_test *self, int op)
-{
-	return __bpf_fill_pattern(self, &op, 64, 64,
-				  PATTERN_BLOCK1, PATTERN_BLOCK2,
-				  &__bpf_emit_jmp_reg);
-}
-
-static int __bpf_fill_jmp32_reg(struct bpf_test *self, int op)
-{
-	return __bpf_fill_pattern(self, &op, 64, 64,
-				  PATTERN_BLOCK1, PATTERN_BLOCK2,
-				  &__bpf_emit_jmp32_reg);
-}
-
-/* JMP immediate tests */
-static int bpf_fill_jmp_jset_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JSET);
-}
-
-static int bpf_fill_jmp_jeq_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JEQ);
-}
-
-static int bpf_fill_jmp_jne_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JNE);
-}
-
-static int bpf_fill_jmp_jgt_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JGT);
-}
-
-static int bpf_fill_jmp_jge_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JGE);
-}
-
-static int bpf_fill_jmp_jlt_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JLT);
-}
-
-static int bpf_fill_jmp_jle_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JLE);
-}
-
-static int bpf_fill_jmp_jsgt_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JSGT);
-}
-
-static int bpf_fill_jmp_jsge_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JSGE);
-}
-
-static int bpf_fill_jmp_jslt_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JSLT);
-}
-
-static int bpf_fill_jmp_jsle_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JSLE);
-}
-
-/* JMP32 immediate tests */
-static int bpf_fill_jmp32_jset_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JSET);
-}
-
-static int bpf_fill_jmp32_jeq_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JEQ);
-}
-
-static int bpf_fill_jmp32_jne_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JNE);
-}
-
-static int bpf_fill_jmp32_jgt_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JGT);
-}
-
-static int bpf_fill_jmp32_jge_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JGE);
-}
-
-static int bpf_fill_jmp32_jlt_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JLT);
-}
-
-static int bpf_fill_jmp32_jle_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JLE);
-}
-
-static int bpf_fill_jmp32_jsgt_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JSGT);
-}
-
-static int bpf_fill_jmp32_jsge_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JSGE);
-}
-
-static int bpf_fill_jmp32_jslt_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JSLT);
-}
-
-static int bpf_fill_jmp32_jsle_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JSLE);
-}
-
-/* JMP register tests */
-static int bpf_fill_jmp_jset_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JSET);
-}
-
-static int bpf_fill_jmp_jeq_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JEQ);
-}
-
-static int bpf_fill_jmp_jne_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JNE);
-}
-
-static int bpf_fill_jmp_jgt_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JGT);
-}
-
-static int bpf_fill_jmp_jge_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JGE);
-}
-
-static int bpf_fill_jmp_jlt_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JLT);
-}
-
-static int bpf_fill_jmp_jle_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JLE);
-}
-
-static int bpf_fill_jmp_jsgt_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JSGT);
-}
-
-static int bpf_fill_jmp_jsge_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JSGE);
-}
-
-static int bpf_fill_jmp_jslt_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JSLT);
-}
-
-static int bpf_fill_jmp_jsle_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JSLE);
-}
-
-/* JMP32 register tests */
-static int bpf_fill_jmp32_jset_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JSET);
-}
-
-static int bpf_fill_jmp32_jeq_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JEQ);
-}
-
-static int bpf_fill_jmp32_jne_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JNE);
-}
-
-static int bpf_fill_jmp32_jgt_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JGT);
-}
-
-static int bpf_fill_jmp32_jge_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JGE);
-}
-
-static int bpf_fill_jmp32_jlt_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JLT);
-}
-
-static int bpf_fill_jmp32_jle_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JLE);
-}
-
-static int bpf_fill_jmp32_jsgt_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JSGT);
-}
-
-static int bpf_fill_jmp32_jsge_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JSGE);
-}
-
-static int bpf_fill_jmp32_jslt_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JSLT);
-}
-
-static int bpf_fill_jmp32_jsle_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JSLE);
-}
-
-/*
- * Set up a sequence of staggered jumps, forwards and backwards with
- * increasing offset. This tests the conversion of relative jumps to
- * JITed native jumps. On some architectures, for example MIPS, a large
- * PC-relative jump offset may overflow the immediate field of the native
- * conditional branch instruction, triggering a conversion to use an
- * absolute jump instead. Since this changes the jump offsets, another
- * offset computation pass is necessary, and that may in turn trigger
- * another branch conversion. This jump sequence is particularly nasty
- * in that regard.
- *
- * The sequence generation is parameterized by size and jump type.
- * The size must be even, and the expected result is always size + 1.
- * Below is an example with size=8 and result=9.
- *
- *                     ________________________Start
- *                     R0 = 0
- *                     R1 = r1
- *                     R2 = r2
- *            ,------- JMP +4 * 3______________Preamble: 4 insns
- * ,----------|-ind 0- if R0 != 7 JMP 8 * 3 + 1 <--------------------.
- * |          |        R0 = 8                                        |
- * |          |        JMP +7 * 3               ------------------------.
- * | ,--------|-----1- if R0 != 5 JMP 7 * 3 + 1 <--------------.     |  |
- * | |        |        R0 = 6                                  |     |  |
- * | |        |        JMP +5 * 3               ------------------.  |  |
- * | | ,------|-----2- if R0 != 3 JMP 6 * 3 + 1 <--------.     |  |  |  |
- * | | |      |        R0 = 4                            |     |  |  |  |
- * | | |      |        JMP +3 * 3               ------------.  |  |  |  |
- * | | | ,----|-----3- if R0 != 1 JMP 5 * 3 + 1 <--.     |  |  |  |  |  |
- * | | | |    |        R0 = 2                      |     |  |  |  |  |  |
- * | | | |    |        JMP +1 * 3               ------.  |  |  |  |  |  |
- * | | | | ,--t=====4> if R0 != 0 JMP 4 * 3 + 1    1  2  3  4  5  6  7  8 loc
- * | | | | |           R0 = 1                     -1 +2 -3 +4 -5 +6 -7 +8 off
- * | | | | |           JMP -2 * 3               ---'  |  |  |  |  |  |  |
- * | | | | | ,------5- if R0 != 2 JMP 3 * 3 + 1 <-----'  |  |  |  |  |  |
- * | | | | | |         R0 = 3                            |  |  |  |  |  |
- * | | | | | |         JMP -4 * 3               ---------'  |  |  |  |  |
- * | | | | | | ,----6- if R0 != 4 JMP 2 * 3 + 1 <-----------'  |  |  |  |
- * | | | | | | |       R0 = 5                                  |  |  |  |
- * | | | | | | |       JMP -6 * 3               ---------------'  |  |  |
- * | | | | | | | ,--7- if R0 != 6 JMP 1 * 3 + 1 <-----------------'  |  |
- * | | | | | | | |     R0 = 7                                        |  |
- * | | Error | | |     JMP -8 * 3               ---------------------'  |
- * | | paths | | | ,8- if R0 != 8 JMP 0 * 3 + 1 <-----------------------'
- * | | | | | | | | |   R0 = 9__________________Sequence: 3 * size - 1 insns
- * `-+-+-+-+-+-+-+-+-> EXIT____________________Return: 1 insn
- *
- */
-
-/* The maximum size parameter */
-#define MAX_STAGGERED_JMP_SIZE ((0x7fff / 3) & ~1)
-
-/* We use a reduced number of iterations to get a reasonable execution time */
-#define NR_STAGGERED_JMP_RUNS 10
-
-static int __bpf_fill_staggered_jumps(struct bpf_test *self,
-				      const struct bpf_insn *jmp,
-				      u64 r1, u64 r2)
-{
-	int size = self->test[0].result - 1;
-	int len = 4 + 3 * (size + 1);
-	struct bpf_insn *insns;
-	int off, ind;
-
-	insns = kmalloc_objs(*insns, len);
-	if (!insns)
-		return -ENOMEM;
-
-	/* Preamble */
-	insns[0] = BPF_ALU64_IMM(BPF_MOV, R0, 0);
-	insns[1] = BPF_ALU64_IMM(BPF_MOV, R1, r1);
-	insns[2] = BPF_ALU64_IMM(BPF_MOV, R2, r2);
-	insns[3] = BPF_JMP_IMM(BPF_JA, 0, 0, 3 * size / 2);
-
-	/* Sequence */
-	for (ind = 0, off = size; ind <= size; ind++, off -= 2) {
-		struct bpf_insn *ins = &insns[4 + 3 * ind];
-		int loc;
-
-		if (off == 0)
-			off--;
-
-		loc = abs(off);
-		ins[0] = BPF_JMP_IMM(BPF_JNE, R0, loc - 1,
-				     3 * (size - ind) + 1);
-		ins[1] = BPF_ALU64_IMM(BPF_MOV, R0, loc);
-		ins[2] = *jmp;
-		ins[2].off = 3 * (off - 1);
-	}
-
-	/* Return */
-	insns[len - 1] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insns;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-/* 64-bit unconditional jump */
-static int bpf_fill_staggered_ja(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JA, 0, 0, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 0, 0);
-}
-
-/* 64-bit immediate jumps */
-static int bpf_fill_staggered_jeq_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JEQ, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
-}
-
-static int bpf_fill_staggered_jne_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JNE, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 4321, 0);
-}
-
-static int bpf_fill_staggered_jset_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JSET, R1, 0x82, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 0x86, 0);
-}
-
-static int bpf_fill_staggered_jgt_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JGT, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 0x80000000, 0);
-}
-
-static int bpf_fill_staggered_jge_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JGE, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
-}
-
-static int bpf_fill_staggered_jlt_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JLT, R1, 0x80000000, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
-}
-
-static int bpf_fill_staggered_jle_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JLE, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
-}
-
-static int bpf_fill_staggered_jsgt_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JSGT, R1, -2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -1, 0);
-}
-
-static int bpf_fill_staggered_jsge_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JSGE, R1, -2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -2, 0);
-}
-
-static int bpf_fill_staggered_jslt_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JSLT, R1, -1, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -2, 0);
-}
-
-static int bpf_fill_staggered_jsle_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JSLE, R1, -1, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -1, 0);
-}
-
-/* 64-bit register jumps */
-static int bpf_fill_staggered_jeq_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JEQ, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 1234);
-}
-
-static int bpf_fill_staggered_jne_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JNE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 4321, 1234);
-}
-
-static int bpf_fill_staggered_jset_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JSET, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 0x86, 0x82);
-}
-
-static int bpf_fill_staggered_jgt_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JGT, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 0x80000000, 1234);
-}
-
-static int bpf_fill_staggered_jge_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JGE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 1234);
-}
-
-static int bpf_fill_staggered_jlt_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JLT, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0x80000000);
-}
-
-static int bpf_fill_staggered_jle_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JLE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 1234);
-}
-
-static int bpf_fill_staggered_jsgt_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JSGT, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -1, -2);
-}
-
-static int bpf_fill_staggered_jsge_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JSGE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -2, -2);
-}
-
-static int bpf_fill_staggered_jslt_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JSLT, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -2, -1);
-}
-
-static int bpf_fill_staggered_jsle_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JSLE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -1, -1);
-}
-
-/* 32-bit immediate jumps */
-static int bpf_fill_staggered_jeq32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JEQ, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
-}
-
-static int bpf_fill_staggered_jne32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JNE, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 4321, 0);
-}
-
-static int bpf_fill_staggered_jset32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JSET, R1, 0x82, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 0x86, 0);
-}
-
-static int bpf_fill_staggered_jgt32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JGT, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 0x80000000, 0);
-}
-
-static int bpf_fill_staggered_jge32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JGE, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
-}
-
-static int bpf_fill_staggered_jlt32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JLT, R1, 0x80000000, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
-}
-
-static int bpf_fill_staggered_jle32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JLE, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
-}
-
-static int bpf_fill_staggered_jsgt32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JSGT, R1, -2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -1, 0);
-}
-
-static int bpf_fill_staggered_jsge32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JSGE, R1, -2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -2, 0);
-}
-
-static int bpf_fill_staggered_jslt32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JSLT, R1, -1, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -2, 0);
-}
-
-static int bpf_fill_staggered_jsle32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JSLE, R1, -1, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -1, 0);
-}
-
-/* 32-bit register jumps */
-static int bpf_fill_staggered_jeq32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JEQ, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 1234);
-}
-
-static int bpf_fill_staggered_jne32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JNE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 4321, 1234);
-}
-
-static int bpf_fill_staggered_jset32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JSET, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 0x86, 0x82);
-}
-
-static int bpf_fill_staggered_jgt32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JGT, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 0x80000000, 1234);
-}
-
-static int bpf_fill_staggered_jge32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JGE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 1234);
-}
-
-static int bpf_fill_staggered_jlt32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JLT, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0x80000000);
-}
-
-static int bpf_fill_staggered_jle32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JLE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 1234);
-}
-
-static int bpf_fill_staggered_jsgt32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JSGT, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -1, -2);
-}
-
-static int bpf_fill_staggered_jsge32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JSGE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -2, -2);
-}
-
-static int bpf_fill_staggered_jslt32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JSLT, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -2, -1);
-}
-
-static int bpf_fill_staggered_jsle32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JSLE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -1, -1);
-}
-
-
-static struct bpf_test tests[] = {
-	{
-		"TAX",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_ALU | BPF_NEG, 0), /* A == -3 */
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_LEN, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0), /* X == len - 3 */
-			BPF_STMT(BPF_LD | BPF_B | BPF_IND, 1),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ 10, 20, 30, 40, 50 },
-		{ { 2, 10 }, { 3, 20 }, { 4, 30 } },
-	},
-	{
-		"TXA",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0) /* A == len * 2 */
-		},
-		CLASSIC,
-		{ 10, 20, 30, 40, 50 },
-		{ { 1, 2 }, { 3, 6 }, { 4, 8 } },
-	},
-	{
-		"ADD_SUB_MUL_K",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 1),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 2),
-			BPF_STMT(BPF_LDX | BPF_IMM, 3),
-			BPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 0xffffffff),
-			BPF_STMT(BPF_ALU | BPF_MUL | BPF_K, 3),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0xfffffffd } }
-	},
-	{
-		"DIV_MOD_KX",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 8),
-			BPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 2),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff),
-			BPF_STMT(BPF_ALU | BPF_DIV | BPF_X, 0),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff),
-			BPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 0x70000000),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff),
-			BPF_STMT(BPF_ALU | BPF_MOD | BPF_X, 0),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff),
-			BPF_STMT(BPF_ALU | BPF_MOD | BPF_K, 0x70000000),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0x20000000 } }
-	},
-	{
-		"AND_OR_LSH_K",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0xff),
-			BPF_STMT(BPF_ALU | BPF_AND | BPF_K, 0xf0),
-			BPF_STMT(BPF_ALU | BPF_LSH | BPF_K, 27),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_IMM, 0xf),
-			BPF_STMT(BPF_ALU | BPF_OR | BPF_K, 0xf0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0x800000ff }, { 1, 0x800000ff } },
-	},
-	{
-		"LD_IMM_0",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0), /* ld #0 */
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 0),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-		},
-		CLASSIC,
-		{ },
-		{ { 1, 1 } },
-	},
-	{
-		"LD_IND",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_IND, MAX_K),
-			BPF_STMT(BPF_RET | BPF_K, 1)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, 0 }, { 10, 0 }, { 60, 0 } },
-	},
-	{
-		"LD_ABS",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS, 1000),
-			BPF_STMT(BPF_RET | BPF_K, 1)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, 0 }, { 10, 0 }, { 60, 0 } },
-	},
-	{
-		"LD_ABS_LL",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, SKF_LL_OFF),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, SKF_LL_OFF + 1),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ 1, 2, 3 },
-		{ { 1, 0 }, { 2, 3 } },
-	},
-	{
-		"LD_IND_LL",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, SKF_LL_OFF - 1),
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_IND, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ 1, 2, 3, 0xff },
-		{ { 1, 1 }, { 3, 3 }, { 4, 0xff } },
-	},
-	{
-		"LD_ABS_NET",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, SKF_NET_OFF),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, SKF_NET_OFF + 1),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3 },
-		{ { 15, 0 }, { 16, 3 } },
-	},
-	{
-		"LD_IND_NET",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, SKF_NET_OFF - 15),
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_IND, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3 },
-		{ { 14, 0 }, { 15, 1 }, { 17, 3 } },
-	},
-	{
-		"LD_PKTTYPE",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_PKTTYPE),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, SKB_TYPE, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_PKTTYPE),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, SKB_TYPE, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_PKTTYPE),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, SKB_TYPE, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, 3 }, { 10, 3 } },
-	},
-	{
-		"LD_MARK",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_MARK),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, SKB_MARK}, { 10, SKB_MARK} },
-	},
-	{
-		"LD_RXHASH",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_RXHASH),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, SKB_HASH}, { 10, SKB_HASH} },
-	},
-	{
-		"LD_QUEUE",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_QUEUE),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, SKB_QUEUE_MAP }, { 10, SKB_QUEUE_MAP } },
-	},
-	{
-		"LD_PROTOCOL",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 1),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 20, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 0),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_PROTOCOL),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 2),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 30, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 0),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ 10, 20, 30 },
-		{ { 10, ETH_P_IP }, { 100, ETH_P_IP } },
-	},
-	{
-		"LD_VLAN_TAG",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_VLAN_TAG),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{
-			{ 1, SKB_VLAN_TCI },
-			{ 10, SKB_VLAN_TCI }
-		},
-	},
-	{
-		"LD_VLAN_TAG_PRESENT",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_VLAN_TAG_PRESENT),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{
-			{ 1, SKB_VLAN_PRESENT },
-			{ 10, SKB_VLAN_PRESENT }
-		},
-	},
-	{
-		"LD_IFINDEX",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_IFINDEX),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, SKB_DEV_IFINDEX }, { 10, SKB_DEV_IFINDEX } },
-	},
-	{
-		"LD_HATYPE",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_HATYPE),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, SKB_DEV_TYPE }, { 10, SKB_DEV_TYPE } },
-	},
-	{
-		"LD_CPU",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_CPU),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_CPU),
-			BPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, 0 }, { 10, 0 } },
-	},
-	{
-		"LD_NLATTR",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 2),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_LDX | BPF_IMM, 3),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_NLATTR),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-#ifdef __BIG_ENDIAN
-		{ 0xff, 0xff, 0, 4, 0, 2, 0, 4, 0, 3 },
-#else
-		{ 0xff, 0xff, 4, 0, 2, 0, 4, 0, 3, 0 },
-#endif
-		{ { 4, 0 }, { 20, 6 } },
-	},
-	{
-		"LD_NLATTR_NEST",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_LDX | BPF_IMM, 3),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-#ifdef __BIG_ENDIAN
-		{ 0xff, 0xff, 0, 12, 0, 1, 0, 4, 0, 2, 0, 4, 0, 3 },
-#else
-		{ 0xff, 0xff, 12, 0, 1, 0, 4, 0, 2, 0, 4, 0, 3, 0 },
-#endif
-		{ { 4, 0 }, { 20, 10 } },
-	},
-	{
-		"LD_PAYLOAD_OFF",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_PAY_OFFSET),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_PAY_OFFSET),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_PAY_OFFSET),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_PAY_OFFSET),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_PAY_OFFSET),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		/* 00:00:00:00:00:00 > 00:00:00:00:00:00, ethtype IPv4 (0x0800),
-		 * length 98: 127.0.0.1 > 127.0.0.1: ICMP echo request,
-		 * id 9737, seq 1, length 64
-		 */
-		{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		  0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		  0x08, 0x00,
-		  0x45, 0x00, 0x00, 0x54, 0xac, 0x8b, 0x40, 0x00, 0x40,
-		  0x01, 0x90, 0x1b, 0x7f, 0x00, 0x00, 0x01 },
-		{ { 30, 0 }, { 100, 42 } },
-	},
-	{
-		"LD_ANC_XOR",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 10),
-			BPF_STMT(BPF_LDX | BPF_IMM, 300),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_ALU_XOR_X),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ { 4, 0xA ^ 300 }, { 20, 0xA ^ 300 } },
-	},
-	{
-		"SPILL_FILL",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_ALU | BPF_RSH, 1),
-			BPF_STMT(BPF_ALU | BPF_XOR | BPF_X, 0),
-			BPF_STMT(BPF_ST, 1), /* M1 = 1 ^ len */
-			BPF_STMT(BPF_ALU | BPF_XOR | BPF_K, 0x80000000),
-			BPF_STMT(BPF_ST, 2), /* M2 = 1 ^ len ^ 0x80000000 */
-			BPF_STMT(BPF_STX, 15), /* M3 = len */
-			BPF_STMT(BPF_LDX | BPF_MEM, 1),
-			BPF_STMT(BPF_LD | BPF_MEM, 2),
-			BPF_STMT(BPF_ALU | BPF_XOR | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 15),
-			BPF_STMT(BPF_ALU | BPF_XOR | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, 0x80000001 }, { 2, 0x80000002 }, { 60, 0x80000000 ^ 60 } }
-	},
-	{
-		"JEQ",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 2),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_X, 0, 0, 1),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-			BPF_STMT(BPF_RET | BPF_K, MAX_K)
-		},
-		CLASSIC,
-		{ 3, 3, 3, 3, 3 },
-		{ { 1, 0 }, { 3, 1 }, { 4, MAX_K } },
-	},
-	{
-		"JGT",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 2),
-			BPF_JUMP(BPF_JMP | BPF_JGT | BPF_X, 0, 0, 1),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-			BPF_STMT(BPF_RET | BPF_K, MAX_K)
-		},
-		CLASSIC,
-		{ 4, 4, 4, 3, 3 },
-		{ { 2, 0 }, { 3, 1 }, { 4, MAX_K } },
-	},
-	{
-		"JGE (jt 0), test 1",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 2),
-			BPF_JUMP(BPF_JMP | BPF_JGE | BPF_X, 0, 0, 1),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-			BPF_STMT(BPF_RET | BPF_K, MAX_K)
-		},
-		CLASSIC,
-		{ 4, 4, 4, 3, 3 },
-		{ { 2, 0 }, { 3, 1 }, { 4, 1 } },
-	},
-	{
-		"JGE (jt 0), test 2",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 2),
-			BPF_JUMP(BPF_JMP | BPF_JGE | BPF_X, 0, 0, 1),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-			BPF_STMT(BPF_RET | BPF_K, MAX_K)
-		},
-		CLASSIC,
-		{ 4, 4, 5, 3, 3 },
-		{ { 4, 1 }, { 5, 1 }, { 6, MAX_K } },
-	},
-	{
-		"JGE",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_IND, MAX_K),
-			BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 1, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 10),
-			BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 2, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 20),
-			BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 3, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 30),
-			BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 4, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 40),
-			BPF_STMT(BPF_RET | BPF_K, MAX_K)
-		},
-		CLASSIC,
-		{ 1, 2, 3, 4, 5 },
-		{ { 1, 20 }, { 3, 40 }, { 5, MAX_K } },
-	},
-	{
-		"JSET",
-		.u.insns = {
-			BPF_JUMP(BPF_JMP | BPF_JA, 0, 0, 0),
-			BPF_JUMP(BPF_JMP | BPF_JA, 1, 1, 1),
-			BPF_JUMP(BPF_JMP | BPF_JA, 0, 0, 0),
-			BPF_JUMP(BPF_JMP | BPF_JA, 0, 0, 0),
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_SUB | BPF_K, 4),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_W | BPF_IND, 0),
-			BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 1, 0, 1),
-			BPF_STMT(BPF_RET | BPF_K, 10),
-			BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0x80000000, 0, 1),
-			BPF_STMT(BPF_RET | BPF_K, 20),
-			BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 30),
-			BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 30),
-			BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 30),
-			BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 30),
-			BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 30),
-			BPF_STMT(BPF_RET | BPF_K, MAX_K)
-		},
-		CLASSIC,
-		{ 0, 0xAA, 0x55, 1 },
-		{ { 4, 10 }, { 5, 20 }, { 6, MAX_K } },
-	},
-	{
-		"tcpdump port 22",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 12),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x86dd, 0, 8), /* IPv6 */
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 20),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x84, 2, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x6, 1, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x11, 0, 17),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 54),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 14, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 56),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 12, 13),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x0800, 0, 12), /* IPv4 */
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 23),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x84, 2, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x6, 1, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x11, 0, 8),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 20),
-			BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0x1fff, 6, 0),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 14),
-			BPF_STMT(BPF_LD | BPF_H | BPF_IND, 14),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 2, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_IND, 16),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 0, 1),
-			BPF_STMT(BPF_RET | BPF_K, 0xffff),
-			BPF_STMT(BPF_RET | BPF_K, 0),
-		},
-		CLASSIC,
-		/* 3c:07:54:43:e5:76 > 10:bf:48:d6:43:d6, ethertype IPv4(0x0800)
-		 * length 114: 10.1.1.149.49700 > 10.1.2.10.22: Flags [P.],
-		 * seq 1305692979:1305693027, ack 3650467037, win 65535,
-		 * options [nop,nop,TS val 2502645400 ecr 3971138], length 48
-		 */
-		{ 0x10, 0xbf, 0x48, 0xd6, 0x43, 0xd6,
-		  0x3c, 0x07, 0x54, 0x43, 0xe5, 0x76,
-		  0x08, 0x00,
-		  0x45, 0x10, 0x00, 0x64, 0x75, 0xb5,
-		  0x40, 0x00, 0x40, 0x06, 0xad, 0x2e, /* IP header */
-		  0x0a, 0x01, 0x01, 0x95, /* ip src */
-		  0x0a, 0x01, 0x02, 0x0a, /* ip dst */
-		  0xc2, 0x24,
-		  0x00, 0x16 /* dst port */ },
-		{ { 10, 0 }, { 30, 0 }, { 100, 65535 } },
-	},
-	{
-		"tcpdump complex",
-		.u.insns = {
-			/* tcpdump -nei eth0 'tcp port 22 and (((ip[2:2] -
-			 * ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0) and
-			 * (len > 115 or len < 30000000000)' -d
-			 */
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 12),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x86dd, 30, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x800, 0, 29),
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 23),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x6, 0, 27),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 20),
-			BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0x1fff, 25, 0),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 14),
-			BPF_STMT(BPF_LD | BPF_H | BPF_IND, 14),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 2, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_IND, 16),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 0, 20),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 16),
-			BPF_STMT(BPF_ST, 1),
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 14),
-			BPF_STMT(BPF_ALU | BPF_AND | BPF_K, 0xf),
-			BPF_STMT(BPF_ALU | BPF_LSH | BPF_K, 2),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0x5), /* libpcap emits K on TAX */
-			BPF_STMT(BPF_LD | BPF_MEM, 1),
-			BPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0),
-			BPF_STMT(BPF_ST, 5),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 14),
-			BPF_STMT(BPF_LD | BPF_B | BPF_IND, 26),
-			BPF_STMT(BPF_ALU | BPF_AND | BPF_K, 0xf0),
-			BPF_STMT(BPF_ALU | BPF_RSH | BPF_K, 2),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0x9), /* libpcap emits K on TAX */
-			BPF_STMT(BPF_LD | BPF_MEM, 5),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_X, 0, 4, 0),
-			BPF_STMT(BPF_LD | BPF_LEN, 0),
-			BPF_JUMP(BPF_JMP | BPF_JGT | BPF_K, 0x73, 1, 0),
-			BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 0xfc23ac00, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 0xffff),
-			BPF_STMT(BPF_RET | BPF_K, 0),
-		},
-		CLASSIC,
-		{ 0x10, 0xbf, 0x48, 0xd6, 0x43, 0xd6,
-		  0x3c, 0x07, 0x54, 0x43, 0xe5, 0x76,
-		  0x08, 0x00,
-		  0x45, 0x10, 0x00, 0x64, 0x75, 0xb5,
-		  0x40, 0x00, 0x40, 0x06, 0xad, 0x2e, /* IP header */
-		  0x0a, 0x01, 0x01, 0x95, /* ip src */
-		  0x0a, 0x01, 0x02, 0x0a, /* ip dst */
-		  0xc2, 0x24,
-		  0x00, 0x16 /* dst port */ },
-		{ { 10, 0 }, { 30, 0 }, { 100, 65535 } },
-	},
-	{
-		"RET_A",
-		.u.insns = {
-			/* check that uninitialized X and A contain zeros */
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ {1, 0}, {2, 0} },
-	},
-	{
-		"INT: ADD trivial",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R1, 1),
-			BPF_ALU64_IMM(BPF_ADD, R1, 2),
-			BPF_ALU64_IMM(BPF_MOV, R2, 3),
-			BPF_ALU64_REG(BPF_SUB, R1, R2),
-			BPF_ALU64_IMM(BPF_ADD, R1, -1),
-			BPF_ALU64_IMM(BPF_MUL, R1, 3),
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffd } }
-	},
-	{
-		"INT: MUL_X",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, -1),
-			BPF_ALU64_IMM(BPF_MOV, R1, -1),
-			BPF_ALU64_IMM(BPF_MOV, R2, 3),
-			BPF_ALU64_REG(BPF_MUL, R1, R2),
-			BPF_JMP_IMM(BPF_JEQ, R1, 0xfffffffd, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		"INT: MUL_X2",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -1),
-			BPF_ALU32_IMM(BPF_MOV, R1, -1),
-			BPF_ALU32_IMM(BPF_MOV, R2, 3),
-			BPF_ALU64_REG(BPF_MUL, R1, R2),
-			BPF_ALU64_IMM(BPF_RSH, R1, 8),
-			BPF_JMP_IMM(BPF_JEQ, R1, 0x2ffffff, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		"INT: MUL32_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -1),
-			BPF_ALU64_IMM(BPF_MOV, R1, -1),
-			BPF_ALU32_IMM(BPF_MOV, R2, 3),
-			BPF_ALU32_REG(BPF_MUL, R1, R2),
-			BPF_ALU64_IMM(BPF_RSH, R1, 8),
-			BPF_JMP_IMM(BPF_JEQ, R1, 0xffffff, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		/* Have to test all register combinations, since
-		 * JITing of different registers will produce
-		 * different asm code.
-		 */
-		"INT: ADD 64-bit",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_ALU64_IMM(BPF_MOV, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R2, 2),
-			BPF_ALU64_IMM(BPF_MOV, R3, 3),
-			BPF_ALU64_IMM(BPF_MOV, R4, 4),
-			BPF_ALU64_IMM(BPF_MOV, R5, 5),
-			BPF_ALU64_IMM(BPF_MOV, R6, 6),
-			BPF_ALU64_IMM(BPF_MOV, R7, 7),
-			BPF_ALU64_IMM(BPF_MOV, R8, 8),
-			BPF_ALU64_IMM(BPF_MOV, R9, 9),
-			BPF_ALU64_IMM(BPF_ADD, R0, 20),
-			BPF_ALU64_IMM(BPF_ADD, R1, 20),
-			BPF_ALU64_IMM(BPF_ADD, R2, 20),
-			BPF_ALU64_IMM(BPF_ADD, R3, 20),
-			BPF_ALU64_IMM(BPF_ADD, R4, 20),
-			BPF_ALU64_IMM(BPF_ADD, R5, 20),
-			BPF_ALU64_IMM(BPF_ADD, R6, 20),
-			BPF_ALU64_IMM(BPF_ADD, R7, 20),
-			BPF_ALU64_IMM(BPF_ADD, R8, 20),
-			BPF_ALU64_IMM(BPF_ADD, R9, 20),
-			BPF_ALU64_IMM(BPF_SUB, R0, 10),
-			BPF_ALU64_IMM(BPF_SUB, R1, 10),
-			BPF_ALU64_IMM(BPF_SUB, R2, 10),
-			BPF_ALU64_IMM(BPF_SUB, R3, 10),
-			BPF_ALU64_IMM(BPF_SUB, R4, 10),
-			BPF_ALU64_IMM(BPF_SUB, R5, 10),
-			BPF_ALU64_IMM(BPF_SUB, R6, 10),
-			BPF_ALU64_IMM(BPF_SUB, R7, 10),
-			BPF_ALU64_IMM(BPF_SUB, R8, 10),
-			BPF_ALU64_IMM(BPF_SUB, R9, 10),
-			BPF_ALU64_REG(BPF_ADD, R0, R0),
-			BPF_ALU64_REG(BPF_ADD, R0, R1),
-			BPF_ALU64_REG(BPF_ADD, R0, R2),
-			BPF_ALU64_REG(BPF_ADD, R0, R3),
-			BPF_ALU64_REG(BPF_ADD, R0, R4),
-			BPF_ALU64_REG(BPF_ADD, R0, R5),
-			BPF_ALU64_REG(BPF_ADD, R0, R6),
-			BPF_ALU64_REG(BPF_ADD, R0, R7),
-			BPF_ALU64_REG(BPF_ADD, R0, R8),
-			BPF_ALU64_REG(BPF_ADD, R0, R9), /* R0 == 155 */
-			BPF_JMP_IMM(BPF_JEQ, R0, 155, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_ADD, R1, R0),
-			BPF_ALU64_REG(BPF_ADD, R1, R1),
-			BPF_ALU64_REG(BPF_ADD, R1, R2),
-			BPF_ALU64_REG(BPF_ADD, R1, R3),
-			BPF_ALU64_REG(BPF_ADD, R1, R4),
-			BPF_ALU64_REG(BPF_ADD, R1, R5),
-			BPF_ALU64_REG(BPF_ADD, R1, R6),
-			BPF_ALU64_REG(BPF_ADD, R1, R7),
-			BPF_ALU64_REG(BPF_ADD, R1, R8),
-			BPF_ALU64_REG(BPF_ADD, R1, R9), /* R1 == 456 */
-			BPF_JMP_IMM(BPF_JEQ, R1, 456, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_ADD, R2, R0),
-			BPF_ALU64_REG(BPF_ADD, R2, R1),
-			BPF_ALU64_REG(BPF_ADD, R2, R2),
-			BPF_ALU64_REG(BPF_ADD, R2, R3),
-			BPF_ALU64_REG(BPF_ADD, R2, R4),
-			BPF_ALU64_REG(BPF_ADD, R2, R5),
-			BPF_ALU64_REG(BPF_ADD, R2, R6),
-			BPF_ALU64_REG(BPF_ADD, R2, R7),
-			BPF_ALU64_REG(BPF_ADD, R2, R8),
-			BPF_ALU64_REG(BPF_ADD, R2, R9), /* R2 == 1358 */
-			BPF_JMP_IMM(BPF_JEQ, R2, 1358, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_ADD, R3, R0),
-			BPF_ALU64_REG(BPF_ADD, R3, R1),
-			BPF_ALU64_REG(BPF_ADD, R3, R2),
-			BPF_ALU64_REG(BPF_ADD, R3, R3),
-			BPF_ALU64_REG(BPF_ADD, R3, R4),
-			BPF_ALU64_REG(BPF_ADD, R3, R5),
-			BPF_ALU64_REG(BPF_ADD, R3, R6),
-			BPF_ALU64_REG(BPF_ADD, R3, R7),
-			BPF_ALU64_REG(BPF_ADD, R3, R8),
-			BPF_ALU64_REG(BPF_ADD, R3, R9), /* R3 == 4063 */
-			BPF_JMP_IMM(BPF_JEQ, R3, 4063, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_ADD, R4, R0),
-			BPF_ALU64_REG(BPF_ADD, R4, R1),
-			BPF_ALU64_REG(BPF_ADD, R4, R2),
-			BPF_ALU64_REG(BPF_ADD, R4, R3),
-			BPF_ALU64_REG(BPF_ADD, R4, R4),
-			BPF_ALU64_REG(BPF_ADD, R4, R5),
-			BPF_ALU64_REG(BPF_ADD, R4, R6),
-			BPF_ALU64_REG(BPF_ADD, R4, R7),
-			BPF_ALU64_REG(BPF_ADD, R4, R8),
-			BPF_ALU64_REG(BPF_ADD, R4, R9), /* R4 == 12177 */
-			BPF_JMP_IMM(BPF_JEQ, R4, 12177, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_ADD, R5, R0),
-			BPF_ALU64_REG(BPF_ADD, R5, R1),
-			BPF_ALU64_REG(BPF_ADD, R5, R2),
-			BPF_ALU64_REG(BPF_ADD, R5, R3),
-			BPF_ALU64_REG(BPF_ADD, R5, R4),
-			BPF_ALU64_REG(BPF_ADD, R5, R5),
-			BPF_ALU64_REG(BPF_ADD, R5, R6),
-			BPF_ALU64_REG(BPF_ADD, R5, R7),
-			BPF_ALU64_REG(BPF_ADD, R5, R8),
-			BPF_ALU64_REG(BPF_ADD, R5, R9), /* R5 == 36518 */
-			BPF_JMP_IMM(BPF_JEQ, R5, 36518, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_ADD, R6, R0),
-			BPF_ALU64_REG(BPF_ADD, R6, R1),
-			BPF_ALU64_REG(BPF_ADD, R6, R2),
-			BPF_ALU64_REG(BPF_ADD, R6, R3),
-			BPF_ALU64_REG(BPF_ADD, R6, R4),
-			BPF_ALU64_REG(BPF_ADD, R6, R5),
-			BPF_ALU64_REG(BPF_ADD, R6, R6),
-			BPF_ALU64_REG(BPF_ADD, R6, R7),
-			BPF_ALU64_REG(BPF_ADD, R6, R8),
-			BPF_ALU64_REG(BPF_ADD, R6, R9), /* R6 == 109540 */
-			BPF_JMP_IMM(BPF_JEQ, R6, 109540, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_ADD, R7, R0),
-			BPF_ALU64_REG(BPF_ADD, R7, R1),
-			BPF_ALU64_REG(BPF_ADD, R7, R2),
-			BPF_ALU64_REG(BPF_ADD, R7, R3),
-			BPF_ALU64_REG(BPF_ADD, R7, R4),
-			BPF_ALU64_REG(BPF_ADD, R7, R5),
-			BPF_ALU64_REG(BPF_ADD, R7, R6),
-			BPF_ALU64_REG(BPF_ADD, R7, R7),
-			BPF_ALU64_REG(BPF_ADD, R7, R8),
-			BPF_ALU64_REG(BPF_ADD, R7, R9), /* R7 == 328605 */
-			BPF_JMP_IMM(BPF_JEQ, R7, 328605, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_ADD, R8, R0),
-			BPF_ALU64_REG(BPF_ADD, R8, R1),
-			BPF_ALU64_REG(BPF_ADD, R8, R2),
-			BPF_ALU64_REG(BPF_ADD, R8, R3),
-			BPF_ALU64_REG(BPF_ADD, R8, R4),
-			BPF_ALU64_REG(BPF_ADD, R8, R5),
-			BPF_ALU64_REG(BPF_ADD, R8, R6),
-			BPF_ALU64_REG(BPF_ADD, R8, R7),
-			BPF_ALU64_REG(BPF_ADD, R8, R8),
-			BPF_ALU64_REG(BPF_ADD, R8, R9), /* R8 == 985799 */
-			BPF_JMP_IMM(BPF_JEQ, R8, 985799, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_ADD, R9, R0),
-			BPF_ALU64_REG(BPF_ADD, R9, R1),
-			BPF_ALU64_REG(BPF_ADD, R9, R2),
-			BPF_ALU64_REG(BPF_ADD, R9, R3),
-			BPF_ALU64_REG(BPF_ADD, R9, R4),
-			BPF_ALU64_REG(BPF_ADD, R9, R5),
-			BPF_ALU64_REG(BPF_ADD, R9, R6),
-			BPF_ALU64_REG(BPF_ADD, R9, R7),
-			BPF_ALU64_REG(BPF_ADD, R9, R8),
-			BPF_ALU64_REG(BPF_ADD, R9, R9), /* R9 == 2957380 */
-			BPF_ALU64_REG(BPF_MOV, R0, R9),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2957380 } }
-	},
-	{
-		"INT: ADD 32-bit",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 20),
-			BPF_ALU32_IMM(BPF_MOV, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R2, 2),
-			BPF_ALU32_IMM(BPF_MOV, R3, 3),
-			BPF_ALU32_IMM(BPF_MOV, R4, 4),
-			BPF_ALU32_IMM(BPF_MOV, R5, 5),
-			BPF_ALU32_IMM(BPF_MOV, R6, 6),
-			BPF_ALU32_IMM(BPF_MOV, R7, 7),
-			BPF_ALU32_IMM(BPF_MOV, R8, 8),
-			BPF_ALU32_IMM(BPF_MOV, R9, 9),
-			BPF_ALU64_IMM(BPF_ADD, R1, 10),
-			BPF_ALU64_IMM(BPF_ADD, R2, 10),
-			BPF_ALU64_IMM(BPF_ADD, R3, 10),
-			BPF_ALU64_IMM(BPF_ADD, R4, 10),
-			BPF_ALU64_IMM(BPF_ADD, R5, 10),
-			BPF_ALU64_IMM(BPF_ADD, R6, 10),
-			BPF_ALU64_IMM(BPF_ADD, R7, 10),
-			BPF_ALU64_IMM(BPF_ADD, R8, 10),
-			BPF_ALU64_IMM(BPF_ADD, R9, 10),
-			BPF_ALU32_REG(BPF_ADD, R0, R1),
-			BPF_ALU32_REG(BPF_ADD, R0, R2),
-			BPF_ALU32_REG(BPF_ADD, R0, R3),
-			BPF_ALU32_REG(BPF_ADD, R0, R4),
-			BPF_ALU32_REG(BPF_ADD, R0, R5),
-			BPF_ALU32_REG(BPF_ADD, R0, R6),
-			BPF_ALU32_REG(BPF_ADD, R0, R7),
-			BPF_ALU32_REG(BPF_ADD, R0, R8),
-			BPF_ALU32_REG(BPF_ADD, R0, R9), /* R0 == 155 */
-			BPF_JMP_IMM(BPF_JEQ, R0, 155, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_REG(BPF_ADD, R1, R0),
-			BPF_ALU32_REG(BPF_ADD, R1, R1),
-			BPF_ALU32_REG(BPF_ADD, R1, R2),
-			BPF_ALU32_REG(BPF_ADD, R1, R3),
-			BPF_ALU32_REG(BPF_ADD, R1, R4),
-			BPF_ALU32_REG(BPF_ADD, R1, R5),
-			BPF_ALU32_REG(BPF_ADD, R1, R6),
-			BPF_ALU32_REG(BPF_ADD, R1, R7),
-			BPF_ALU32_REG(BPF_ADD, R1, R8),
-			BPF_ALU32_REG(BPF_ADD, R1, R9), /* R1 == 456 */
-			BPF_JMP_IMM(BPF_JEQ, R1, 456, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_REG(BPF_ADD, R2, R0),
-			BPF_ALU32_REG(BPF_ADD, R2, R1),
-			BPF_ALU32_REG(BPF_ADD, R2, R2),
-			BPF_ALU32_REG(BPF_ADD, R2, R3),
-			BPF_ALU32_REG(BPF_ADD, R2, R4),
-			BPF_ALU32_REG(BPF_ADD, R2, R5),
-			BPF_ALU32_REG(BPF_ADD, R2, R6),
-			BPF_ALU32_REG(BPF_ADD, R2, R7),
-			BPF_ALU32_REG(BPF_ADD, R2, R8),
-			BPF_ALU32_REG(BPF_ADD, R2, R9), /* R2 == 1358 */
-			BPF_JMP_IMM(BPF_JEQ, R2, 1358, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_REG(BPF_ADD, R3, R0),
-			BPF_ALU32_REG(BPF_ADD, R3, R1),
-			BPF_ALU32_REG(BPF_ADD, R3, R2),
-			BPF_ALU32_REG(BPF_ADD, R3, R3),
-			BPF_ALU32_REG(BPF_ADD, R3, R4),
-			BPF_ALU32_REG(BPF_ADD, R3, R5),
-			BPF_ALU32_REG(BPF_ADD, R3, R6),
-			BPF_ALU32_REG(BPF_ADD, R3, R7),
-			BPF_ALU32_REG(BPF_ADD, R3, R8),
-			BPF_ALU32_REG(BPF_ADD, R3, R9), /* R3 == 4063 */
-			BPF_JMP_IMM(BPF_JEQ, R3, 4063, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_REG(BPF_ADD, R4, R0),
-			BPF_ALU32_REG(BPF_ADD, R4, R1),
-			BPF_ALU32_REG(BPF_ADD, R4, R2),
-			BPF_ALU32_REG(BPF_ADD, R4, R3),
-			BPF_ALU32_REG(BPF_ADD, R4, R4),
-			BPF_ALU32_REG(BPF_ADD, R4, R5),
-			BPF_ALU32_REG(BPF_ADD, R4, R6),
-			BPF_ALU32_REG(BPF_ADD, R4, R7),
-			BPF_ALU32_REG(BPF_ADD, R4, R8),
-			BPF_ALU32_REG(BPF_ADD, R4, R9), /* R4 == 12177 */
-			BPF_JMP_IMM(BPF_JEQ, R4, 12177, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_REG(BPF_ADD, R5, R0),
-			BPF_ALU32_REG(BPF_ADD, R5, R1),
-			BPF_ALU32_REG(BPF_ADD, R5, R2),
-			BPF_ALU32_REG(BPF_ADD, R5, R3),
-			BPF_ALU32_REG(BPF_ADD, R5, R4),
-			BPF_ALU32_REG(BPF_ADD, R5, R5),
-			BPF_ALU32_REG(BPF_ADD, R5, R6),
-			BPF_ALU32_REG(BPF_ADD, R5, R7),
-			BPF_ALU32_REG(BPF_ADD, R5, R8),
-			BPF_ALU32_REG(BPF_ADD, R5, R9), /* R5 == 36518 */
-			BPF_JMP_IMM(BPF_JEQ, R5, 36518, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_REG(BPF_ADD, R6, R0),
-			BPF_ALU32_REG(BPF_ADD, R6, R1),
-			BPF_ALU32_REG(BPF_ADD, R6, R2),
-			BPF_ALU32_REG(BPF_ADD, R6, R3),
-			BPF_ALU32_REG(BPF_ADD, R6, R4),
-			BPF_ALU32_REG(BPF_ADD, R6, R5),
-			BPF_ALU32_REG(BPF_ADD, R6, R6),
-			BPF_ALU32_REG(BPF_ADD, R6, R7),
-			BPF_ALU32_REG(BPF_ADD, R6, R8),
-			BPF_ALU32_REG(BPF_ADD, R6, R9), /* R6 == 109540 */
-			BPF_JMP_IMM(BPF_JEQ, R6, 109540, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_REG(BPF_ADD, R7, R0),
-			BPF_ALU32_REG(BPF_ADD, R7, R1),
-			BPF_ALU32_REG(BPF_ADD, R7, R2),
-			BPF_ALU32_REG(BPF_ADD, R7, R3),
-			BPF_ALU32_REG(BPF_ADD, R7, R4),
-			BPF_ALU32_REG(BPF_ADD, R7, R5),
-			BPF_ALU32_REG(BPF_ADD, R7, R6),
-			BPF_ALU32_REG(BPF_ADD, R7, R7),
-			BPF_ALU32_REG(BPF_ADD, R7, R8),
-			BPF_ALU32_REG(BPF_ADD, R7, R9), /* R7 == 328605 */
-			BPF_JMP_IMM(BPF_JEQ, R7, 328605, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_REG(BPF_ADD, R8, R0),
-			BPF_ALU32_REG(BPF_ADD, R8, R1),
-			BPF_ALU32_REG(BPF_ADD, R8, R2),
-			BPF_ALU32_REG(BPF_ADD, R8, R3),
-			BPF_ALU32_REG(BPF_ADD, R8, R4),
-			BPF_ALU32_REG(BPF_ADD, R8, R5),
-			BPF_ALU32_REG(BPF_ADD, R8, R6),
-			BPF_ALU32_REG(BPF_ADD, R8, R7),
-			BPF_ALU32_REG(BPF_ADD, R8, R8),
-			BPF_ALU32_REG(BPF_ADD, R8, R9), /* R8 == 985799 */
-			BPF_JMP_IMM(BPF_JEQ, R8, 985799, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_REG(BPF_ADD, R9, R0),
-			BPF_ALU32_REG(BPF_ADD, R9, R1),
-			BPF_ALU32_REG(BPF_ADD, R9, R2),
-			BPF_ALU32_REG(BPF_ADD, R9, R3),
-			BPF_ALU32_REG(BPF_ADD, R9, R4),
-			BPF_ALU32_REG(BPF_ADD, R9, R5),
-			BPF_ALU32_REG(BPF_ADD, R9, R6),
-			BPF_ALU32_REG(BPF_ADD, R9, R7),
-			BPF_ALU32_REG(BPF_ADD, R9, R8),
-			BPF_ALU32_REG(BPF_ADD, R9, R9), /* R9 == 2957380 */
-			BPF_ALU32_REG(BPF_MOV, R0, R9),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2957380 } }
-	},
-	{	/* Mainly checking JIT here. */
-		"INT: SUB",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_ALU64_IMM(BPF_MOV, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R2, 2),
-			BPF_ALU64_IMM(BPF_MOV, R3, 3),
-			BPF_ALU64_IMM(BPF_MOV, R4, 4),
-			BPF_ALU64_IMM(BPF_MOV, R5, 5),
-			BPF_ALU64_IMM(BPF_MOV, R6, 6),
-			BPF_ALU64_IMM(BPF_MOV, R7, 7),
-			BPF_ALU64_IMM(BPF_MOV, R8, 8),
-			BPF_ALU64_IMM(BPF_MOV, R9, 9),
-			BPF_ALU64_REG(BPF_SUB, R0, R0),
-			BPF_ALU64_REG(BPF_SUB, R0, R1),
-			BPF_ALU64_REG(BPF_SUB, R0, R2),
-			BPF_ALU64_REG(BPF_SUB, R0, R3),
-			BPF_ALU64_REG(BPF_SUB, R0, R4),
-			BPF_ALU64_REG(BPF_SUB, R0, R5),
-			BPF_ALU64_REG(BPF_SUB, R0, R6),
-			BPF_ALU64_REG(BPF_SUB, R0, R7),
-			BPF_ALU64_REG(BPF_SUB, R0, R8),
-			BPF_ALU64_REG(BPF_SUB, R0, R9),
-			BPF_ALU64_IMM(BPF_SUB, R0, 10),
-			BPF_JMP_IMM(BPF_JEQ, R0, -55, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_SUB, R1, R0),
-			BPF_ALU64_REG(BPF_SUB, R1, R2),
-			BPF_ALU64_REG(BPF_SUB, R1, R3),
-			BPF_ALU64_REG(BPF_SUB, R1, R4),
-			BPF_ALU64_REG(BPF_SUB, R1, R5),
-			BPF_ALU64_REG(BPF_SUB, R1, R6),
-			BPF_ALU64_REG(BPF_SUB, R1, R7),
-			BPF_ALU64_REG(BPF_SUB, R1, R8),
-			BPF_ALU64_REG(BPF_SUB, R1, R9),
-			BPF_ALU64_IMM(BPF_SUB, R1, 10),
-			BPF_ALU64_REG(BPF_SUB, R2, R0),
-			BPF_ALU64_REG(BPF_SUB, R2, R1),
-			BPF_ALU64_REG(BPF_SUB, R2, R3),
-			BPF_ALU64_REG(BPF_SUB, R2, R4),
-			BPF_ALU64_REG(BPF_SUB, R2, R5),
-			BPF_ALU64_REG(BPF_SUB, R2, R6),
-			BPF_ALU64_REG(BPF_SUB, R2, R7),
-			BPF_ALU64_REG(BPF_SUB, R2, R8),
-			BPF_ALU64_REG(BPF_SUB, R2, R9),
-			BPF_ALU64_IMM(BPF_SUB, R2, 10),
-			BPF_ALU64_REG(BPF_SUB, R3, R0),
-			BPF_ALU64_REG(BPF_SUB, R3, R1),
-			BPF_ALU64_REG(BPF_SUB, R3, R2),
-			BPF_ALU64_REG(BPF_SUB, R3, R4),
-			BPF_ALU64_REG(BPF_SUB, R3, R5),
-			BPF_ALU64_REG(BPF_SUB, R3, R6),
-			BPF_ALU64_REG(BPF_SUB, R3, R7),
-			BPF_ALU64_REG(BPF_SUB, R3, R8),
-			BPF_ALU64_REG(BPF_SUB, R3, R9),
-			BPF_ALU64_IMM(BPF_SUB, R3, 10),
-			BPF_ALU64_REG(BPF_SUB, R4, R0),
-			BPF_ALU64_REG(BPF_SUB, R4, R1),
-			BPF_ALU64_REG(BPF_SUB, R4, R2),
-			BPF_ALU64_REG(BPF_SUB, R4, R3),
-			BPF_ALU64_REG(BPF_SUB, R4, R5),
-			BPF_ALU64_REG(BPF_SUB, R4, R6),
-			BPF_ALU64_REG(BPF_SUB, R4, R7),
-			BPF_ALU64_REG(BPF_SUB, R4, R8),
-			BPF_ALU64_REG(BPF_SUB, R4, R9),
-			BPF_ALU64_IMM(BPF_SUB, R4, 10),
-			BPF_ALU64_REG(BPF_SUB, R5, R0),
-			BPF_ALU64_REG(BPF_SUB, R5, R1),
-			BPF_ALU64_REG(BPF_SUB, R5, R2),
-			BPF_ALU64_REG(BPF_SUB, R5, R3),
-			BPF_ALU64_REG(BPF_SUB, R5, R4),
-			BPF_ALU64_REG(BPF_SUB, R5, R6),
-			BPF_ALU64_REG(BPF_SUB, R5, R7),
-			BPF_ALU64_REG(BPF_SUB, R5, R8),
-			BPF_ALU64_REG(BPF_SUB, R5, R9),
-			BPF_ALU64_IMM(BPF_SUB, R5, 10),
-			BPF_ALU64_REG(BPF_SUB, R6, R0),
-			BPF_ALU64_REG(BPF_SUB, R6, R1),
-			BPF_ALU64_REG(BPF_SUB, R6, R2),
-			BPF_ALU64_REG(BPF_SUB, R6, R3),
-			BPF_ALU64_REG(BPF_SUB, R6, R4),
-			BPF_ALU64_REG(BPF_SUB, R6, R5),
-			BPF_ALU64_REG(BPF_SUB, R6, R7),
-			BPF_ALU64_REG(BPF_SUB, R6, R8),
-			BPF_ALU64_REG(BPF_SUB, R6, R9),
-			BPF_ALU64_IMM(BPF_SUB, R6, 10),
-			BPF_ALU64_REG(BPF_SUB, R7, R0),
-			BPF_ALU64_REG(BPF_SUB, R7, R1),
-			BPF_ALU64_REG(BPF_SUB, R7, R2),
-			BPF_ALU64_REG(BPF_SUB, R7, R3),
-			BPF_ALU64_REG(BPF_SUB, R7, R4),
-			BPF_ALU64_REG(BPF_SUB, R7, R5),
-			BPF_ALU64_REG(BPF_SUB, R7, R6),
-			BPF_ALU64_REG(BPF_SUB, R7, R8),
-			BPF_ALU64_REG(BPF_SUB, R7, R9),
-			BPF_ALU64_IMM(BPF_SUB, R7, 10),
-			BPF_ALU64_REG(BPF_SUB, R8, R0),
-			BPF_ALU64_REG(BPF_SUB, R8, R1),
-			BPF_ALU64_REG(BPF_SUB, R8, R2),
-			BPF_ALU64_REG(BPF_SUB, R8, R3),
-			BPF_ALU64_REG(BPF_SUB, R8, R4),
-			BPF_ALU64_REG(BPF_SUB, R8, R5),
-			BPF_ALU64_REG(BPF_SUB, R8, R6),
-			BPF_ALU64_REG(BPF_SUB, R8, R7),
-			BPF_ALU64_REG(BPF_SUB, R8, R9),
-			BPF_ALU64_IMM(BPF_SUB, R8, 10),
-			BPF_ALU64_REG(BPF_SUB, R9, R0),
-			BPF_ALU64_REG(BPF_SUB, R9, R1),
-			BPF_ALU64_REG(BPF_SUB, R9, R2),
-			BPF_ALU64_REG(BPF_SUB, R9, R3),
-			BPF_ALU64_REG(BPF_SUB, R9, R4),
-			BPF_ALU64_REG(BPF_SUB, R9, R5),
-			BPF_ALU64_REG(BPF_SUB, R9, R6),
-			BPF_ALU64_REG(BPF_SUB, R9, R7),
-			BPF_ALU64_REG(BPF_SUB, R9, R8),
-			BPF_ALU64_IMM(BPF_SUB, R9, 10),
-			BPF_ALU64_IMM(BPF_SUB, R0, 10),
-			BPF_ALU64_IMM(BPF_NEG, R0, 0),
-			BPF_ALU64_REG(BPF_SUB, R0, R1),
-			BPF_ALU64_REG(BPF_SUB, R0, R2),
-			BPF_ALU64_REG(BPF_SUB, R0, R3),
-			BPF_ALU64_REG(BPF_SUB, R0, R4),
-			BPF_ALU64_REG(BPF_SUB, R0, R5),
-			BPF_ALU64_REG(BPF_SUB, R0, R6),
-			BPF_ALU64_REG(BPF_SUB, R0, R7),
-			BPF_ALU64_REG(BPF_SUB, R0, R8),
-			BPF_ALU64_REG(BPF_SUB, R0, R9),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 11 } }
-	},
-	{	/* Mainly checking JIT here. */
-		"INT: XOR",
-		.u.insns_int = {
-			BPF_ALU64_REG(BPF_SUB, R0, R0),
-			BPF_ALU64_REG(BPF_XOR, R1, R1),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_IMM(BPF_MOV, R0, 10),
-			BPF_ALU64_IMM(BPF_MOV, R1, -1),
-			BPF_ALU64_REG(BPF_SUB, R1, R1),
-			BPF_ALU64_REG(BPF_XOR, R2, R2),
-			BPF_JMP_REG(BPF_JEQ, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_SUB, R2, R2),
-			BPF_ALU64_REG(BPF_XOR, R3, R3),
-			BPF_ALU64_IMM(BPF_MOV, R0, 10),
-			BPF_ALU64_IMM(BPF_MOV, R1, -1),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_SUB, R3, R3),
-			BPF_ALU64_REG(BPF_XOR, R4, R4),
-			BPF_ALU64_IMM(BPF_MOV, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R5, -1),
-			BPF_JMP_REG(BPF_JEQ, R3, R4, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_SUB, R4, R4),
-			BPF_ALU64_REG(BPF_XOR, R5, R5),
-			BPF_ALU64_IMM(BPF_MOV, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R7, -1),
-			BPF_JMP_REG(BPF_JEQ, R5, R4, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_IMM(BPF_MOV, R5, 1),
-			BPF_ALU64_REG(BPF_SUB, R5, R5),
-			BPF_ALU64_REG(BPF_XOR, R6, R6),
-			BPF_ALU64_IMM(BPF_MOV, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R8, -1),
-			BPF_JMP_REG(BPF_JEQ, R5, R6, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_SUB, R6, R6),
-			BPF_ALU64_REG(BPF_XOR, R7, R7),
-			BPF_JMP_REG(BPF_JEQ, R7, R6, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_SUB, R7, R7),
-			BPF_ALU64_REG(BPF_XOR, R8, R8),
-			BPF_JMP_REG(BPF_JEQ, R7, R8, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_SUB, R8, R8),
-			BPF_ALU64_REG(BPF_XOR, R9, R9),
-			BPF_JMP_REG(BPF_JEQ, R9, R8, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_SUB, R9, R9),
-			BPF_ALU64_REG(BPF_XOR, R0, R0),
-			BPF_JMP_REG(BPF_JEQ, R9, R0, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_SUB, R1, R1),
-			BPF_ALU64_REG(BPF_XOR, R0, R0),
-			BPF_JMP_REG(BPF_JEQ, R9, R0, 2),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{	/* Mainly checking JIT here. */
-		"INT: MUL",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 11),
-			BPF_ALU64_IMM(BPF_MOV, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R2, 2),
-			BPF_ALU64_IMM(BPF_MOV, R3, 3),
-			BPF_ALU64_IMM(BPF_MOV, R4, 4),
-			BPF_ALU64_IMM(BPF_MOV, R5, 5),
-			BPF_ALU64_IMM(BPF_MOV, R6, 6),
-			BPF_ALU64_IMM(BPF_MOV, R7, 7),
-			BPF_ALU64_IMM(BPF_MOV, R8, 8),
-			BPF_ALU64_IMM(BPF_MOV, R9, 9),
-			BPF_ALU64_REG(BPF_MUL, R0, R0),
-			BPF_ALU64_REG(BPF_MUL, R0, R1),
-			BPF_ALU64_REG(BPF_MUL, R0, R2),
-			BPF_ALU64_REG(BPF_MUL, R0, R3),
-			BPF_ALU64_REG(BPF_MUL, R0, R4),
-			BPF_ALU64_REG(BPF_MUL, R0, R5),
-			BPF_ALU64_REG(BPF_MUL, R0, R6),
-			BPF_ALU64_REG(BPF_MUL, R0, R7),
-			BPF_ALU64_REG(BPF_MUL, R0, R8),
-			BPF_ALU64_REG(BPF_MUL, R0, R9),
-			BPF_ALU64_IMM(BPF_MUL, R0, 10),
-			BPF_JMP_IMM(BPF_JEQ, R0, 439084800, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_MUL, R1, R0),
-			BPF_ALU64_REG(BPF_MUL, R1, R2),
-			BPF_ALU64_REG(BPF_MUL, R1, R3),
-			BPF_ALU64_REG(BPF_MUL, R1, R4),
-			BPF_ALU64_REG(BPF_MUL, R1, R5),
-			BPF_ALU64_REG(BPF_MUL, R1, R6),
-			BPF_ALU64_REG(BPF_MUL, R1, R7),
-			BPF_ALU64_REG(BPF_MUL, R1, R8),
-			BPF_ALU64_REG(BPF_MUL, R1, R9),
-			BPF_ALU64_IMM(BPF_MUL, R1, 10),
-			BPF_ALU64_REG(BPF_MOV, R2, R1),
-			BPF_ALU64_IMM(BPF_RSH, R2, 32),
-			BPF_JMP_IMM(BPF_JEQ, R2, 0x5a924, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_IMM(BPF_LSH, R1, 32),
-			BPF_ALU64_IMM(BPF_ARSH, R1, 32),
-			BPF_JMP_IMM(BPF_JEQ, R1, 0xebb90000, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_MUL, R2, R0),
-			BPF_ALU64_REG(BPF_MUL, R2, R1),
-			BPF_ALU64_REG(BPF_MUL, R2, R3),
-			BPF_ALU64_REG(BPF_MUL, R2, R4),
-			BPF_ALU64_REG(BPF_MUL, R2, R5),
-			BPF_ALU64_REG(BPF_MUL, R2, R6),
-			BPF_ALU64_REG(BPF_MUL, R2, R7),
-			BPF_ALU64_REG(BPF_MUL, R2, R8),
-			BPF_ALU64_REG(BPF_MUL, R2, R9),
-			BPF_ALU64_IMM(BPF_MUL, R2, 10),
-			BPF_ALU64_IMM(BPF_RSH, R2, 32),
-			BPF_ALU64_REG(BPF_MOV, R0, R2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x35d97ef2 } }
-	},
-	{	/* Mainly checking JIT here. */
-		"MOV REG64",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xffffffffffffffffLL),
-			BPF_MOV64_REG(R1, R0),
-			BPF_MOV64_REG(R2, R1),
-			BPF_MOV64_REG(R3, R2),
-			BPF_MOV64_REG(R4, R3),
-			BPF_MOV64_REG(R5, R4),
-			BPF_MOV64_REG(R6, R5),
-			BPF_MOV64_REG(R7, R6),
-			BPF_MOV64_REG(R8, R7),
-			BPF_MOV64_REG(R9, R8),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_ALU64_IMM(BPF_MOV, R1, 0),
-			BPF_ALU64_IMM(BPF_MOV, R2, 0),
-			BPF_ALU64_IMM(BPF_MOV, R3, 0),
-			BPF_ALU64_IMM(BPF_MOV, R4, 0),
-			BPF_ALU64_IMM(BPF_MOV, R5, 0),
-			BPF_ALU64_IMM(BPF_MOV, R6, 0),
-			BPF_ALU64_IMM(BPF_MOV, R7, 0),
-			BPF_ALU64_IMM(BPF_MOV, R8, 0),
-			BPF_ALU64_IMM(BPF_MOV, R9, 0),
-			BPF_ALU64_REG(BPF_ADD, R0, R0),
-			BPF_ALU64_REG(BPF_ADD, R0, R1),
-			BPF_ALU64_REG(BPF_ADD, R0, R2),
-			BPF_ALU64_REG(BPF_ADD, R0, R3),
-			BPF_ALU64_REG(BPF_ADD, R0, R4),
-			BPF_ALU64_REG(BPF_ADD, R0, R5),
-			BPF_ALU64_REG(BPF_ADD, R0, R6),
-			BPF_ALU64_REG(BPF_ADD, R0, R7),
-			BPF_ALU64_REG(BPF_ADD, R0, R8),
-			BPF_ALU64_REG(BPF_ADD, R0, R9),
-			BPF_ALU64_IMM(BPF_ADD, R0, 0xfefe),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfefe } }
-	},
-	{	/* Mainly checking JIT here. */
-		"MOV REG32",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xffffffffffffffffLL),
-			BPF_MOV64_REG(R1, R0),
-			BPF_MOV64_REG(R2, R1),
-			BPF_MOV64_REG(R3, R2),
-			BPF_MOV64_REG(R4, R3),
-			BPF_MOV64_REG(R5, R4),
-			BPF_MOV64_REG(R6, R5),
-			BPF_MOV64_REG(R7, R6),
-			BPF_MOV64_REG(R8, R7),
-			BPF_MOV64_REG(R9, R8),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0),
-			BPF_ALU32_IMM(BPF_MOV, R2, 0),
-			BPF_ALU32_IMM(BPF_MOV, R3, 0),
-			BPF_ALU32_IMM(BPF_MOV, R4, 0),
-			BPF_ALU32_IMM(BPF_MOV, R5, 0),
-			BPF_ALU32_IMM(BPF_MOV, R6, 0),
-			BPF_ALU32_IMM(BPF_MOV, R7, 0),
-			BPF_ALU32_IMM(BPF_MOV, R8, 0),
-			BPF_ALU32_IMM(BPF_MOV, R9, 0),
-			BPF_ALU64_REG(BPF_ADD, R0, R0),
-			BPF_ALU64_REG(BPF_ADD, R0, R1),
-			BPF_ALU64_REG(BPF_ADD, R0, R2),
-			BPF_ALU64_REG(BPF_ADD, R0, R3),
-			BPF_ALU64_REG(BPF_ADD, R0, R4),
-			BPF_ALU64_REG(BPF_ADD, R0, R5),
-			BPF_ALU64_REG(BPF_ADD, R0, R6),
-			BPF_ALU64_REG(BPF_ADD, R0, R7),
-			BPF_ALU64_REG(BPF_ADD, R0, R8),
-			BPF_ALU64_REG(BPF_ADD, R0, R9),
-			BPF_ALU64_IMM(BPF_ADD, R0, 0xfefe),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfefe } }
-	},
-	{	/* Mainly checking JIT here. */
-		"LD IMM64",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xffffffffffffffffLL),
-			BPF_MOV64_REG(R1, R0),
-			BPF_MOV64_REG(R2, R1),
-			BPF_MOV64_REG(R3, R2),
-			BPF_MOV64_REG(R4, R3),
-			BPF_MOV64_REG(R5, R4),
-			BPF_MOV64_REG(R6, R5),
-			BPF_MOV64_REG(R7, R6),
-			BPF_MOV64_REG(R8, R7),
-			BPF_MOV64_REG(R9, R8),
-			BPF_LD_IMM64(R0, 0x0LL),
-			BPF_LD_IMM64(R1, 0x0LL),
-			BPF_LD_IMM64(R2, 0x0LL),
-			BPF_LD_IMM64(R3, 0x0LL),
-			BPF_LD_IMM64(R4, 0x0LL),
-			BPF_LD_IMM64(R5, 0x0LL),
-			BPF_LD_IMM64(R6, 0x0LL),
-			BPF_LD_IMM64(R7, 0x0LL),
-			BPF_LD_IMM64(R8, 0x0LL),
-			BPF_LD_IMM64(R9, 0x0LL),
-			BPF_ALU64_REG(BPF_ADD, R0, R0),
-			BPF_ALU64_REG(BPF_ADD, R0, R1),
-			BPF_ALU64_REG(BPF_ADD, R0, R2),
-			BPF_ALU64_REG(BPF_ADD, R0, R3),
-			BPF_ALU64_REG(BPF_ADD, R0, R4),
-			BPF_ALU64_REG(BPF_ADD, R0, R5),
-			BPF_ALU64_REG(BPF_ADD, R0, R6),
-			BPF_ALU64_REG(BPF_ADD, R0, R7),
-			BPF_ALU64_REG(BPF_ADD, R0, R8),
-			BPF_ALU64_REG(BPF_ADD, R0, R9),
-			BPF_ALU64_IMM(BPF_ADD, R0, 0xfefe),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfefe } }
-	},
-	{
-		"INT: ALU MIX",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 11),
-			BPF_ALU64_IMM(BPF_ADD, R0, -1),
-			BPF_ALU64_IMM(BPF_MOV, R2, 2),
-			BPF_ALU64_IMM(BPF_XOR, R2, 3),
-			BPF_ALU64_REG(BPF_DIV, R0, R2),
-			BPF_JMP_IMM(BPF_JEQ, R0, 10, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_IMM(BPF_MOD, R0, 3),
-			BPF_JMP_IMM(BPF_JEQ, R0, 1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_IMM(BPF_MOV, R0, -1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } }
-	},
-	{
-		"INT: shifts by register",
-		.u.insns_int = {
-			BPF_MOV64_IMM(R0, -1234),
-			BPF_MOV64_IMM(R1, 1),
-			BPF_ALU32_REG(BPF_RSH, R0, R1),
-			BPF_JMP_IMM(BPF_JEQ, R0, 0x7ffffd97, 1),
-			BPF_EXIT_INSN(),
-			BPF_MOV64_IMM(R2, 1),
-			BPF_ALU64_REG(BPF_LSH, R0, R2),
-			BPF_MOV32_IMM(R4, -1234),
-			BPF_JMP_REG(BPF_JEQ, R0, R4, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_IMM(BPF_AND, R4, 63),
-			BPF_ALU64_REG(BPF_LSH, R0, R4), /* R0 <= 46 */
-			BPF_MOV64_IMM(R3, 47),
-			BPF_ALU64_REG(BPF_ARSH, R0, R3),
-			BPF_JMP_IMM(BPF_JEQ, R0, -617, 1),
-			BPF_EXIT_INSN(),
-			BPF_MOV64_IMM(R2, 1),
-			BPF_ALU64_REG(BPF_LSH, R4, R2), /* R4 = 46 << 1 */
-			BPF_JMP_IMM(BPF_JEQ, R4, 92, 1),
-			BPF_EXIT_INSN(),
-			BPF_MOV64_IMM(R4, 4),
-			BPF_ALU64_REG(BPF_LSH, R4, R4), /* R4 = 4 << 4 */
-			BPF_JMP_IMM(BPF_JEQ, R4, 64, 1),
-			BPF_EXIT_INSN(),
-			BPF_MOV64_IMM(R4, 5),
-			BPF_ALU32_REG(BPF_LSH, R4, R4), /* R4 = 5 << 5 */
-			BPF_JMP_IMM(BPF_JEQ, R4, 160, 1),
-			BPF_EXIT_INSN(),
-			BPF_MOV64_IMM(R0, -1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } }
-	},
-#ifdef CONFIG_32BIT
-	{
-		"INT: 32-bit context pointer word order and zero-extension",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_JMP32_IMM(BPF_JEQ, R1, 0, 3),
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),
-			BPF_JMP32_IMM(BPF_JNE, R1, 0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-#endif
-	{
-		"check: missing ret",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 1),
-		},
-		CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-		{ },
-		{ },
-		.fill_helper = NULL,
-		.expected_errcode = -EINVAL,
-	},
-	{
-		"check: div_k_0",
-		.u.insns = {
-			BPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 0),
-			BPF_STMT(BPF_RET | BPF_K, 0)
-		},
-		CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-		{ },
-		{ },
-		.fill_helper = NULL,
-		.expected_errcode = -EINVAL,
-	},
-	{
-		"check: unknown insn",
-		.u.insns = {
-			/* seccomp insn, rejected in socket filter */
-			BPF_STMT(BPF_LDX | BPF_W | BPF_ABS, 0),
-			BPF_STMT(BPF_RET | BPF_K, 0)
-		},
-		CLASSIC | FLAG_EXPECTED_FAIL,
-		{ },
-		{ },
-		.fill_helper = NULL,
-		.expected_errcode = -EINVAL,
-	},
-	{
-		"check: out of range spill/fill",
-		.u.insns = {
-			BPF_STMT(BPF_STX, 16),
-			BPF_STMT(BPF_RET | BPF_K, 0)
-		},
-		CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-		{ },
-		{ },
-		.fill_helper = NULL,
-		.expected_errcode = -EINVAL,
-	},
-	{
-		"JUMPS + HOLES",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_JUMP(BPF_JMP | BPF_JGE, 0, 13, 15),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ, 0x90c2894d, 3, 4),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ, 0x90c2894d, 1, 2),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_JUMP(BPF_JMP | BPF_JGE, 0, 14, 15),
-			BPF_JUMP(BPF_JMP | BPF_JGE, 0, 13, 14),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ, 0x2ac28349, 2, 3),
-			BPF_JUMP(BPF_JMP | BPF_JEQ, 0x2ac28349, 1, 2),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_JUMP(BPF_JMP | BPF_JGE, 0, 14, 15),
-			BPF_JUMP(BPF_JMP | BPF_JGE, 0, 13, 14),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ, 0x90d2ff41, 2, 3),
-			BPF_JUMP(BPF_JMP | BPF_JEQ, 0x90d2ff41, 1, 2),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0),
-		},
-		CLASSIC,
-		{ 0x00, 0x1b, 0x21, 0x3c, 0x9d, 0xf8,
-		  0x90, 0xe2, 0xba, 0x0a, 0x56, 0xb4,
-		  0x08, 0x00,
-		  0x45, 0x00, 0x00, 0x28, 0x00, 0x00,
-		  0x20, 0x00, 0x40, 0x11, 0x00, 0x00, /* IP header */
-		  0xc0, 0xa8, 0x33, 0x01,
-		  0xc0, 0xa8, 0x33, 0x02,
-		  0xbb, 0xb6,
-		  0xa9, 0xfa,
-		  0x00, 0x14, 0x00, 0x00,
-		  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-		  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-		  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-		  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-		  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-		  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-		  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-		  0xcc, 0xcc, 0xcc, 0xcc },
-		{ { 88, 0x001b } }
-	},
-	{
-		"check: RET X",
-		.u.insns = {
-			BPF_STMT(BPF_RET | BPF_X, 0),
-		},
-		CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-		{ },
-		{ },
-		.fill_helper = NULL,
-		.expected_errcode = -EINVAL,
-	},
-	{
-		"check: LDX + RET X",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 42),
-			BPF_STMT(BPF_RET | BPF_X, 0),
-		},
-		CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-		{ },
-		{ },
-		.fill_helper = NULL,
-		.expected_errcode = -EINVAL,
-	},
-	{	/* Mainly checking JIT here. */
-		"M[]: alt STX + LDX",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 100),
-			BPF_STMT(BPF_STX, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 0),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 1),
-			BPF_STMT(BPF_LDX | BPF_MEM, 1),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 2),
-			BPF_STMT(BPF_LDX | BPF_MEM, 2),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 3),
-			BPF_STMT(BPF_LDX | BPF_MEM, 3),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 4),
-			BPF_STMT(BPF_LDX | BPF_MEM, 4),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 5),
-			BPF_STMT(BPF_LDX | BPF_MEM, 5),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 6),
-			BPF_STMT(BPF_LDX | BPF_MEM, 6),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 7),
-			BPF_STMT(BPF_LDX | BPF_MEM, 7),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 8),
-			BPF_STMT(BPF_LDX | BPF_MEM, 8),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 9),
-			BPF_STMT(BPF_LDX | BPF_MEM, 9),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 10),
-			BPF_STMT(BPF_LDX | BPF_MEM, 10),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 11),
-			BPF_STMT(BPF_LDX | BPF_MEM, 11),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 12),
-			BPF_STMT(BPF_LDX | BPF_MEM, 12),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 13),
-			BPF_STMT(BPF_LDX | BPF_MEM, 13),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 14),
-			BPF_STMT(BPF_LDX | BPF_MEM, 14),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 15),
-			BPF_STMT(BPF_LDX | BPF_MEM, 15),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 116 } },
-	},
-	{	/* Mainly checking JIT here. */
-		"M[]: full STX + full LDX",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xbadfeedb),
-			BPF_STMT(BPF_STX, 0),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xecabedae),
-			BPF_STMT(BPF_STX, 1),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xafccfeaf),
-			BPF_STMT(BPF_STX, 2),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xbffdcedc),
-			BPF_STMT(BPF_STX, 3),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xfbbbdccb),
-			BPF_STMT(BPF_STX, 4),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xfbabcbda),
-			BPF_STMT(BPF_STX, 5),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xaedecbdb),
-			BPF_STMT(BPF_STX, 6),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xadebbade),
-			BPF_STMT(BPF_STX, 7),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xfcfcfaec),
-			BPF_STMT(BPF_STX, 8),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xbcdddbdc),
-			BPF_STMT(BPF_STX, 9),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xfeefdfac),
-			BPF_STMT(BPF_STX, 10),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xcddcdeea),
-			BPF_STMT(BPF_STX, 11),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xaccfaebb),
-			BPF_STMT(BPF_STX, 12),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xbdcccdcf),
-			BPF_STMT(BPF_STX, 13),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xaaedecde),
-			BPF_STMT(BPF_STX, 14),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xfaeacdad),
-			BPF_STMT(BPF_STX, 15),
-			BPF_STMT(BPF_LDX | BPF_MEM, 0),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 1),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 2),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 3),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 4),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 5),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 6),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 7),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 8),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 9),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 10),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 11),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 12),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 13),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 14),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 15),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0x2a5a5e5 } },
-	},
-	{
-		"check: SKF_AD_MAX",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_MAX),
-			BPF_STMT(BPF_RET | BPF_A, 0),
-		},
-		CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-		{ },
-		{ },
-		.fill_helper = NULL,
-		.expected_errcode = -EINVAL,
-	},
-	{	/* Passes checker but fails during runtime. */
-		"LD [SKF_AD_OFF-1]",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF - 1),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-		},
-		CLASSIC,
-		{ },
-		{ { 1, 0 } },
-	},
-	{
-		"load 64-bit immediate",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x567800001234LL),
-			BPF_MOV64_REG(R2, R1),
-			BPF_MOV64_REG(R3, R2),
-			BPF_ALU64_IMM(BPF_RSH, R2, 32),
-			BPF_ALU64_IMM(BPF_LSH, R3, 32),
-			BPF_ALU64_IMM(BPF_RSH, R3, 32),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_JMP_IMM(BPF_JEQ, R2, 0x5678, 1),
-			BPF_EXIT_INSN(),
-			BPF_JMP_IMM(BPF_JEQ, R3, 0x1234, 1),
-			BPF_EXIT_INSN(),
-			BPF_LD_IMM64(R0, 0x1ffffffffLL),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32), /* R0 = 1 */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	/* BPF_ALU | BPF_MOV | BPF_X */
-	{
-		"ALU_MOV_X: dst = 2",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU32_REG(BPF_MOV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU_MOV_X: dst = 4294967295",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R1, 4294967295U),
-			BPF_ALU32_REG(BPF_MOV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 4294967295U } },
-	},
-	{
-		"ALU64_MOV_X: dst = 2",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_MOV_X: dst = 4294967295",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R1, 4294967295U),
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 4294967295U } },
-	},
-	/* BPF_ALU | BPF_MOV | BPF_K */
-	{
-		"ALU_MOV_K: dst = 2",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU_MOV_K: dst = 4294967295",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 4294967295U),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 4294967295U } },
-	},
-	{
-		"ALU_MOV_K: 0x0000ffffffff0000 = 0x00000000ffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000ffffffff0000LL),
-			BPF_LD_IMM64(R3, 0x00000000ffffffffLL),
-			BPF_ALU32_IMM(BPF_MOV, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU_MOV_K: small negative",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123 } }
-	},
-	{
-		"ALU_MOV_K: small negative zero extension",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU_MOV_K: large negative",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123456789),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123456789 } }
-	},
-	{
-		"ALU_MOV_K: large negative zero extension",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123456789),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU64_MOV_K: dst = 2",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_MOV_K: dst = 2147483647",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 2147483647),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2147483647 } },
-	},
-	{
-		"ALU64_OR_K: dst = 0x0",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000ffffffff0000LL),
-			BPF_LD_IMM64(R3, 0x0),
-			BPF_ALU64_IMM(BPF_MOV, R2, 0x0),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_MOV_K: dst = -1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000ffffffff0000LL),
-			BPF_LD_IMM64(R3, 0xffffffffffffffffLL),
-			BPF_ALU64_IMM(BPF_MOV, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_MOV_K: small negative",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, -123),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123 } }
-	},
-	{
-		"ALU64_MOV_K: small negative sign extension",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, -123),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } }
-	},
-	{
-		"ALU64_MOV_K: large negative",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, -123456789),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123456789 } }
-	},
-	{
-		"ALU64_MOV_K: large negative sign extension",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, -123456789),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } }
-	},
-	/* MOVSX32 */
-	{
-		"ALU_MOVSX | BPF_B",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x00000000ffffffefLL),
-			BPF_LD_IMM64(R3, 0xdeadbeefdeadbeefLL),
-			BPF_MOVSX32_REG(R1, R3, 8),
-			BPF_JMP_REG(BPF_JEQ, R2, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU_MOVSX | BPF_H",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x00000000ffffbeefLL),
-			BPF_LD_IMM64(R3, 0xdeadbeefdeadbeefLL),
-			BPF_MOVSX32_REG(R1, R3, 16),
-			BPF_JMP_REG(BPF_JEQ, R2, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	/* MOVSX64 REG */
-	{
-		"ALU64_MOVSX | BPF_B",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0xffffffffffffffefLL),
-			BPF_LD_IMM64(R3, 0xdeadbeefdeadbeefLL),
-			BPF_MOVSX64_REG(R1, R3, 8),
-			BPF_JMP_REG(BPF_JEQ, R2, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_MOVSX | BPF_H",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0xffffffffffffbeefLL),
-			BPF_LD_IMM64(R3, 0xdeadbeefdeadbeefLL),
-			BPF_MOVSX64_REG(R1, R3, 16),
-			BPF_JMP_REG(BPF_JEQ, R2, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_MOVSX | BPF_W",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0xffffffffdeadbeefLL),
-			BPF_LD_IMM64(R3, 0xdeadbeefdeadbeefLL),
-			BPF_MOVSX64_REG(R1, R3, 32),
-			BPF_JMP_REG(BPF_JEQ, R2, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	/* BPF_ALU | BPF_ADD | BPF_X */
-	{
-		"ALU_ADD_X: 1 + 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU32_REG(BPF_ADD, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_ADD_X: 1 + 4294967294 = 4294967295",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 4294967294U),
-			BPF_ALU32_REG(BPF_ADD, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 4294967295U } },
-	},
-	{
-		"ALU_ADD_X: 2 + 4294967294 = 0",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_LD_IMM64(R1, 4294967294U),
-			BPF_ALU32_REG(BPF_ADD, R0, R1),
-			BPF_JMP_IMM(BPF_JEQ, R0, 0, 2),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_ADD_X: 1 + 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU64_REG(BPF_ADD, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_ADD_X: 1 + 4294967294 = 4294967295",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 4294967294U),
-			BPF_ALU64_REG(BPF_ADD, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 4294967295U } },
-	},
-	{
-		"ALU64_ADD_X: 2 + 4294967294 = 4294967296",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_LD_IMM64(R1, 4294967294U),
-			BPF_LD_IMM64(R2, 4294967296ULL),
-			BPF_ALU64_REG(BPF_ADD, R0, R1),
-			BPF_JMP_REG(BPF_JEQ, R0, R2, 2),
-			BPF_MOV32_IMM(R0, 0),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_ALU | BPF_ADD | BPF_K */
-	{
-		"ALU_ADD_K: 1 + 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_ADD, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_ADD_K: 3 + 0 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_ADD, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_ADD_K: 1 + 4294967294 = 4294967295",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_ADD, R0, 4294967294U),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 4294967295U } },
-	},
-	{
-		"ALU_ADD_K: 4294967294 + 2 = 0",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967294U),
-			BPF_ALU32_IMM(BPF_ADD, R0, 2),
-			BPF_JMP_IMM(BPF_JEQ, R0, 0, 2),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU_ADD_K: 0 + (-1) = 0x00000000ffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0x00000000ffffffff),
-			BPF_ALU32_IMM(BPF_ADD, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU_ADD_K: 0 + 0xffff = 0xffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0xffff),
-			BPF_ALU32_IMM(BPF_ADD, R2, 0xffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU_ADD_K: 0 + 0x7fffffff = 0x7fffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0x7fffffff),
-			BPF_ALU32_IMM(BPF_ADD, R2, 0x7fffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU_ADD_K: 0 + 0x80000000 = 0x80000000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0x80000000),
-			BPF_ALU32_IMM(BPF_ADD, R2, 0x80000000),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU_ADD_K: 0 + 0x80008000 = 0x80008000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0x80008000),
-			BPF_ALU32_IMM(BPF_ADD, R2, 0x80008000),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_ADD_K: 1 + 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU64_IMM(BPF_ADD, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_ADD_K: 3 + 0 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU64_IMM(BPF_ADD, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_ADD_K: 1 + 2147483646 = 2147483647",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU64_IMM(BPF_ADD, R0, 2147483646),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2147483647 } },
-	},
-	{
-		"ALU64_ADD_K: 4294967294 + 2 = 4294967296",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967294U),
-			BPF_LD_IMM64(R1, 4294967296ULL),
-			BPF_ALU64_IMM(BPF_ADD, R0, 2),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_ADD_K: 2147483646 + -2147483647 = -1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2147483646),
-			BPF_ALU64_IMM(BPF_ADD, R0, -2147483647),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } },
-	},
-	{
-		"ALU64_ADD_K: 1 + 0 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x1),
-			BPF_LD_IMM64(R3, 0x1),
-			BPF_ALU64_IMM(BPF_ADD, R2, 0x0),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_ADD_K: 0 + (-1) = 0xffffffffffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0xffffffffffffffffLL),
-			BPF_ALU64_IMM(BPF_ADD, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_ADD_K: 0 + 0xffff = 0xffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0xffff),
-			BPF_ALU64_IMM(BPF_ADD, R2, 0xffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_ADD_K: 0 + 0x7fffffff = 0x7fffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0x7fffffff),
-			BPF_ALU64_IMM(BPF_ADD, R2, 0x7fffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_ADD_K: 0 + 0x80000000 = 0xffffffff80000000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0xffffffff80000000LL),
-			BPF_ALU64_IMM(BPF_ADD, R2, 0x80000000),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU_ADD_K: 0 + 0x80008000 = 0xffffffff80008000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0xffffffff80008000LL),
-			BPF_ALU64_IMM(BPF_ADD, R2, 0x80008000),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	/* BPF_ALU | BPF_SUB | BPF_X */
-	{
-		"ALU_SUB_X: 3 - 1 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_MOV, R1, 1),
-			BPF_ALU32_REG(BPF_SUB, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU_SUB_X: 4294967295 - 4294967294 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967295U),
-			BPF_ALU32_IMM(BPF_MOV, R1, 4294967294U),
-			BPF_ALU32_REG(BPF_SUB, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_SUB_X: 3 - 1 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_MOV, R1, 1),
-			BPF_ALU64_REG(BPF_SUB, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_SUB_X: 4294967295 - 4294967294 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967295U),
-			BPF_ALU32_IMM(BPF_MOV, R1, 4294967294U),
-			BPF_ALU64_REG(BPF_SUB, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_ALU | BPF_SUB | BPF_K */
-	{
-		"ALU_SUB_K: 3 - 1 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_SUB, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU_SUB_K: 3 - 0 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_SUB, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_SUB_K: 4294967295 - 4294967294 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967295U),
-			BPF_ALU32_IMM(BPF_SUB, R0, 4294967294U),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_SUB_K: 3 - 1 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU64_IMM(BPF_SUB, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_SUB_K: 3 - 0 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU64_IMM(BPF_SUB, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_SUB_K: 4294967294 - 4294967295 = -1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967294U),
-			BPF_ALU64_IMM(BPF_SUB, R0, 4294967295U),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } },
-	},
-	{
-		"ALU64_ADD_K: 2147483646 - 2147483647 = -1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2147483646),
-			BPF_ALU64_IMM(BPF_SUB, R0, 2147483647),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } },
-	},
-	/* BPF_ALU | BPF_MUL | BPF_X */
-	{
-		"ALU_MUL_X: 2 * 3 = 6",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 3),
-			BPF_ALU32_REG(BPF_MUL, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 6 } },
-	},
-	{
-		"ALU_MUL_X: 2 * 0x7FFFFFF8 = 0xFFFFFFF0",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0x7FFFFFF8),
-			BPF_ALU32_REG(BPF_MUL, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xFFFFFFF0 } },
-	},
-	{
-		"ALU_MUL_X: -1 * -1 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -1),
-			BPF_ALU32_IMM(BPF_MOV, R1, -1),
-			BPF_ALU32_REG(BPF_MUL, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_MUL_X: 2 * 3 = 6",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 3),
-			BPF_ALU64_REG(BPF_MUL, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 6 } },
-	},
-	{
-		"ALU64_MUL_X: 1 * 2147483647 = 2147483647",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2147483647),
-			BPF_ALU64_REG(BPF_MUL, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2147483647 } },
-	},
-	{
-		"ALU64_MUL_X: 64x64 multiply, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0fedcba987654321LL),
-			BPF_LD_IMM64(R1, 0x123456789abcdef0LL),
-			BPF_ALU64_REG(BPF_MUL, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xe5618cf0 } }
-	},
-	{
-		"ALU64_MUL_X: 64x64 multiply, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0fedcba987654321LL),
-			BPF_LD_IMM64(R1, 0x123456789abcdef0LL),
-			BPF_ALU64_REG(BPF_MUL, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x2236d88f } }
-	},
-	/* BPF_ALU | BPF_MUL | BPF_K */
-	{
-		"ALU_MUL_K: 2 * 3 = 6",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU32_IMM(BPF_MUL, R0, 3),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 6 } },
-	},
-	{
-		"ALU_MUL_K: 3 * 1 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_MUL, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_MUL_K: 2 * 0x7FFFFFF8 = 0xFFFFFFF0",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU32_IMM(BPF_MUL, R0, 0x7FFFFFF8),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xFFFFFFF0 } },
-	},
-	{
-		"ALU_MUL_K: 1 * (-1) = 0x00000000ffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x1),
-			BPF_LD_IMM64(R3, 0x00000000ffffffff),
-			BPF_ALU32_IMM(BPF_MUL, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_MUL_K: 2 * 3 = 6",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU64_IMM(BPF_MUL, R0, 3),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 6 } },
-	},
-	{
-		"ALU64_MUL_K: 3 * 1 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU64_IMM(BPF_MUL, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_MUL_K: 1 * 2147483647 = 2147483647",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU64_IMM(BPF_MUL, R0, 2147483647),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2147483647 } },
-	},
-	{
-		"ALU64_MUL_K: 1 * -2147483647 = -2147483647",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU64_IMM(BPF_MUL, R0, -2147483647),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -2147483647 } },
-	},
-	{
-		"ALU64_MUL_K: 1 * (-1) = 0xffffffffffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x1),
-			BPF_LD_IMM64(R3, 0xffffffffffffffffLL),
-			BPF_ALU64_IMM(BPF_MUL, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_MUL_K: 64x32 multiply, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_MUL, R0, 0x12345678),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xe242d208 } }
-	},
-	{
-		"ALU64_MUL_K: 64x32 multiply, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_MUL, R0, 0x12345678),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xc28f5c28 } }
-	},
-	/* BPF_ALU | BPF_DIV | BPF_X */
-	{
-		"ALU_DIV_X: 6 / 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 6),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU32_REG(BPF_DIV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_DIV_X: 4294967295 / 4294967295 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967295U),
-			BPF_ALU32_IMM(BPF_MOV, R1, 4294967295U),
-			BPF_ALU32_REG(BPF_DIV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_DIV_X: 6 / 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 6),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU64_REG(BPF_DIV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_DIV_X: 2147483647 / 2147483647 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2147483647),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2147483647),
-			BPF_ALU64_REG(BPF_DIV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_DIV_X: 0xffffffffffffffff / (-1) = 0x0000000000000001",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0xffffffffffffffffLL),
-			BPF_LD_IMM64(R4, 0xffffffffffffffffLL),
-			BPF_LD_IMM64(R3, 0x0000000000000001LL),
-			BPF_ALU64_REG(BPF_DIV, R2, R4),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	/* BPF_ALU | BPF_DIV | BPF_K */
-	{
-		"ALU_DIV_K: 6 / 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 6),
-			BPF_ALU32_IMM(BPF_DIV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_DIV_K: 3 / 1 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_DIV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_DIV_K: 4294967295 / 4294967295 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967295U),
-			BPF_ALU32_IMM(BPF_DIV, R0, 4294967295U),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU_DIV_K: 0xffffffffffffffff / (-1) = 0x1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0xffffffffffffffffLL),
-			BPF_LD_IMM64(R3, 0x1UL),
-			BPF_ALU32_IMM(BPF_DIV, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_DIV_K: 6 / 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 6),
-			BPF_ALU64_IMM(BPF_DIV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_DIV_K: 3 / 1 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU64_IMM(BPF_DIV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_DIV_K: 2147483647 / 2147483647 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2147483647),
-			BPF_ALU64_IMM(BPF_DIV, R0, 2147483647),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_DIV_K: 0xffffffffffffffff / (-1) = 0x0000000000000001",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0xffffffffffffffffLL),
-			BPF_LD_IMM64(R3, 0x0000000000000001LL),
-			BPF_ALU64_IMM(BPF_DIV, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	/* BPF_ALU | BPF_MOD | BPF_X */
-	{
-		"ALU_MOD_X: 3 % 2 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU32_REG(BPF_MOD, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU_MOD_X: 4294967295 % 4294967293 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967295U),
-			BPF_ALU32_IMM(BPF_MOV, R1, 4294967293U),
-			BPF_ALU32_REG(BPF_MOD, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_MOD_X: 3 % 2 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU64_REG(BPF_MOD, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_MOD_X: 2147483647 % 2147483645 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2147483647),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2147483645),
-			BPF_ALU64_REG(BPF_MOD, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	/* BPF_ALU | BPF_MOD | BPF_K */
-	{
-		"ALU_MOD_K: 3 % 2 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_MOD, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU_MOD_K: 3 % 1 = 0",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_MOD, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"ALU_MOD_K: 4294967295 % 4294967293 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967295U),
-			BPF_ALU32_IMM(BPF_MOD, R0, 4294967293U),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_MOD_K: 3 % 2 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU64_IMM(BPF_MOD, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_MOD_K: 3 % 1 = 0",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU64_IMM(BPF_MOD, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"ALU64_MOD_K: 2147483647 % 2147483645 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2147483647),
-			BPF_ALU64_IMM(BPF_MOD, R0, 2147483645),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	/* BPF_ALU | BPF_DIV | BPF_X off=1 (SDIV) */
-	{
-		"ALU_SDIV_X: -6 / 2 = -3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -6),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU32_REG_OFF(BPF_DIV, R0, R1, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -3 } },
-	},
-	/* BPF_ALU | BPF_DIV | BPF_K off=1 (SDIV) */
-	{
-		"ALU_SDIV_K: -6 / 2 = -3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -6),
-			BPF_ALU32_IMM_OFF(BPF_DIV, R0, 2, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -3 } },
-	},
-	/* BPF_ALU64 | BPF_DIV | BPF_X off=1 (SDIV64) */
-	{
-		"ALU64_SDIV_X: -6 / 2 = -3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -6),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU64_REG_OFF(BPF_DIV, R0, R1, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -3 } },
-	},
-	/* BPF_ALU64 | BPF_DIV | BPF_K off=1 (SDIV64) */
-	{
-		"ALU64_SDIV_K: -6 / 2 = -3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -6),
-			BPF_ALU64_IMM_OFF(BPF_DIV, R0, 2, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -3 } },
-	},
-	/* BPF_ALU | BPF_MOD | BPF_X off=1 (SMOD) */
-	{
-		"ALU_SMOD_X: -7 % 2 = -1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -7),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU32_REG_OFF(BPF_MOD, R0, R1, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } },
-	},
-	/* BPF_ALU | BPF_MOD | BPF_K off=1 (SMOD) */
-	{
-		"ALU_SMOD_K: -7 % 2 = -1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -7),
-			BPF_ALU32_IMM_OFF(BPF_MOD, R0, 2, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } },
-	},
-	/* BPF_ALU64 | BPF_MOD | BPF_X off=1 (SMOD64) */
-	{
-		"ALU64_SMOD_X: -7 % 2 = -1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -7),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU64_REG_OFF(BPF_MOD, R0, R1, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } },
-	},
-	/* BPF_ALU64 | BPF_MOD | BPF_K off=1 (SMOD64) */
-	{
-		"ALU64_SMOD_K: -7 % 2 = -1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -7),
-			BPF_ALU64_IMM_OFF(BPF_MOD, R0, 2, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } },
-	},
-	/* BPF_ALU | BPF_AND | BPF_X */
-	{
-		"ALU_AND_X: 3 & 2 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU32_REG(BPF_AND, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU_AND_X: 0xffffffff & 0xffffffff = 0xffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xffffffff),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
-			BPF_ALU32_REG(BPF_AND, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-	},
-	{
-		"ALU64_AND_X: 3 & 2 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU64_REG(BPF_AND, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_AND_X: 0xffffffff & 0xffffffff = 0xffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xffffffff),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
-			BPF_ALU64_REG(BPF_AND, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-	},
-	/* BPF_ALU | BPF_AND | BPF_K */
-	{
-		"ALU_AND_K: 3 & 2 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_AND, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU_AND_K: 0xffffffff & 0xffffffff = 0xffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xffffffff),
-			BPF_ALU32_IMM(BPF_AND, R0, 0xffffffff),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-	},
-	{
-		"ALU_AND_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x01020304),
-			BPF_ALU32_IMM(BPF_AND, R0, 15),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 4 } }
-	},
-	{
-		"ALU_AND_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xf1f2f3f4),
-			BPF_ALU32_IMM(BPF_AND, R0, 0xafbfcfdf),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xa1b2c3d4 } }
-	},
-	{
-		"ALU_AND_K: Zero extension",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_LD_IMM64(R1, 0x0000000080a0c0e0LL),
-			BPF_ALU32_IMM(BPF_AND, R0, 0xf0f0f0f0),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		"ALU64_AND_K: 3 & 2 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU64_IMM(BPF_AND, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_AND_K: 0xffffffff & 0xffffffff = 0xffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xffffffff),
-			BPF_ALU64_IMM(BPF_AND, R0, 0xffffffff),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-	},
-	{
-		"ALU64_AND_K: 0x0000ffffffff0000 & 0x0 = 0x0000000000000000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000ffffffff0000LL),
-			BPF_LD_IMM64(R3, 0x0000000000000000LL),
-			BPF_ALU64_IMM(BPF_AND, R2, 0x0),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_AND_K: 0x0000ffffffff0000 & -1 = 0x0000ffffffff0000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000ffffffff0000LL),
-			BPF_LD_IMM64(R3, 0x0000ffffffff0000LL),
-			BPF_ALU64_IMM(BPF_AND, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_AND_K: 0xffffffffffffffff & -1 = 0xffffffffffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0xffffffffffffffffLL),
-			BPF_LD_IMM64(R3, 0xffffffffffffffffLL),
-			BPF_ALU64_IMM(BPF_AND, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_AND_K: Sign extension 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_LD_IMM64(R1, 0x00000000090b0d0fLL),
-			BPF_ALU64_IMM(BPF_AND, R0, 0x0f0f0f0f),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		"ALU64_AND_K: Sign extension 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_LD_IMM64(R1, 0x0123456780a0c0e0LL),
-			BPF_ALU64_IMM(BPF_AND, R0, 0xf0f0f0f0),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	/* BPF_ALU | BPF_OR | BPF_X */
-	{
-		"ALU_OR_X: 1 | 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU32_REG(BPF_OR, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_OR_X: 0x0 | 0xffffffff = 0xffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
-			BPF_ALU32_REG(BPF_OR, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-	},
-	{
-		"ALU64_OR_X: 1 | 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU64_REG(BPF_OR, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_OR_X: 0 | 0xffffffff = 0xffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
-			BPF_ALU64_REG(BPF_OR, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-	},
-	/* BPF_ALU | BPF_OR | BPF_K */
-	{
-		"ALU_OR_K: 1 | 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_OR, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_OR_K: 0 & 0xffffffff = 0xffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_ALU32_IMM(BPF_OR, R0, 0xffffffff),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-	},
-	{
-		"ALU_OR_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x01020304),
-			BPF_ALU32_IMM(BPF_OR, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x01020305 } }
-	},
-	{
-		"ALU_OR_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x01020304),
-			BPF_ALU32_IMM(BPF_OR, R0, 0xa0b0c0d0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xa1b2c3d4 } }
-	},
-	{
-		"ALU_OR_K: Zero extension",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_LD_IMM64(R1, 0x00000000f9fbfdffLL),
-			BPF_ALU32_IMM(BPF_OR, R0, 0xf0f0f0f0),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		"ALU64_OR_K: 1 | 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU64_IMM(BPF_OR, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_OR_K: 0 & 0xffffffff = 0xffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_ALU64_IMM(BPF_OR, R0, 0xffffffff),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-	},
-	{
-		"ALU64_OR_K: 0x0000ffffffff0000 | 0x0 = 0x0000ffffffff0000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000ffffffff0000LL),
-			BPF_LD_IMM64(R3, 0x0000ffffffff0000LL),
-			BPF_ALU64_IMM(BPF_OR, R2, 0x0),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_OR_K: 0x0000ffffffff0000 | -1 = 0xffffffffffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000ffffffff0000LL),
-			BPF_LD_IMM64(R3, 0xffffffffffffffffLL),
-			BPF_ALU64_IMM(BPF_OR, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_OR_K: 0x000000000000000 | -1 = 0xffffffffffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000000000000000LL),
-			BPF_LD_IMM64(R3, 0xffffffffffffffffLL),
-			BPF_ALU64_IMM(BPF_OR, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_OR_K: Sign extension 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_LD_IMM64(R1, 0x012345678fafcfefLL),
-			BPF_ALU64_IMM(BPF_OR, R0, 0x0f0f0f0f),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		"ALU64_OR_K: Sign extension 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_LD_IMM64(R1, 0xfffffffff9fbfdffLL),
-			BPF_ALU64_IMM(BPF_OR, R0, 0xf0f0f0f0),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	/* BPF_ALU | BPF_XOR | BPF_X */
-	{
-		"ALU_XOR_X: 5 ^ 6 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 5),
-			BPF_ALU32_IMM(BPF_MOV, R1, 6),
-			BPF_ALU32_REG(BPF_XOR, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_XOR_X: 0x1 ^ 0xffffffff = 0xfffffffe",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
-			BPF_ALU32_REG(BPF_XOR, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } },
-	},
-	{
-		"ALU64_XOR_X: 5 ^ 6 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 5),
-			BPF_ALU32_IMM(BPF_MOV, R1, 6),
-			BPF_ALU64_REG(BPF_XOR, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_XOR_X: 1 ^ 0xffffffff = 0xfffffffe",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
-			BPF_ALU64_REG(BPF_XOR, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } },
-	},
-	/* BPF_ALU | BPF_XOR | BPF_K */
-	{
-		"ALU_XOR_K: 5 ^ 6 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 5),
-			BPF_ALU32_IMM(BPF_XOR, R0, 6),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_XOR_K: 1 ^ 0xffffffff = 0xfffffffe",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_XOR, R0, 0xffffffff),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } },
-	},
-	{
-		"ALU_XOR_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x01020304),
-			BPF_ALU32_IMM(BPF_XOR, R0, 15),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x0102030b } }
-	},
-	{
-		"ALU_XOR_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xf1f2f3f4),
-			BPF_ALU32_IMM(BPF_XOR, R0, 0xafbfcfdf),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x5e4d3c2b } }
-	},
-	{
-		"ALU_XOR_K: Zero extension",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_LD_IMM64(R1, 0x00000000795b3d1fLL),
-			BPF_ALU32_IMM(BPF_XOR, R0, 0xf0f0f0f0),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		"ALU64_XOR_K: 5 ^ 6 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 5),
-			BPF_ALU64_IMM(BPF_XOR, R0, 6),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_XOR_K: 1 ^ 0xffffffff = 0xfffffffe",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU64_IMM(BPF_XOR, R0, 0xffffffff),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } },
-	},
-	{
-		"ALU64_XOR_K: 0x0000ffffffff0000 ^ 0x0 = 0x0000ffffffff0000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000ffffffff0000LL),
-			BPF_LD_IMM64(R3, 0x0000ffffffff0000LL),
-			BPF_ALU64_IMM(BPF_XOR, R2, 0x0),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_XOR_K: 0x0000ffffffff0000 ^ -1 = 0xffff00000000ffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000ffffffff0000LL),
-			BPF_LD_IMM64(R3, 0xffff00000000ffffLL),
-			BPF_ALU64_IMM(BPF_XOR, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_XOR_K: 0x000000000000000 ^ -1 = 0xffffffffffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000000000000000LL),
-			BPF_LD_IMM64(R3, 0xffffffffffffffffLL),
-			BPF_ALU64_IMM(BPF_XOR, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_XOR_K: Sign extension 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_LD_IMM64(R1, 0x0123456786a4c2e0LL),
-			BPF_ALU64_IMM(BPF_XOR, R0, 0x0f0f0f0f),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		"ALU64_XOR_K: Sign extension 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_LD_IMM64(R1, 0xfedcba98795b3d1fLL),
-			BPF_ALU64_IMM(BPF_XOR, R0, 0xf0f0f0f0),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	/* BPF_ALU | BPF_LSH | BPF_X */
-	{
-		"ALU_LSH_X: 1 << 1 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 1),
-			BPF_ALU32_REG(BPF_LSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU_LSH_X: 1 << 31 = 0x80000000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 31),
-			BPF_ALU32_REG(BPF_LSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x80000000 } },
-	},
-	{
-		"ALU_LSH_X: 0x12345678 << 12 = 0x45678000",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x12345678),
-			BPF_ALU32_IMM(BPF_MOV, R1, 12),
-			BPF_ALU32_REG(BPF_LSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x45678000 } }
-	},
-	{
-		"ALU64_LSH_X: 1 << 1 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 1),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_LSH_X: 1 << 31 = 0x80000000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 31),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x80000000 } },
-	},
-	{
-		"ALU64_LSH_X: Shift < 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 12),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xbcdef000 } }
-	},
-	{
-		"ALU64_LSH_X: Shift < 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 12),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x3456789a } }
-	},
-	{
-		"ALU64_LSH_X: Shift > 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 36),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU64_LSH_X: Shift > 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 36),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x9abcdef0 } }
-	},
-	{
-		"ALU64_LSH_X: Shift == 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 32),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU64_LSH_X: Shift == 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 32),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } }
-	},
-	{
-		"ALU64_LSH_X: Zero shift, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } }
-	},
-	{
-		"ALU64_LSH_X: Zero shift, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x01234567 } }
-	},
-	/* BPF_ALU | BPF_LSH | BPF_K */
-	{
-		"ALU_LSH_K: 1 << 1 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_LSH, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU_LSH_K: 1 << 31 = 0x80000000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_LSH, R0, 31),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x80000000 } },
-	},
-	{
-		"ALU_LSH_K: 0x12345678 << 12 = 0x45678000",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x12345678),
-			BPF_ALU32_IMM(BPF_LSH, R0, 12),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x45678000 } }
-	},
-	{
-		"ALU_LSH_K: 0x12345678 << 0 = 0x12345678",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x12345678),
-			BPF_ALU32_IMM(BPF_LSH, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x12345678 } }
-	},
-	{
-		"ALU64_LSH_K: 1 << 1 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU64_IMM(BPF_LSH, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_LSH_K: 1 << 31 = 0x80000000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU64_IMM(BPF_LSH, R0, 31),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x80000000 } },
-	},
-	{
-		"ALU64_LSH_K: Shift < 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_LSH, R0, 12),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xbcdef000 } }
-	},
-	{
-		"ALU64_LSH_K: Shift < 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_LSH, R0, 12),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x3456789a } }
-	},
-	{
-		"ALU64_LSH_K: Shift > 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_LSH, R0, 36),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU64_LSH_K: Shift > 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_LSH, R0, 36),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x9abcdef0 } }
-	},
-	{
-		"ALU64_LSH_K: Shift == 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_LSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU64_LSH_K: Shift == 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_LSH, R0, 32),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } }
-	},
-	{
-		"ALU64_LSH_K: Zero shift",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_LSH, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } }
-	},
-	/* BPF_ALU | BPF_RSH | BPF_X */
-	{
-		"ALU_RSH_X: 2 >> 1 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 1),
-			BPF_ALU32_REG(BPF_RSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU_RSH_X: 0x80000000 >> 31 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x80000000),
-			BPF_ALU32_IMM(BPF_MOV, R1, 31),
-			BPF_ALU32_REG(BPF_RSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU_RSH_X: 0x12345678 >> 20 = 0x123",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x12345678),
-			BPF_ALU32_IMM(BPF_MOV, R1, 20),
-			BPF_ALU32_REG(BPF_RSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x123 } }
-	},
-	{
-		"ALU64_RSH_X: 2 >> 1 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 1),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_RSH_X: 0x80000000 >> 31 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x80000000),
-			BPF_ALU32_IMM(BPF_MOV, R1, 31),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_RSH_X: Shift < 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 12),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x56789abc } }
-	},
-	{
-		"ALU64_RSH_X: Shift < 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 12),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x00081234 } }
-	},
-	{
-		"ALU64_RSH_X: Shift > 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 36),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x08123456 } }
-	},
-	{
-		"ALU64_RSH_X: Shift > 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 36),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU64_RSH_X: Shift == 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 32),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x81234567 } }
-	},
-	{
-		"ALU64_RSH_X: Shift == 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 32),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU64_RSH_X: Zero shift, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } }
-	},
-	{
-		"ALU64_RSH_X: Zero shift, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x81234567 } }
-	},
-	/* BPF_ALU | BPF_RSH | BPF_K */
-	{
-		"ALU_RSH_K: 2 >> 1 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU32_IMM(BPF_RSH, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU_RSH_K: 0x80000000 >> 31 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x80000000),
-			BPF_ALU32_IMM(BPF_RSH, R0, 31),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU_RSH_K: 0x12345678 >> 20 = 0x123",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x12345678),
-			BPF_ALU32_IMM(BPF_RSH, R0, 20),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x123 } }
-	},
-	{
-		"ALU_RSH_K: 0x12345678 >> 0 = 0x12345678",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x12345678),
-			BPF_ALU32_IMM(BPF_RSH, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x12345678 } }
-	},
-	{
-		"ALU64_RSH_K: 2 >> 1 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU64_IMM(BPF_RSH, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_RSH_K: 0x80000000 >> 31 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x80000000),
-			BPF_ALU64_IMM(BPF_RSH, R0, 31),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_RSH_K: Shift < 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_RSH, R0, 12),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x56789abc } }
-	},
-	{
-		"ALU64_RSH_K: Shift < 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_RSH, R0, 12),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x00081234 } }
-	},
-	{
-		"ALU64_RSH_K: Shift > 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_RSH, R0, 36),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x08123456 } }
-	},
-	{
-		"ALU64_RSH_K: Shift > 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_RSH, R0, 36),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU64_RSH_K: Shift == 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x81234567 } }
-	},
-	{
-		"ALU64_RSH_K: Shift == 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU64_RSH_K: Zero shift",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_RSH, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } }
-	},
-	/* BPF_ALU | BPF_ARSH | BPF_X */
-	{
-		"ALU32_ARSH_X: -1234 >> 7 = -10",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -1234),
-			BPF_ALU32_IMM(BPF_MOV, R1, 7),
-			BPF_ALU32_REG(BPF_ARSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -10 } }
-	},
-	{
-		"ALU64_ARSH_X: 0xff00ff0000000000 >> 40 = 0xffffffffffff00ff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xff00ff0000000000LL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 40),
-			BPF_ALU64_REG(BPF_ARSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffff00ff } },
-	},
-	{
-		"ALU64_ARSH_X: Shift < 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 12),
-			BPF_ALU64_REG(BPF_ARSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x56789abc } }
-	},
-	{
-		"ALU64_ARSH_X: Shift < 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 12),
-			BPF_ALU64_REG(BPF_ARSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfff81234 } }
-	},
-	{
-		"ALU64_ARSH_X: Shift > 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 36),
-			BPF_ALU64_REG(BPF_ARSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xf8123456 } }
-	},
-	{
-		"ALU64_ARSH_X: Shift > 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 36),
-			BPF_ALU64_REG(BPF_ARSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } }
-	},
-	{
-		"ALU64_ARSH_X: Shift == 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 32),
-			BPF_ALU64_REG(BPF_ARSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x81234567 } }
-	},
-	{
-		"ALU64_ARSH_X: Shift == 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 32),
-			BPF_ALU64_REG(BPF_ARSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } }
-	},
-	{
-		"ALU64_ARSH_X: Zero shift, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0),
-			BPF_ALU64_REG(BPF_ARSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } }
-	},
-	{
-		"ALU64_ARSH_X: Zero shift, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0),
-			BPF_ALU64_REG(BPF_ARSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x81234567 } }
-	},
-	/* BPF_ALU | BPF_ARSH | BPF_K */
-	{
-		"ALU32_ARSH_K: -1234 >> 7 = -10",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -1234),
-			BPF_ALU32_IMM(BPF_ARSH, R0, 7),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -10 } }
-	},
-	{
-		"ALU32_ARSH_K: -1234 >> 0 = -1234",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -1234),
-			BPF_ALU32_IMM(BPF_ARSH, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1234 } }
-	},
-	{
-		"ALU64_ARSH_K: 0xff00ff0000000000 >> 40 = 0xffffffffffff00ff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xff00ff0000000000LL),
-			BPF_ALU64_IMM(BPF_ARSH, R0, 40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffff00ff } },
-	},
-	{
-		"ALU64_ARSH_K: Shift < 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_RSH, R0, 12),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x56789abc } }
-	},
-	{
-		"ALU64_ARSH_K: Shift < 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_ARSH, R0, 12),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfff81234 } }
-	},
-	{
-		"ALU64_ARSH_K: Shift > 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_ARSH, R0, 36),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xf8123456 } }
-	},
-	{
-		"ALU64_ARSH_K: Shift > 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xf123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_ARSH, R0, 36),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } }
-	},
-	{
-		"ALU64_ARSH_K: Shift == 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_ARSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x81234567 } }
-	},
-	{
-		"ALU64_ARSH_K: Shift == 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_ARSH, R0, 32),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } }
-	},
-	{
-		"ALU64_ARSH_K: Zero shift",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_ARSH, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } }
-	},
-	/* BPF_ALU | BPF_NEG */
-	{
-		"ALU_NEG: -(3) = -3",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 3),
-			BPF_ALU32_IMM(BPF_NEG, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -3 } },
-	},
-	{
-		"ALU_NEG: -(-3) = 3",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -3),
-			BPF_ALU32_IMM(BPF_NEG, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_NEG: -(3) = -3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU64_IMM(BPF_NEG, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -3 } },
-	},
-	{
-		"ALU64_NEG: -(-3) = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -3),
-			BPF_ALU64_IMM(BPF_NEG, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	/* BPF_ALU | BPF_END | BPF_FROM_BE */
-	{
-		"ALU_END_FROM_BE 16: 0x0123456789abcdef -> 0xcdef",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ENDIAN(BPF_FROM_BE, R0, 16),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0,  cpu_to_be16(0xcdef) } },
-	},
-	{
-		"ALU_END_FROM_BE 32: 0x0123456789abcdef -> 0x89abcdef",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ENDIAN(BPF_FROM_BE, R0, 32),
-			BPF_ALU64_REG(BPF_MOV, R1, R0),
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),
-			BPF_ALU32_REG(BPF_ADD, R0, R1), /* R1 = 0 */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, cpu_to_be32(0x89abcdef) } },
-	},
-	{
-		"ALU_END_FROM_BE 64: 0x0123456789abcdef -> 0x89abcdef",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ENDIAN(BPF_FROM_BE, R0, 64),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, (u32) cpu_to_be64(0x0123456789abcdefLL) } },
-	},
-	{
-		"ALU_END_FROM_BE 64: 0x0123456789abcdef >> 32 -> 0x01234567",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ENDIAN(BPF_FROM_BE, R0, 64),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, (u32) (cpu_to_be64(0x0123456789abcdefLL) >> 32) } },
-	},
-	/* BPF_ALU | BPF_END | BPF_FROM_BE, reversed */
-	{
-		"ALU_END_FROM_BE 16: 0xfedcba9876543210 -> 0x3210",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_ENDIAN(BPF_FROM_BE, R0, 16),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0,  cpu_to_be16(0x3210) } },
-	},
-	{
-		"ALU_END_FROM_BE 32: 0xfedcba9876543210 -> 0x76543210",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_ENDIAN(BPF_FROM_BE, R0, 32),
-			BPF_ALU64_REG(BPF_MOV, R1, R0),
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),
-			BPF_ALU32_REG(BPF_ADD, R0, R1), /* R1 = 0 */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, cpu_to_be32(0x76543210) } },
-	},
-	{
-		"ALU_END_FROM_BE 64: 0xfedcba9876543210 -> 0x76543210",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_ENDIAN(BPF_FROM_BE, R0, 64),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, (u32) cpu_to_be64(0xfedcba9876543210ULL) } },
-	},
-	{
-		"ALU_END_FROM_BE 64: 0xfedcba9876543210 >> 32 -> 0xfedcba98",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_ENDIAN(BPF_FROM_BE, R0, 64),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, (u32) (cpu_to_be64(0xfedcba9876543210ULL) >> 32) } },
-	},
-	/* BPF_ALU | BPF_END | BPF_FROM_LE */
-	{
-		"ALU_END_FROM_LE 16: 0x0123456789abcdef -> 0xefcd",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ENDIAN(BPF_FROM_LE, R0, 16),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, cpu_to_le16(0xcdef) } },
-	},
-	{
-		"ALU_END_FROM_LE 32: 0x0123456789abcdef -> 0xefcdab89",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ENDIAN(BPF_FROM_LE, R0, 32),
-			BPF_ALU64_REG(BPF_MOV, R1, R0),
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),
-			BPF_ALU32_REG(BPF_ADD, R0, R1), /* R1 = 0 */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, cpu_to_le32(0x89abcdef) } },
-	},
-	{
-		"ALU_END_FROM_LE 64: 0x0123456789abcdef -> 0x67452301",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ENDIAN(BPF_FROM_LE, R0, 64),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, (u32) cpu_to_le64(0x0123456789abcdefLL) } },
-	},
-	{
-		"ALU_END_FROM_LE 64: 0x0123456789abcdef >> 32 -> 0xefcdab89",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ENDIAN(BPF_FROM_LE, R0, 64),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, (u32) (cpu_to_le64(0x0123456789abcdefLL) >> 32) } },
-	},
-	/* BPF_ALU | BPF_END | BPF_FROM_LE, reversed */
-	{
-		"ALU_END_FROM_LE 16: 0xfedcba9876543210 -> 0x1032",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_ENDIAN(BPF_FROM_LE, R0, 16),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0,  cpu_to_le16(0x3210) } },
-	},
-	{
-		"ALU_END_FROM_LE 32: 0xfedcba9876543210 -> 0x10325476",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_ENDIAN(BPF_FROM_LE, R0, 32),
-			BPF_ALU64_REG(BPF_MOV, R1, R0),
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),
-			BPF_ALU32_REG(BPF_ADD, R0, R1), /* R1 = 0 */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, cpu_to_le32(0x76543210) } },
-	},
-	{
-		"ALU_END_FROM_LE 64: 0xfedcba9876543210 -> 0x10325476",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_ENDIAN(BPF_FROM_LE, R0, 64),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, (u32) cpu_to_le64(0xfedcba9876543210ULL) } },
-	},
-	{
-		"ALU_END_FROM_LE 64: 0xfedcba9876543210 >> 32 -> 0x98badcfe",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_ENDIAN(BPF_FROM_LE, R0, 64),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, (u32) (cpu_to_le64(0xfedcba9876543210ULL) >> 32) } },
-	},
-	/* BSWAP */
-	{
-		"BSWAP 16: 0x0123456789abcdef -> 0xefcd",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_BSWAP(R0, 16),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xefcd } },
-	},
-	{
-		"BSWAP 32: 0x0123456789abcdef -> 0xefcdab89",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_BSWAP(R0, 32),
-			BPF_ALU64_REG(BPF_MOV, R1, R0),
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),
-			BPF_ALU32_REG(BPF_ADD, R0, R1), /* R1 = 0 */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xefcdab89 } },
-	},
-	{
-		"BSWAP 64: 0x0123456789abcdef -> 0x67452301",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_BSWAP(R0, 64),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x67452301 } },
-	},
-	{
-		"BSWAP 64: 0x0123456789abcdef >> 32 -> 0xefcdab89",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_BSWAP(R0, 64),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xefcdab89 } },
-	},
-	/* BSWAP, reversed */
-	{
-		"BSWAP 16: 0xfedcba9876543210 -> 0x1032",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_BSWAP(R0, 16),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1032 } },
-	},
-	{
-		"BSWAP 32: 0xfedcba9876543210 -> 0x10325476",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_BSWAP(R0, 32),
-			BPF_ALU64_REG(BPF_MOV, R1, R0),
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),
-			BPF_ALU32_REG(BPF_ADD, R0, R1), /* R1 = 0 */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x10325476 } },
-	},
-	{
-		"BSWAP 64: 0xfedcba9876543210 -> 0x98badcfe",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_BSWAP(R0, 64),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x98badcfe } },
-	},
-	{
-		"BSWAP 64: 0xfedcba9876543210 >> 32 -> 0x10325476",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_BSWAP(R0, 64),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x10325476 } },
-	},
-	/* BPF_LDX_MEM B/H/W/DW */
-	{
-		"BPF_LDX_MEM | BPF_B, base",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0102030405060708ULL),
-			BPF_LD_IMM64(R2, 0x0000000000000008ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_LDX_MEM(BPF_B, R0, R10, -1),
-#else
-			BPF_LDX_MEM(BPF_B, R0, R10, -8),
-#endif
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEM | BPF_B, MSB set",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R2, 0x0000000000000088ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_LDX_MEM(BPF_B, R0, R10, -1),
-#else
-			BPF_LDX_MEM(BPF_B, R0, R10, -8),
-#endif
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEM | BPF_B, negative offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000000000088ULL),
-			BPF_ALU64_IMM(BPF_ADD, R1, 512),
-			BPF_STX_MEM(BPF_B, R1, R2, -256),
-			BPF_LDX_MEM(BPF_B, R0, R1, -256),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 512, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_B, small positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000000000088ULL),
-			BPF_STX_MEM(BPF_B, R1, R2, 256),
-			BPF_LDX_MEM(BPF_B, R0, R1, 256),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 512, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_B, large positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000000000088ULL),
-			BPF_STX_MEM(BPF_B, R1, R2, 4096),
-			BPF_LDX_MEM(BPF_B, R0, R1, 4096),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 4096 + 16, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_H, base",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0102030405060708ULL),
-			BPF_LD_IMM64(R2, 0x0000000000000708ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_LDX_MEM(BPF_H, R0, R10, -2),
-#else
-			BPF_LDX_MEM(BPF_H, R0, R10, -8),
-#endif
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEM | BPF_H, MSB set",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R2, 0x0000000000008788ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_LDX_MEM(BPF_H, R0, R10, -2),
-#else
-			BPF_LDX_MEM(BPF_H, R0, R10, -8),
-#endif
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEM | BPF_H, negative offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000000008788ULL),
-			BPF_ALU64_IMM(BPF_ADD, R1, 512),
-			BPF_STX_MEM(BPF_H, R1, R2, -256),
-			BPF_LDX_MEM(BPF_H, R0, R1, -256),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 512, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_H, small positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000000008788ULL),
-			BPF_STX_MEM(BPF_H, R1, R2, 256),
-			BPF_LDX_MEM(BPF_H, R0, R1, 256),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 512, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_H, large positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000000008788ULL),
-			BPF_STX_MEM(BPF_H, R1, R2, 8192),
-			BPF_LDX_MEM(BPF_H, R0, R1, 8192),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 8192 + 16, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_H, unaligned positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000000008788ULL),
-			BPF_STX_MEM(BPF_H, R1, R2, 13),
-			BPF_LDX_MEM(BPF_H, R0, R1, 13),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 32, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_W, base",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0102030405060708ULL),
-			BPF_LD_IMM64(R2, 0x0000000005060708ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_LDX_MEM(BPF_W, R0, R10, -4),
-#else
-			BPF_LDX_MEM(BPF_W, R0, R10, -8),
-#endif
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEM | BPF_W, MSB set",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R2, 0x0000000085868788ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_LDX_MEM(BPF_W, R0, R10, -4),
-#else
-			BPF_LDX_MEM(BPF_W, R0, R10, -8),
-#endif
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEM | BPF_W, negative offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000085868788ULL),
-			BPF_ALU64_IMM(BPF_ADD, R1, 512),
-			BPF_STX_MEM(BPF_W, R1, R2, -256),
-			BPF_LDX_MEM(BPF_W, R0, R1, -256),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 512, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_W, small positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000085868788ULL),
-			BPF_STX_MEM(BPF_W, R1, R2, 256),
-			BPF_LDX_MEM(BPF_W, R0, R1, 256),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 512, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_W, large positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000085868788ULL),
-			BPF_STX_MEM(BPF_W, R1, R2, 16384),
-			BPF_LDX_MEM(BPF_W, R0, R1, 16384),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 16384 + 16, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_W, unaligned positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000085868788ULL),
-			BPF_STX_MEM(BPF_W, R1, R2, 13),
-			BPF_LDX_MEM(BPF_W, R0, R1, 13),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 32, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_DW, base",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0102030405060708ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-			BPF_LDX_MEM(BPF_DW, R0, R10, -8),
-			BPF_JMP_REG(BPF_JNE, R0, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEM | BPF_DW, MSB set",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8182838485868788ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-			BPF_LDX_MEM(BPF_DW, R0, R10, -8),
-			BPF_JMP_REG(BPF_JNE, R0, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEM | BPF_DW, negative offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_ALU64_IMM(BPF_ADD, R1, 512),
-			BPF_STX_MEM(BPF_DW, R1, R2, -256),
-			BPF_LDX_MEM(BPF_DW, R0, R1, -256),
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 512, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_DW, small positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_STX_MEM(BPF_DW, R1, R2, 256),
-			BPF_LDX_MEM(BPF_DW, R0, R1, 256),
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 512, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEM | BPF_DW, large positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_STX_MEM(BPF_DW, R1, R2, 32760),
-			BPF_LDX_MEM(BPF_DW, R0, R1, 32760),
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 32768, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_DW, unaligned positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_STX_MEM(BPF_DW, R1, R2, 13),
-			BPF_LDX_MEM(BPF_DW, R0, R1, 13),
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 32, 0 } },
-		.stack_depth = 0,
-	},
-	/* BPF_LDX_MEMSX B/H/W */
-	{
-		"BPF_LDX_MEMSX | BPF_B",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0xdead0000000000f0ULL),
-			BPF_LD_IMM64(R2, 0xfffffffffffffff0ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_LDX_MEMSX(BPF_B, R0, R10, -1),
-#else
-			BPF_LDX_MEMSX(BPF_B, R0, R10, -8),
-#endif
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEMSX | BPF_H",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0xdead00000000f123ULL),
-			BPF_LD_IMM64(R2, 0xfffffffffffff123ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_LDX_MEMSX(BPF_H, R0, R10, -2),
-#else
-			BPF_LDX_MEMSX(BPF_H, R0, R10, -8),
-#endif
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEMSX | BPF_W",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x00000000deadbeefULL),
-			BPF_LD_IMM64(R2, 0xffffffffdeadbeefULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_LDX_MEMSX(BPF_W, R0, R10, -4),
-#else
-			BPF_LDX_MEMSX(BPF_W, R0, R10, -8),
-#endif
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	/* BPF_STX_MEM B/H/W/DW */
-	{
-		"BPF_STX_MEM | BPF_B",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8090a0b0c0d0e0f0ULL),
-			BPF_LD_IMM64(R2, 0x0102030405060708ULL),
-			BPF_LD_IMM64(R3, 0x8090a0b0c0d0e008ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_STX_MEM(BPF_B, R10, R2, -1),
-#else
-			BPF_STX_MEM(BPF_B, R10, R2, -8),
-#endif
-			BPF_LDX_MEM(BPF_DW, R0, R10, -8),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_STX_MEM | BPF_B, MSB set",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8090a0b0c0d0e0f0ULL),
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x8090a0b0c0d0e088ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_STX_MEM(BPF_B, R10, R2, -1),
-#else
-			BPF_STX_MEM(BPF_B, R10, R2, -8),
-#endif
-			BPF_LDX_MEM(BPF_DW, R0, R10, -8),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_STX_MEM | BPF_H",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8090a0b0c0d0e0f0ULL),
-			BPF_LD_IMM64(R2, 0x0102030405060708ULL),
-			BPF_LD_IMM64(R3, 0x8090a0b0c0d00708ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_STX_MEM(BPF_H, R10, R2, -2),
-#else
-			BPF_STX_MEM(BPF_H, R10, R2, -8),
-#endif
-			BPF_LDX_MEM(BPF_DW, R0, R10, -8),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_STX_MEM | BPF_H, MSB set",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8090a0b0c0d0e0f0ULL),
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x8090a0b0c0d08788ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_STX_MEM(BPF_H, R10, R2, -2),
-#else
-			BPF_STX_MEM(BPF_H, R10, R2, -8),
-#endif
-			BPF_LDX_MEM(BPF_DW, R0, R10, -8),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_STX_MEM | BPF_W",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8090a0b0c0d0e0f0ULL),
-			BPF_LD_IMM64(R2, 0x0102030405060708ULL),
-			BPF_LD_IMM64(R3, 0x8090a0b005060708ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_STX_MEM(BPF_W, R10, R2, -4),
-#else
-			BPF_STX_MEM(BPF_W, R10, R2, -8),
-#endif
-			BPF_LDX_MEM(BPF_DW, R0, R10, -8),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_STX_MEM | BPF_W, MSB set",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8090a0b0c0d0e0f0ULL),
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x8090a0b085868788ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_STX_MEM(BPF_W, R10, R2, -4),
-#else
-			BPF_STX_MEM(BPF_W, R10, R2, -8),
-#endif
-			BPF_LDX_MEM(BPF_DW, R0, R10, -8),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	/* BPF_ST(X) | BPF_MEM | BPF_B/H/W/DW */
-	{
-		"ST_MEM_B: Store/Load byte: max negative",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_ST_MEM(BPF_B, R10, -40, 0xff),
-			BPF_LDX_MEM(BPF_B, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xff } },
-		.stack_depth = 40,
-	},
-	{
-		"ST_MEM_B: Store/Load byte: max positive",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_ST_MEM(BPF_H, R10, -40, 0x7f),
-			BPF_LDX_MEM(BPF_H, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x7f } },
-		.stack_depth = 40,
-	},
-	{
-		"STX_MEM_B: Store/Load byte: max negative",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_LD_IMM64(R1, 0xffLL),
-			BPF_STX_MEM(BPF_B, R10, R1, -40),
-			BPF_LDX_MEM(BPF_B, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xff } },
-		.stack_depth = 40,
-	},
-	{
-		"ST_MEM_H: Store/Load half word: max negative",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_ST_MEM(BPF_H, R10, -40, 0xffff),
-			BPF_LDX_MEM(BPF_H, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffff } },
-		.stack_depth = 40,
-	},
-	{
-		"ST_MEM_H: Store/Load half word: max positive",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_ST_MEM(BPF_H, R10, -40, 0x7fff),
-			BPF_LDX_MEM(BPF_H, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x7fff } },
-		.stack_depth = 40,
-	},
-	{
-		"STX_MEM_H: Store/Load half word: max negative",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_LD_IMM64(R1, 0xffffLL),
-			BPF_STX_MEM(BPF_H, R10, R1, -40),
-			BPF_LDX_MEM(BPF_H, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffff } },
-		.stack_depth = 40,
-	},
-	{
-		"ST_MEM_W: Store/Load word: max negative",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_ST_MEM(BPF_W, R10, -40, 0xffffffff),
-			BPF_LDX_MEM(BPF_W, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-		.stack_depth = 40,
-	},
-	{
-		"ST_MEM_W: Store/Load word: max positive",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_ST_MEM(BPF_W, R10, -40, 0x7fffffff),
-			BPF_LDX_MEM(BPF_W, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x7fffffff } },
-		.stack_depth = 40,
-	},
-	{
-		"STX_MEM_W: Store/Load word: max negative",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_LD_IMM64(R1, 0xffffffffLL),
-			BPF_STX_MEM(BPF_W, R10, R1, -40),
-			BPF_LDX_MEM(BPF_W, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-		.stack_depth = 40,
-	},
-	{
-		"ST_MEM_DW: Store/Load double word: max negative",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_ST_MEM(BPF_DW, R10, -40, 0xffffffff),
-			BPF_LDX_MEM(BPF_DW, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-		.stack_depth = 40,
-	},
-	{
-		"ST_MEM_DW: Store/Load double word: max negative 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0xffff00000000ffffLL),
-			BPF_LD_IMM64(R3, 0xffffffffffffffffLL),
-			BPF_ST_MEM(BPF_DW, R10, -40, 0xffffffff),
-			BPF_LDX_MEM(BPF_DW, R2, R10, -40),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-		.stack_depth = 40,
-	},
-	{
-		"ST_MEM_DW: Store/Load double word: max positive",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_ST_MEM(BPF_DW, R10, -40, 0x7fffffff),
-			BPF_LDX_MEM(BPF_DW, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x7fffffff } },
-		.stack_depth = 40,
-	},
-	{
-		"STX_MEM_DW: Store/Load double word: max negative",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_LD_IMM64(R1, 0xffffffffffffffffLL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -40),
-			BPF_LDX_MEM(BPF_DW, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-		.stack_depth = 40,
-	},
-	{
-		"STX_MEM_DW: Store double word: first word in memory",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_LD_IMM64(R1, 0x0123456789abcdefLL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -40),
-			BPF_LDX_MEM(BPF_W, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-#ifdef __BIG_ENDIAN
-		{ { 0, 0x01234567 } },
-#else
-		{ { 0, 0x89abcdef } },
-#endif
-		.stack_depth = 40,
-	},
-	{
-		"STX_MEM_DW: Store double word: second word in memory",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_LD_IMM64(R1, 0x0123456789abcdefLL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -40),
-			BPF_LDX_MEM(BPF_W, R0, R10, -36),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-#ifdef __BIG_ENDIAN
-		{ { 0, 0x89abcdef } },
-#else
-		{ { 0, 0x01234567 } },
-#endif
-		.stack_depth = 40,
-	},
-	/* BPF_STX | BPF_ATOMIC | BPF_W/DW */
-	{
-		"STX_XADD_W: X + 1 + 1 + 1 + ...",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 4134 } },
-		.fill_helper = bpf_fill_stxw,
-	},
-	{
-		"STX_XADD_DW: X + 1 + 1 + 1 + ...",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 4134 } },
-		.fill_helper = bpf_fill_stxdw,
-	},
-	/*
-	 * Exhaustive tests of atomic operation variants.
-	 * Individual tests are expanded from template macros for all
-	 * combinations of ALU operation, word size and fetching.
-	 */
-#define BPF_ATOMIC_POISON(width) ((width) == BPF_W ? (0xbaadf00dULL << 32) : 0)
-
-#define BPF_ATOMIC_OP_TEST1(width, op, logic, old, update, result)	\
-{									\
-	"BPF_ATOMIC | " #width ", " #op ": Test: "			\
-		#old " " #logic " " #update " = " #result,		\
-	.u.insns_int = {						\
-		BPF_LD_IMM64(R5, (update) | BPF_ATOMIC_POISON(width)),	\
-		BPF_ST_MEM(width, R10, -40, old),			\
-		BPF_ATOMIC_OP(width, op, R10, R5, -40),			\
-		BPF_LDX_MEM(width, R0, R10, -40),			\
-		BPF_ALU64_REG(BPF_MOV, R1, R0),				\
-		BPF_ALU64_IMM(BPF_RSH, R1, 32),				\
-		BPF_ALU64_REG(BPF_OR, R0, R1),				\
-		BPF_EXIT_INSN(),					\
-	},								\
-	INTERNAL,							\
-	{ },								\
-	{ { 0, result } },						\
-	.stack_depth = 40,						\
-}
-#define BPF_ATOMIC_OP_TEST2(width, op, logic, old, update, result)	\
-{									\
-	"BPF_ATOMIC | " #width ", " #op ": Test side effects, r10: "	\
-		#old " " #logic " " #update " = " #result,		\
-	.u.insns_int = {						\
-		BPF_ALU64_REG(BPF_MOV, R1, R10),			\
-		BPF_LD_IMM64(R0, (update) | BPF_ATOMIC_POISON(width)),	\
-		BPF_ST_MEM(BPF_W, R10, -40, old),			\
-		BPF_ATOMIC_OP(width, op, R10, R0, -40),			\
-		BPF_ALU64_REG(BPF_MOV, R0, R10),			\
-		BPF_ALU64_REG(BPF_SUB, R0, R1),				\
-		BPF_ALU64_REG(BPF_MOV, R1, R0),				\
-		BPF_ALU64_IMM(BPF_RSH, R1, 32),				\
-		BPF_ALU64_REG(BPF_OR, R0, R1),				\
-		BPF_EXIT_INSN(),					\
-	},								\
-	INTERNAL,							\
-	{ },								\
-	{ { 0, 0 } },							\
-	.stack_depth = 40,						\
-}
-#define BPF_ATOMIC_OP_TEST3(width, op, logic, old, update, result)	\
-{									\
-	"BPF_ATOMIC | " #width ", " #op ": Test side effects, r0: "	\
-		#old " " #logic " " #update " = " #result,		\
-	.u.insns_int = {						\
-		BPF_ALU64_REG(BPF_MOV, R0, R10),			\
-		BPF_LD_IMM64(R1, (update) | BPF_ATOMIC_POISON(width)),	\
-		BPF_ST_MEM(width, R10, -40, old),			\
-		BPF_ATOMIC_OP(width, op, R10, R1, -40),			\
-		BPF_ALU64_REG(BPF_SUB, R0, R10),			\
-		BPF_ALU64_REG(BPF_MOV, R1, R0),				\
-		BPF_ALU64_IMM(BPF_RSH, R1, 32),				\
-		BPF_ALU64_REG(BPF_OR, R0, R1),				\
-		BPF_EXIT_INSN(),					\
-	},								\
-	INTERNAL,                                                       \
-	{ },                                                            \
-	{ { 0, 0 } },                                                   \
-	.stack_depth = 40,                                              \
-}
-#define BPF_ATOMIC_OP_TEST4(width, op, logic, old, update, result)	\
-{									\
-	"BPF_ATOMIC | " #width ", " #op ": Test fetch: "		\
-		#old " " #logic " " #update " = " #result,		\
-	.u.insns_int = {						\
-		BPF_LD_IMM64(R3, (update) | BPF_ATOMIC_POISON(width)),	\
-		BPF_ST_MEM(width, R10, -40, old),			\
-		BPF_ATOMIC_OP(width, op, R10, R3, -40),			\
-		BPF_ALU32_REG(BPF_MOV, R0, R3),                         \
-		BPF_EXIT_INSN(),					\
-	},								\
-	INTERNAL,                                                       \
-	{ },                                                            \
-	{ { 0, (op) & BPF_FETCH ? old : update } },			\
-	.stack_depth = 40,                                              \
-}
-	/* BPF_ATOMIC | BPF_W: BPF_ADD */
-	BPF_ATOMIC_OP_TEST1(BPF_W, BPF_ADD, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST2(BPF_W, BPF_ADD, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST3(BPF_W, BPF_ADD, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST4(BPF_W, BPF_ADD, +, 0x12, 0xab, 0xbd),
-	/* BPF_ATOMIC | BPF_W: BPF_ADD | BPF_FETCH */
-	BPF_ATOMIC_OP_TEST1(BPF_W, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST2(BPF_W, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST3(BPF_W, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST4(BPF_W, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),
-	/* BPF_ATOMIC | BPF_DW: BPF_ADD */
-	BPF_ATOMIC_OP_TEST1(BPF_DW, BPF_ADD, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST2(BPF_DW, BPF_ADD, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST3(BPF_DW, BPF_ADD, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST4(BPF_DW, BPF_ADD, +, 0x12, 0xab, 0xbd),
-	/* BPF_ATOMIC | BPF_DW: BPF_ADD | BPF_FETCH */
-	BPF_ATOMIC_OP_TEST1(BPF_DW, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST2(BPF_DW, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST3(BPF_DW, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST4(BPF_DW, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),
-	/* BPF_ATOMIC | BPF_W: BPF_AND */
-	BPF_ATOMIC_OP_TEST1(BPF_W, BPF_AND, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST2(BPF_W, BPF_AND, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST3(BPF_W, BPF_AND, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST4(BPF_W, BPF_AND, &, 0x12, 0xab, 0x02),
-	/* BPF_ATOMIC | BPF_W: BPF_AND | BPF_FETCH */
-	BPF_ATOMIC_OP_TEST1(BPF_W, BPF_AND | BPF_FETCH, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST2(BPF_W, BPF_AND | BPF_FETCH, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST3(BPF_W, BPF_AND | BPF_FETCH, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST4(BPF_W, BPF_AND | BPF_FETCH, &, 0x12, 0xab, 0x02),
-	/* BPF_ATOMIC | BPF_DW: BPF_AND */
-	BPF_ATOMIC_OP_TEST1(BPF_DW, BPF_AND, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST2(BPF_DW, BPF_AND, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST3(BPF_DW, BPF_AND, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST4(BPF_DW, BPF_AND, &, 0x12, 0xab, 0x02),
-	/* BPF_ATOMIC | BPF_DW: BPF_AND | BPF_FETCH */
-	BPF_ATOMIC_OP_TEST1(BPF_DW, BPF_AND | BPF_FETCH, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST2(BPF_DW, BPF_AND | BPF_FETCH, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST3(BPF_DW, BPF_AND | BPF_FETCH, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST4(BPF_DW, BPF_AND | BPF_FETCH, &, 0x12, 0xab, 0x02),
-	/* BPF_ATOMIC | BPF_W: BPF_OR */
-	BPF_ATOMIC_OP_TEST1(BPF_W, BPF_OR, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST2(BPF_W, BPF_OR, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST3(BPF_W, BPF_OR, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST4(BPF_W, BPF_OR, |, 0x12, 0xab, 0xbb),
-	/* BPF_ATOMIC | BPF_W: BPF_OR | BPF_FETCH */
-	BPF_ATOMIC_OP_TEST1(BPF_W, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST2(BPF_W, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST3(BPF_W, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST4(BPF_W, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),
-	/* BPF_ATOMIC | BPF_DW: BPF_OR */
-	BPF_ATOMIC_OP_TEST1(BPF_DW, BPF_OR, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST2(BPF_DW, BPF_OR, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST3(BPF_DW, BPF_OR, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST4(BPF_DW, BPF_OR, |, 0x12, 0xab, 0xbb),
-	/* BPF_ATOMIC | BPF_DW: BPF_OR | BPF_FETCH */
-	BPF_ATOMIC_OP_TEST1(BPF_DW, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST2(BPF_DW, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST3(BPF_DW, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST4(BPF_DW, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),
-	/* BPF_ATOMIC | BPF_W: BPF_XOR */
-	BPF_ATOMIC_OP_TEST1(BPF_W, BPF_XOR, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST2(BPF_W, BPF_XOR, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST3(BPF_W, BPF_XOR, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST4(BPF_W, BPF_XOR, ^, 0x12, 0xab, 0xb9),
-	/* BPF_ATOMIC | BPF_W: BPF_XOR | BPF_FETCH */
-	BPF_ATOMIC_OP_TEST1(BPF_W, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST2(BPF_W, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST3(BPF_W, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST4(BPF_W, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),
-	/* BPF_ATOMIC | BPF_DW: BPF_XOR */
-	BPF_ATOMIC_OP_TEST1(BPF_DW, BPF_XOR, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST2(BPF_DW, BPF_XOR, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST3(BPF_DW, BPF_XOR, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST4(BPF_DW, BPF_XOR, ^, 0x12, 0xab, 0xb9),
-	/* BPF_ATOMIC | BPF_DW: BPF_XOR | BPF_FETCH */
-	BPF_ATOMIC_OP_TEST1(BPF_DW, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST2(BPF_DW, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST3(BPF_DW, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST4(BPF_DW, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),
-	/* BPF_ATOMIC | BPF_W: BPF_XCHG */
-	BPF_ATOMIC_OP_TEST1(BPF_W, BPF_XCHG, xchg, 0x12, 0xab, 0xab),
-	BPF_ATOMIC_OP_TEST2(BPF_W, BPF_XCHG, xchg, 0x12, 0xab, 0xab),
-	BPF_ATOMIC_OP_TEST3(BPF_W, BPF_XCHG, xchg, 0x12, 0xab, 0xab),
-	BPF_ATOMIC_OP_TEST4(BPF_W, BPF_XCHG, xchg, 0x12, 0xab, 0xab),
-	/* BPF_ATOMIC | BPF_DW: BPF_XCHG */
-	BPF_ATOMIC_OP_TEST1(BPF_DW, BPF_XCHG, xchg, 0x12, 0xab, 0xab),
-	BPF_ATOMIC_OP_TEST2(BPF_DW, BPF_XCHG, xchg, 0x12, 0xab, 0xab),
-	BPF_ATOMIC_OP_TEST3(BPF_DW, BPF_XCHG, xchg, 0x12, 0xab, 0xab),
-	BPF_ATOMIC_OP_TEST4(BPF_DW, BPF_XCHG, xchg, 0x12, 0xab, 0xab),
-#undef BPF_ATOMIC_POISON
-#undef BPF_ATOMIC_OP_TEST1
-#undef BPF_ATOMIC_OP_TEST2
-#undef BPF_ATOMIC_OP_TEST3
-#undef BPF_ATOMIC_OP_TEST4
-	/* BPF_ATOMIC | BPF_W, BPF_CMPXCHG */
-	{
-		"BPF_ATOMIC | BPF_W, BPF_CMPXCHG: Test successful return",
-		.u.insns_int = {
-			BPF_ST_MEM(BPF_W, R10, -40, 0x01234567),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x01234567),
-			BPF_ALU32_IMM(BPF_MOV, R3, 0x89abcdef),
-			BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R3, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x01234567 } },
-		.stack_depth = 40,
-	},
-	{
-		"BPF_ATOMIC | BPF_W, BPF_CMPXCHG: Test successful store",
-		.u.insns_int = {
-			BPF_ST_MEM(BPF_W, R10, -40, 0x01234567),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x01234567),
-			BPF_ALU32_IMM(BPF_MOV, R3, 0x89abcdef),
-			BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R3, -40),
-			BPF_LDX_MEM(BPF_W, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } },
-		.stack_depth = 40,
-	},
-	{
-		"BPF_ATOMIC | BPF_W, BPF_CMPXCHG: Test failure return",
-		.u.insns_int = {
-			BPF_ST_MEM(BPF_W, R10, -40, 0x01234567),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x76543210),
-			BPF_ALU32_IMM(BPF_MOV, R3, 0x89abcdef),
-			BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R3, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x01234567 } },
-		.stack_depth = 40,
-	},
-	{
-		"BPF_ATOMIC | BPF_W, BPF_CMPXCHG: Test failure store",
-		.u.insns_int = {
-			BPF_ST_MEM(BPF_W, R10, -40, 0x01234567),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x76543210),
-			BPF_ALU32_IMM(BPF_MOV, R3, 0x89abcdef),
-			BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R3, -40),
-			BPF_LDX_MEM(BPF_W, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x01234567 } },
-		.stack_depth = 40,
-	},
-	{
-		"BPF_ATOMIC | BPF_W, BPF_CMPXCHG: Test side effects",
-		.u.insns_int = {
-			BPF_ST_MEM(BPF_W, R10, -40, 0x01234567),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x01234567),
-			BPF_ALU32_IMM(BPF_MOV, R3, 0x89abcdef),
-			BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R3, -40),
-			BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R3, -40),
-			BPF_ALU32_REG(BPF_MOV, R0, R3),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } },
-		.stack_depth = 40,
-	},
-	/* BPF_ATOMIC | BPF_DW, BPF_CMPXCHG */
-	{
-		"BPF_ATOMIC | BPF_DW, BPF_CMPXCHG: Test successful return",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0123456789abcdefULL),
-			BPF_LD_IMM64(R2, 0xfedcba9876543210ULL),
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_STX_MEM(BPF_DW, R10, R1, -40),
-			BPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -40),
-			BPF_JMP_REG(BPF_JNE, R0, R1, 1),
-			BPF_ALU64_REG(BPF_SUB, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 40,
-	},
-	{
-		"BPF_ATOMIC | BPF_DW, BPF_CMPXCHG: Test successful store",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0123456789abcdefULL),
-			BPF_LD_IMM64(R2, 0xfedcba9876543210ULL),
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_STX_MEM(BPF_DW, R10, R0, -40),
-			BPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -40),
-			BPF_LDX_MEM(BPF_DW, R0, R10, -40),
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_REG(BPF_SUB, R0, R2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 40,
-	},
-	{
-		"BPF_ATOMIC | BPF_DW, BPF_CMPXCHG: Test failure return",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0123456789abcdefULL),
-			BPF_LD_IMM64(R2, 0xfedcba9876543210ULL),
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_ALU64_IMM(BPF_ADD, R0, 1),
-			BPF_STX_MEM(BPF_DW, R10, R1, -40),
-			BPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -40),
-			BPF_JMP_REG(BPF_JNE, R0, R1, 1),
-			BPF_ALU64_REG(BPF_SUB, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 40,
-	},
-	{
-		"BPF_ATOMIC | BPF_DW, BPF_CMPXCHG: Test failure store",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0123456789abcdefULL),
-			BPF_LD_IMM64(R2, 0xfedcba9876543210ULL),
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_ALU64_IMM(BPF_ADD, R0, 1),
-			BPF_STX_MEM(BPF_DW, R10, R1, -40),
-			BPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -40),
-			BPF_LDX_MEM(BPF_DW, R0, R10, -40),
-			BPF_JMP_REG(BPF_JNE, R0, R1, 1),
-			BPF_ALU64_REG(BPF_SUB, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 40,
-	},
-	{
-		"BPF_ATOMIC | BPF_DW, BPF_CMPXCHG: Test side effects",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0123456789abcdefULL),
-			BPF_LD_IMM64(R2, 0xfedcba9876543210ULL),
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_STX_MEM(BPF_DW, R10, R1, -40),
-			BPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -40),
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_REG(BPF_SUB, R0, R2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 40,
-	},
-	/* BPF_JMP32 | BPF_JEQ | BPF_K */
-	{
-		"JMP32_JEQ_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 123),
-			BPF_JMP32_IMM(BPF_JEQ, R0, 321, 1),
-			BPF_JMP32_IMM(BPF_JEQ, R0, 123, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 123 } }
-	},
-	{
-		"JMP32_JEQ_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 12345678),
-			BPF_JMP32_IMM(BPF_JEQ, R0, 12345678 & 0xffff, 1),
-			BPF_JMP32_IMM(BPF_JEQ, R0, 12345678, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 12345678 } }
-	},
-	{
-		"JMP32_JEQ_K: negative immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123),
-			BPF_JMP32_IMM(BPF_JEQ, R0,  123, 1),
-			BPF_JMP32_IMM(BPF_JEQ, R0, -123, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123 } }
-	},
-	/* BPF_JMP32 | BPF_JEQ | BPF_X */
-	{
-		"JMP32_JEQ_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1234),
-			BPF_ALU32_IMM(BPF_MOV, R1, 4321),
-			BPF_JMP32_REG(BPF_JEQ, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 1234),
-			BPF_JMP32_REG(BPF_JEQ, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1234 } }
-	},
-	/* BPF_JMP32 | BPF_JNE | BPF_K */
-	{
-		"JMP32_JNE_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 123),
-			BPF_JMP32_IMM(BPF_JNE, R0, 123, 1),
-			BPF_JMP32_IMM(BPF_JNE, R0, 321, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 123 } }
-	},
-	{
-		"JMP32_JNE_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 12345678),
-			BPF_JMP32_IMM(BPF_JNE, R0, 12345678, 1),
-			BPF_JMP32_IMM(BPF_JNE, R0, 12345678 & 0xffff, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 12345678 } }
-	},
-	{
-		"JMP32_JNE_K: negative immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123),
-			BPF_JMP32_IMM(BPF_JNE, R0, -123, 1),
-			BPF_JMP32_IMM(BPF_JNE, R0,  123, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123 } }
-	},
-	/* BPF_JMP32 | BPF_JNE | BPF_X */
-	{
-		"JMP32_JNE_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1234),
-			BPF_ALU32_IMM(BPF_MOV, R1, 1234),
-			BPF_JMP32_REG(BPF_JNE, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 4321),
-			BPF_JMP32_REG(BPF_JNE, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1234 } }
-	},
-	/* BPF_JMP32 | BPF_JSET | BPF_K */
-	{
-		"JMP32_JSET_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_JMP32_IMM(BPF_JSET, R0, 2, 1),
-			BPF_JMP32_IMM(BPF_JSET, R0, 3, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		"JMP32_JSET_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x40000000),
-			BPF_JMP32_IMM(BPF_JSET, R0, 0x3fffffff, 1),
-			BPF_JMP32_IMM(BPF_JSET, R0, 0x60000000, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x40000000 } }
-	},
-	{
-		"JMP32_JSET_K: negative immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123),
-			BPF_JMP32_IMM(BPF_JSET, R0, -1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123 } }
-	},
-	/* BPF_JMP32 | BPF_JSET | BPF_X */
-	{
-		"JMP32_JSET_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 8),
-			BPF_ALU32_IMM(BPF_MOV, R1, 7),
-			BPF_JMP32_REG(BPF_JSET, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 8 | 2),
-			BPF_JMP32_REG(BPF_JNE, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 8 } }
-	},
-	/* BPF_JMP32 | BPF_JGT | BPF_K */
-	{
-		"JMP32_JGT_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 123),
-			BPF_JMP32_IMM(BPF_JGT, R0, 123, 1),
-			BPF_JMP32_IMM(BPF_JGT, R0, 122, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 123 } }
-	},
-	{
-		"JMP32_JGT_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
-			BPF_JMP32_IMM(BPF_JGT, R0, 0xffffffff, 1),
-			BPF_JMP32_IMM(BPF_JGT, R0, 0xfffffffd, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } }
-	},
-	/* BPF_JMP32 | BPF_JGT | BPF_X */
-	{
-		"JMP32_JGT_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
-			BPF_JMP32_REG(BPF_JGT, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xfffffffd),
-			BPF_JMP32_REG(BPF_JGT, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } }
-	},
-	/* BPF_JMP32 | BPF_JGE | BPF_K */
-	{
-		"JMP32_JGE_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 123),
-			BPF_JMP32_IMM(BPF_JGE, R0, 124, 1),
-			BPF_JMP32_IMM(BPF_JGE, R0, 123, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 123 } }
-	},
-	{
-		"JMP32_JGE_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
-			BPF_JMP32_IMM(BPF_JGE, R0, 0xffffffff, 1),
-			BPF_JMP32_IMM(BPF_JGE, R0, 0xfffffffe, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } }
-	},
-	/* BPF_JMP32 | BPF_JGE | BPF_X */
-	{
-		"JMP32_JGE_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
-			BPF_JMP32_REG(BPF_JGE, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xfffffffe),
-			BPF_JMP32_REG(BPF_JGE, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } }
-	},
-	/* BPF_JMP32 | BPF_JLT | BPF_K */
-	{
-		"JMP32_JLT_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 123),
-			BPF_JMP32_IMM(BPF_JLT, R0, 123, 1),
-			BPF_JMP32_IMM(BPF_JLT, R0, 124, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 123 } }
-	},
-	{
-		"JMP32_JLT_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
-			BPF_JMP32_IMM(BPF_JLT, R0, 0xfffffffd, 1),
-			BPF_JMP32_IMM(BPF_JLT, R0, 0xffffffff, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } }
-	},
-	/* BPF_JMP32 | BPF_JLT | BPF_X */
-	{
-		"JMP32_JLT_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xfffffffd),
-			BPF_JMP32_REG(BPF_JLT, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
-			BPF_JMP32_REG(BPF_JLT, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } }
-	},
-	/* BPF_JMP32 | BPF_JLE | BPF_K */
-	{
-		"JMP32_JLE_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 123),
-			BPF_JMP32_IMM(BPF_JLE, R0, 122, 1),
-			BPF_JMP32_IMM(BPF_JLE, R0, 123, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 123 } }
-	},
-	{
-		"JMP32_JLE_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
-			BPF_JMP32_IMM(BPF_JLE, R0, 0xfffffffd, 1),
-			BPF_JMP32_IMM(BPF_JLE, R0, 0xfffffffe, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } }
-	},
-	/* BPF_JMP32 | BPF_JLE | BPF_X */
-	{
-		"JMP32_JLE_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xfffffffd),
-			BPF_JMP32_REG(BPF_JLE, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xfffffffe),
-			BPF_JMP32_REG(BPF_JLE, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } }
-	},
-	/* BPF_JMP32 | BPF_JSGT | BPF_K */
-	{
-		"JMP32_JSGT_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123),
-			BPF_JMP32_IMM(BPF_JSGT, R0, -123, 1),
-			BPF_JMP32_IMM(BPF_JSGT, R0, -124, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123 } }
-	},
-	{
-		"JMP32_JSGT_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -12345678),
-			BPF_JMP32_IMM(BPF_JSGT, R0, -12345678, 1),
-			BPF_JMP32_IMM(BPF_JSGT, R0, -12345679, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -12345678 } }
-	},
-	/* BPF_JMP32 | BPF_JSGT | BPF_X */
-	{
-		"JMP32_JSGT_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -12345678),
-			BPF_ALU32_IMM(BPF_MOV, R1, -12345678),
-			BPF_JMP32_REG(BPF_JSGT, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, -12345679),
-			BPF_JMP32_REG(BPF_JSGT, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -12345678 } }
-	},
-	/* BPF_JMP32 | BPF_JSGE | BPF_K */
-	{
-		"JMP32_JSGE_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123),
-			BPF_JMP32_IMM(BPF_JSGE, R0, -122, 1),
-			BPF_JMP32_IMM(BPF_JSGE, R0, -123, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123 } }
-	},
-	{
-		"JMP32_JSGE_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -12345678),
-			BPF_JMP32_IMM(BPF_JSGE, R0, -12345677, 1),
-			BPF_JMP32_IMM(BPF_JSGE, R0, -12345678, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -12345678 } }
-	},
-	/* BPF_JMP32 | BPF_JSGE | BPF_X */
-	{
-		"JMP32_JSGE_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -12345678),
-			BPF_ALU32_IMM(BPF_MOV, R1, -12345677),
-			BPF_JMP32_REG(BPF_JSGE, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, -12345678),
-			BPF_JMP32_REG(BPF_JSGE, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -12345678 } }
-	},
-	/* BPF_JMP32 | BPF_JSLT | BPF_K */
-	{
-		"JMP32_JSLT_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123),
-			BPF_JMP32_IMM(BPF_JSLT, R0, -123, 1),
-			BPF_JMP32_IMM(BPF_JSLT, R0, -122, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123 } }
-	},
-	{
-		"JMP32_JSLT_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -12345678),
-			BPF_JMP32_IMM(BPF_JSLT, R0, -12345678, 1),
-			BPF_JMP32_IMM(BPF_JSLT, R0, -12345677, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -12345678 } }
-	},
-	/* BPF_JMP32 | BPF_JSLT | BPF_X */
-	{
-		"JMP32_JSLT_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -12345678),
-			BPF_ALU32_IMM(BPF_MOV, R1, -12345678),
-			BPF_JMP32_REG(BPF_JSLT, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, -12345677),
-			BPF_JMP32_REG(BPF_JSLT, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -12345678 } }
-	},
-	/* BPF_JMP32 | BPF_JSLE | BPF_K */
-	{
-		"JMP32_JSLE_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123),
-			BPF_JMP32_IMM(BPF_JSLE, R0, -124, 1),
-			BPF_JMP32_IMM(BPF_JSLE, R0, -123, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123 } }
-	},
-	{
-		"JMP32_JSLE_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -12345678),
-			BPF_JMP32_IMM(BPF_JSLE, R0, -12345679, 1),
-			BPF_JMP32_IMM(BPF_JSLE, R0, -12345678, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -12345678 } }
-	},
-	/* BPF_JMP32 | BPF_JSLE | BPF_K */
-	{
-		"JMP32_JSLE_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -12345678),
-			BPF_ALU32_IMM(BPF_MOV, R1, -12345679),
-			BPF_JMP32_REG(BPF_JSLE, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, -12345678),
-			BPF_JMP32_REG(BPF_JSLE, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -12345678 } }
-	},
-	/* BPF_JMP | BPF_EXIT */
-	{
-		"JMP_EXIT",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x4711),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x4712),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x4711 } },
-	},
-	/* BPF_JMP | BPF_JA */
-	{
-		"JMP_JA: Unconditional jump: if (true) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_JMP_IMM(BPF_JA, 0, 0, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP32 | BPF_JA */
-	{
-		"JMP32_JA: Unconditional jump: if (true) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_JMP32_IMM(BPF_JA, 0, 1, 0),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSLT | BPF_K */
-	{
-		"JMP_JSLT_K: Signed jump: if (-2 < -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 0xfffffffffffffffeLL),
-			BPF_JMP_IMM(BPF_JSLT, R1, -1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSLT_K: Signed jump: if (-1 < -1) return 0",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_LD_IMM64(R1, 0xffffffffffffffffLL),
-			BPF_JMP_IMM(BPF_JSLT, R1, -1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSGT | BPF_K */
-	{
-		"JMP_JSGT_K: Signed jump: if (-1 > -2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 0xffffffffffffffffLL),
-			BPF_JMP_IMM(BPF_JSGT, R1, -2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSGT_K: Signed jump: if (-1 > -1) return 0",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_LD_IMM64(R1, 0xffffffffffffffffLL),
-			BPF_JMP_IMM(BPF_JSGT, R1, -1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSLE | BPF_K */
-	{
-		"JMP_JSLE_K: Signed jump: if (-2 <= -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 0xfffffffffffffffeLL),
-			BPF_JMP_IMM(BPF_JSLE, R1, -1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSLE_K: Signed jump: if (-1 <= -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 0xffffffffffffffffLL),
-			BPF_JMP_IMM(BPF_JSLE, R1, -1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSLE_K: Signed jump: value walk 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JSLE, R1, 0, 6),
-			BPF_ALU64_IMM(BPF_SUB, R1, 1),
-			BPF_JMP_IMM(BPF_JSLE, R1, 0, 4),
-			BPF_ALU64_IMM(BPF_SUB, R1, 1),
-			BPF_JMP_IMM(BPF_JSLE, R1, 0, 2),
-			BPF_ALU64_IMM(BPF_SUB, R1, 1),
-			BPF_JMP_IMM(BPF_JSLE, R1, 0, 1),
-			BPF_EXIT_INSN(),		/* bad exit */
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),	/* good exit */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSLE_K: Signed jump: value walk 2",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JSLE, R1, 0, 4),
-			BPF_ALU64_IMM(BPF_SUB, R1, 2),
-			BPF_JMP_IMM(BPF_JSLE, R1, 0, 2),
-			BPF_ALU64_IMM(BPF_SUB, R1, 2),
-			BPF_JMP_IMM(BPF_JSLE, R1, 0, 1),
-			BPF_EXIT_INSN(),		/* bad exit */
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),	/* good exit */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSGE | BPF_K */
-	{
-		"JMP_JSGE_K: Signed jump: if (-1 >= -2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 0xffffffffffffffffLL),
-			BPF_JMP_IMM(BPF_JSGE, R1, -2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSGE_K: Signed jump: if (-1 >= -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 0xffffffffffffffffLL),
-			BPF_JMP_IMM(BPF_JSGE, R1, -1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSGE_K: Signed jump: value walk 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -3),
-			BPF_JMP_IMM(BPF_JSGE, R1, 0, 6),
-			BPF_ALU64_IMM(BPF_ADD, R1, 1),
-			BPF_JMP_IMM(BPF_JSGE, R1, 0, 4),
-			BPF_ALU64_IMM(BPF_ADD, R1, 1),
-			BPF_JMP_IMM(BPF_JSGE, R1, 0, 2),
-			BPF_ALU64_IMM(BPF_ADD, R1, 1),
-			BPF_JMP_IMM(BPF_JSGE, R1, 0, 1),
-			BPF_EXIT_INSN(),		/* bad exit */
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),	/* good exit */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSGE_K: Signed jump: value walk 2",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -3),
-			BPF_JMP_IMM(BPF_JSGE, R1, 0, 4),
-			BPF_ALU64_IMM(BPF_ADD, R1, 2),
-			BPF_JMP_IMM(BPF_JSGE, R1, 0, 2),
-			BPF_ALU64_IMM(BPF_ADD, R1, 2),
-			BPF_JMP_IMM(BPF_JSGE, R1, 0, 1),
-			BPF_EXIT_INSN(),		/* bad exit */
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),	/* good exit */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JGT | BPF_K */
-	{
-		"JMP_JGT_K: if (3 > 2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JGT, R1, 2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JGT_K: Unsigned jump: if (-1 > 1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -1),
-			BPF_JMP_IMM(BPF_JGT, R1, 1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JLT | BPF_K */
-	{
-		"JMP_JLT_K: if (2 < 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 2),
-			BPF_JMP_IMM(BPF_JLT, R1, 3, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JGT_K: Unsigned jump: if (1 < -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 1),
-			BPF_JMP_IMM(BPF_JLT, R1, -1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JGE | BPF_K */
-	{
-		"JMP_JGE_K: if (3 >= 2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JGE, R1, 2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JLE | BPF_K */
-	{
-		"JMP_JLE_K: if (2 <= 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 2),
-			BPF_JMP_IMM(BPF_JLE, R1, 3, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JGT | BPF_K jump backwards */
-	{
-		"JMP_JGT_K: if (3 > 2) return 1 (jump backwards)",
-		.u.insns_int = {
-			BPF_JMP_IMM(BPF_JA, 0, 0, 2), /* goto start */
-			BPF_ALU32_IMM(BPF_MOV, R0, 1), /* out: */
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0), /* start: */
-			BPF_LD_IMM64(R1, 3), /* note: this takes 2 insns */
-			BPF_JMP_IMM(BPF_JGT, R1, 2, -6), /* goto out */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JGE_K: if (3 >= 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JGE, R1, 3, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JLT | BPF_K jump backwards */
-	{
-		"JMP_JGT_K: if (2 < 3) return 1 (jump backwards)",
-		.u.insns_int = {
-			BPF_JMP_IMM(BPF_JA, 0, 0, 2), /* goto start */
-			BPF_ALU32_IMM(BPF_MOV, R0, 1), /* out: */
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0), /* start: */
-			BPF_LD_IMM64(R1, 2), /* note: this takes 2 insns */
-			BPF_JMP_IMM(BPF_JLT, R1, 3, -6), /* goto out */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JLE_K: if (3 <= 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JLE, R1, 3, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JNE | BPF_K */
-	{
-		"JMP_JNE_K: if (3 != 2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JNE, R1, 2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JEQ | BPF_K */
-	{
-		"JMP_JEQ_K: if (3 == 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JEQ, R1, 3, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSET | BPF_K */
-	{
-		"JMP_JSET_K: if (0x3 & 0x2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JSET, R1, 2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSET_K: if (0x3 & 0xffffffff) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JSET, R1, 0xffffffff, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSGT | BPF_X */
-	{
-		"JMP_JSGT_X: Signed jump: if (-1 > -2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, -2),
-			BPF_JMP_REG(BPF_JSGT, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSGT_X: Signed jump: if (-1 > -1) return 0",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, -1),
-			BPF_JMP_REG(BPF_JSGT, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSLT | BPF_X */
-	{
-		"JMP_JSLT_X: Signed jump: if (-2 < -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, -2),
-			BPF_JMP_REG(BPF_JSLT, R2, R1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSLT_X: Signed jump: if (-1 < -1) return 0",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, -1),
-			BPF_JMP_REG(BPF_JSLT, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSGE | BPF_X */
-	{
-		"JMP_JSGE_X: Signed jump: if (-1 >= -2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, -2),
-			BPF_JMP_REG(BPF_JSGE, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSGE_X: Signed jump: if (-1 >= -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, -1),
-			BPF_JMP_REG(BPF_JSGE, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSLE | BPF_X */
-	{
-		"JMP_JSLE_X: Signed jump: if (-2 <= -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, -2),
-			BPF_JMP_REG(BPF_JSLE, R2, R1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSLE_X: Signed jump: if (-1 <= -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, -1),
-			BPF_JMP_REG(BPF_JSLE, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JGT | BPF_X */
-	{
-		"JMP_JGT_X: if (3 > 2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JGT, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JGT_X: Unsigned jump: if (-1 > 1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, 1),
-			BPF_JMP_REG(BPF_JGT, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JLT | BPF_X */
-	{
-		"JMP_JLT_X: if (2 < 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JLT, R2, R1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JLT_X: Unsigned jump: if (1 < -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, 1),
-			BPF_JMP_REG(BPF_JLT, R2, R1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JGE | BPF_X */
-	{
-		"JMP_JGE_X: if (3 >= 2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JGE, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JGE_X: if (3 >= 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 3),
-			BPF_JMP_REG(BPF_JGE, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JLE | BPF_X */
-	{
-		"JMP_JLE_X: if (2 <= 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JLE, R2, R1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JLE_X: if (3 <= 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 3),
-			BPF_JMP_REG(BPF_JLE, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		/* Mainly testing JIT + imm64 here. */
-		"JMP_JGE_X: ldimm64 test 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JGE, R1, R2, 2),
-			BPF_LD_IMM64(R0, 0xffffffffffffffffULL),
-			BPF_LD_IMM64(R0, 0xeeeeeeeeeeeeeeeeULL),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xeeeeeeeeU } },
-	},
-	{
-		"JMP_JGE_X: ldimm64 test 2",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JGE, R1, R2, 0),
-			BPF_LD_IMM64(R0, 0xffffffffffffffffULL),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffffU } },
-	},
-	{
-		"JMP_JGE_X: ldimm64 test 3",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JGE, R1, R2, 4),
-			BPF_LD_IMM64(R0, 0xffffffffffffffffULL),
-			BPF_LD_IMM64(R0, 0xeeeeeeeeeeeeeeeeULL),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JLE_X: ldimm64 test 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JLE, R2, R1, 2),
-			BPF_LD_IMM64(R0, 0xffffffffffffffffULL),
-			BPF_LD_IMM64(R0, 0xeeeeeeeeeeeeeeeeULL),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xeeeeeeeeU } },
-	},
-	{
-		"JMP_JLE_X: ldimm64 test 2",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JLE, R2, R1, 0),
-			BPF_LD_IMM64(R0, 0xffffffffffffffffULL),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffffU } },
-	},
-	{
-		"JMP_JLE_X: ldimm64 test 3",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JLE, R2, R1, 4),
-			BPF_LD_IMM64(R0, 0xffffffffffffffffULL),
-			BPF_LD_IMM64(R0, 0xeeeeeeeeeeeeeeeeULL),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JNE | BPF_X */
-	{
-		"JMP_JNE_X: if (3 != 2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JNE, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JEQ | BPF_X */
-	{
-		"JMP_JEQ_X: if (3 == 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 3),
-			BPF_JMP_REG(BPF_JEQ, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSET | BPF_X */
-	{
-		"JMP_JSET_X: if (0x3 & 0x2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JSET, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSET_X: if (0x3 & 0xffffffff) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JSET, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JA: Jump, gap, jump, ...",
-		{ },
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0xababcbac } },
-		.fill_helper = bpf_fill_ja,
-	},
-	{	/* Mainly checking JIT here. */
-		"BPF_MAXINSNS: Maximum possible literals",
-		{ },
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0xffffffff } },
-		.fill_helper = bpf_fill_maxinsns1,
-	},
-	{	/* Mainly checking JIT here. */
-		"BPF_MAXINSNS: Single literal",
-		{ },
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0xfefefefe } },
-		.fill_helper = bpf_fill_maxinsns2,
-	},
-	{	/* Mainly checking JIT here. */
-		"BPF_MAXINSNS: Run/add until end",
-		{ },
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0x947bf368 } },
-		.fill_helper = bpf_fill_maxinsns3,
-	},
-	{
-		"BPF_MAXINSNS: Too many instructions",
-		{ },
-		CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-		{ },
-		{ },
-		.fill_helper = bpf_fill_maxinsns4,
-		.expected_errcode = -EINVAL,
-	},
-	{	/* Mainly checking JIT here. */
-		"BPF_MAXINSNS: Very long jump",
-		{ },
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0xabababab } },
-		.fill_helper = bpf_fill_maxinsns5,
-	},
-	{	/* Mainly checking JIT here. */
-		"BPF_MAXINSNS: Ctx heavy transformations",
-		{ },
-		CLASSIC,
-		{ },
-		{
-			{  1, SKB_VLAN_PRESENT },
-			{ 10, SKB_VLAN_PRESENT }
-		},
-		.fill_helper = bpf_fill_maxinsns6,
-	},
-	{	/* Mainly checking JIT here. */
-		"BPF_MAXINSNS: Call heavy transformations",
-		{ },
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 1, 0 }, { 10, 0 } },
-		.fill_helper = bpf_fill_maxinsns7,
-	},
-	{	/* Mainly checking JIT here. */
-		"BPF_MAXINSNS: Jump heavy test",
-		{ },
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0xffffffff } },
-		.fill_helper = bpf_fill_maxinsns8,
-	},
-	{	/* Mainly checking JIT here. */
-		"BPF_MAXINSNS: Very long jump backwards",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0xcbababab } },
-		.fill_helper = bpf_fill_maxinsns9,
-	},
-	{	/* Mainly checking JIT here. */
-		"BPF_MAXINSNS: Edge hopping nuthouse",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0xabababac } },
-		.fill_helper = bpf_fill_maxinsns10,
-	},
-	{
-		"BPF_MAXINSNS: Jump, gap, jump, ...",
-		{ },
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0xababcbac } },
-		.fill_helper = bpf_fill_maxinsns11,
-	},
-	{
-		"BPF_MAXINSNS: jump over MSH",
-		{ },
-		CLASSIC | FLAG_EXPECTED_FAIL,
-		{ 0xfa, 0xfb, 0xfc, 0xfd, },
-		{ { 4, 0xabababab } },
-		.fill_helper = bpf_fill_maxinsns12,
-		.expected_errcode = -EINVAL,
-	},
-	{
-		"BPF_MAXINSNS: exec all MSH",
-		{ },
-		CLASSIC,
-		{ 0xfa, 0xfb, 0xfc, 0xfd, },
-		{ { 4, 0xababab83 } },
-		.fill_helper = bpf_fill_maxinsns13,
-	},
-	{
-		"BPF_MAXINSNS: ld_abs+get_processor_id",
-		{ },
-		CLASSIC,
-		{ },
-		{ { 1, 0xbee } },
-		.fill_helper = bpf_fill_ld_abs_get_processor_id,
-	},
-	/*
-	 * LD_IND / LD_ABS on fragmented SKBs
-	 */
-	{
-		"LD_IND byte frag",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x40),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, 0x0),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ },
-		{ {0x40, 0x42} },
-		.frag_data = {
-			0x42, 0x00, 0x00, 0x00,
-			0x43, 0x44, 0x00, 0x00,
-			0x21, 0x07, 0x19, 0x83,
-		},
-	},
-	{
-		"LD_IND halfword frag",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x40),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_H, 0x4),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ },
-		{ {0x40, 0x4344} },
-		.frag_data = {
-			0x42, 0x00, 0x00, 0x00,
-			0x43, 0x44, 0x00, 0x00,
-			0x21, 0x07, 0x19, 0x83,
-		},
-	},
-	{
-		"LD_IND word frag",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x40),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, 0x8),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ },
-		{ {0x40, 0x21071983} },
-		.frag_data = {
-			0x42, 0x00, 0x00, 0x00,
-			0x43, 0x44, 0x00, 0x00,
-			0x21, 0x07, 0x19, 0x83,
-		},
-	},
-	{
-		"LD_IND halfword mixed head/frag",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x40),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_H, -0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ [0x3e] = 0x25, [0x3f] = 0x05, },
-		{ {0x40, 0x0519} },
-		.frag_data = { 0x19, 0x82 },
-	},
-	{
-		"LD_IND word mixed head/frag",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x40),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, -0x2),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ [0x3e] = 0x25, [0x3f] = 0x05, },
-		{ {0x40, 0x25051982} },
-		.frag_data = { 0x19, 0x82 },
-	},
-	{
-		"LD_ABS byte frag",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, 0x40),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ },
-		{ {0x40, 0x42} },
-		.frag_data = {
-			0x42, 0x00, 0x00, 0x00,
-			0x43, 0x44, 0x00, 0x00,
-			0x21, 0x07, 0x19, 0x83,
-		},
-	},
-	{
-		"LD_ABS halfword frag",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_H, 0x44),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ },
-		{ {0x40, 0x4344} },
-		.frag_data = {
-			0x42, 0x00, 0x00, 0x00,
-			0x43, 0x44, 0x00, 0x00,
-			0x21, 0x07, 0x19, 0x83,
-		},
-	},
-	{
-		"LD_ABS word frag",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x48),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ },
-		{ {0x40, 0x21071983} },
-		.frag_data = {
-			0x42, 0x00, 0x00, 0x00,
-			0x43, 0x44, 0x00, 0x00,
-			0x21, 0x07, 0x19, 0x83,
-		},
-	},
-	{
-		"LD_ABS halfword mixed head/frag",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_H, 0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ [0x3e] = 0x25, [0x3f] = 0x05, },
-		{ {0x40, 0x0519} },
-		.frag_data = { 0x19, 0x82 },
-	},
-	{
-		"LD_ABS word mixed head/frag",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x3e),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ [0x3e] = 0x25, [0x3f] = 0x05, },
-		{ {0x40, 0x25051982} },
-		.frag_data = { 0x19, 0x82 },
-	},
-	/*
-	 * LD_IND / LD_ABS on non fragmented SKBs
-	 */
-	{
-		/*
-		 * this tests that the JIT/interpreter correctly resets X
-		 * before using it in an LD_IND instruction.
-		 */
-		"LD_IND byte default X",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x1] = 0x42 },
-		{ {0x40, 0x42 } },
-	},
-	{
-		"LD_IND byte positive offset",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3e),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x82 } },
-	},
-	{
-		"LD_IND byte negative offset",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3e),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, -0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x05 } },
-	},
-	{
-		"LD_IND byte positive offset, all ff",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3e),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0xff, [0x3d] = 0xff,  [0x3e] = 0xff, [0x3f] = 0xff },
-		{ {0x40, 0xff } },
-	},
-	{
-		"LD_IND byte positive offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3e),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 }, },
-	},
-	{
-		"LD_IND byte negative offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3e),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, -0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 } },
-	},
-	{
-		"LD_IND byte negative offset, multiple calls",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3b),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, SKF_LL_OFF + 1),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, SKF_LL_OFF + 2),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, SKF_LL_OFF + 3),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, SKF_LL_OFF + 4),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x82 }, },
-	},
-	{
-		"LD_IND halfword positive offset",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x20),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_H, 0x2),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-		},
-		{ {0x40, 0xdd88 } },
-	},
-	{
-		"LD_IND halfword negative offset",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x20),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_H, -0x2),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-		},
-		{ {0x40, 0xbb66 } },
-	},
-	{
-		"LD_IND halfword unaligned",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x20),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_H, -0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-		},
-		{ {0x40, 0x66cc } },
-	},
-	{
-		"LD_IND halfword positive offset, all ff",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3d),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_H, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0xff, [0x3d] = 0xff,  [0x3e] = 0xff, [0x3f] = 0xff },
-		{ {0x40, 0xffff } },
-	},
-	{
-		"LD_IND halfword positive offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3e),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_H, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 }, },
-	},
-	{
-		"LD_IND halfword negative offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3e),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_H, -0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 } },
-	},
-	{
-		"LD_IND word positive offset",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x20),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, 0x4),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0xee99ffaa } },
-	},
-	{
-		"LD_IND word negative offset",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x20),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, -0x4),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0xaa55bb66 } },
-	},
-	{
-		"LD_IND word unaligned (addr & 3 == 2)",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x20),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, -0x2),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0xbb66cc77 } },
-	},
-	{
-		"LD_IND word unaligned (addr & 3 == 1)",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x20),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, -0x3),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0x55bb66cc } },
-	},
-	{
-		"LD_IND word unaligned (addr & 3 == 3)",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x20),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, -0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0x66cc77dd } },
-	},
-	{
-		"LD_IND word positive offset, all ff",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3b),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0xff, [0x3d] = 0xff,  [0x3e] = 0xff, [0x3f] = 0xff },
-		{ {0x40, 0xffffffff } },
-	},
-	{
-		"LD_IND word positive offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3e),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 }, },
-	},
-	{
-		"LD_IND word negative offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3e),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, -0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 } },
-	},
-	{
-		"LD_ABS byte",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, 0x20),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0xcc } },
-	},
-	{
-		"LD_ABS byte positive offset, all ff",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, 0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0xff, [0x3d] = 0xff,  [0x3e] = 0xff, [0x3f] = 0xff },
-		{ {0x40, 0xff } },
-	},
-	{
-		"LD_ABS byte positive offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, 0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 }, },
-	},
-	{
-		"LD_ABS byte negative offset, out of bounds load",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, -1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_EXPECTED_FAIL,
-		.expected_errcode = -EINVAL,
-	},
-	{
-		"LD_ABS byte negative offset, in bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, SKF_LL_OFF + 0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x82 }, },
-	},
-	{
-		"LD_ABS byte negative offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, SKF_LL_OFF + 0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 }, },
-	},
-	{
-		"LD_ABS byte negative offset, multiple calls",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, SKF_LL_OFF + 0x3c),
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, SKF_LL_OFF + 0x3d),
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, SKF_LL_OFF + 0x3e),
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, SKF_LL_OFF + 0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x82 }, },
-	},
-	{
-		"LD_ABS halfword",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_H, 0x22),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0xdd88 } },
-	},
-	{
-		"LD_ABS halfword unaligned",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_H, 0x25),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0x99ff } },
-	},
-	{
-		"LD_ABS halfword positive offset, all ff",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_H, 0x3e),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0xff, [0x3d] = 0xff,  [0x3e] = 0xff, [0x3f] = 0xff },
-		{ {0x40, 0xffff } },
-	},
-	{
-		"LD_ABS halfword positive offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_H, 0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 }, },
-	},
-	{
-		"LD_ABS halfword negative offset, out of bounds load",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_H, -1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_EXPECTED_FAIL,
-		.expected_errcode = -EINVAL,
-	},
-	{
-		"LD_ABS halfword negative offset, in bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_H, SKF_LL_OFF + 0x3e),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x1982 }, },
-	},
-	{
-		"LD_ABS halfword negative offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_H, SKF_LL_OFF + 0x3e),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 }, },
-	},
-	{
-		"LD_ABS word",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x1c),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0xaa55bb66 } },
-	},
-	{
-		"LD_ABS word unaligned (addr & 3 == 2)",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x22),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0xdd88ee99 } },
-	},
-	{
-		"LD_ABS word unaligned (addr & 3 == 1)",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x21),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0x77dd88ee } },
-	},
-	{
-		"LD_ABS word unaligned (addr & 3 == 3)",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x23),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0x88ee99ff } },
-	},
-	{
-		"LD_ABS word positive offset, all ff",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x3c),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0xff, [0x3d] = 0xff,  [0x3e] = 0xff, [0x3f] = 0xff },
-		{ {0x40, 0xffffffff } },
-	},
-	{
-		"LD_ABS word positive offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 }, },
-	},
-	{
-		"LD_ABS word negative offset, out of bounds load",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, -1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_EXPECTED_FAIL,
-		.expected_errcode = -EINVAL,
-	},
-	{
-		"LD_ABS word negative offset, in bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, SKF_LL_OFF + 0x3c),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x25051982 }, },
-	},
-	{
-		"LD_ABS word negative offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, SKF_LL_OFF + 0x3c),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 }, },
-	},
-	{
-		"LDX_MSH standalone, preserved A",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffeebbaa),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3c),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0xffeebbaa }, },
-	},
-	{
-		"LDX_MSH standalone, preserved A 2",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0x175e9d63),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3c),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3d),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3e),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x175e9d63 }, },
-	},
-	{
-		"LDX_MSH standalone, test result 1",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffeebbaa),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3c),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x14 }, },
-	},
-	{
-		"LDX_MSH standalone, test result 2",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffeebbaa),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3e),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x24 }, },
-	},
-	{
-		"LDX_MSH standalone, negative offset",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffeebbaa),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, -1),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0 }, },
-	},
-	{
-		"LDX_MSH standalone, negative offset 2",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffeebbaa),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, SKF_LL_OFF + 0x3e),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x24 }, },
-	},
-	{
-		"LDX_MSH standalone, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffeebbaa),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x40),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0 }, },
-	},
-	/*
-	 * verify that the interpreter or JIT correctly sets A and X
-	 * to 0.
-	 */
-	{
-		"ADD default X",
-		.u.insns = {
-			/*
-			 * A = 0x42
-			 * A = A + X
-			 * ret A
-			 */
-			BPF_STMT(BPF_LD | BPF_IMM, 0x42),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x42 } },
-	},
-	{
-		"ADD default A",
-		.u.insns = {
-			/*
-			 * A = A + 0x42
-			 * ret A
-			 */
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 0x42),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x42 } },
-	},
-	{
-		"SUB default X",
-		.u.insns = {
-			/*
-			 * A = 0x66
-			 * A = A - X
-			 * ret A
-			 */
-			BPF_STMT(BPF_LD | BPF_IMM, 0x66),
-			BPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x66 } },
-	},
-	{
-		"SUB default A",
-		.u.insns = {
-			/*
-			 * A = A - -0x66
-			 * ret A
-			 */
-			BPF_STMT(BPF_ALU | BPF_SUB | BPF_K, -0x66),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x66 } },
-	},
-	{
-		"MUL default X",
-		.u.insns = {
-			/*
-			 * A = 0x42
-			 * A = A * X
-			 * ret A
-			 */
-			BPF_STMT(BPF_LD | BPF_IMM, 0x42),
-			BPF_STMT(BPF_ALU | BPF_MUL | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x0 } },
-	},
-	{
-		"MUL default A",
-		.u.insns = {
-			/*
-			 * A = A * 0x66
-			 * ret A
-			 */
-			BPF_STMT(BPF_ALU | BPF_MUL | BPF_K, 0x66),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x0 } },
-	},
-	{
-		"DIV default X",
-		.u.insns = {
-			/*
-			 * A = 0x42
-			 * A = A / X ; this halt the filter execution if X is 0
-			 * ret 0x42
-			 */
-			BPF_STMT(BPF_LD | BPF_IMM, 0x42),
-			BPF_STMT(BPF_ALU | BPF_DIV | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_K, 0x42),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x0 } },
-	},
-	{
-		"DIV default A",
-		.u.insns = {
-			/*
-			 * A = A / 1
-			 * ret A
-			 */
-			BPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x0 } },
-	},
-	{
-		"MOD default X",
-		.u.insns = {
-			/*
-			 * A = 0x42
-			 * A = A mod X ; this halt the filter execution if X is 0
-			 * ret 0x42
-			 */
-			BPF_STMT(BPF_LD | BPF_IMM, 0x42),
-			BPF_STMT(BPF_ALU | BPF_MOD | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_K, 0x42),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x0 } },
-	},
-	{
-		"MOD default A",
-		.u.insns = {
-			/*
-			 * A = A mod 1
-			 * ret A
-			 */
-			BPF_STMT(BPF_ALU | BPF_MOD | BPF_K, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x0 } },
-	},
-	{
-		"JMP EQ default A",
-		.u.insns = {
-			/*
-			 * cmp A, 0x0, 0, 1
-			 * ret 0x42
-			 * ret 0x66
-			 */
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x0, 0, 1),
-			BPF_STMT(BPF_RET | BPF_K, 0x42),
-			BPF_STMT(BPF_RET | BPF_K, 0x66),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x42 } },
-	},
-	{
-		"JMP EQ default X",
-		.u.insns = {
-			/*
-			 * A = 0x0
-			 * cmp A, X, 0, 1
-			 * ret 0x42
-			 * ret 0x66
-			 */
-			BPF_STMT(BPF_LD | BPF_IMM, 0x0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_X, 0x0, 0, 1),
-			BPF_STMT(BPF_RET | BPF_K, 0x42),
-			BPF_STMT(BPF_RET | BPF_K, 0x66),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x42 } },
-	},
-	/* Checking interpreter vs JIT wrt signed extended imms. */
-	{
-		"JNE signed compare, test 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xfefbbc12),
-			BPF_ALU32_IMM(BPF_MOV, R3, 0xffff0000),
-			BPF_MOV64_REG(R2, R1),
-			BPF_ALU64_REG(BPF_AND, R2, R3),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JNE, R2, -17104896, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JNE signed compare, test 2",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xfefbbc12),
-			BPF_ALU32_IMM(BPF_MOV, R3, 0xffff0000),
-			BPF_MOV64_REG(R2, R1),
-			BPF_ALU64_REG(BPF_AND, R2, R3),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JNE, R2, 0xfefb0000, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JNE signed compare, test 3",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xfefbbc12),
-			BPF_ALU32_IMM(BPF_MOV, R3, 0xffff0000),
-			BPF_ALU32_IMM(BPF_MOV, R4, 0xfefb0000),
-			BPF_MOV64_REG(R2, R1),
-			BPF_ALU64_REG(BPF_AND, R2, R3),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JNE, R2, R4, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"JNE signed compare, test 4",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, -17104896),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JNE, R1, -17104896, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"JNE signed compare, test 5",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0xfefb0000),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JNE, R1, 0xfefb0000, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JNE signed compare, test 6",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x7efb0000),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JNE, R1, 0x7efb0000, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"JNE signed compare, test 7",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffff0000),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_IMM, 0xfefbbc12),
-			BPF_STMT(BPF_ALU | BPF_AND | BPF_X, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0xfefb0000, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-			BPF_STMT(BPF_RET | BPF_K, 2),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ { 0, 2 } },
-	},
-	/* BPF_LDX_MEM with operand aliasing */
-	{
-		"LDX_MEM_B: operand register aliasing",
-		.u.insns_int = {
-			BPF_ST_MEM(BPF_B, R10, -8, 123),
-			BPF_MOV64_REG(R0, R10),
-			BPF_LDX_MEM(BPF_B, R0, R0, -8),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 123 } },
-		.stack_depth = 8,
-	},
-	{
-		"LDX_MEM_H: operand register aliasing",
-		.u.insns_int = {
-			BPF_ST_MEM(BPF_H, R10, -8, 12345),
-			BPF_MOV64_REG(R0, R10),
-			BPF_LDX_MEM(BPF_H, R0, R0, -8),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 12345 } },
-		.stack_depth = 8,
-	},
-	{
-		"LDX_MEM_W: operand register aliasing",
-		.u.insns_int = {
-			BPF_ST_MEM(BPF_W, R10, -8, 123456789),
-			BPF_MOV64_REG(R0, R10),
-			BPF_LDX_MEM(BPF_W, R0, R0, -8),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 123456789 } },
-		.stack_depth = 8,
-	},
-	{
-		"LDX_MEM_DW: operand register aliasing",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x123456789abcdefULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-			BPF_MOV64_REG(R0, R10),
-			BPF_LDX_MEM(BPF_DW, R0, R0, -8),
-			BPF_ALU64_REG(BPF_SUB, R0, R1),
-			BPF_MOV64_REG(R1, R0),
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),
-			BPF_ALU64_REG(BPF_OR, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	/*
-	 * Register (non-)clobbering tests for the case where a JIT implements
-	 * complex ALU or ATOMIC operations via function calls. If so, the
-	 * function call must be transparent to the eBPF registers. The JIT
-	 * must therefore save and restore relevant registers across the call.
-	 * The following tests check that the eBPF registers retain their
-	 * values after such an operation. Mainly intended for complex ALU
-	 * and atomic operation, but we run it for all. You never know...
-	 *
-	 * Note that each operations should be tested twice with different
-	 * destinations, to check preservation for all registers.
-	 */
-#define BPF_TEST_CLOBBER_ALU(alu, op, dst, src)			\
-	{							\
-		#alu "_" #op " to " #dst ": no clobbering",	\
-		.u.insns_int = {				\
-			BPF_ALU64_IMM(BPF_MOV, R0, R0),		\
-			BPF_ALU64_IMM(BPF_MOV, R1, R1),		\
-			BPF_ALU64_IMM(BPF_MOV, R2, R2),		\
-			BPF_ALU64_IMM(BPF_MOV, R3, R3),		\
-			BPF_ALU64_IMM(BPF_MOV, R4, R4),		\
-			BPF_ALU64_IMM(BPF_MOV, R5, R5),		\
-			BPF_ALU64_IMM(BPF_MOV, R6, R6),		\
-			BPF_ALU64_IMM(BPF_MOV, R7, R7),		\
-			BPF_ALU64_IMM(BPF_MOV, R8, R8),		\
-			BPF_ALU64_IMM(BPF_MOV, R9, R9),		\
-			BPF_##alu(BPF_ ##op, dst, src),		\
-			BPF_ALU32_IMM(BPF_MOV, dst, dst),	\
-			BPF_JMP_IMM(BPF_JNE, R0, R0, 10),	\
-			BPF_JMP_IMM(BPF_JNE, R1, R1, 9),	\
-			BPF_JMP_IMM(BPF_JNE, R2, R2, 8),	\
-			BPF_JMP_IMM(BPF_JNE, R3, R3, 7),	\
-			BPF_JMP_IMM(BPF_JNE, R4, R4, 6),	\
-			BPF_JMP_IMM(BPF_JNE, R5, R5, 5),	\
-			BPF_JMP_IMM(BPF_JNE, R6, R6, 4),	\
-			BPF_JMP_IMM(BPF_JNE, R7, R7, 3),	\
-			BPF_JMP_IMM(BPF_JNE, R8, R8, 2),	\
-			BPF_JMP_IMM(BPF_JNE, R9, R9, 1),	\
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),		\
-			BPF_EXIT_INSN(),			\
-		},						\
-		INTERNAL,					\
-		{ },						\
-		{ { 0, 1 } }					\
-	}
-	/* ALU64 operations, register clobbering */
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, AND, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, AND, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, OR, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, OR, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, XOR, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, XOR, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, LSH, R8, 12),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, LSH, R9, 12),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, RSH, R8, 12),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, RSH, R9, 12),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, ARSH, R8, 12),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, ARSH, R9, 12),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, ADD, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, ADD, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, SUB, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, SUB, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, MUL, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, MUL, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, DIV, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, DIV, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, MOD, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, MOD, R9, 123456789),
-	/* ALU32 immediate operations, register clobbering */
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, AND, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, AND, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, OR, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, OR, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, XOR, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, XOR, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, LSH, R8, 12),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, LSH, R9, 12),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, RSH, R8, 12),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, RSH, R9, 12),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, ARSH, R8, 12),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, ARSH, R9, 12),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, ADD, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, ADD, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, SUB, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, SUB, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, MUL, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, MUL, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, DIV, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, DIV, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, MOD, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, MOD, R9, 123456789),
-	/* ALU64 register operations, register clobbering */
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, AND, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, AND, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, OR, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, OR, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, XOR, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, XOR, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, LSH, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, LSH, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, RSH, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, RSH, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, ARSH, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, ARSH, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, ADD, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, ADD, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, SUB, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, SUB, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, MUL, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, MUL, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, DIV, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, DIV, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, MOD, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, MOD, R9, R1),
-	/* ALU32 register operations, register clobbering */
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, AND, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, AND, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, OR, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, OR, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, XOR, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, XOR, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, LSH, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, LSH, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, RSH, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, RSH, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, ARSH, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, ARSH, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, ADD, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, ADD, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, SUB, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, SUB, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, MUL, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, MUL, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, DIV, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, DIV, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, MOD, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, MOD, R9, R1),
-#undef BPF_TEST_CLOBBER_ALU
-#define BPF_TEST_CLOBBER_ATOMIC(width, op)			\
-	{							\
-		"Atomic_" #width " " #op ": no clobbering",	\
-		.u.insns_int = {				\
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),		\
-			BPF_ALU64_IMM(BPF_MOV, R1, 1),		\
-			BPF_ALU64_IMM(BPF_MOV, R2, 2),		\
-			BPF_ALU64_IMM(BPF_MOV, R3, 3),		\
-			BPF_ALU64_IMM(BPF_MOV, R4, 4),		\
-			BPF_ALU64_IMM(BPF_MOV, R5, 5),		\
-			BPF_ALU64_IMM(BPF_MOV, R6, 6),		\
-			BPF_ALU64_IMM(BPF_MOV, R7, 7),		\
-			BPF_ALU64_IMM(BPF_MOV, R8, 8),		\
-			BPF_ALU64_IMM(BPF_MOV, R9, 9),		\
-			BPF_ST_MEM(width, R10, -8,		\
-				   (op) == BPF_CMPXCHG ? 0 :	\
-				   (op) & BPF_FETCH ? 1 : 0),	\
-			BPF_ATOMIC_OP(width, op, R10, R1, -8),	\
-			BPF_JMP_IMM(BPF_JNE, R0, 0, 10),	\
-			BPF_JMP_IMM(BPF_JNE, R1, 1, 9),		\
-			BPF_JMP_IMM(BPF_JNE, R2, 2, 8),		\
-			BPF_JMP_IMM(BPF_JNE, R3, 3, 7),		\
-			BPF_JMP_IMM(BPF_JNE, R4, 4, 6),		\
-			BPF_JMP_IMM(BPF_JNE, R5, 5, 5),		\
-			BPF_JMP_IMM(BPF_JNE, R6, 6, 4),		\
-			BPF_JMP_IMM(BPF_JNE, R7, 7, 3),		\
-			BPF_JMP_IMM(BPF_JNE, R8, 8, 2),		\
-			BPF_JMP_IMM(BPF_JNE, R9, 9, 1),		\
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),		\
-			BPF_EXIT_INSN(),			\
-		},						\
-		INTERNAL,					\
-		{ },						\
-		{ { 0, 1 } },					\
-		.stack_depth = 8,				\
-	}
-	/* 64-bit atomic operations, register clobbering */
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_ADD),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_AND),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_OR),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_XOR),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_ADD | BPF_FETCH),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_AND | BPF_FETCH),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_OR | BPF_FETCH),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_XOR | BPF_FETCH),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_XCHG),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_CMPXCHG),
-	/* 32-bit atomic operations, register clobbering */
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_ADD),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_AND),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_OR),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_XOR),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_ADD | BPF_FETCH),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_AND | BPF_FETCH),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_OR | BPF_FETCH),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_XOR | BPF_FETCH),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_XCHG),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_CMPXCHG),
-#undef BPF_TEST_CLOBBER_ATOMIC
-	/* Checking that ALU32 src is not zero extended in place */
-#define BPF_ALU32_SRC_ZEXT(op)					\
-	{							\
-		"ALU32_" #op "_X: src preserved in zext",	\
-		.u.insns_int = {				\
-			BPF_LD_IMM64(R1, 0x0123456789acbdefULL),\
-			BPF_LD_IMM64(R2, 0xfedcba9876543210ULL),\
-			BPF_ALU64_REG(BPF_MOV, R0, R1),		\
-			BPF_ALU32_REG(BPF_##op, R2, R1),	\
-			BPF_ALU64_REG(BPF_SUB, R0, R1),		\
-			BPF_ALU64_REG(BPF_MOV, R1, R0),		\
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),		\
-			BPF_ALU64_REG(BPF_OR, R0, R1),		\
-			BPF_EXIT_INSN(),			\
-		},						\
-		INTERNAL,					\
-		{ },						\
-		{ { 0, 0 } },					\
-	}
-	BPF_ALU32_SRC_ZEXT(MOV),
-	BPF_ALU32_SRC_ZEXT(AND),
-	BPF_ALU32_SRC_ZEXT(OR),
-	BPF_ALU32_SRC_ZEXT(XOR),
-	BPF_ALU32_SRC_ZEXT(ADD),
-	BPF_ALU32_SRC_ZEXT(SUB),
-	BPF_ALU32_SRC_ZEXT(MUL),
-	BPF_ALU32_SRC_ZEXT(DIV),
-	BPF_ALU32_SRC_ZEXT(MOD),
-#undef BPF_ALU32_SRC_ZEXT
-	/* Checking that ATOMIC32 src is not zero extended in place */
-#define BPF_ATOMIC32_SRC_ZEXT(op)					\
-	{								\
-		"ATOMIC_W_" #op ": src preserved in zext",		\
-		.u.insns_int = {					\
-			BPF_LD_IMM64(R0, 0x0123456789acbdefULL),	\
-			BPF_ALU64_REG(BPF_MOV, R1, R0),			\
-			BPF_ST_MEM(BPF_W, R10, -4, 0),			\
-			BPF_ATOMIC_OP(BPF_W, BPF_##op, R10, R1, -4),	\
-			BPF_ALU64_REG(BPF_SUB, R0, R1),			\
-			BPF_ALU64_REG(BPF_MOV, R1, R0),			\
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),			\
-			BPF_ALU64_REG(BPF_OR, R0, R1),			\
-			BPF_EXIT_INSN(),				\
-		},							\
-		INTERNAL,						\
-		{ },							\
-		{ { 0, 0 } },						\
-		.stack_depth = 8,					\
-	}
-	BPF_ATOMIC32_SRC_ZEXT(ADD),
-	BPF_ATOMIC32_SRC_ZEXT(AND),
-	BPF_ATOMIC32_SRC_ZEXT(OR),
-	BPF_ATOMIC32_SRC_ZEXT(XOR),
-#undef BPF_ATOMIC32_SRC_ZEXT
-	/* Checking that CMPXCHG32 src is not zero extended in place */
-	{
-		"ATOMIC_W_CMPXCHG: src preserved in zext",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0123456789acbdefULL),
-			BPF_ALU64_REG(BPF_MOV, R2, R1),
-			BPF_ALU64_REG(BPF_MOV, R0, 0),
-			BPF_ST_MEM(BPF_W, R10, -4, 0),
-			BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R1, -4),
-			BPF_ALU64_REG(BPF_SUB, R1, R2),
-			BPF_ALU64_REG(BPF_MOV, R2, R1),
-			BPF_ALU64_IMM(BPF_RSH, R2, 32),
-			BPF_ALU64_REG(BPF_OR, R1, R2),
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	/* Checking that JMP32 immediate src is not zero extended in place */
-#define BPF_JMP32_IMM_ZEXT(op)					\
-	{							\
-		"JMP32_" #op "_K: operand preserved in zext",	\
-		.u.insns_int = {				\
-			BPF_LD_IMM64(R0, 0x0123456789acbdefULL),\
-			BPF_ALU64_REG(BPF_MOV, R1, R0),		\
-			BPF_JMP32_IMM(BPF_##op, R0, 1234, 1),	\
-			BPF_JMP_A(0), /* Nop */			\
-			BPF_ALU64_REG(BPF_SUB, R0, R1),		\
-			BPF_ALU64_REG(BPF_MOV, R1, R0),		\
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),		\
-			BPF_ALU64_REG(BPF_OR, R0, R1),		\
-			BPF_EXIT_INSN(),			\
-		},						\
-		INTERNAL,					\
-		{ },						\
-		{ { 0, 0 } },					\
-	}
-	BPF_JMP32_IMM_ZEXT(JEQ),
-	BPF_JMP32_IMM_ZEXT(JNE),
-	BPF_JMP32_IMM_ZEXT(JSET),
-	BPF_JMP32_IMM_ZEXT(JGT),
-	BPF_JMP32_IMM_ZEXT(JGE),
-	BPF_JMP32_IMM_ZEXT(JLT),
-	BPF_JMP32_IMM_ZEXT(JLE),
-	BPF_JMP32_IMM_ZEXT(JSGT),
-	BPF_JMP32_IMM_ZEXT(JSGE),
-	BPF_JMP32_IMM_ZEXT(JSLT),
-	BPF_JMP32_IMM_ZEXT(JSLE),
-#undef BPF_JMP2_IMM_ZEXT
-	/* Checking that JMP32 dst & src are not zero extended in place */
-#define BPF_JMP32_REG_ZEXT(op)					\
-	{							\
-		"JMP32_" #op "_X: operands preserved in zext",	\
-		.u.insns_int = {				\
-			BPF_LD_IMM64(R0, 0x0123456789acbdefULL),\
-			BPF_LD_IMM64(R1, 0xfedcba9876543210ULL),\
-			BPF_ALU64_REG(BPF_MOV, R2, R0),		\
-			BPF_ALU64_REG(BPF_MOV, R3, R1),		\
-			BPF_JMP32_IMM(BPF_##op, R0, R1, 1),	\
-			BPF_JMP_A(0), /* Nop */			\
-			BPF_ALU64_REG(BPF_SUB, R0, R2),		\
-			BPF_ALU64_REG(BPF_SUB, R1, R3),		\
-			BPF_ALU64_REG(BPF_OR, R0, R1),		\
-			BPF_ALU64_REG(BPF_MOV, R1, R0),		\
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),		\
-			BPF_ALU64_REG(BPF_OR, R0, R1),		\
-			BPF_EXIT_INSN(),			\
-		},						\
-		INTERNAL,					\
-		{ },						\
-		{ { 0, 0 } },					\
-	}
-	BPF_JMP32_REG_ZEXT(JEQ),
-	BPF_JMP32_REG_ZEXT(JNE),
-	BPF_JMP32_REG_ZEXT(JSET),
-	BPF_JMP32_REG_ZEXT(JGT),
-	BPF_JMP32_REG_ZEXT(JGE),
-	BPF_JMP32_REG_ZEXT(JLT),
-	BPF_JMP32_REG_ZEXT(JLE),
-	BPF_JMP32_REG_ZEXT(JSGT),
-	BPF_JMP32_REG_ZEXT(JSGE),
-	BPF_JMP32_REG_ZEXT(JSLT),
-	BPF_JMP32_REG_ZEXT(JSLE),
-#undef BPF_JMP2_REG_ZEXT
-	/* ALU64 K register combinations */
-	{
-		"ALU64_MOV_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mov_imm_regs,
-	},
-	{
-		"ALU64_AND_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_and_imm_regs,
-	},
-	{
-		"ALU64_OR_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_or_imm_regs,
-	},
-	{
-		"ALU64_XOR_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_xor_imm_regs,
-	},
-	{
-		"ALU64_LSH_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_lsh_imm_regs,
-	},
-	{
-		"ALU64_RSH_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_rsh_imm_regs,
-	},
-	{
-		"ALU64_ARSH_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_arsh_imm_regs,
-	},
-	{
-		"ALU64_ADD_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_add_imm_regs,
-	},
-	{
-		"ALU64_SUB_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_sub_imm_regs,
-	},
-	{
-		"ALU64_MUL_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mul_imm_regs,
-	},
-	{
-		"ALU64_DIV_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_div_imm_regs,
-	},
-	{
-		"ALU64_MOD_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mod_imm_regs,
-	},
-	{
-		"ALU64_SDIV_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_sdiv_imm_regs,
-	},
-	{
-		"ALU64_SMOD_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_smod_imm_regs,
-	},
-	/* ALU32 K registers */
-	{
-		"ALU32_MOV_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mov_imm_regs,
-	},
-	{
-		"ALU32_AND_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_and_imm_regs,
-	},
-	{
-		"ALU32_OR_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_or_imm_regs,
-	},
-	{
-		"ALU32_XOR_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_xor_imm_regs,
-	},
-	{
-		"ALU32_LSH_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_lsh_imm_regs,
-	},
-	{
-		"ALU32_RSH_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_rsh_imm_regs,
-	},
-	{
-		"ALU32_ARSH_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_arsh_imm_regs,
-	},
-	{
-		"ALU32_ADD_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_add_imm_regs,
-	},
-	{
-		"ALU32_SUB_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_sub_imm_regs,
-	},
-	{
-		"ALU32_MUL_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mul_imm_regs,
-	},
-	{
-		"ALU32_DIV_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_div_imm_regs,
-	},
-	{
-		"ALU32_MOD_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mod_imm_regs,
-	},
-	{
-		"ALU32_SDIV_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_sdiv_imm_regs,
-	},
-	{
-		"ALU32_SMOD_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_smod_imm_regs,
-	},
-	/* ALU64 X register combinations */
-	{
-		"ALU64_MOV_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mov_reg_pairs,
-	},
-	{
-		"ALU64_AND_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_and_reg_pairs,
-	},
-	{
-		"ALU64_OR_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_or_reg_pairs,
-	},
-	{
-		"ALU64_XOR_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_xor_reg_pairs,
-	},
-	{
-		"ALU64_LSH_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_lsh_reg_pairs,
-	},
-	{
-		"ALU64_RSH_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_rsh_reg_pairs,
-	},
-	{
-		"ALU64_ARSH_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_arsh_reg_pairs,
-	},
-	{
-		"ALU64_ADD_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_add_reg_pairs,
-	},
-	{
-		"ALU64_SUB_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_sub_reg_pairs,
-	},
-	{
-		"ALU64_MUL_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mul_reg_pairs,
-	},
-	{
-		"ALU64_DIV_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_div_reg_pairs,
-	},
-	{
-		"ALU64_MOD_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mod_reg_pairs,
-	},
-	/* ALU32 X register combinations */
-	{
-		"ALU32_MOV_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mov_reg_pairs,
-	},
-	{
-		"ALU32_AND_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_and_reg_pairs,
-	},
-	{
-		"ALU32_OR_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_or_reg_pairs,
-	},
-	{
-		"ALU32_XOR_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_xor_reg_pairs,
-	},
-	{
-		"ALU32_LSH_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_lsh_reg_pairs,
-	},
-	{
-		"ALU32_RSH_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_rsh_reg_pairs,
-	},
-	{
-		"ALU32_ARSH_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_arsh_reg_pairs,
-	},
-	{
-		"ALU32_ADD_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_add_reg_pairs,
-	},
-	{
-		"ALU32_SUB_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_sub_reg_pairs,
-	},
-	{
-		"ALU32_MUL_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mul_reg_pairs,
-	},
-	{
-		"ALU32_DIV_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_div_reg_pairs,
-	},
-	{
-		"ALU32_MOD_X register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mod_reg_pairs,
-	},
-	/* Exhaustive test of ALU64 shift operations */
-	{
-		"ALU64_LSH_K: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_lsh_imm,
-	},
-	{
-		"ALU64_RSH_K: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_rsh_imm,
-	},
-	{
-		"ALU64_ARSH_K: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_arsh_imm,
-	},
-	{
-		"ALU64_LSH_X: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_lsh_reg,
-	},
-	{
-		"ALU64_RSH_X: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_rsh_reg,
-	},
-	{
-		"ALU64_ARSH_X: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_arsh_reg,
-	},
-	/* Exhaustive test of ALU32 shift operations */
-	{
-		"ALU32_LSH_K: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_lsh_imm,
-	},
-	{
-		"ALU32_RSH_K: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_rsh_imm,
-	},
-	{
-		"ALU32_ARSH_K: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_arsh_imm,
-	},
-	{
-		"ALU32_LSH_X: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_lsh_reg,
-	},
-	{
-		"ALU32_RSH_X: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_rsh_reg,
-	},
-	{
-		"ALU32_ARSH_X: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_arsh_reg,
-	},
-	/*
-	 * Exhaustive test of ALU64 shift operations when
-	 * source and destination register are the same.
-	 */
-	{
-		"ALU64_LSH_X: all shift values with the same register",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_lsh_same_reg,
-	},
-	{
-		"ALU64_RSH_X: all shift values with the same register",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_rsh_same_reg,
-	},
-	{
-		"ALU64_ARSH_X: all shift values with the same register",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_arsh_same_reg,
-	},
-	/*
-	 * Exhaustive test of ALU32 shift operations when
-	 * source and destination register are the same.
-	 */
-	{
-		"ALU32_LSH_X: all shift values with the same register",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_lsh_same_reg,
-	},
-	{
-		"ALU32_RSH_X: all shift values with the same register",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_rsh_same_reg,
-	},
-	{
-		"ALU32_ARSH_X: all shift values with the same register",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_arsh_same_reg,
-	},
-	/* ALU64 immediate magnitudes */
-	{
-		"ALU64_MOV_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mov_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_AND_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_and_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_OR_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_or_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_XOR_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_xor_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_ADD_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_add_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_SUB_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_sub_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_MUL_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mul_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_DIV_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_div_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_MOD_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mod_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_SDIV_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_sdiv_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_SMOD_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_smod_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* ALU32 immediate magnitudes */
-	{
-		"ALU32_MOV_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mov_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_AND_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_and_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_OR_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_or_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_XOR_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_xor_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_ADD_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_add_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_SUB_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_sub_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_MUL_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mul_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_DIV_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_div_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_MOD_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mod_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_SDIV_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_sdiv_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_SMOD_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_smod_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* ALU64 register magnitudes */
-	{
-		"ALU64_MOV_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mov_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_AND_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_and_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_OR_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_or_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_XOR_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_xor_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_ADD_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_add_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_SUB_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_sub_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_MUL_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mul_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_DIV_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_div_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_MOD_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mod_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* ALU32 register magnitudes */
-	{
-		"ALU32_MOV_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mov_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_AND_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_and_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_OR_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_or_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_XOR_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_xor_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_ADD_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_add_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_SUB_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_sub_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_MUL_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mul_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_DIV_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_div_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_MOD_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mod_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* LD_IMM64 immediate magnitudes and byte patterns */
-	{
-		"LD_IMM64: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_ld_imm64_magn,
-	},
-	{
-		"LD_IMM64: checker byte patterns",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_ld_imm64_checker,
-	},
-	{
-		"LD_IMM64: random positive and zero byte patterns",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_ld_imm64_pos_zero,
-	},
-	{
-		"LD_IMM64: random negative and zero byte patterns",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_ld_imm64_neg_zero,
-	},
-	{
-		"LD_IMM64: random positive and negative byte patterns",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_ld_imm64_pos_neg,
-	},
-	/* 64-bit ATOMIC register combinations */
-	{
-		"ATOMIC_DW_ADD: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_add_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_DW_AND: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_and_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_DW_OR: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_or_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_DW_XOR: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_xor_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_DW_ADD_FETCH: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_add_fetch_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_DW_AND_FETCH: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_and_fetch_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_DW_OR_FETCH: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_or_fetch_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_DW_XOR_FETCH: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_xor_fetch_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_DW_XCHG: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_xchg_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_DW_CMPXCHG: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_cmpxchg_reg_pairs,
-		.stack_depth = 8,
-	},
-	/* 32-bit ATOMIC register combinations */
-	{
-		"ATOMIC_W_ADD: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_add_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_W_AND: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_and_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_W_OR: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_or_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_W_XOR: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_xor_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_W_ADD_FETCH: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_add_fetch_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_W_AND_FETCH: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_and_fetch_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_W_OR_FETCH: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_or_fetch_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_W_XOR_FETCH: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_xor_fetch_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_W_XCHG: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_xchg_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_W_CMPXCHG: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_cmpxchg_reg_pairs,
-		.stack_depth = 8,
-	},
-	/* 64-bit ATOMIC magnitudes */
-	{
-		"ATOMIC_DW_ADD: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_add,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_DW_AND: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_and,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_DW_OR: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_or,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_DW_XOR: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_xor,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_DW_ADD_FETCH: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_add_fetch,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_DW_AND_FETCH: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_and_fetch,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_DW_OR_FETCH: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_or_fetch,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_DW_XOR_FETCH: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_xor_fetch,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_DW_XCHG: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_xchg,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_DW_CMPXCHG: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_cmpxchg64,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* 32-bit atomic magnitudes */
-	{
-		"ATOMIC_W_ADD: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_add,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_W_AND: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_and,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_W_OR: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_or,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_W_XOR: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_xor,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_W_ADD_FETCH: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_add_fetch,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_W_AND_FETCH: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_and_fetch,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_W_OR_FETCH: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_or_fetch,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_W_XOR_FETCH: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_xor_fetch,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_W_XCHG: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_xchg,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_W_CMPXCHG: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_cmpxchg32,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* JMP immediate magnitudes */
-	{
-		"JMP_JSET_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jset_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JEQ_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jeq_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JNE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jne_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JGT_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jgt_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JGE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jge_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JLT_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jlt_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JLE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jle_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JSGT_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jsgt_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JSGE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jsge_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JSLT_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jslt_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JSLE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jsle_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* JMP register magnitudes */
-	{
-		"JMP_JSET_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jset_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JEQ_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jeq_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JNE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jne_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JGT_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jgt_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JGE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jge_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JLT_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jlt_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JLE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jle_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JSGT_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jsgt_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JSGE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jsge_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JSLT_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jslt_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JSLE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jsle_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* JMP32 immediate magnitudes */
-	{
-		"JMP32_JSET_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jset_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JEQ_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jeq_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JNE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jne_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JGT_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jgt_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JGE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jge_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JLT_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jlt_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JLE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jle_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JSGT_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jsgt_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JSGE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jsge_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JSLT_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jslt_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JSLE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jsle_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* JMP32 register magnitudes */
-	{
-		"JMP32_JSET_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jset_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JEQ_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jeq_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JNE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jne_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JGT_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jgt_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JGE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jge_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JLT_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jlt_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JLE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jle_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JSGT_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jsgt_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JSGE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jsge_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JSLT_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jslt_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JSLE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jsle_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* Conditional jumps with constant decision */
-	{
-		"JMP_JSET_K: imm = 0 -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JSET, R1, 0, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"JMP_JLT_K: imm = 0 -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JLT, R1, 0, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"JMP_JGE_K: imm = 0 -> always taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JGE, R1, 0, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JGT_K: imm = 0xffffffff -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JGT, R1, U32_MAX, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"JMP_JLE_K: imm = 0xffffffff -> always taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JLE, R1, U32_MAX, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP32_JSGT_K: imm = 0x7fffffff -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP32_IMM(BPF_JSGT, R1, S32_MAX, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"JMP32_JSGE_K: imm = -0x80000000 -> always taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP32_IMM(BPF_JSGE, R1, S32_MIN, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP32_JSLT_K: imm = -0x80000000 -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP32_IMM(BPF_JSLT, R1, S32_MIN, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"JMP32_JSLE_K: imm = 0x7fffffff -> always taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP32_IMM(BPF_JSLE, R1, S32_MAX, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JEQ_X: dst = src -> always taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JEQ, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JGE_X: dst = src -> always taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JGE, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JLE_X: dst = src -> always taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JLE, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSGE_X: dst = src -> always taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JSGE, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSLE_X: dst = src -> always taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JSLE, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JNE_X: dst = src -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JNE, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"JMP_JGT_X: dst = src -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JGT, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"JMP_JLT_X: dst = src -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JLT, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"JMP_JSGT_X: dst = src -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JSGT, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"JMP_JSLT_X: dst = src -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JSLT, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	/* Short relative jumps */
-	{
-		"Short relative jump: offset=0",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_JMP_IMM(BPF_JEQ, R0, 0, 0),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, -1),
-		},
-		INTERNAL | FLAG_NO_DATA | FLAG_VERIFIER_ZEXT,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"Short relative jump: offset=1",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_JMP_IMM(BPF_JEQ, R0, 0, 1),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, -1),
-		},
-		INTERNAL | FLAG_NO_DATA | FLAG_VERIFIER_ZEXT,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"Short relative jump: offset=2",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_JMP_IMM(BPF_JEQ, R0, 0, 2),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, -1),
-		},
-		INTERNAL | FLAG_NO_DATA | FLAG_VERIFIER_ZEXT,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"Short relative jump: offset=3",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_JMP_IMM(BPF_JEQ, R0, 0, 3),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, -1),
-		},
-		INTERNAL | FLAG_NO_DATA | FLAG_VERIFIER_ZEXT,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"Short relative jump: offset=4",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_JMP_IMM(BPF_JEQ, R0, 0, 4),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, -1),
-		},
-		INTERNAL | FLAG_NO_DATA | FLAG_VERIFIER_ZEXT,
-		{ },
-		{ { 0, 0 } },
-	},
-	/* Conditional branch conversions */
-	{
-		"Long conditional jump: taken at runtime (32 bits)",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_max_jmp_taken_32,
-	},
-	{
-		"Long conditional jump: not taken at runtime (32 bits)",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 2 } },
-		.fill_helper = bpf_fill_max_jmp_not_taken_32,
-	},
-	{
-		"Long conditional jump: always taken, known at JIT time (32 bits)",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_max_jmp_always_taken_32,
-	},
-	{
-		"Long conditional jump: never taken, known at JIT time (32 bits)",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 2 } },
-		.fill_helper = bpf_fill_max_jmp_never_taken_32,
-	},
-	{
-		"Long conditional jump: taken at runtime",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_max_jmp_taken,
-	},
-	{
-		"Long conditional jump: not taken at runtime",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 2 } },
-		.fill_helper = bpf_fill_max_jmp_not_taken,
-	},
-	{
-		"Long conditional jump: always taken, known at JIT time",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_max_jmp_always_taken,
-	},
-	{
-		"Long conditional jump: never taken, known at JIT time",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 2 } },
-		.fill_helper = bpf_fill_max_jmp_never_taken,
-	},
-	/* Staggered jump sequences, immediate */
-	{
-		"Staggered jumps: JMP_JA",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_ja,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JEQ_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jeq_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JNE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jne_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSET_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jset_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JGT_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jgt_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JGE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jge_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JLT_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jlt_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JLE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jle_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSGT_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsgt_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSGE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsge_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSLT_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jslt_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSLE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsle_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	/* Staggered jump sequences, register */
-	{
-		"Staggered jumps: JMP_JEQ_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jeq_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JNE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jne_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSET_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jset_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JGT_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jgt_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JGE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jge_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JLT_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jlt_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JLE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jle_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSGT_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsgt_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSGE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsge_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSLT_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jslt_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSLE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsle_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	/* Staggered jump sequences, JMP32 immediate */
-	{
-		"Staggered jumps: JMP32_JEQ_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jeq32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JNE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jne32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSET_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jset32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JGT_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jgt32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JGE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jge32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JLT_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jlt32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JLE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jle32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSGT_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsgt32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSGE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsge32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSLT_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jslt32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSLE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsle32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	/* Staggered jump sequences, JMP32 register */
-	{
-		"Staggered jumps: JMP32_JEQ_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jeq32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JNE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jne32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSET_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jset32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JGT_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jgt32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JGE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jge32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JLT_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jlt32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JLE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jle32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSGT_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsgt32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSGE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsge32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSLT_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jslt32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSLE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsle32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-};
-
-static struct net_device dev;
-
-static struct sk_buff *populate_skb(char *buf, int size)
-{
-	struct sk_buff *skb;
-
-	if (size >= MAX_DATA)
-		return NULL;
-
-	skb = alloc_skb(MAX_DATA, GFP_KERNEL);
-	if (!skb)
-		return NULL;
-
-	__skb_put_data(skb, buf, size);
-
-	/* Initialize a fake skb with test pattern. */
-	skb_reset_mac_header(skb);
-	skb->protocol = htons(ETH_P_IP);
-	skb->pkt_type = SKB_TYPE;
-	skb->mark = SKB_MARK;
-	skb->hash = SKB_HASH;
-	skb->queue_mapping = SKB_QUEUE_MAP;
-	skb->vlan_tci = SKB_VLAN_TCI;
-	skb->vlan_proto = htons(ETH_P_IP);
-	dev_net_set(&dev, &init_net);
-	skb->dev = &dev;
-	skb->dev->ifindex = SKB_DEV_IFINDEX;
-	skb->dev->type = SKB_DEV_TYPE;
-	skb_set_network_header(skb, min(size, ETH_HLEN));
-
-	return skb;
-}
-
-static void *generate_test_data(struct bpf_test *test, int sub)
-{
-	struct sk_buff *skb;
-	struct page *page;
-
-	if (test->aux & FLAG_NO_DATA)
-		return NULL;
-
-	if (test->aux & FLAG_LARGE_MEM)
-		return kmalloc(test->test[sub].data_size, GFP_KERNEL);
-
-	/* Test case expects an skb, so populate one. Various
-	 * subtests generate skbs of different sizes based on
-	 * the same data.
-	 */
-	skb = populate_skb(test->data, test->test[sub].data_size);
-	if (!skb)
-		return NULL;
-
-	if (test->aux & FLAG_SKB_FRAG) {
-		/*
-		 * when the test requires a fragmented skb, add a
-		 * single fragment to the skb, filled with
-		 * test->frag_data.
-		 */
-		page = alloc_page(GFP_KERNEL);
-		if (!page)
-			goto err_kfree_skb;
-
-		memcpy(page_address(page), test->frag_data, MAX_DATA);
-		skb_add_rx_frag(skb, 0, page, 0, MAX_DATA, MAX_DATA);
-	}
-
-	return skb;
-err_kfree_skb:
-	kfree_skb(skb);
-	return NULL;
-}
-
-static void release_test_data(const struct bpf_test *test, void *data)
-{
-	if (test->aux & FLAG_NO_DATA)
-		return;
-
-	if (test->aux & FLAG_LARGE_MEM)
-		kfree(data);
-	else
-		kfree_skb(data);
-}
-
-static int filter_length(int which)
-{
-	struct sock_filter *fp;
-	int len;
-
-	if (tests[which].fill_helper)
-		return tests[which].u.ptr.len;
-
-	fp = tests[which].u.insns;
-	for (len = MAX_INSNS - 1; len > 0; --len)
-		if (fp[len].code != 0 || fp[len].k != 0)
-			break;
-
-	return len + 1;
-}
-
-static void *filter_pointer(int which)
-{
-	if (tests[which].fill_helper)
-		return tests[which].u.ptr.insns;
-	else
-		return tests[which].u.insns;
-}
-
-static struct bpf_prog *generate_filter(int which, int *err)
-{
-	__u8 test_type = tests[which].aux & TEST_TYPE_MASK;
-	unsigned int flen = filter_length(which);
-	void *fptr = filter_pointer(which);
-	struct sock_fprog_kern fprog;
-	struct bpf_prog *fp;
-
-	switch (test_type) {
-	case CLASSIC:
-		fprog.filter = fptr;
-		fprog.len = flen;
-
-		*err = bpf_prog_create(&fp, &fprog);
-		if (tests[which].aux & FLAG_EXPECTED_FAIL) {
-			if (*err == tests[which].expected_errcode) {
-				pr_cont("PASS\n");
-				/* Verifier rejected filter as expected. */
-				*err = 0;
-				return NULL;
-			} else {
-				pr_cont("UNEXPECTED_PASS\n");
-				/* Verifier didn't reject the test that's
-				 * bad enough, just return!
-				 */
-				*err = -EINVAL;
-				return NULL;
-			}
-		}
-		if (*err) {
-			pr_cont("FAIL to prog_create err=%d len=%d\n",
-				*err, fprog.len);
-			return NULL;
-		}
-		break;
-
-	case INTERNAL:
-		fp = bpf_prog_alloc(bpf_prog_size(flen), 0);
-		if (fp == NULL) {
-			pr_cont("UNEXPECTED_FAIL no memory left\n");
-			*err = -ENOMEM;
-			return NULL;
-		}
-
-		fp->len = flen;
-		/* Type doesn't really matter here as long as it's not unspec. */
-		fp->type = BPF_PROG_TYPE_SOCKET_FILTER;
-		memcpy(fp->insnsi, fptr, fp->len * sizeof(struct bpf_insn));
-		fp->aux->stack_depth = tests[which].stack_depth;
-		fp->aux->verifier_zext = !!(tests[which].aux &
-					    FLAG_VERIFIER_ZEXT);
-
-		/* We cannot error here as we don't need type compatibility
-		 * checks.
-		 */
-		fp = bpf_prog_select_runtime(fp, err);
-		if (*err) {
-			pr_cont("FAIL to select_runtime err=%d\n", *err);
-			return NULL;
-		}
-		break;
-	}
-
-	*err = 0;
-	return fp;
-}
-
-static void release_filter(struct bpf_prog *fp, int which)
-{
-	__u8 test_type = tests[which].aux & TEST_TYPE_MASK;
-
-	switch (test_type) {
-	case CLASSIC:
-		bpf_prog_destroy(fp);
-		break;
-	case INTERNAL:
-		bpf_prog_free(fp);
-		break;
-	}
-}
-
-static int __run_one(const struct bpf_prog *fp, const void *data,
-		     int runs, u64 *duration)
-{
-	u64 start, finish;
-	int ret = 0, i;
-
-	migrate_disable();
-	start = ktime_get_ns();
-
-	for (i = 0; i < runs; i++)
-		ret = bpf_prog_run(fp, data);
-
-	finish = ktime_get_ns();
-	migrate_enable();
-
-	*duration = finish - start;
-	do_div(*duration, runs);
-
-	return ret;
-}
-
-static int run_one(const struct bpf_prog *fp, struct bpf_test *test)
-{
-	int err_cnt = 0, i, runs = MAX_TESTRUNS;
-
-	if (test->nr_testruns)
-		runs = min(test->nr_testruns, MAX_TESTRUNS);
-
-	for (i = 0; i < MAX_SUBTESTS; i++) {
-		void *data;
-		u64 duration;
-		u32 ret;
-
-		/*
-		 * NOTE: Several sub-tests may be present, in which case
-		 * a zero {data_size, result} tuple indicates the end of
-		 * the sub-test array. The first test is always run,
-		 * even if both data_size and result happen to be zero.
-		 */
-		if (i > 0 &&
-		    test->test[i].data_size == 0 &&
-		    test->test[i].result == 0)
-			break;
-
-		data = generate_test_data(test, i);
-		if (!data && !(test->aux & FLAG_NO_DATA)) {
-			pr_cont("data generation failed ");
-			err_cnt++;
-			break;
-		}
-		ret = __run_one(fp, data, runs, &duration);
-		release_test_data(test, data);
-
-		if (ret == test->test[i].result) {
-			pr_cont("%lld ", duration);
-		} else {
-			s32 res = test->test[i].result;
-
-			pr_cont("ret %d != %d (%#x != %#x)",
-				ret, res, ret, res);
-			err_cnt++;
-		}
-	}
-
-	return err_cnt;
-}
-
-static char test_name[64];
-module_param_string(test_name, test_name, sizeof(test_name), 0);
-
-static int test_id = -1;
-module_param(test_id, int, 0);
-
-static int test_range[2] = { 0, INT_MAX };
-module_param_array(test_range, int, NULL, 0);
-
-static bool exclude_test(int test_id)
-{
-	return test_id < test_range[0] || test_id > test_range[1];
-}
-
-static __init struct sk_buff *build_test_skb(void)
-{
-	u32 headroom = NET_SKB_PAD + NET_IP_ALIGN + ETH_HLEN;
-	struct sk_buff *skb[2];
-	struct page *page[2];
-	int i, data_size = 8;
-
-	for (i = 0; i < 2; i++) {
-		page[i] = alloc_page(GFP_KERNEL);
-		if (!page[i]) {
-			if (i == 0)
-				goto err_page0;
-			else
-				goto err_page1;
-		}
-
-		/* this will set skb[i]->head_frag */
-		skb[i] = dev_alloc_skb(headroom + data_size);
-		if (!skb[i]) {
-			if (i == 0)
-				goto err_skb0;
-			else
-				goto err_skb1;
-		}
-
-		skb_reserve(skb[i], headroom);
-		skb_put(skb[i], data_size);
-		skb[i]->protocol = htons(ETH_P_IP);
-		skb_reset_network_header(skb[i]);
-		skb_set_mac_header(skb[i], -ETH_HLEN);
-
-		skb_add_rx_frag(skb[i], 0, page[i], 0, 64, 64);
-		// skb_headlen(skb[i]): 8, skb[i]->head_frag = 1
-	}
-
-	/* setup shinfo */
-	skb_shinfo(skb[0])->gso_size = 1448;
-	skb_shinfo(skb[0])->gso_type = SKB_GSO_TCPV4;
-	skb_shinfo(skb[0])->gso_type |= SKB_GSO_DODGY;
-	skb_shinfo(skb[0])->gso_segs = 0;
-	skb_shinfo(skb[0])->frag_list = skb[1];
-	skb_shinfo(skb[0])->hwtstamps.hwtstamp = 1000;
-
-	/* adjust skb[0]'s len */
-	skb[0]->len += skb[1]->len;
-	skb[0]->data_len += skb[1]->data_len;
-	skb[0]->truesize += skb[1]->truesize;
-
-	return skb[0];
-
-err_skb1:
-	__free_page(page[1]);
-err_page1:
-	kfree_skb(skb[0]);
-err_skb0:
-	__free_page(page[0]);
-err_page0:
-	return NULL;
-}
-
-static __init struct sk_buff *build_test_skb_linear_no_head_frag(void)
-{
-	unsigned int alloc_size = 2000;
-	unsigned int headroom = 102, doffset = 72, data_size = 1308;
-	struct sk_buff *skb[2];
-	int i;
-
-	/* skbs linked in a frag_list, both with linear data, with head_frag=0
-	 * (data allocated by kmalloc), both have tcp data of 1308 bytes
-	 * (total payload is 2616 bytes).
-	 * Data offset is 72 bytes (40 ipv6 hdr, 32 tcp hdr). Some headroom.
-	 */
-	for (i = 0; i < 2; i++) {
-		skb[i] = alloc_skb(alloc_size, GFP_KERNEL);
-		if (!skb[i]) {
-			if (i == 0)
-				goto err_skb0;
-			else
-				goto err_skb1;
-		}
-
-		skb[i]->protocol = htons(ETH_P_IPV6);
-		skb_reserve(skb[i], headroom);
-		skb_put(skb[i], doffset + data_size);
-		skb_reset_network_header(skb[i]);
-		if (i == 0)
-			skb_reset_mac_header(skb[i]);
-		else
-			skb_set_mac_header(skb[i], -ETH_HLEN);
-		__skb_pull(skb[i], doffset);
-	}
-
-	/* setup shinfo.
-	 * mimic bpf_skb_proto_4_to_6, which resets gso_segs and assigns a
-	 * reduced gso_size.
-	 */
-	skb_shinfo(skb[0])->gso_size = 1288;
-	skb_shinfo(skb[0])->gso_type = SKB_GSO_TCPV6 | SKB_GSO_DODGY;
-	skb_shinfo(skb[0])->gso_segs = 0;
-	skb_shinfo(skb[0])->frag_list = skb[1];
-
-	/* adjust skb[0]'s len */
-	skb[0]->len += skb[1]->len;
-	skb[0]->data_len += skb[1]->len;
-	skb[0]->truesize += skb[1]->truesize;
-
-	return skb[0];
-
-err_skb1:
-	kfree_skb(skb[0]);
-err_skb0:
-	return NULL;
-}
-
-struct skb_segment_test {
-	const char *descr;
-	struct sk_buff *(*build_skb)(void);
-	netdev_features_t features;
-};
-
-static struct skb_segment_test skb_segment_tests[] __initconst = {
-	{
-		.descr = "gso_with_rx_frags",
-		.build_skb = build_test_skb,
-		.features = NETIF_F_SG | NETIF_F_GSO_PARTIAL | NETIF_F_IP_CSUM |
-			    NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM
-	},
-	{
-		.descr = "gso_linear_no_head_frag",
-		.build_skb = build_test_skb_linear_no_head_frag,
-		.features = NETIF_F_SG | NETIF_F_FRAGLIST |
-			    NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_GSO |
-			    NETIF_F_GRO | NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM |
-			    NETIF_F_HW_VLAN_STAG_TX
-	}
-};
-
-static __init int test_skb_segment_single(const struct skb_segment_test *test)
-{
-	struct sk_buff *skb, *segs;
-	int ret = -1;
-
-	skb = test->build_skb();
-	if (!skb) {
-		pr_info("%s: failed to build_test_skb", __func__);
-		goto done;
-	}
-
-	segs = skb_segment(skb, test->features);
-	if (!IS_ERR(segs)) {
-		kfree_skb_list(segs);
-		ret = 0;
-	}
-	kfree_skb(skb);
-done:
-	return ret;
-}
-
-static __init int test_skb_segment(void)
-{
-	int i, err_cnt = 0, pass_cnt = 0;
-
-	for (i = 0; i < ARRAY_SIZE(skb_segment_tests); i++) {
-		const struct skb_segment_test *test = &skb_segment_tests[i];
-
-		cond_resched();
-		if (exclude_test(i))
-			continue;
-
-		pr_info("#%d %s ", i, test->descr);
-
-		if (test_skb_segment_single(test)) {
-			pr_cont("FAIL\n");
-			err_cnt++;
-		} else {
-			pr_cont("PASS\n");
-			pass_cnt++;
-		}
-	}
-
-	pr_info("%s: Summary: %d PASSED, %d FAILED\n", __func__,
-		pass_cnt, err_cnt);
-	return err_cnt ? -EINVAL : 0;
-}
-
-static __init int test_bpf(void)
-{
-	int i, err_cnt = 0, pass_cnt = 0;
-	int jit_cnt = 0, run_cnt = 0;
-
-	for (i = 0; i < ARRAY_SIZE(tests); i++) {
-		struct bpf_prog *fp;
-		int err;
-
-		cond_resched();
-		if (exclude_test(i))
-			continue;
-
-		pr_info("#%d %s ", i, tests[i].descr);
-
-		if (tests[i].fill_helper &&
-		    tests[i].fill_helper(&tests[i]) < 0) {
-			pr_cont("FAIL to prog_fill\n");
-			continue;
-		}
-
-		fp = generate_filter(i, &err);
-
-		if (tests[i].fill_helper) {
-			kfree(tests[i].u.ptr.insns);
-			tests[i].u.ptr.insns = NULL;
-		}
-
-		if (fp == NULL) {
-			if (err == 0) {
-				pass_cnt++;
-				continue;
-			}
-			err_cnt++;
-			continue;
-		}
-
-		pr_cont("jited:%u ", fp->jited);
-
-		run_cnt++;
-		if (fp->jited)
-			jit_cnt++;
-
-		err = run_one(fp, &tests[i]);
-		release_filter(fp, i);
-
-		if (err) {
-			pr_cont("FAIL (%d times)\n", err);
-			err_cnt++;
-		} else {
-			pr_cont("PASS\n");
-			pass_cnt++;
-		}
-	}
-
-	pr_info("Summary: %d PASSED, %d FAILED, [%d/%d JIT'ed]\n",
-		pass_cnt, err_cnt, jit_cnt, run_cnt);
-
-	return err_cnt ? -EINVAL : 0;
-}
-
-struct tail_call_test {
-	const char *descr;
-	struct bpf_insn insns[MAX_INSNS];
-	int flags;
-	int result;
-	int stack_depth;
-	bool has_tail_call;
-};
-
-/* Flags that can be passed to tail call test cases */
-#define FLAG_NEED_STATE		BIT(0)
-#define FLAG_RESULT_IN_STATE	BIT(1)
-
-/*
- * Magic marker used in test snippets for tail calls below.
- * BPF_LD/MOV to R2 and R2 with this immediate value is replaced
- * with the proper values by the test runner.
- */
-#define TAIL_CALL_MARKER 0x7a11ca11
-
-/* Special offset to indicate a NULL call target */
-#define TAIL_CALL_NULL 0x7fff
-
-/* Special offset to indicate an out-of-range index */
-#define TAIL_CALL_INVALID 0x7ffe
-
-#define TAIL_CALL(offset)			       \
-	BPF_LD_IMM64(R2, TAIL_CALL_MARKER),	       \
-	BPF_RAW_INSN(BPF_ALU | BPF_MOV | BPF_K, R3, 0, \
-		     offset, TAIL_CALL_MARKER),	       \
-	BPF_JMP_IMM(BPF_TAIL_CALL, 0, 0, 0)
-
-/*
- * A test function to be called from a BPF program, clobbering a lot of
- * CPU registers in the process. A JITed BPF program calling this function
- * must save and restore any caller-saved registers it uses for internal
- * state, for example the current tail call count.
- */
-BPF_CALL_1(bpf_test_func, u64, arg)
-{
-	char buf[64];
-	long a = 0;
-	long b = 1;
-	long c = 2;
-	long d = 3;
-	long e = 4;
-	long f = 5;
-	long g = 6;
-	long h = 7;
-
-	return snprintf(buf, sizeof(buf),
-			"%ld %lu %lx %ld %lu %lx %ld %lu %x",
-			a, b, c, d, e, f, g, h, (int)arg);
-}
-#define BPF_FUNC_test_func __BPF_FUNC_MAX_ID
-
-/*
- * Tail call tests. Each test case may call any other test in the table,
- * including itself, specified as a relative index offset from the calling
- * test. The index TAIL_CALL_NULL can be used to specify a NULL target
- * function to test the JIT error path. Similarly, the index TAIL_CALL_INVALID
- * results in a target index that is out of range.
- */
-static struct tail_call_test tail_call_tests[] = {
-	{
-		"Tail call leaf",
-		.insns = {
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_ALU64_IMM(BPF_ADD, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		.result = 1,
-	},
-	{
-		"Tail call 2",
-		.insns = {
-			BPF_ALU64_IMM(BPF_ADD, R1, 2),
-			TAIL_CALL(-1),
-			BPF_ALU64_IMM(BPF_MOV, R0, -1),
-			BPF_EXIT_INSN(),
-		},
-		.result = 3,
-		.has_tail_call = true,
-	},
-	{
-		"Tail call 3",
-		.insns = {
-			BPF_ALU64_IMM(BPF_ADD, R1, 3),
-			TAIL_CALL(-1),
-			BPF_ALU64_IMM(BPF_MOV, R0, -1),
-			BPF_EXIT_INSN(),
-		},
-		.result = 6,
-		.has_tail_call = true,
-	},
-	{
-		"Tail call 4",
-		.insns = {
-			BPF_ALU64_IMM(BPF_ADD, R1, 4),
-			TAIL_CALL(-1),
-			BPF_ALU64_IMM(BPF_MOV, R0, -1),
-			BPF_EXIT_INSN(),
-		},
-		.result = 10,
-		.has_tail_call = true,
-	},
-	{
-		"Tail call load/store leaf",
-		.insns = {
-			BPF_ALU64_IMM(BPF_MOV, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R2, 2),
-			BPF_ALU64_REG(BPF_MOV, R3, BPF_REG_FP),
-			BPF_STX_MEM(BPF_DW, R3, R1, -8),
-			BPF_STX_MEM(BPF_DW, R3, R2, -16),
-			BPF_LDX_MEM(BPF_DW, R0, BPF_REG_FP, -8),
-			BPF_JMP_REG(BPF_JNE, R0, R1, 3),
-			BPF_LDX_MEM(BPF_DW, R0, BPF_REG_FP, -16),
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		.result = 0,
-		.stack_depth = 32,
-	},
-	{
-		"Tail call load/store",
-		.insns = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 3),
-			BPF_STX_MEM(BPF_DW, BPF_REG_FP, R0, -8),
-			TAIL_CALL(-1),
-			BPF_ALU64_IMM(BPF_MOV, R0, -1),
-			BPF_EXIT_INSN(),
-		},
-		.result = 0,
-		.stack_depth = 16,
-		.has_tail_call = true,
-	},
-	{
-		"Tail call error path, max count reached",
-		.insns = {
-			BPF_LDX_MEM(BPF_W, R2, R1, 0),
-			BPF_ALU64_IMM(BPF_ADD, R2, 1),
-			BPF_STX_MEM(BPF_W, R1, R2, 0),
-			TAIL_CALL(0),
-			BPF_EXIT_INSN(),
-		},
-		.flags = FLAG_NEED_STATE | FLAG_RESULT_IN_STATE,
-		.result = (MAX_TAIL_CALL_CNT + 1) * MAX_TESTRUNS,
-		.has_tail_call = true,
-	},
-	{
-		"Tail call count preserved across function calls",
-		.insns = {
-			BPF_LDX_MEM(BPF_W, R2, R1, 0),
-			BPF_ALU64_IMM(BPF_ADD, R2, 1),
-			BPF_STX_MEM(BPF_W, R1, R2, 0),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-			BPF_CALL_REL(BPF_FUNC_get_numa_node_id),
-			BPF_CALL_REL(BPF_FUNC_ktime_get_ns),
-			BPF_CALL_REL(BPF_FUNC_ktime_get_boot_ns),
-			BPF_CALL_REL(BPF_FUNC_ktime_get_coarse_ns),
-			BPF_CALL_REL(BPF_FUNC_jiffies64),
-			BPF_CALL_REL(BPF_FUNC_test_func),
-			BPF_LDX_MEM(BPF_DW, R1, R10, -8),
-			BPF_ALU32_REG(BPF_MOV, R0, R1),
-			TAIL_CALL(0),
-			BPF_EXIT_INSN(),
-		},
-		.stack_depth = 8,
-		.flags = FLAG_NEED_STATE | FLAG_RESULT_IN_STATE,
-		.result = (MAX_TAIL_CALL_CNT + 1) * MAX_TESTRUNS,
-		.has_tail_call = true,
-	},
-	{
-		"Tail call error path, NULL target",
-		.insns = {
-			BPF_LDX_MEM(BPF_W, R2, R1, 0),
-			BPF_ALU64_IMM(BPF_ADD, R2, 1),
-			BPF_STX_MEM(BPF_W, R1, R2, 0),
-			TAIL_CALL(TAIL_CALL_NULL),
-			BPF_EXIT_INSN(),
-		},
-		.flags = FLAG_NEED_STATE | FLAG_RESULT_IN_STATE,
-		.result = MAX_TESTRUNS,
-		.has_tail_call = true,
-	},
-	{
-		"Tail call error path, index out of range",
-		.insns = {
-			BPF_LDX_MEM(BPF_W, R2, R1, 0),
-			BPF_ALU64_IMM(BPF_ADD, R2, 1),
-			BPF_STX_MEM(BPF_W, R1, R2, 0),
-			TAIL_CALL(TAIL_CALL_INVALID),
-			BPF_EXIT_INSN(),
-		},
-		.flags = FLAG_NEED_STATE | FLAG_RESULT_IN_STATE,
-		.result = MAX_TESTRUNS,
-		.has_tail_call = true,
-	},
-};
-
-static void __init destroy_tail_call_tests(struct bpf_array *progs)
-{
-	int i;
-
-	for (i = 0; i < ARRAY_SIZE(tail_call_tests); i++)
-		if (progs->ptrs[i])
-			bpf_prog_free(progs->ptrs[i]);
-	kfree(progs);
-}
-
-static __init int prepare_tail_call_tests(struct bpf_array **pprogs)
-{
-	int ntests = ARRAY_SIZE(tail_call_tests);
-	struct bpf_array *progs;
-	int which, err;
-
-	/* Allocate the table of programs to be used for tail calls */
-	progs = kzalloc_flex(*progs, ptrs, ntests + 1);
-	if (!progs)
-		goto out_nomem;
-
-	/* Create all eBPF programs and populate the table */
-	for (which = 0; which < ntests; which++) {
-		struct tail_call_test *test = &tail_call_tests[which];
-		struct bpf_prog *fp;
-		int len, i;
-
-		/* Compute the number of program instructions */
-		for (len = 0; len < MAX_INSNS; len++) {
-			struct bpf_insn *insn = &test->insns[len];
-
-			if (len < MAX_INSNS - 1 &&
-			    insn->code == (BPF_LD | BPF_DW | BPF_IMM))
-				len++;
-			if (insn->code == 0)
-				break;
-		}
-
-		/* Allocate and initialize the program */
-		fp = bpf_prog_alloc(bpf_prog_size(len), 0);
-		if (!fp)
-			goto out_nomem;
-
-		fp->len = len;
-		fp->type = BPF_PROG_TYPE_SOCKET_FILTER;
-		fp->aux->stack_depth = test->stack_depth;
-		fp->aux->tail_call_reachable = test->has_tail_call;
-		memcpy(fp->insnsi, test->insns, len * sizeof(struct bpf_insn));
-
-		/* Relocate runtime tail call offsets and addresses */
-		for (i = 0; i < len; i++) {
-			struct bpf_insn *insn = &fp->insnsi[i];
-			long addr = 0;
-
-			switch (insn->code) {
-			case BPF_LD | BPF_DW | BPF_IMM:
-				if (insn->imm != TAIL_CALL_MARKER)
-					break;
-				insn[0].imm = (u32)(long)progs;
-				insn[1].imm = ((u64)(long)progs) >> 32;
-				break;
-
-			case BPF_ALU | BPF_MOV | BPF_K:
-				if (insn->imm != TAIL_CALL_MARKER)
-					break;
-				if (insn->off == TAIL_CALL_NULL)
-					insn->imm = ntests;
-				else if (insn->off == TAIL_CALL_INVALID)
-					insn->imm = ntests + 1;
-				else
-					insn->imm = which + insn->off;
-				insn->off = 0;
-				break;
-
-			case BPF_JMP | BPF_CALL:
-				if (insn->src_reg != BPF_PSEUDO_CALL)
-					break;
-				switch (insn->imm) {
-				case BPF_FUNC_get_numa_node_id:
-					addr = (long)&numa_node_id;
-					break;
-				case BPF_FUNC_ktime_get_ns:
-					addr = (long)&ktime_get_ns;
-					break;
-				case BPF_FUNC_ktime_get_boot_ns:
-					addr = (long)&ktime_get_boot_fast_ns;
-					break;
-				case BPF_FUNC_ktime_get_coarse_ns:
-					addr = (long)&ktime_get_coarse_ns;
-					break;
-				case BPF_FUNC_jiffies64:
-					addr = (long)&get_jiffies_64;
-					break;
-				case BPF_FUNC_test_func:
-					addr = (long)&bpf_test_func;
-					break;
-				default:
-					err = -EFAULT;
-					goto out_err;
-				}
-				*insn = BPF_EMIT_CALL(addr);
-				if ((long)__bpf_call_base + insn->imm != addr)
-					*insn = BPF_JMP_A(0); /* Skip: NOP */
-				break;
-			}
-		}
-
-		fp = bpf_prog_select_runtime(fp, &err);
-		if (err)
-			goto out_err;
-
-		progs->ptrs[which] = fp;
-	}
-
-	/* The last entry contains a NULL program pointer */
-	progs->map.max_entries = ntests + 1;
-	*pprogs = progs;
-	return 0;
-
-out_nomem:
-	err = -ENOMEM;
-
-out_err:
-	if (progs)
-		destroy_tail_call_tests(progs);
-	return err;
-}
-
-static __init int test_tail_calls(struct bpf_array *progs)
-{
-	int i, err_cnt = 0, pass_cnt = 0;
-	int jit_cnt = 0, run_cnt = 0;
-
-	for (i = 0; i < ARRAY_SIZE(tail_call_tests); i++) {
-		struct tail_call_test *test = &tail_call_tests[i];
-		struct bpf_prog *fp = progs->ptrs[i];
-		int *data = NULL;
-		int state = 0;
-		u64 duration;
-		int ret;
-
-		cond_resched();
-		if (exclude_test(i))
-			continue;
-
-		pr_info("#%d %s ", i, test->descr);
-		if (!fp) {
-			err_cnt++;
-			continue;
-		}
-		pr_cont("jited:%u ", fp->jited);
-
-		run_cnt++;
-		if (fp->jited)
-			jit_cnt++;
-
-		if (test->flags & FLAG_NEED_STATE)
-			data = &state;
-		ret = __run_one(fp, data, MAX_TESTRUNS, &duration);
-		if (test->flags & FLAG_RESULT_IN_STATE)
-			ret = state;
-		if (ret == test->result) {
-			pr_cont("%lld PASS", duration);
-			pass_cnt++;
-		} else {
-			pr_cont("ret %d != %d FAIL", ret, test->result);
-			err_cnt++;
-		}
-	}
-
-	pr_info("%s: Summary: %d PASSED, %d FAILED, [%d/%d JIT'ed]\n",
-		__func__, pass_cnt, err_cnt, jit_cnt, run_cnt);
-
-	return err_cnt ? -EINVAL : 0;
-}
-
-static char test_suite[32];
-module_param_string(test_suite, test_suite, sizeof(test_suite), 0);
-
-static __init int find_test_index(const char *test_name)
-{
-	int i;
-
-	if (!strcmp(test_suite, "test_bpf")) {
-		for (i = 0; i < ARRAY_SIZE(tests); i++) {
-			if (!strcmp(tests[i].descr, test_name))
-				return i;
-		}
-	}
-
-	if (!strcmp(test_suite, "test_tail_calls")) {
-		for (i = 0; i < ARRAY_SIZE(tail_call_tests); i++) {
-			if (!strcmp(tail_call_tests[i].descr, test_name))
-				return i;
-		}
-	}
-
-	if (!strcmp(test_suite, "test_skb_segment")) {
-		for (i = 0; i < ARRAY_SIZE(skb_segment_tests); i++) {
-			if (!strcmp(skb_segment_tests[i].descr, test_name))
-				return i;
-		}
-	}
-
-	return -1;
-}
-
-static __init int prepare_test_range(void)
-{
-	int valid_range;
-
-	if (!strcmp(test_suite, "test_bpf"))
-		valid_range = ARRAY_SIZE(tests);
-	else if (!strcmp(test_suite, "test_tail_calls"))
-		valid_range = ARRAY_SIZE(tail_call_tests);
-	else if (!strcmp(test_suite, "test_skb_segment"))
-		valid_range = ARRAY_SIZE(skb_segment_tests);
-	else
-		return 0;
-
-	if (test_id >= 0) {
-		/*
-		 * if a test_id was specified, use test_range to
-		 * cover only that test.
-		 */
-		if (test_id >= valid_range) {
-			pr_err("test_bpf: invalid test_id specified for '%s' suite.\n",
-			       test_suite);
-			return -EINVAL;
-		}
-
-		test_range[0] = test_id;
-		test_range[1] = test_id;
-	} else if (*test_name) {
-		/*
-		 * if a test_name was specified, find it and setup
-		 * test_range to cover only that test.
-		 */
-		int idx = find_test_index(test_name);
-
-		if (idx < 0) {
-			pr_err("test_bpf: no test named '%s' found for '%s' suite.\n",
-			       test_name, test_suite);
-			return -EINVAL;
-		}
-		test_range[0] = idx;
-		test_range[1] = idx;
-	} else if (test_range[0] != 0 || test_range[1] != INT_MAX) {
-		/*
-		 * check that the supplied test_range is valid.
-		 */
-		if (test_range[0] < 0 || test_range[1] >= valid_range) {
-			pr_err("test_bpf: test_range is out of bound for '%s' suite.\n",
-			       test_suite);
-			return -EINVAL;
-		}
-
-		if (test_range[1] < test_range[0]) {
-			pr_err("test_bpf: test_range is ending before it starts.\n");
-			return -EINVAL;
-		}
-	}
-
-	return 0;
-}
-
-static int __init test_bpf_init(void)
-{
-	struct bpf_array *progs = NULL;
-	int ret;
-
-	if (strlen(test_suite) &&
-	    strcmp(test_suite, "test_bpf") &&
-	    strcmp(test_suite, "test_tail_calls") &&
-	    strcmp(test_suite, "test_skb_segment")) {
-		pr_err("test_bpf: invalid test_suite '%s' specified.\n", test_suite);
-		return -EINVAL;
-	}
-
-	/*
-	 * if test_suite is not specified, but test_id, test_name or test_range
-	 * is specified, set 'test_bpf' as the default test suite.
-	 */
-	if (!strlen(test_suite) &&
-	    (test_id != -1 || strlen(test_name) ||
-	    (test_range[0] != 0 || test_range[1] != INT_MAX))) {
-		pr_info("test_bpf: set 'test_bpf' as the default test_suite.\n");
-		strscpy(test_suite, "test_bpf", sizeof(test_suite));
-	}
-
-	ret = prepare_test_range();
-	if (ret < 0)
-		return ret;
-
-	if (!strlen(test_suite) || !strcmp(test_suite, "test_bpf")) {
-		ret = test_bpf();
-		if (ret)
-			return ret;
-	}
-
-	if (!strlen(test_suite) || !strcmp(test_suite, "test_tail_calls")) {
-		ret = prepare_tail_call_tests(&progs);
-		if (ret)
-			return ret;
-		ret = test_tail_calls(progs);
-		destroy_tail_call_tests(progs);
-		if (ret)
-			return ret;
-	}
-
-	if (!strlen(test_suite) || !strcmp(test_suite, "test_skb_segment"))
-		return test_skb_segment();
-
-	return 0;
-}
-
-static void __exit test_bpf_exit(void)
-{
-}
-
-module_init(test_bpf_init);
-module_exit(test_bpf_exit);
-
-MODULE_DESCRIPTION("Testsuite for BPF interpreter and BPF JIT compiler");
-MODULE_LICENSE("GPL");
diff --git a/tools/bpf/bpftool/feature.c b/tools/bpf/bpftool/feature.c
index 0f6070a0c8e71..846a58e562034 100644
--- a/tools/bpf/bpftool/feature.c
+++ b/tools/bpf/bpftool/feature.c
@@ -394,9 +394,6 @@ static void probe_kernel_image_config(const char *define_prefix)
 		/* xt_bpf module for passing BPF programs to netfilter  */
 		{ "CONFIG_NETFILTER_XT_MATCH_BPF", },
 
-		/* test_bpf module for BPF tests */
-		{ "CONFIG_TEST_BPF", },
-
 		/* Misc configs useful in BPF C programs */
 		/* jiffies <-> sec conversion for bpf_jiffies64() helper */
 		{ "CONFIG_HZ", true, }
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 80d8bbbc3084a..1e4af62e8312e 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -38,8 +38,7 @@ TEST_FILES = xsk_prereqs.sh $(wildcard progs/btf_dump_test_case_*.c)	\
 	     bpftool_btf_dump_unsorted.expected
 
 # Order correspond to 'make run_tests' order
-TEST_PROGS := test_kmod.sh \
-	test_bpftool_build.sh \
+TEST_PROGS := test_bpftool_build.sh \
 	test_doc_build.sh \
 	test_xsk.sh \
 	test_xdp_features.sh
diff --git a/tools/testing/selftests/bpf/config b/tools/testing/selftests/bpf/config
index 2b883b388f90c..1f41283ae2f0f 100644
--- a/tools/testing/selftests/bpf/config
+++ b/tools/testing/selftests/bpf/config
@@ -123,7 +123,6 @@ CONFIG_SAMPLE_LIVEPATCH=m
 CONFIG_SECURITY=y
 CONFIG_SECURITYFS=y
 CONFIG_SYN_COOKIES=y
-CONFIG_TEST_BPF=m
 CONFIG_TMPFS=y
 CONFIG_TMPFS_XATTR=y
 CONFIG_UDMABUF=y
diff --git a/tools/testing/selftests/bpf/prog_tests/jit_insns.c b/tools/testing/selftests/bpf/prog_tests/jit_insns.c
new file mode 100644
index 0000000000000..dabf8a4abdfe2
--- /dev/null
+++ b/tools/testing/selftests/bpf/prog_tests/jit_insns.c
@@ -0,0 +1,2433 @@
+// SPDX-License-Identifier: GPL-2.0
+/* Copyright (c) 2026 Isovalent */
+
+#include <endian.h>
+#include <stdint.h>
+#include <test_progs.h>
+#include <bpf/btf.h>
+#include <linux/filter.h>
+
+#include "sysctl_helpers.h"
+#include "jit_insns_arena.skel.h"
+
+#define NR_CASES	512
+#define CTX_SPILL	-16	/* stack slot holding the ctx pointer */
+#define MEM_SLOT	-8	/* stack slot for the atomic operations */
+
+struct sweep_ctx {
+	__u64 in[NR_CASES][2];
+	__u64 out[NR_CASES][3];
+};
+
+#define IN_OFF(k, j)	(offsetof(struct sweep_ctx, in) + ((k) * 2 + (j)) * 8)
+#define OUT_OFF(k, j)	(offsetof(struct sweep_ctx, out) + ((k) * 3 + (j)) * 8)
+
+/* The cases of one program: operands in, results out, expected results */
+struct batch {
+	struct bpf_insn *insns;
+	int cnt, cap;
+	struct sweep_ctx ctx;
+	__u64 exp[NR_CASES][3];
+	__u8 nr_out[NR_CASES];
+	int nr;
+	char desc[80];
+};
+
+static char log[1 << 16];
+
+#define EMIT(b, insn)	((b)->insns[(b)->cnt++] = (insn))
+
+static void emit_ld_imm64(struct batch *b, int reg, __u64 imm)
+{
+	EMIT(b, BPF_RAW_INSN(BPF_LD | BPF_DW | BPF_IMM, reg, 0, 0, (__u32)imm));
+	EMIT(b, BPF_RAW_INSN(0, 0, 0, 0, imm >> 32));
+}
+
+static void batch_reset(struct batch *b)
+{
+	b->cnt = 0;
+	b->nr = 0;
+	/* The ctx pointer lives on the stack, every register is an operand */
+	EMIT(b, BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_1, CTX_SPILL));
+}
+
+static bool batch_init(struct batch *b)
+{
+	b->cap = NR_CASES * 24 + 8;
+	b->insns = malloc(b->cap * sizeof(*b->insns));
+	if (!ASSERT_OK_PTR(b->insns, "insns"))
+		return false;
+	batch_reset(b);
+	return true;
+}
+
+static void batch_fini(struct batch *b)
+{
+	free(b->insns);
+}
+
+static int load_prog(struct bpf_insn *insns, int cnt, const char *desc)
+{
+	LIBBPF_OPTS(bpf_prog_load_opts, lopts,
+		.prog_flags = BPF_F_SLEEPABLE,
+		.log_buf = log,
+		.log_size = sizeof(log),
+	);
+	int fd;
+
+	fd = bpf_prog_load(BPF_PROG_TYPE_SYSCALL, NULL, "GPL", insns, cnt, &lopts);
+	if (!ASSERT_GE(fd, 0, desc))
+		fprintf(stderr, "%s", log);
+	return fd;
+}
+
+/* Run the batch, check the results, start a new one */
+static void batch_flush(struct batch *b)
+{
+	LIBBPF_OPTS(bpf_test_run_opts, opts,
+		.ctx_in = &b->ctx,
+		.ctx_size_in = sizeof(b->ctx),
+	);
+	char buf[160];
+	int fd, k, j;
+
+	if (!b->nr)
+		return;
+	EMIT(b, BPF_MOV64_IMM(BPF_REG_0, 0));
+	EMIT(b, BPF_EXIT_INSN());
+	snprintf(buf, sizeof(buf), "%s: load %d cases", b->desc, b->nr);
+	fd = load_prog(b->insns, b->cnt, buf);
+	if (fd >= 0 && ASSERT_OK(bpf_prog_test_run_opts(fd, &opts), b->desc)) {
+		for (k = 0; k < b->nr; k++) {
+			for (j = 0; j < b->nr_out[k]; j++) {
+				if (b->ctx.out[k][j] == b->exp[k][j])
+					continue;
+				snprintf(buf, sizeof(buf), "%s: in0=0x%llx in1=0x%llx out%d",
+					 b->desc, b->ctx.in[k][0], b->ctx.in[k][1], j);
+				ASSERT_EQ(b->ctx.out[k][j], b->exp[k][j], buf);
+			}
+		}
+	}
+	if (fd >= 0)
+		close(fd);
+	batch_reset(b);
+}
+
+/* Add a case: record the operands and load the ctx pointer into rc */
+static int batch_case(struct batch *b, int rc, __u64 in0, __u64 in1)
+{
+	int k;
+
+	if (b->nr == NR_CASES)
+		batch_flush(b);
+	k = b->nr++;
+	b->ctx.in[k][0] = in0;
+	b->ctx.in[k][1] = in1;
+	b->nr_out[k] = 0;
+	EMIT(b, BPF_LDX_MEM(BPF_DW, rc, BPF_REG_10, CTX_SPILL));
+	return k;
+}
+
+static void batch_expect(struct batch *b, int k, int j, __u64 val)
+{
+	b->exp[k][j] = val;
+	if (b->nr_out[k] <= j)
+		b->nr_out[k] = j + 1;
+}
+
+#define LD_IN(b, k, j, rc, reg)		EMIT(b, BPF_LDX_MEM(BPF_DW, reg, rc, IN_OFF(k, j)))
+#define ST_OUT(b, k, j, rc, reg)	EMIT(b, BPF_STX_MEM(BPF_DW, rc, reg, OUT_OFF(k, j)))
+
+/* A register that is neither of the two operand registers nor r0 */
+static int scratch_reg(int r1, int r2)
+{
+	int r;
+
+	for (r = BPF_REG_1; r <= BPF_REG_9; r++)
+		if (r != r1 && r != r2)
+			return r;
+	return BPF_REG_9;
+}
+
+static const char *alu_name(int op)
+{
+	switch (BPF_OP(op)) {
+	case BPF_MOV: return "mov";
+	case BPF_NEG: return "neg";
+	case BPF_AND: return "and";
+	case BPF_OR: return "or";
+	case BPF_XOR: return "xor";
+	case BPF_LSH: return "lsh";
+	case BPF_RSH: return "rsh";
+	case BPF_ARSH: return "arsh";
+	case BPF_ADD: return "add";
+	case BPF_SUB: return "sub";
+	case BPF_MUL: return "mul";
+	case BPF_DIV: return "div";
+	case BPF_MOD: return "mod";
+	case BPF_OP(BPF_XCHG): return "xchg";
+	case BPF_OP(BPF_CMPXCHG): return "cmpxchg";
+	default: return "?";
+	}
+}
+
+static const char *jmp_name(int op)
+{
+	switch (op) {
+	case BPF_JSET: return "jset";
+	case BPF_JEQ: return "jeq";
+	case BPF_JNE: return "jne";
+	case BPF_JGT: return "jgt";
+	case BPF_JGE: return "jge";
+	case BPF_JLT: return "jlt";
+	case BPF_JLE: return "jle";
+	case BPF_JSGT: return "jsgt";
+	case BPF_JSGE: return "jsge";
+	case BPF_JSLT: return "jslt";
+	case BPF_JSLE: return "jsle";
+	default: return "?";
+	}
+}
+
+/* ALU result computation, false when the operands are not valid */
+enum { F_ALU32 = 1, F_SIGNED = 2 };
+
+static bool alu_result(__u64 *res, __u64 v1, __u64 v2, __u8 op, __u32 flags)
+{
+	bool is_signed = flags & F_SIGNED;
+
+	/* Narrow operands for ALU32 */
+	if (flags & F_ALU32) {
+		if (is_signed) {
+			v1 = (__u64)(__s32)v1;
+			v2 = (__u64)(__s32)v2;
+		} else {
+			v1 = (__u32)v1;
+			v2 = (__u32)v2;
+		}
+	}
+
+	*res = 0;
+	switch (op) {
+	case BPF_MOV:
+		*res = v2;
+		break;
+	case BPF_NEG:
+		*res = -v1;
+		break;
+	case BPF_AND:
+		*res = v1 & v2;
+		break;
+	case BPF_OR:
+		*res = v1 | v2;
+		break;
+	case BPF_XOR:
+		*res = v1 ^ v2;
+		break;
+	case BPF_LSH:
+		*res = v1 << v2;
+		break;
+	case BPF_RSH:
+		*res = v1 >> v2;
+		break;
+	case BPF_ARSH:
+		*res = v1 >> v2;
+		if (v2 > 0 && v1 > INT64_MAX)
+			*res |= ~0ULL << (64 - v2);
+		break;
+	case BPF_ADD:
+		*res = v1 + v2;
+		break;
+	case BPF_SUB:
+		*res = v1 - v2;
+		break;
+	case BPF_MUL:
+		*res = v1 * v2;
+		break;
+	case BPF_DIV:
+		if (v2 == 0)
+			return false;
+		if (!is_signed) {
+			*res = v1 / v2;
+		} else {
+			if ((__s64)v2 == -1) /* Handled by the verifier */
+				return false;
+			*res = (__u64)((__s64)v1 / (__s64)v2);
+		}
+		break;
+	case BPF_MOD:
+		if (v2 == 0)
+			return false;
+		if (!is_signed) {
+			*res = v1 % v2;
+		} else {
+			if ((__s64)v2 == -1)
+				return false;
+			*res = (__u64)((__s64)v1 % (__s64)v2);
+		}
+		break;
+	}
+	return true;
+}
+
+/*
+ * Operand pattern generator for the power-of-two magnitude tests: all
+ * combinations of magnitudes and signs with a block of contiguous values
+ * around each magnitude, with every dstep'th magnitude of the destination,
+ * and a larger block for the same magnitude of both operands. The first
+ * pattern is where the immediates take every encoding a JIT has, the
+ * second where the sign and overflow boundaries of both operands meet.
+ */
+static __s64 value(int msb, int delta, int sign)
+{
+	return sign * (1LL << msb) + delta;
+}
+
+#define PATTERN_BLOCK1 1
+#define PATTERN_BLOCK2 3
+
+typedef void (*emit_fn)(struct batch *b, void *arg, __s64 dst, __s64 src);
+
+static void fill_pattern(struct batch *b, void *arg, int dbits, int sbits,
+			 int block1, int dstep, int block2, emit_fn emit)
+{
+	static const int sgn[][2] = { { 1, 1 }, { 1, -1 }, { -1, 1 }, { -1, -1 } };
+	int di, si, bt, db, sb, k;
+
+	for (di = 0; di < dbits - 1; di += dstep)
+		for (si = 0; si < sbits - 1; si++)
+			for (k = 0; k < ARRAY_SIZE(sgn); k++)
+				for (db = -(block1 / 2); db < (block1 + 1) / 2; db++)
+					for (sb = -(block1 / 2); sb < (block1 + 1) / 2; sb++)
+						emit(b, arg, value(di, db, sgn[k][0]),
+						     value(si, sb, sgn[k][1]));
+
+	for (bt = 0; bt < (dbits > sbits ? dbits : sbits) - 1; bt++)
+		for (k = 0; k < ARRAY_SIZE(sgn); k++)
+			for (db = -(block2 / 2); db < (block2 + 1) / 2; db++)
+				for (sb = -(block2 / 2); sb < (block2 + 1) / 2; sb++)
+					emit(b, arg, value(bt % dbits, db, sgn[k][0]),
+					     value(bt % sbits, sb, sgn[k][1]));
+	batch_flush(b);
+}
+
+/* ALU operations with an immediate and with a register for all magnitudes */
+static const int alu_ops[] = {
+	BPF_MOV, BPF_AND, BPF_OR, BPF_XOR, BPF_ADD, BPF_SUB, BPF_MUL, BPF_DIV, BPF_MOD,
+};
+
+struct alu_arg {
+	int op;
+	__u32 flags;
+};
+
+static void emit_alu_imm(struct batch *b, void *arg, __s64 dst, __s64 imm)
+{
+	struct alu_arg *a = arg;
+	bool alu32 = a->flags & F_ALU32;
+	__u64 res;
+	int k;
+
+	if (!alu_result(&res, dst, (__s32)imm, a->op, a->flags))
+		return;
+	k = batch_case(b, BPF_REG_3, dst, 0);
+	LD_IN(b, k, 0, BPF_REG_3, BPF_REG_1);
+	EMIT(b, BPF_RAW_INSN((alu32 ? BPF_ALU : BPF_ALU64) | BPF_OP(a->op) | BPF_K,
+			     BPF_REG_1, 0, a->flags & F_SIGNED ? 1 : 0, imm));
+	ST_OUT(b, k, 0, BPF_REG_3, BPF_REG_1);
+	batch_expect(b, k, 0, alu32 ? (__u32)res : res);
+}
+
+static void emit_alu_reg(struct batch *b, void *arg, __s64 dst, __s64 src)
+{
+	struct alu_arg *a = arg;
+	bool alu32 = a->flags & F_ALU32;
+	__u64 res;
+	int k;
+
+	if (!alu_result(&res, dst, src, a->op, a->flags))
+		return;
+	k = batch_case(b, BPF_REG_3, dst, src);
+	LD_IN(b, k, 0, BPF_REG_3, BPF_REG_1);
+	LD_IN(b, k, 1, BPF_REG_3, BPF_REG_2);
+	EMIT(b, BPF_RAW_INSN((alu32 ? BPF_ALU : BPF_ALU64) | BPF_OP(a->op) | BPF_X,
+			     BPF_REG_1, BPF_REG_2, a->flags & F_SIGNED ? 1 : 0, 0));
+	ST_OUT(b, k, 0, BPF_REG_3, BPF_REG_1);
+	batch_expect(b, k, 0, alu32 ? (__u32)res : res);
+}
+
+static void test_alu_magnitudes(bool reg)
+{
+	struct batch b;
+	int o, f;
+
+	if (!batch_init(&b))
+		return;
+	for (f = 0; f < 2; f++) {
+		for (o = 0; o < ARRAY_SIZE(alu_ops); o++) {
+			struct alu_arg a = { alu_ops[o], f ? F_ALU32 : 0 };
+
+			snprintf(b.desc, sizeof(b.desc), "alu%d_%s_%c magnitudes",
+				 f ? 32 : 64, alu_name(a.op), reg ? 'x' : 'k');
+			if (reg)
+				fill_pattern(&b, &a, 64, 64, 0, 1, PATTERN_BLOCK2, emit_alu_reg);
+			else
+				fill_pattern(&b, &a, 64, 32, PATTERN_BLOCK1, 1, 5, emit_alu_imm);
+		}
+		for (o = 0; o < 2; o++) {
+			struct alu_arg a = { o ? BPF_MOD : BPF_DIV, F_SIGNED | (f ? F_ALU32 : 0) };
+
+			snprintf(b.desc, sizeof(b.desc), "alu%d_s%s_%c magnitudes",
+				 f ? 32 : 64, alu_name(a.op), reg ? 'x' : 'k');
+			if (reg)
+				fill_pattern(&b, &a, 64, 64, 0, 1, PATTERN_BLOCK2, emit_alu_reg);
+			else
+				fill_pattern(&b, &a, 64, 32, PATTERN_BLOCK1, 1, 5, emit_alu_imm);
+		}
+	}
+	batch_fini(&b);
+}
+
+static void test_alu_imm(void)
+{
+	test_alu_magnitudes(false);
+}
+
+static void test_alu_reg(void)
+{
+	test_alu_magnitudes(true);
+}
+
+/* ALU operations with an immediate for every destination register */
+static const int alu_reg_ops[] = {
+	BPF_MOV, BPF_AND, BPF_OR, BPF_XOR, BPF_LSH, BPF_RSH, BPF_ARSH,
+	BPF_ADD, BPF_SUB, BPF_MUL, BPF_DIV, BPF_MOD,
+};
+
+static void alu_imm_regs(struct batch *b, int op, __u32 flags)
+{
+	bool alu32 = flags & F_ALU32;
+	__u32 imm = 0x01234567U;
+	__u64 dst, res;
+	int rd, rc, k;
+
+	if (flags & F_SIGNED)
+		dst = alu32 ? (__u64)-76543210LL : (__u64)-7654321076543210LL;
+	else
+		dst = alu32 ? 0x76543210ULL : 0x7edcba9876543210ULL;
+	if (op == BPF_LSH || op == BPF_RSH || op == BPF_ARSH)
+		imm &= 31;
+	if (op == BPF_NEG)
+		imm = 0;
+	alu_result(&res, dst, imm, op, flags);
+	if (alu32)
+		res = (__u32)res;
+
+	snprintf(b->desc, sizeof(b->desc), "alu%d_%s%s_k registers", alu32 ? 32 : 64,
+		 flags & F_SIGNED ? "s" : "", alu_name(op));
+	for (rd = BPF_REG_0; rd <= BPF_REG_9; rd++) {
+		rc = scratch_reg(rd, rd);
+		k = batch_case(b, rc, dst, 0);
+		LD_IN(b, k, 0, rc, rd);
+		EMIT(b, BPF_RAW_INSN((alu32 ? BPF_ALU : BPF_ALU64) | BPF_OP(op) | BPF_K,
+				     rd, 0, flags & F_SIGNED ? 1 : 0, imm));
+		ST_OUT(b, k, 0, rc, rd);
+		batch_expect(b, k, 0, res);
+	}
+	batch_flush(b);
+}
+
+static void test_alu_imm_regs(void)
+{
+	struct batch b;
+	int o, f;
+
+	if (!batch_init(&b))
+		return;
+	for (f = 0; f < 2; f++) {
+		for (o = 0; o < ARRAY_SIZE(alu_reg_ops); o++)
+			alu_imm_regs(&b, alu_reg_ops[o], f ? F_ALU32 : 0);
+		alu_imm_regs(&b, BPF_NEG, f ? F_ALU32 : 0);
+		alu_imm_regs(&b, BPF_DIV, F_SIGNED | (f ? F_ALU32 : 0));
+		alu_imm_regs(&b, BPF_MOD, F_SIGNED | (f ? F_ALU32 : 0));
+	}
+	batch_fini(&b);
+}
+
+/*
+ * Division and modulo by constants for every width, signedness and
+ * destination register with a set of divisors and dividends around the
+ * multiple boundaries and the extremes of each range. This covers a JIT
+ * replacing the division with a multiplication by a magic number in all
+ * of its forms: magic numbers needing the extra add step, zero shifts,
+ * both signed corrections, and the divisors like 1, -1 and the ones
+ * above 2^63 that are still emitted as a real division. The dividends
+ * of the 32-bit operations carry garbage in the upper 32 bits.
+ */
+static const __s32 unsigned_divisors[] = {
+	2, 3, 7, 10, 25, 641, 1000, 4096, 65536, 1000000007, 0x7fffffff,
+	-2, -10, -0x7fffffff - 1, -1, 1,
+};
+
+static const __s32 signed_divisors[] = {
+	2, 3, 7, 25, 1000, 0x40000000, 0x7fffffff,
+	-2, -3, -5, -7, -1000, -0x7fffffff, -0x7fffffff - 1, 1, -1,
+};
+
+static int dividends(__u32 flags, __s32 imm, __u64 *n)
+{
+	bool alu32 = flags & F_ALU32, is_signed = flags & F_SIGNED;
+	__u64 d = is_signed ? (imm < 0 ? -(__s64)imm : imm) :
+		  alu32 ? (__u32)imm : (__u64)(__s64)imm;
+	int cnt = 0, i;
+
+	n[cnt++] = 0;
+	n[cnt++] = d - 1;
+	n[cnt++] = d + 1;
+	n[cnt++] = 3 * d + 2;
+	if (!alu32) {
+		n[cnt++] = (d << 40) - 1;
+		n[cnt++] = (d << 40) + 1;
+		n[cnt++] = (1ULL << 63) - 1;
+		n[cnt++] = 1ULL << 63;
+		n[cnt++] = ~0ULL;
+		n[cnt++] = 0xdaeb8ebd244a330cULL;
+	} else {
+		n[cnt++] = (d << 16) - 1;
+		n[cnt++] = (d << 16) + 1;
+		n[cnt++] = (1ULL << 31) - 1;
+		n[cnt++] = 1ULL << 31;
+		n[cnt++] = ~0U;
+		n[cnt++] = 0x8c1e86f1;
+	}
+	if (is_signed) {
+		n[cnt++] = -1;
+		n[cnt++] = -d - 1;
+		n[cnt++] = -3 * d - 2;
+		n[cnt++] = alu32 ? -(1ULL << 31) + 1 : -(1ULL << 63) + 1;
+	}
+	if (alu32)
+		for (i = 0; i < cnt; i++)
+			n[i] = (__u32)n[i] | ((0xa5a50000ULL + i) << 32);
+	return cnt;
+}
+
+static __u64 div_result(int op, __u32 flags, __s32 imm, __u64 n)
+{
+	__u64 res;
+
+	/* LLONG_MIN / -1 == LLONG_MIN, LLONG_MIN % -1 == 0, same for INT_MIN */
+	if ((flags & F_SIGNED) && imm == -1)
+		res = op == BPF_MOD ? 0 : -n;
+	else
+		alu_result(&res, n, (__s32)imm, op, flags);
+	return flags & F_ALU32 ? (__u32)res : res;
+}
+
+static void div_const(struct batch *b, int op, __u32 flags)
+{
+	bool alu32 = flags & F_ALU32, is_signed = flags & F_SIGNED;
+	const __s32 *divs = is_signed ? signed_divisors : unsigned_divisors;
+	int cnt = is_signed ? ARRAY_SIZE(signed_divisors) : ARRAY_SIZE(unsigned_divisors);
+	int code = (alu32 ? BPF_ALU : BPF_ALU64) | BPF_OP(op) | BPF_K;
+	int i, j, nr, rd, rc, k;
+	__u64 n[16];
+
+	snprintf(b->desc, sizeof(b->desc), "alu%d_%s%s_k constants", alu32 ? 32 : 64,
+		 is_signed ? "s" : "", alu_name(op));
+	for (i = 0; i < cnt; i++) {
+		nr = dividends(flags, divs[i], n);
+		for (rd = BPF_REG_0; rd <= BPF_REG_9; rd++) {
+			rc = scratch_reg(rd, rd);
+			for (j = 0; j < nr; j++) {
+				k = batch_case(b, rc, n[j], divs[i]);
+				LD_IN(b, k, 0, rc, rd);
+				EMIT(b, BPF_RAW_INSN(code, rd, 0, is_signed, divs[i]));
+				ST_OUT(b, k, 0, rc, rd);
+				batch_expect(b, k, 0, div_result(op, flags, divs[i], n[j]));
+			}
+		}
+	}
+	batch_flush(b);
+}
+
+static void test_div_const(void)
+{
+	struct batch b;
+	int f;
+
+	if (!batch_init(&b))
+		return;
+	for (f = 0; f < 2; f++) {
+		div_const(&b, BPF_DIV, f ? F_ALU32 : 0);
+		div_const(&b, BPF_MOD, f ? F_ALU32 : 0);
+		div_const(&b, BPF_DIV, F_SIGNED | (f ? F_ALU32 : 0));
+		div_const(&b, BPF_MOD, F_SIGNED | (f ? F_ALU32 : 0));
+	}
+	batch_fini(&b);
+}
+
+/* ALU operations for all combinations of operand registers */
+static void alu_reg_pairs(struct batch *b, int op, __u32 flags)
+{
+	bool alu32 = flags & F_ALU32;
+	__u64 dst, src, res, same;
+	int rd, rs, rc, k;
+
+	if (flags & F_SIGNED)
+		dst = alu32 ? (__u64)-76543210LL : (__u64)-7654321076543210LL;
+	else
+		dst = alu32 ? 0x76543210ULL : 0x7edcba9876543210ULL;
+	src = alu32 ? 0x01234567ULL : 0x0123456789abcdefULL;
+	if (op == BPF_LSH || op == BPF_RSH || op == BPF_ARSH)
+		src &= 31;
+	alu_result(&res, dst, src, op, flags);
+	alu_result(&same, src, src, op, flags);
+	if (alu32) {
+		res = (__u32)res;
+		same = (__u32)same;
+	}
+
+	snprintf(b->desc, sizeof(b->desc), "alu%d_%s%s_x register pairs", alu32 ? 32 : 64,
+		 flags & F_SIGNED ? "s" : "", alu_name(op));
+	for (rd = BPF_REG_0; rd <= BPF_REG_9; rd++) {
+		for (rs = BPF_REG_0; rs <= BPF_REG_9; rs++) {
+			rc = scratch_reg(rd, rs);
+			k = batch_case(b, rc, rd == rs ? src : dst, src);
+			LD_IN(b, k, 0, rc, rd);
+			if (rs != rd)
+				LD_IN(b, k, 1, rc, rs);
+			EMIT(b, BPF_RAW_INSN((alu32 ? BPF_ALU : BPF_ALU64) | BPF_OP(op) | BPF_X,
+					     rd, rs, flags & F_SIGNED ? 1 : 0, 0));
+			ST_OUT(b, k, 0, rc, rd);
+			batch_expect(b, k, 0, rd == rs ? same : res);
+		}
+	}
+	batch_flush(b);
+}
+
+static void test_alu_reg_pairs(void)
+{
+	struct batch b;
+	int o, f;
+
+	if (!batch_init(&b))
+		return;
+	for (f = 0; f < 2; f++) {
+		for (o = 0; o < ARRAY_SIZE(alu_reg_ops); o++)
+			alu_reg_pairs(&b, alu_reg_ops[o], f ? F_ALU32 : 0);
+		alu_reg_pairs(&b, BPF_DIV, F_SIGNED | (f ? F_ALU32 : 0));
+		alu_reg_pairs(&b, BPF_MOD, F_SIGNED | (f ? F_ALU32 : 0));
+	}
+	batch_fini(&b);
+}
+
+/* Shifts for all shift counts, by immediate, by register and by the shifted register */
+static void test_shifts(void)
+{
+	static const __s64 vals[] = {
+		0x0123456789abcdefLL, /* dword > 0, word < 0 */
+		0xfedcba9876543210LL, /* dword < 0, word > 0 */
+		0xfedcba0198765432LL, /* dword < 0, word < 0 */
+		0x0123458967abcdefLL, /* dword > 0, word > 0 */
+	};
+	static const int ops[] = { BPF_LSH, BPF_RSH, BPF_ARSH };
+	struct batch b;
+	int o, f, v, imm, k;
+
+	if (!batch_init(&b))
+		return;
+	for (f = 0; f < 2; f++) {
+		int bits = f ? 32 : 64;
+
+		for (o = 0; o < ARRAY_SIZE(ops); o++) {
+			int op = ops[o];
+
+			snprintf(b.desc, sizeof(b.desc), "alu%d_%s all shift counts", bits,
+				 alu_name(op));
+			for (v = 0; v < ARRAY_SIZE(vals); v++) {
+				for (imm = 0; imm < bits; imm++) {
+					__u64 reg = vals[v], res;
+
+					if (f)
+						reg = op == BPF_ARSH ? (__u64)(__s32)reg :
+						      (__u32)reg;
+					alu_result(&res, reg, imm, op, 0);
+					if (f)
+						res = (__u32)res;
+
+					k = batch_case(&b, BPF_REG_3, vals[v], imm);
+					LD_IN(&b, k, 0, BPF_REG_3, BPF_REG_1);
+					if (f)
+						EMIT(&b, BPF_ALU32_IMM(op, BPF_REG_1, imm));
+					else
+						EMIT(&b, BPF_ALU64_IMM(op, BPF_REG_1, imm));
+					ST_OUT(&b, k, 0, BPF_REG_3, BPF_REG_1);
+					batch_expect(&b, k, 0, res);
+
+					k = batch_case(&b, BPF_REG_3, vals[v], imm);
+					LD_IN(&b, k, 0, BPF_REG_3, BPF_REG_1);
+					LD_IN(&b, k, 1, BPF_REG_3, BPF_REG_2);
+					if (f)
+						EMIT(&b, BPF_ALU32_REG(op, BPF_REG_1, BPF_REG_2));
+					else
+						EMIT(&b, BPF_ALU64_REG(op, BPF_REG_1, BPF_REG_2));
+					ST_OUT(&b, k, 0, BPF_REG_3, BPF_REG_1);
+					batch_expect(&b, k, 0, res);
+				}
+			}
+			/* The count in the shifted register */
+			for (imm = 0; imm < bits; imm++) {
+				__u64 res;
+
+				alu_result(&res, imm, imm, op, 0);
+				k = batch_case(&b, BPF_REG_3, imm, 0);
+				LD_IN(&b, k, 0, BPF_REG_3, BPF_REG_1);
+				if (f)
+					EMIT(&b, BPF_ALU32_REG(op, BPF_REG_1, BPF_REG_1));
+				else
+					EMIT(&b, BPF_ALU64_REG(op, BPF_REG_1, BPF_REG_1));
+				ST_OUT(&b, k, 0, BPF_REG_3, BPF_REG_1);
+				batch_expect(&b, k, 0, f ? (__u32)res : res);
+			}
+			batch_flush(&b);
+		}
+	}
+	batch_fini(&b);
+}
+
+/* Atomic operations on the stack for all magnitudes of memory and source operand */
+static const int atomic_ops[] = {
+	BPF_ADD, BPF_AND, BPF_OR, BPF_XOR,
+	BPF_ADD | BPF_FETCH, BPF_AND | BPF_FETCH, BPF_OR | BPF_FETCH, BPF_XOR | BPF_FETCH,
+	BPF_XCHG,
+};
+
+struct atomic_arg {
+	int op;
+	int size;
+};
+
+static void emit_atomic(struct batch *b, void *arg, __s64 dst, __s64 src)
+{
+	struct atomic_arg *a = arg;
+	bool w = a->size == BPF_W;
+	__u64 keep = 0x0123456789abcdefULL, res, fetch;
+	int k;
+
+	if (a->op == BPF_XCHG)
+		res = src;
+	else
+		alu_result(&res, w ? (__u32)dst : dst, w ? (__u32)src : src, BPF_OP(a->op), 0);
+	/* The source register gets the old value with fetch, keeps its own without */
+	fetch = a->op & BPF_FETCH ? (w ? (__u32)dst : dst) : src;
+
+	k = batch_case(b, BPF_REG_3, dst, src);
+	LD_IN(b, k, 0, BPF_REG_3, BPF_REG_1);
+	EMIT(b, BPF_STX_MEM(a->size, BPF_REG_10, BPF_REG_1, MEM_SLOT));
+	LD_IN(b, k, 1, BPF_REG_3, BPF_REG_2);
+	emit_ld_imm64(b, BPF_REG_0, keep);
+	EMIT(b, BPF_ATOMIC_OP(a->size, a->op, BPF_REG_10, BPF_REG_2, MEM_SLOT));
+	EMIT(b, BPF_LDX_MEM(a->size, BPF_REG_1, BPF_REG_10, MEM_SLOT));
+	ST_OUT(b, k, 0, BPF_REG_3, BPF_REG_1);
+	ST_OUT(b, k, 1, BPF_REG_3, BPF_REG_2);
+	ST_OUT(b, k, 2, BPF_REG_3, BPF_REG_0);
+	batch_expect(b, k, 0, w ? (__u32)res : res);
+	batch_expect(b, k, 1, fetch);
+	batch_expect(b, k, 2, keep);
+}
+
+static void emit_cmpxchg(struct batch *b, void *arg, __s64 dst, __s64 src)
+{
+	int size = *(int *)arg;
+	bool w = size == BPF_W;
+	__u64 old = w ? (__u32)dst : dst;
+	int k;
+
+	k = batch_case(b, BPF_REG_3, dst, src);
+	LD_IN(b, k, 0, BPF_REG_3, BPF_REG_1);
+	EMIT(b, BPF_STX_MEM(size, BPF_REG_10, BPF_REG_1, MEM_SLOT));
+	LD_IN(b, k, 1, BPF_REG_3, BPF_REG_2);
+	/* Mismatch: the memory keeps its value, r0 gets it */
+	EMIT(b, BPF_MOV64_REG(BPF_REG_0, BPF_REG_1));
+	EMIT(b, BPF_ALU64_IMM(BPF_XOR, BPF_REG_0, -1));
+	EMIT(b, BPF_ATOMIC_OP(size, BPF_CMPXCHG, BPF_REG_10, BPF_REG_2, MEM_SLOT));
+	ST_OUT(b, k, 0, BPF_REG_3, BPF_REG_0);
+	/* Match: the memory gets the source, r0 the old value */
+	EMIT(b, BPF_ATOMIC_OP(size, BPF_CMPXCHG, BPF_REG_10, BPF_REG_2, MEM_SLOT));
+	EMIT(b, BPF_LDX_MEM(size, BPF_REG_1, BPF_REG_10, MEM_SLOT));
+	ST_OUT(b, k, 1, BPF_REG_3, BPF_REG_1);
+	ST_OUT(b, k, 2, BPF_REG_3, BPF_REG_0);
+	batch_expect(b, k, 0, old);
+	batch_expect(b, k, 1, w ? (__u32)src : src);
+	batch_expect(b, k, 2, old);
+}
+
+static void test_atomics(void)
+{
+	static const int sizes[] = { BPF_DW, BPF_W };
+	struct batch b;
+	int o, s;
+
+	if (!batch_init(&b))
+		return;
+	for (s = 0; s < ARRAY_SIZE(sizes); s++) {
+		int size = sizes[s];
+
+		for (o = 0; o < ARRAY_SIZE(atomic_ops); o++) {
+			struct atomic_arg a = { atomic_ops[o], size };
+
+			snprintf(b.desc, sizeof(b.desc), "atomic%d_%s%s magnitudes",
+				 size == BPF_DW ? 64 : 32, alu_name(a.op),
+				 a.op == BPF_XCHG ? "" : a.op & BPF_FETCH ? "_fetch" : "");
+			fill_pattern(&b, &a, 64, 64, 0, 1, PATTERN_BLOCK2, emit_atomic);
+		}
+		snprintf(b.desc, sizeof(b.desc), "atomic%d_cmpxchg magnitudes",
+			 size == BPF_DW ? 64 : 32);
+		fill_pattern(&b, &size, 64, 64, 0, 1, PATTERN_BLOCK2, emit_cmpxchg);
+	}
+	batch_fini(&b);
+}
+
+/* Atomic operations for all combinations of pointer and source register */
+static void atomic_reg_pairs(struct batch *b, int size, int op)
+{
+	bool w = size == BPF_W;
+	__u64 mem, upd;
+	int rd, rs, rc, k, n;
+
+	if (w) {
+		mem = 0x01234567U;
+		upd = 0x76543210U;
+	} else {
+		mem = 0x0123456789abcdefULL;
+		upd = 0xfedcba9876543210ULL;
+	}
+
+	snprintf(b->desc, sizeof(b->desc), "atomic%d_%s%s register pairs", w ? 32 : 64,
+		 alu_name(op), op == BPF_XCHG || op == BPF_CMPXCHG ? "" :
+		 op & BPF_FETCH ? "_fetch" : "");
+	for (rd = BPF_REG_0; rd <= BPF_REG_9; rd++) {
+		for (rs = BPF_REG_0; rs <= BPF_REG_9; rs++) {
+			__u64 regs[10], old = mem, new, src, cmp;
+
+			/* The source would be the pointer, r0 the compare value */
+			if (rs == rd || (op == BPF_CMPXCHG && rd == BPF_REG_0))
+				continue;
+			rc = scratch_reg(rd, rs);
+			k = batch_case(b, rc, mem, upd);
+			/* Memory from in0, r0 inverted, source from in1, pointer */
+			LD_IN(b, k, 0, rc, rs);
+			EMIT(b, BPF_STX_MEM(size, BPF_REG_10, rs, MEM_SLOT));
+			LD_IN(b, k, 0, rc, BPF_REG_0);
+			EMIT(b, BPF_ALU64_IMM(BPF_XOR, BPF_REG_0, -1));
+			LD_IN(b, k, 1, rc, rs);
+			EMIT(b, BPF_MOV64_REG(rd, BPF_REG_10));
+			EMIT(b, BPF_ATOMIC_OP(size, op, rd, rs, MEM_SLOT));
+			/* r0 holds the pointer when it is the destination */
+			n = 0;
+			if (rd != BPF_REG_0)
+				ST_OUT(b, k, n++, rc, BPF_REG_0);
+			ST_OUT(b, k, n++, rc, rs);
+			EMIT(b, BPF_LDX_MEM(size, rs, BPF_REG_10, MEM_SLOT));
+			ST_OUT(b, k, n, rc, rs);
+
+			/* Model with the register aliasing of r0 */
+			regs[BPF_REG_0] = ~mem;
+			regs[rs] = upd;
+			src = w ? (__u32)regs[rs] : regs[rs];
+			if (op == BPF_XCHG) {
+				new = src;
+				regs[rs] = old;
+			} else if (op == BPF_CMPXCHG) {
+				cmp = w ? (__u32)regs[BPF_REG_0] : regs[BPF_REG_0];
+				new = cmp == old ? src : old;
+				regs[BPF_REG_0] = old;
+			} else {
+				alu_result(&new, old, src, BPF_OP(op), 0);
+				if (w)
+					new = (__u32)new;
+				if (op & BPF_FETCH)
+					regs[rs] = old;
+			}
+			n = 0;
+			if (rd != BPF_REG_0)
+				batch_expect(b, k, n++, regs[BPF_REG_0]);
+			batch_expect(b, k, n++, regs[rs]);
+			batch_expect(b, k, n, new);
+		}
+	}
+	batch_flush(b);
+}
+
+static void test_atomic_reg_pairs(void)
+{
+	static const int sizes[] = { BPF_DW, BPF_W };
+	struct batch b;
+	int o, s;
+
+	if (!batch_init(&b))
+		return;
+	for (s = 0; s < ARRAY_SIZE(sizes); s++) {
+		for (o = 0; o < ARRAY_SIZE(atomic_ops); o++)
+			atomic_reg_pairs(&b, sizes[s], atomic_ops[o]);
+		atomic_reg_pairs(&b, sizes[s], BPF_CMPXCHG);
+	}
+	batch_fini(&b);
+}
+
+/* A maximal chain of atomic adds on one stack slot */
+static void test_xadd_chain(void)
+{
+	static const int sizes[] = { BPF_DW, BPF_W };
+	LIBBPF_OPTS(bpf_test_run_opts, opts);
+	struct bpf_insn *insns;
+	int len = BPF_MAXINSNS, s, i, fd;
+
+	insns = malloc(len * sizeof(*insns));
+	if (!ASSERT_OK_PTR(insns, "insns"))
+		return;
+	for (s = 0; s < ARRAY_SIZE(sizes); s++) {
+		insns[0] = BPF_MOV32_IMM(BPF_REG_0, 1);
+		insns[1] = BPF_ST_MEM(sizes[s], BPF_REG_10, -40, 42);
+		for (i = 2; i < len - 2; i++)
+			insns[i] = BPF_STX_XADD(sizes[s], BPF_REG_10, BPF_REG_0, -40);
+		insns[len - 2] = BPF_LDX_MEM(sizes[s], BPF_REG_0, BPF_REG_10, -40);
+		insns[len - 1] = BPF_EXIT_INSN();
+
+		fd = load_prog(insns, len, "xadd chain");
+		if (fd < 0)
+			break;
+		if (ASSERT_OK(bpf_prog_test_run_opts(fd, &opts), "xadd chain run"))
+			ASSERT_EQ(opts.retval, 42 + len - 4, "xadd chain result");
+		close(fd);
+	}
+	free(insns);
+}
+
+/* 64-bit immediate loads for all magnitudes and byte patterns */
+static void ld_imm64_case(struct batch *b, __u64 imm)
+{
+	int k = batch_case(b, BPF_REG_3, imm, 0);
+
+	emit_ld_imm64(b, BPF_REG_1, imm);
+	ST_OUT(b, k, 0, BPF_REG_3, BPF_REG_1);
+	batch_expect(b, k, 0, imm);
+}
+
+static void test_ld_imm64(void)
+{
+	static const struct {
+		__u8 base1, mask1, base2, mask2;
+	} bytes[] = {
+		{ 0, 0xff, 0xff, 0xff },	/* checker */
+		{ 1, 0x81, 0x80, 0x80 },	/* positive and negative */
+		{ 1, 0x81, 0, 0xff },		/* positive and zero */
+		{ 0x80, 0x80, 0, 0xff },	/* negative and zero */
+	};
+	int block = 64, bit, adj, sign, p, pattern, index;
+	struct batch b;
+
+	if (!batch_init(&b))
+		return;
+	snprintf(b.desc, sizeof(b.desc), "ld_imm64 magnitudes");
+	for (bit = 0; bit <= 62; bit++)
+		for (adj = -block / 2; adj < block / 2; adj++)
+			for (sign = -1; sign <= 1; sign += 2)
+				ld_imm64_case(&b, sign * ((1LL << bit) + adj));
+	batch_flush(&b);
+
+	for (p = 0; p < ARRAY_SIZE(bytes); p++) {
+		__u32 rand = 1;
+
+		snprintf(b.desc, sizeof(b.desc), "ld_imm64 byte pattern %d", p);
+		for (pattern = 0; pattern < 256; pattern++) {
+			__u64 imm = 0;
+
+			for (index = 0; index < 8; index++) {
+				int byte;
+
+				if (pattern & (1 << index))
+					byte = (bytes[p].base1 & bytes[p].mask1) |
+					       (rand & ~bytes[p].mask1);
+				else
+					byte = (bytes[p].base2 & bytes[p].mask2) |
+					       (rand & ~bytes[p].mask2);
+				imm = (imm << 8) | (__u8)byte;
+			}
+			rand = rand * 1664525 + 1013904223;
+			ld_imm64_case(&b, imm);
+		}
+		batch_flush(&b);
+	}
+	batch_fini(&b);
+}
+
+/* Conditional jumps with an immediate and with a register for all magnitudes */
+static const int jmp_ops[] = {
+	BPF_JSET, BPF_JEQ, BPF_JNE, BPF_JGT, BPF_JGE, BPF_JLT, BPF_JLE,
+	BPF_JSGT, BPF_JSGE, BPF_JSLT, BPF_JSLE,
+};
+
+static bool jmp_match(__s64 v1, __s64 v2, __u8 op)
+{
+	switch (op) {
+	case BPF_JSET:
+		return !!(v1 & v2);
+	case BPF_JEQ:
+		return v1 == v2;
+	case BPF_JNE:
+		return v1 != v2;
+	case BPF_JGT:
+		return (__u64)v1 > (__u64)v2;
+	case BPF_JGE:
+		return (__u64)v1 >= (__u64)v2;
+	case BPF_JLT:
+		return (__u64)v1 < (__u64)v2;
+	case BPF_JLE:
+		return (__u64)v1 <= (__u64)v2;
+	case BPF_JSGT:
+		return v1 > v2;
+	case BPF_JSGE:
+		return v1 >= v2;
+	case BPF_JSLT:
+		return v1 < v2;
+	case BPF_JSLE:
+		return v1 <= v2;
+	}
+	return false;
+}
+
+struct jmp_arg {
+	int op;
+	bool is32;
+	bool reg;
+};
+
+static void emit_jmp(struct batch *b, void *arg, __s64 dst, __s64 src)
+{
+	struct jmp_arg *a = arg;
+	bool match;
+	int k;
+
+	if (a->is32)
+		match = jmp_match((__s32)dst, (__s32)src, a->op);
+	else
+		match = jmp_match(dst, a->reg ? src : (__s32)src, a->op);
+
+	k = batch_case(b, BPF_REG_3, dst, src);
+	LD_IN(b, k, 0, BPF_REG_3, BPF_REG_1);
+	if (a->reg)
+		LD_IN(b, k, 1, BPF_REG_3, BPF_REG_2);
+	EMIT(b, BPF_MOV64_IMM(BPF_REG_4, 1));
+	if (a->reg && a->is32)
+		EMIT(b, BPF_JMP32_REG(a->op, BPF_REG_1, BPF_REG_2, 1));
+	else if (a->reg)
+		EMIT(b, BPF_JMP_REG(a->op, BPF_REG_1, BPF_REG_2, 1));
+	else if (a->is32)
+		EMIT(b, BPF_JMP32_IMM(a->op, BPF_REG_1, src, 1));
+	else
+		EMIT(b, BPF_JMP_IMM(a->op, BPF_REG_1, src, 1));
+	EMIT(b, BPF_MOV64_IMM(BPF_REG_4, 0));
+	ST_OUT(b, k, 0, BPF_REG_3, BPF_REG_4);
+	batch_expect(b, k, 0, match);
+}
+
+static void test_jmp_magnitudes(bool reg)
+{
+	struct batch b;
+	int o, f;
+
+	if (!batch_init(&b))
+		return;
+	for (f = 0; f < 2; f++) {
+		for (o = 0; o < ARRAY_SIZE(jmp_ops); o++) {
+			struct jmp_arg a = { jmp_ops[o], f, reg };
+
+			snprintf(b.desc, sizeof(b.desc), "jmp%s_%s_%c magnitudes", f ? "32" : "",
+				 jmp_name(a.op), reg ? 'x' : 'k');
+			if (reg)
+				fill_pattern(&b, &a, 64, 64, 0, 1, PATTERN_BLOCK2, emit_jmp);
+			else
+				fill_pattern(&b, &a, 64, 32, PATTERN_BLOCK1, 8, PATTERN_BLOCK2,
+					     emit_jmp);
+		}
+	}
+	batch_fini(&b);
+}
+
+static void test_jmp_imm(void)
+{
+	test_jmp_magnitudes(false);
+}
+
+static void test_jmp_reg(void)
+{
+	test_jmp_magnitudes(true);
+}
+
+/* A conditional jump on two registers, with the operands swapped for n == 1 */
+static void jmp_reg_pair(struct batch *b, bool is32, int op, int rd, int rs, int n)
+{
+	const __u64 a = 0x7edcba9876543210ULL, c = 0x0123456789abcdefULL;
+	__u64 v1 = n ? c : a, v2 = n ? a : c;
+	int rc, rt, k;
+	bool match;
+
+	/* Two scratch registers besides the operands */
+	rc = scratch_reg(rd, rs);
+	for (rt = BPF_REG_1; rt < BPF_REG_9; rt++)
+		if (rt != rd && rt != rs && rt != rc)
+			break;
+	if (rd == rs)
+		v2 = v1;
+	match = is32 ? jmp_match((__s32)v1, (__s32)v2, op) : jmp_match(v1, v2, op);
+
+	k = batch_case(b, rc, v1, v2);
+	LD_IN(b, k, 0, rc, rd);
+	if (rs != rd)
+		LD_IN(b, k, 1, rc, rs);
+	EMIT(b, BPF_MOV64_IMM(rt, 1));
+	if (is32)
+		EMIT(b, BPF_JMP32_REG(op, rd, rs, 1));
+	else
+		EMIT(b, BPF_JMP_REG(op, rd, rs, 1));
+	EMIT(b, BPF_MOV64_IMM(rt, 0));
+	ST_OUT(b, k, 0, rc, rt);
+	batch_expect(b, k, 0, match);
+}
+
+/* Conditional jumps for all combinations of operand registers, taken and not */
+static void test_jmp_reg_pairs(void)
+{
+	struct batch b;
+	int o, f, rd, rs, n;
+
+	if (!batch_init(&b))
+		return;
+	for (f = 0; f < 2; f++) {
+		for (o = 0; o < ARRAY_SIZE(jmp_ops); o++) {
+			snprintf(b.desc, sizeof(b.desc), "jmp%s_%s_x register pairs",
+				 f ? "32" : "", jmp_name(jmp_ops[o]));
+			for (rd = BPF_REG_0; rd <= BPF_REG_9; rd++)
+				for (rs = BPF_REG_0; rs <= BPF_REG_9; rs++)
+					for (n = 0; n < 2; n++)
+						jmp_reg_pair(&b, f, jmp_ops[o], rd, rs, n);
+			batch_flush(&b);
+		}
+	}
+	batch_fini(&b);
+}
+
+/* The offset of a jump instruction, which the 32-bit unconditional jump keeps in imm */
+static void set_jmp_off(struct bpf_insn *insn, bool ja32, int off)
+{
+	if (ja32)
+		insn->imm = off;
+	else
+		insn->off = off;
+}
+
+static struct bpf_insn jmp_insn(bool ja32)
+{
+	return ja32 ? BPF_RAW_INSN(BPF_JMP32 | BPF_JA, 0, 0, 0, 0) : BPF_JMP_IMM(BPF_JA, 0, 0, 0);
+}
+
+/*
+ * Taken jumps over regions of doubling length, forward or backward, up to
+ * the maximal offset of the jump: 16 bits, or 2^17 for the 32-bit
+ * unconditional jump. The not taken path of a conditional jump and the
+ * guard of an unconditional one lead to an exit with the region number, so
+ * the verifier sees every instruction reachable and a jump landing anywhere
+ * else than on its target fails the run.
+ */
+static void staggered_jumps(const struct bpf_insn *jmp, __s64 r1, __s64 r2, bool backward,
+			    const char *desc)
+{
+	bool ja32 = BPF_CLASS(jmp->code) == BPF_JMP32 && BPF_OP(jmp->code) == BPF_JA;
+	bool ja = BPF_OP(jmp->code) == BPF_JA;
+	struct { __u64 r1, r2; } ctx = { r1, r2 };
+	LIBBPF_OPTS(bpf_test_run_opts, opts,
+		.ctx_in = &ctx,
+		.ctx_size_in = sizeof(ctx),
+	);
+	int max = ja32 ? 1 << 17 : INT16_MAX;
+	int len = 128 + 2 * max, i = 0, n = 0, gap, fd;
+	struct bpf_insn *insns;
+
+	insns = malloc(len * sizeof(*insns));
+	if (!ASSERT_OK_PTR(insns, "insns"))
+		return;
+	insns[i++] = BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_1, 8);
+	insns[i++] = BPF_LDX_MEM(BPF_DW, BPF_REG_1, BPF_REG_1, 0);
+	insns[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_0, 0);
+	for (gap = backward ? 4 : 2; gap <= max; gap = gap < max / 2 ? gap * 2 : max) {
+		int k, a, t, x, g, j;
+
+		if (backward) {
+			/*
+			 * Over the region to its guard and jump, which comes back
+			 * to the start of the region, from where it leads on to
+			 * the next one.
+			 */
+			a = i++;
+			t = i;
+			for (k = 0; k < gap - 3; k++)
+				insns[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_3, 0);
+			x = i++;
+			g = i;
+			if (ja)
+				insns[i++] = BPF_JMP_IMM(BPF_JEQ, BPF_REG_2, 0, 1);
+			j = i;
+			insns[i] = *jmp;
+			set_jmp_off(&insns[i++], ja32, t - (j + 1));
+			insns[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_0, ++n);
+			insns[i++] = BPF_EXIT_INSN();
+			insns[a] = jmp_insn(ja32);
+			set_jmp_off(&insns[a], ja32, g - (a + 1));
+			insns[x] = jmp_insn(ja32);
+			set_jmp_off(&insns[x], ja32, i - (x + 1));
+		} else {
+			/* An unconditional jump needs a way into its region */
+			if (ja)
+				insns[i++] = BPF_JMP_IMM(BPF_JEQ, BPF_REG_2, 0, 1);
+			insns[i] = *jmp;
+			set_jmp_off(&insns[i++], ja32, gap);
+			insns[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_0, ++n);
+			for (k = 0; k < gap - 2; k++)
+				insns[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_3, 0);
+			insns[i++] = BPF_EXIT_INSN();
+		}
+		if (gap == max)
+			break;
+	}
+	insns[i++] = BPF_EXIT_INSN();
+	if (!ASSERT_LE(i, len, "insn count"))
+		goto out;
+
+	fd = load_prog(insns, i, desc);
+	if (fd >= 0) {
+		if (ASSERT_OK(bpf_prog_test_run_opts(fd, &opts), desc))
+			ASSERT_EQ(opts.retval, 0, desc);
+		close(fd);
+	}
+out:
+	free(insns);
+}
+
+static void test_staggered_jumps(void)
+{
+	/* A representative set, with operands which make the jump taken */
+	static const struct {
+		const char *desc;
+		struct bpf_insn jmp;
+		__s64 r1, r2;
+	} kinds[] = {
+		{ "staggered ja",
+		  BPF_JMP_IMM(BPF_JA, 0, 0, 0), 0, 1 },
+		{ "staggered gotol",
+		  BPF_RAW_INSN(BPF_JMP32 | BPF_JA, 0, 0, 0, 0), 0, 1 },
+		{ "staggered jmp_jeq_k",
+		  BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 1234, 0), 1234, 0 },
+		{ "staggered jmp_jne_x",
+		  BPF_JMP_REG(BPF_JNE, BPF_REG_1, BPF_REG_2, 0), 4321, 1234 },
+		{ "staggered jmp_jset_k",
+		  BPF_JMP_IMM(BPF_JSET, BPF_REG_1, 0x82, 0), 0x86, 0 },
+		{ "staggered jmp_jsgt_x",
+		  BPF_JMP_REG(BPF_JSGT, BPF_REG_1, BPF_REG_2, 0), -1, -2 },
+		{ "staggered jmp32_jlt_k",
+		  BPF_JMP32_IMM(BPF_JLT, BPF_REG_1, 0x80000000, 0), 1234, 0 },
+		{ "staggered jmp32_jsge_x",
+		  BPF_JMP32_REG(BPF_JSGE, BPF_REG_1, BPF_REG_2, 0), -2, -2 },
+	};
+	char desc[64];
+	int i, d;
+
+	for (i = 0; i < ARRAY_SIZE(kinds); i++) {
+		for (d = 0; d < 2; d++) {
+			snprintf(desc, sizeof(desc), "%s %s", kinds[i].desc,
+				 d ? "backward" : "forward");
+			staggered_jumps(&kinds[i].jmp, kinds[i].r1, kinds[i].r2, d, desc);
+		}
+	}
+}
+
+/*
+ * The pattern sweeps: one program per pattern and register choice, run
+ * once per input with the operands in the ctx and the result handed back
+ * through it.
+ */
+struct pat_ctx {
+	__u64 in0;
+	__u64 in1;
+	__u64 res;
+};
+
+#define IN0	offsetof(struct pat_ctx, in0)
+#define IN1	offsetof(struct pat_ctx, in1)
+#define RES	offsetof(struct pat_ctx, res)
+
+/* r6 holds the ctx */
+static const int pat_regs[] = {
+	BPF_REG_0, BPF_REG_1, BPF_REG_2, BPF_REG_3, BPF_REG_4,
+	BPF_REG_5, BPF_REG_7, BPF_REG_8, BPF_REG_9,
+};
+
+/* The second register of a pattern: the same one, the next and a far one */
+#define NR_PAIRS 3
+static const int pair_off[NR_PAIRS] = { 0, 1, 5 };
+
+static int pair_reg(int i, int k)
+{
+	return pat_regs[(i + pair_off[k]) % ARRAY_SIZE(pat_regs)];
+}
+
+static const __u64 inputs[] = {
+	0, 0x1122334455667788ULL, 0xfedcba9876543210ULL, 0x80, 0xffffffffffffff7fULL,
+};
+
+struct prog {
+	struct bpf_insn insns[16];
+	int cnt;
+};
+
+static void prog_start(struct prog *p)
+{
+	p->cnt = 0;
+	EMIT(p, BPF_MOV64_REG(BPF_REG_6, BPF_REG_1));
+}
+
+/* Hand the result in reg back and return */
+static void prog_end(struct prog *p, int reg)
+{
+	EMIT(p, BPF_STX_MEM(BPF_DW, BPF_REG_6, reg, RES));
+	EMIT(p, BPF_MOV64_IMM(BPF_REG_0, 0));
+	EMIT(p, BPF_EXIT_INSN());
+}
+
+static int prog_load(struct prog *p, const char *desc)
+{
+	LIBBPF_OPTS(bpf_prog_load_opts, lopts,
+		.prog_flags = BPF_F_SLEEPABLE,
+		.log_buf = log,
+		.log_size = sizeof(log),
+	);
+	int fd;
+
+	fd = bpf_prog_load(BPF_PROG_TYPE_SYSCALL, NULL, "GPL", p->insns, p->cnt, &lopts);
+	if (!ASSERT_GE(fd, 0, desc))
+		fprintf(stderr, "%s", log);
+	return fd;
+}
+
+static void prog_run(int fd, __u64 in0, __u64 in1, __u64 expected, const char *desc)
+{
+	struct pat_ctx ctx = { .in0 = in0, .in1 = in1 };
+	LIBBPF_OPTS(bpf_test_run_opts, opts,
+		.ctx_in = &ctx,
+		.ctx_size_in = sizeof(ctx),
+	);
+	char buf[128];
+
+	snprintf(buf, sizeof(buf), "%s in0=0x%llx in1=0x%llx", desc, in0, in1);
+	if (ASSERT_OK(bpf_prog_test_run_opts(fd, &opts), buf))
+		ASSERT_EQ(ctx.res, expected, buf);
+}
+
+static int size_bits(int size)
+{
+	switch (size) {
+	case BPF_B:
+		return 8;
+	case BPF_H:
+		return 16;
+	case BPF_W:
+		return 32;
+	default:
+		return 64;
+	}
+}
+
+/* The first size bytes of v in memory, as a load of that size reads them */
+static __u64 head_bytes(__u64 v, int size)
+{
+	int bits = size_bits(size);
+
+	if (bits == 64)
+		return v;
+#if __BYTE_ORDER == __BIG_ENDIAN
+	return v >> (64 - bits);
+#else
+	return v & ((1ULL << bits) - 1);
+#endif
+}
+
+/* v with its first size bytes in memory replaced by those of w */
+static __u64 head_merge(__u64 v, __u64 w, int size)
+{
+	int bits = size_bits(size);
+	__u64 mask;
+
+	if (bits == 64)
+		return w;
+	mask = (1ULL << bits) - 1;
+#if __BYTE_ORDER == __BIG_ENDIAN
+	return (v & ~(mask << (64 - bits))) | ((w & mask) << (64 - bits));
+#else
+	return (v & ~mask) | (w & mask);
+#endif
+}
+
+static void test_ldst_zero_off(void)
+{
+	static const int sizes[] = { BPF_B, BPF_H, BPF_W, BPF_DW };
+	static const int aops[] = {
+		BPF_ADD, BPF_ADD | BPF_FETCH, BPF_OR, BPF_XCHG, BPF_CMPXCHG,
+	};
+	static const __s32 imms[] = { 0x5a, -1 };
+	struct prog p;
+	char desc[64];
+	int b, k, s, j, fd;
+
+	for (b = 0; b < ARRAY_SIZE(pat_regs); b++) {
+		int rb = pat_regs[b];
+
+		for (s = 0; s < ARRAY_SIZE(sizes); s++) {
+			int size = sizes[s];
+
+			for (k = 0; k < NR_PAIRS; k++) {
+				int rd = pair_reg(b, k);
+
+				/* Load with a zero offset, also into the base */
+				prog_start(&p);
+				EMIT(&p, BPF_MOV64_REG(rb, BPF_REG_6));
+				EMIT(&p, BPF_LDX_MEM(size, rd, rb, 0));
+				prog_end(&p, rd);
+				snprintf(desc, sizeof(desc), "ldx size=%d base=r%d dst=r%d",
+					 size, rb, rd);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				for (j = 0; j < ARRAY_SIZE(inputs); j++)
+					prog_run(fd, inputs[j], 0,
+						 head_bytes(inputs[j], size), desc);
+				close(fd);
+
+				/* Sign extending load with a zero offset from the stack */
+				if (size != BPF_DW) {
+					prog_start(&p);
+					EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));
+					EMIT(&p, BPF_STX_MEM(BPF_DW, BPF_REG_10, rd, -8));
+					EMIT(&p, BPF_MOV64_REG(rb, BPF_REG_10));
+					EMIT(&p, BPF_ALU64_IMM(BPF_ADD, rb, -8));
+					EMIT(&p, BPF_RAW_INSN(BPF_LDX | BPF_MEMSX | size,
+							      rd, rb, 0, 0));
+					prog_end(&p, rd);
+					snprintf(desc, sizeof(desc),
+						 "ldsx size=%d base=r%d dst=r%d", size, rb, rd);
+					fd = prog_load(&p, desc);
+					if (fd < 0)
+						return;
+					for (j = 0; j < ARRAY_SIZE(inputs); j++) {
+						__s64 v = head_bytes(inputs[j], size);
+
+						v = size == BPF_B ? (__s8)v :
+						    size == BPF_H ? (__s16)v : (__s32)v;
+						prog_run(fd, inputs[j], 0, v, desc);
+					}
+					close(fd);
+				}
+
+				if (rd == rb)
+					continue;
+				/* Store with a zero offset over in0 */
+				prog_start(&p);
+				EMIT(&p, BPF_MOV64_REG(rb, BPF_REG_6));
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN1));
+				EMIT(&p, BPF_STX_MEM(size, rb, rd, 0));
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));
+				prog_end(&p, rd);
+				snprintf(desc, sizeof(desc), "stx size=%d base=r%d src=r%d",
+					 size, rb, rd);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				for (j = 0; j < ARRAY_SIZE(inputs); j++) {
+					__u64 in1 = inputs[(j + 1) % ARRAY_SIZE(inputs)];
+
+					prog_run(fd, inputs[j], in1,
+						 head_merge(inputs[j], in1, size), desc);
+				}
+				close(fd);
+			}
+
+			/* Store an immediate with a zero offset into a zeroed stack slot */
+			for (k = 0; k < ARRAY_SIZE(imms); k++) {
+				int rd = pair_reg(b, 1);
+
+				prog_start(&p);
+				EMIT(&p, BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0));
+				EMIT(&p, BPF_MOV64_REG(rb, BPF_REG_10));
+				EMIT(&p, BPF_ALU64_IMM(BPF_ADD, rb, -8));
+				EMIT(&p, BPF_ST_MEM(size, rb, 0, imms[k]));
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_10, -8));
+				prog_end(&p, rd);
+				snprintf(desc, sizeof(desc), "st size=%d base=r%d imm=%d",
+					 size, rb, imms[k]);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				prog_run(fd, 0, 0,
+					 head_merge(0, (__u64)(__s64)imms[k], size), desc);
+				close(fd);
+			}
+
+			/* Atomics with a zero offset on a stack slot holding in0 */
+			for (k = 0; k < ARRAY_SIZE(aops); k++) {
+				int rd = pair_reg(b, 1), op = aops[k];
+
+				if (size == BPF_B || size == BPF_H)
+					break;
+				/* cmpxchg compares with r0 */
+				if (op == BPF_CMPXCHG && (rb == BPF_REG_0 || rd == BPF_REG_0))
+					continue;
+				prog_start(&p);
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));
+				EMIT(&p, BPF_STX_MEM(BPF_DW, BPF_REG_10, rd, -8));
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN1));
+				EMIT(&p, BPF_MOV64_REG(rb, BPF_REG_10));
+				EMIT(&p, BPF_ALU64_IMM(BPF_ADD, rb, -8));
+				if (op == BPF_CMPXCHG)
+					EMIT(&p, BPF_LDX_MEM(size, BPF_REG_0, BPF_REG_10, -8));
+				EMIT(&p, BPF_ATOMIC_OP(size, op, rb, rd, 0));
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_10, -8));
+				prog_end(&p, rd);
+				snprintf(desc, sizeof(desc), "atomic 0x%x size=%d base=r%d src=r%d",
+					 op, size, rb, rd);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				for (j = 0; j < ARRAY_SIZE(inputs); j++) {
+					__u64 in1 = inputs[(j + 1) % ARRAY_SIZE(inputs)];
+					__u64 v = head_bytes(inputs[j], size);
+					/* The source is the low half, whichever the byte order */
+					__u64 w = size == BPF_W ? (__u32)in1 : in1;
+					__u64 r = BPF_OP(op) == BPF_ADD ? v + w :
+						  BPF_OP(op) == BPF_OR ? v | w : w;
+
+					prog_run(fd, inputs[j], in1,
+						 head_merge(inputs[j], r, size), desc);
+				}
+				close(fd);
+			}
+		}
+	}
+}
+
+/*
+ * Loads, stores and stores of an immediate with the offsets around the
+ * limits of the short displacement forms, negative, large and unaligned
+ * ones, with every register as base. The memory is an array map value with
+ * the base register pointing at its middle, the loads hand their results
+ * back through a second value and the stores are checked against a copy
+ * kept here. The unaligned offsets are left out where the verifier insists
+ * on aligned accesses.
+ */
+#define MEM_SIZE	65536
+#define MEM_BASE	(MEM_SIZE / 2)
+#define MEM_KEY		0
+#define RES_KEY		1
+#define SLOT_KEY	-4	/* stack slots: map key, results and base pointer */
+#define SLOT_RES	-16
+#define SLOT_BASE	-24
+#define STORE_VAL	0x8899aabbccddeeffULL
+
+struct off_prog {
+	struct bpf_insn insns[128];
+	int cnt;
+};
+
+/* The map holding the memory and the results, a copy of the memory and a buffer */
+struct off_mem {
+	int map_fd;
+	__u8 *mem, *exp, *res;
+};
+
+enum { K_LDX, K_LDSX, K_STX, K_ST };
+
+/* The offsets for an access of size, aligned unless unaligned ones are ok */
+static int offsets_for(int size, bool unaligned, int *off)
+{
+	int n = size_bits(size) / 8, cnt = 0;
+
+	off[cnt++] = n;
+	off[cnt++] = 128 - n;
+	off[cnt++] = 128;
+	off[cnt++] = 256 - n;
+	off[cnt++] = 256;
+	off[cnt++] = 4096;
+	off[cnt++] = MEM_BASE - n;
+	off[cnt++] = -n;
+	off[cnt++] = -128;
+	off[cnt++] = -128 - n;
+	off[cnt++] = -256;
+	off[cnt++] = -4096;
+	off[cnt++] = -MEM_BASE;
+	if (n > 1 && unaligned) {
+		off[cnt++] = 13;
+		off[cnt++] = 127;
+		off[cnt++] = -13;
+		off[cnt++] = -129;
+	}
+	return cnt;
+}
+
+/* The bytes a store of size writes from the register value v */
+static void store_bytes(__u8 *dst, __u64 v, int size)
+{
+	int n = size_bits(size) / 8;
+
+#if __BYTE_ORDER == __BIG_ENDIAN
+	memcpy(dst, (__u8 *)&v + 8 - n, n);
+#else
+	memcpy(dst, &v, n);
+#endif
+}
+
+/* The value a load of size reads from the bytes at src */
+static __u64 load_bytes(const __u8 *src, int size)
+{
+	__u64 v = 0;
+
+	memcpy(&v, src, size_bits(size) / 8);
+	return head_bytes(v, size);
+}
+
+/* A register that is neither of the two given ones */
+static int other_reg(int r1, int r2)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(pat_regs); i++)
+		if (pat_regs[i] != r1 && pat_regs[i] != r2)
+			return pat_regs[i];
+	return BPF_REG_9;
+}
+
+/* Look up the value of key into r0, exit with 1 when the lookup fails */
+static void off_prog_lookup(struct off_prog *p, int map_fd, int key)
+{
+	EMIT(p, BPF_ST_MEM(BPF_W, BPF_REG_10, SLOT_KEY, key));
+	EMIT(p, BPF_RAW_INSN(BPF_LD | BPF_DW | BPF_IMM, BPF_REG_1, BPF_PSEUDO_MAP_FD, 0, map_fd));
+	EMIT(p, BPF_RAW_INSN(0, 0, 0, 0, 0));
+	EMIT(p, BPF_MOV64_REG(BPF_REG_2, BPF_REG_10));
+	EMIT(p, BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, SLOT_KEY));
+	EMIT(p, BPF_EMIT_CALL(BPF_FUNC_map_lookup_elem));
+	EMIT(p, BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 2));
+	EMIT(p, BPF_MOV64_IMM(BPF_REG_0, 1));
+	EMIT(p, BPF_EXIT_INSN());
+}
+
+/* rb points at the middle of the memory, the results value is spilled */
+static void off_prog_start(struct off_prog *p, int map_fd, int rb)
+{
+	p->cnt = 0;
+	off_prog_lookup(p, map_fd, RES_KEY);
+	EMIT(p, BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_0, SLOT_RES));
+	off_prog_lookup(p, map_fd, MEM_KEY);
+	EMIT(p, BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, MEM_BASE));
+	EMIT(p, BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_0, SLOT_BASE));
+	if (rb != BPF_REG_0)
+		EMIT(p, BPF_MOV64_REG(rb, BPF_REG_0));
+}
+
+static int off_prog_load(struct off_prog *p, const char *desc, bool quiet)
+{
+	LIBBPF_OPTS(bpf_prog_load_opts, lopts,
+		.prog_flags = BPF_F_SLEEPABLE,
+		.log_buf = log,
+		.log_size = sizeof(log),
+	);
+	int fd;
+
+	EMIT(p, BPF_MOV64_IMM(BPF_REG_0, 0));
+	EMIT(p, BPF_EXIT_INSN());
+	fd = bpf_prog_load(BPF_PROG_TYPE_SYSCALL, NULL, "GPL", p->insns, p->cnt, &lopts);
+	if (quiet)
+		return fd;
+	if (!ASSERT_GE(fd, 0, desc))
+		fprintf(stderr, "%s", log);
+	return fd;
+}
+
+static int off_prog_run(int fd, const char *desc)
+{
+	LIBBPF_OPTS(bpf_test_run_opts, opts);
+	int err;
+
+	err = bpf_prog_test_run_opts(fd, &opts);
+	close(fd);
+	if (!ASSERT_OK(err, desc) || !ASSERT_EQ(opts.retval, 0, desc))
+		return -1;
+	return 0;
+}
+
+/* Whether the verifier accepts a halfword load from an odd offset */
+static bool unaligned_ok(int map_fd)
+{
+	struct off_prog p;
+	int fd;
+
+	off_prog_start(&p, map_fd, BPF_REG_1);
+	EMIT(&p, BPF_LDX_MEM(BPF_H, BPF_REG_0, BPF_REG_1, 1));
+	fd = off_prog_load(&p, "unaligned probe", true);
+	if (fd < 0)
+		return false;
+	close(fd);
+	return true;
+}
+
+/* One program loading from all the offsets of size through rb into rd */
+static void load_offsets(struct off_mem *m, int kind, int size, int rb, int rd,
+			 const int *off, int nr)
+{
+	__u32 mem_key = MEM_KEY, res_key = RES_KEY;
+	int rs = other_reg(rb, rd), fd, i;
+	__u64 *res = (__u64 *)m->res;
+	int map_fd = m->map_fd;
+	struct off_prog p;
+	char desc[64];
+
+	off_prog_start(&p, map_fd, rb);
+	for (i = 0; i < nr; i++) {
+		if (rd == rb)
+			EMIT(&p, BPF_LDX_MEM(BPF_DW, rb, BPF_REG_10, SLOT_BASE));
+		if (kind == K_LDX)
+			EMIT(&p, BPF_LDX_MEM(size, rd, rb, off[i]));
+		else
+			EMIT(&p, BPF_RAW_INSN(BPF_LDX | BPF_MEMSX | size, rd, rb, off[i], 0));
+		EMIT(&p, BPF_LDX_MEM(BPF_DW, rs, BPF_REG_10, SLOT_RES));
+		EMIT(&p, BPF_STX_MEM(BPF_DW, rs, rd, i * 8));
+	}
+	snprintf(desc, sizeof(desc), "%s size=%d base=r%d dst=r%d",
+		 kind == K_LDX ? "ldx" : "ldsx", size, rb, rd);
+	if (!ASSERT_OK(bpf_map_update_elem(map_fd, &mem_key, m->mem, 0), desc))
+		return;
+	fd = off_prog_load(&p, desc, false);
+	if (fd < 0)
+		return;
+	if (off_prog_run(fd, desc) || !ASSERT_OK(bpf_map_lookup_elem(map_fd, &res_key, res), desc))
+		return;
+	for (i = 0; i < nr; i++) {
+		__u64 v = load_bytes(m->mem + MEM_BASE + off[i], size);
+
+		if (kind == K_LDSX)
+			v = size == BPF_B ? (__s8)v : size == BPF_H ? (__s16)v : (__s32)v;
+		if (res[i] != v) {
+			snprintf(desc, sizeof(desc), "%s size=%d base=r%d dst=r%d off=%d",
+				 kind == K_LDX ? "ldx" : "ldsx", size, rb, rd, off[i]);
+			ASSERT_EQ(res[i], v, desc);
+		}
+	}
+}
+
+/* One program storing rd, or the immediate imm when rd < 0, at all the offsets */
+static void store_offsets(struct off_mem *m, int size, int rb, int rd, __s32 imm,
+			  const int *off, int nr)
+{
+	__u64 val = rd >= 0 ? STORE_VAL : (__u64)(__s64)imm;
+	__u8 *mem = m->mem, *exp = m->exp, *res = m->res;
+	__u32 mem_key = MEM_KEY;
+	int map_fd = m->map_fd;
+	char desc[64], buf[96];
+	struct off_prog p;
+	int fd, i;
+
+	off_prog_start(&p, map_fd, rb);
+	if (rd >= 0) {
+		EMIT(&p, BPF_RAW_INSN(BPF_LD | BPF_DW | BPF_IMM, rd, 0, 0, (__u32)STORE_VAL));
+		EMIT(&p, BPF_RAW_INSN(0, 0, 0, 0, STORE_VAL >> 32));
+	}
+	memcpy(exp, mem, MEM_SIZE);
+	for (i = 0; i < nr; i++) {
+		if (rd >= 0)
+			EMIT(&p, BPF_STX_MEM(size, rb, rd, off[i]));
+		else
+			EMIT(&p, BPF_ST_MEM(size, rb, off[i], imm));
+		store_bytes(exp + MEM_BASE + off[i], val, size);
+	}
+	if (rd >= 0)
+		snprintf(desc, sizeof(desc), "stx size=%d base=r%d src=r%d", size, rb, rd);
+	else
+		snprintf(desc, sizeof(desc), "st size=%d base=r%d imm=%d", size, rb, imm);
+	if (!ASSERT_OK(bpf_map_update_elem(map_fd, &mem_key, mem, 0), desc))
+		return;
+	fd = off_prog_load(&p, desc, false);
+	if (fd < 0)
+		return;
+	if (off_prog_run(fd, desc) || !ASSERT_OK(bpf_map_lookup_elem(map_fd, &mem_key, res), desc))
+		return;
+	for (i = 0; i < MEM_SIZE && res[i] == exp[i]; i++)
+		;
+	if (i < MEM_SIZE) {
+		snprintf(buf, sizeof(buf), "%s: byte at offset %d", desc, i - MEM_BASE);
+		ASSERT_EQ(res[i], exp[i], buf);
+	}
+}
+
+static void test_ldst_offsets(void)
+{
+	static const int sizes[] = { BPF_B, BPF_H, BPF_W, BPF_DW };
+	static const __s32 imms[] = { -1, 0x7fffffff, -0x7fffffff - 1 };
+	int b, k, s, i, nr, off[32];
+	struct off_mem m = {};
+	bool unaligned;
+
+	m.map_fd = bpf_map_create(BPF_MAP_TYPE_ARRAY, "ldst_mem", sizeof(__u32), MEM_SIZE, 2, NULL);
+	if (!ASSERT_GE(m.map_fd, 0, "ldst_mem map"))
+		return;
+	m.mem = malloc(MEM_SIZE);
+	m.exp = malloc(MEM_SIZE);
+	m.res = malloc(MEM_SIZE);
+	if (!ASSERT_OK_PTR(m.mem, "mem") || !ASSERT_OK_PTR(m.exp, "exp") ||
+	    !ASSERT_OK_PTR(m.res, "res"))
+		goto out;
+	for (i = 0; i < MEM_SIZE; i++)
+		m.mem[i] = (i * 7 + 3) ^ (i >> 8);
+	unaligned = unaligned_ok(m.map_fd);
+
+	for (b = 0; b < ARRAY_SIZE(pat_regs); b++) {
+		for (s = 0; s < ARRAY_SIZE(sizes); s++) {
+			int rb = pat_regs[b], size = sizes[s];
+
+			nr = offsets_for(size, unaligned, off);
+			/* Loads and sign extending loads, also into the base */
+			for (k = 0; k < NR_PAIRS; k++) {
+				int rd = pair_reg(b, k);
+
+				load_offsets(&m, K_LDX, size, rb, rd, off, nr);
+				if (size != BPF_DW)
+					load_offsets(&m, K_LDSX, size, rb, rd, off, nr);
+			}
+			/* Stores of a register and of an immediate */
+			for (k = 1; k < NR_PAIRS; k++)
+				store_offsets(&m, size, rb, pair_reg(b, k), 0, off, nr);
+			for (k = 0; k < ARRAY_SIZE(imms); k++)
+				store_offsets(&m, size, rb, -1, imms[k], off, nr);
+		}
+	}
+out:
+	free(m.mem);
+	free(m.exp);
+	free(m.res);
+	close(m.map_fd);
+}
+
+static void test_movsx(void)
+{
+	static const struct {
+		bool is64;
+		int off;
+	} ops[] = {
+		{ true, 8 }, { true, 16 }, { true, 32 }, { false, 8 }, { false, 16 },
+	};
+	struct prog p;
+	char desc[64];
+	int s, k, o, j, fd;
+
+	for (s = 0; s < ARRAY_SIZE(pat_regs); s++) {
+		int rs = pat_regs[s];
+
+		for (k = 0; k < NR_PAIRS; k++) {
+			int rd = pair_reg(s, k);
+
+			for (o = 0; o < ARRAY_SIZE(ops); o++) {
+				prog_start(&p);
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rs, BPF_REG_6, IN0));
+				if (ops[o].is64)
+					EMIT(&p, BPF_MOVSX64_REG(rd, rs, ops[o].off));
+				else
+					EMIT(&p, BPF_MOVSX32_REG(rd, rs, ops[o].off));
+				prog_end(&p, rd);
+				snprintf(desc, sizeof(desc), "movsx%d off=%d dst=r%d src=r%d",
+					 ops[o].is64 ? 64 : 32, ops[o].off, rd, rs);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				for (j = 0; j < ARRAY_SIZE(inputs); j++) {
+					__s64 v = inputs[j];
+
+					if (ops[o].off == 8)
+						v = (__s8)v;
+					else if (ops[o].off == 16)
+						v = (__s16)v;
+					else
+						v = (__s32)v;
+					prog_run(fd, inputs[j], 0,
+						 ops[o].is64 ? (__u64)v : (__u32)v, desc);
+				}
+				close(fd);
+			}
+		}
+	}
+}
+
+/* Branch on dst and imm, with 1 in res when taken and 0 otherwise */
+static void jmp_prog(struct prog *p, bool is64, int op, int d, __s32 imm)
+{
+	int rd = pat_regs[d], rt = pair_reg(d, 1);
+
+	prog_start(p);
+	EMIT(p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));
+	EMIT(p, BPF_MOV64_IMM(rt, 1));
+	if (is64)
+		EMIT(p, BPF_JMP_IMM(op, rd, imm, 1));
+	else
+		EMIT(p, BPF_JMP32_IMM(op, rd, imm, 1));
+	EMIT(p, BPF_MOV64_IMM(rt, 0));
+	prog_end(p, rt);
+}
+
+static void test_jset_imm(void)
+{
+	static const __s32 masks[] = {
+		0x1, 0x40, 0x80, 0xff, 0x100, 0x7fff, 0x7fffffff, -1, -0x7fffffff - 1,
+	};
+	struct prog p;
+	char desc[64];
+	int d, m, j, fd;
+	bool is64;
+
+	for (d = 0; d < ARRAY_SIZE(pat_regs); d++) {
+		int rd = pat_regs[d];
+
+		for (is64 = false; ; is64 = true) {
+			for (m = 0; m < ARRAY_SIZE(masks); m++) {
+				jmp_prog(&p, is64, BPF_JSET, d, masks[m]);
+				snprintf(desc, sizeof(desc), "jset%d dst=r%d mask=0x%x",
+					 is64 ? 64 : 32, rd, masks[m]);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				for (j = 0; j < ARRAY_SIZE(inputs); j++) {
+					__u64 v = inputs[j];
+					bool taken;
+
+					if (is64)
+						taken = v & (__u64)(__s64)masks[m];
+					else
+						taken = (__u32)v & (__u32)masks[m];
+					prog_run(fd, v, 0, taken, desc);
+				}
+				close(fd);
+			}
+			if (is64)
+				break;
+		}
+	}
+}
+
+static bool cmp_taken(int op, bool is64, __u64 v, __u64 c)
+{
+	__s64 sv = is64 ? (__s64)v : (__s32)v, sc = is64 ? (__s64)c : (__s32)c;
+
+	switch (op) {
+	case BPF_JEQ:
+		return v == c;
+	case BPF_JNE:
+		return v != c;
+	case BPF_JGT:
+		return v > c;
+	case BPF_JGE:
+		return v >= c;
+	case BPF_JLT:
+		return v < c;
+	case BPF_JLE:
+		return v <= c;
+	case BPF_JSGT:
+		return sv > sc;
+	case BPF_JSGE:
+		return sv >= sc;
+	case BPF_JSLT:
+		return sv < sc;
+	default:
+		return sv <= sc;
+	}
+}
+
+static void test_cmp_imm(void)
+{
+	static const __s32 imms[] = {
+		1, -1, 0x7f, 0x80, -0x80, -0x81, 0x1000, 0x7fffffff,
+	};
+	static const int ops[] = {
+		BPF_JEQ, BPF_JNE, BPF_JGT, BPF_JGE, BPF_JLT, BPF_JLE,
+		BPF_JSGT, BPF_JSGE, BPF_JSLT, BPF_JSLE,
+	};
+	struct prog p;
+	char desc[64];
+	int d, o, m, j, fd;
+	bool is64;
+
+	for (d = 0; d < ARRAY_SIZE(pat_regs); d++) {
+		int rd = pat_regs[d];
+
+		for (is64 = false; ; is64 = true) {
+			for (o = 0; o < ARRAY_SIZE(ops); o++) {
+				for (m = 0; m < ARRAY_SIZE(imms); m++) {
+					jmp_prog(&p, is64, ops[o], d, imms[m]);
+					snprintf(desc, sizeof(desc), "jmp%d op=0x%x dst=r%d imm=%d",
+						 is64 ? 64 : 32, ops[o], rd, imms[m]);
+					fd = prog_load(&p, desc);
+					if (fd < 0)
+						return;
+					for (j = 0; j < ARRAY_SIZE(inputs); j++) {
+						__u64 v = is64 ? inputs[j] : (__u32)inputs[j];
+						__u64 c = is64 ? (__u64)(__s64)imms[m] :
+							  (__u32)imms[m];
+						__u64 taken = cmp_taken(ops[o], is64, v, c);
+
+						prog_run(fd, inputs[j], 0, taken, desc);
+					}
+					close(fd);
+				}
+			}
+			if (is64)
+				break;
+		}
+	}
+}
+
+static __u64 alu_model(int op, __u64 v, __u64 c)
+{
+	switch (op) {
+	case BPF_ADD:
+		return v + c;
+	case BPF_SUB:
+		return v - c;
+	case BPF_AND:
+		return v & c;
+	case BPF_OR:
+		return v | c;
+	case BPF_XOR:
+		return v ^ c;
+	default:
+		return v * c;
+	}
+}
+
+static void test_alu_consts(void)
+{
+	static const struct {
+		int op;
+		__s32 imm;
+	} ops[] = {
+		{ BPF_ADD, 1 }, { BPF_ADD, -1 }, { BPF_SUB, 1 }, { BPF_SUB, -1 },
+		{ BPF_ADD, 128 }, { BPF_SUB, 128 }, { BPF_ADD, -128 },
+		{ BPF_AND, 0xff }, { BPF_AND, 0xffff }, { BPF_AND, 0x7f },
+		{ BPF_AND, 0x3ff }, { BPF_AND, 0x7fffffff },
+		{ BPF_OR, 0xff }, { BPF_XOR, -1 }, { BPF_XOR, 0x80 },
+		{ BPF_MUL, 2 }, { BPF_MUL, 3 }, { BPF_MUL, 4 }, { BPF_MUL, 5 },
+		{ BPF_MUL, 7 }, { BPF_MUL, 8 }, { BPF_MUL, 9 }, { BPF_MUL, 16 },
+		{ BPF_MUL, 0x40000000 }, { BPF_MUL, -3 }, { BPF_MUL, -0x7fffffff - 1 },
+		{ BPF_MUL, 0 }, { BPF_MUL, 1 }, { BPF_MUL, -1 },
+	};
+	struct prog p;
+	char desc[64];
+	int d, o, j, fd;
+	bool is64;
+
+	for (d = 0; d < ARRAY_SIZE(pat_regs); d++) {
+		int rd = pat_regs[d];
+
+		for (is64 = false; ; is64 = true) {
+			for (o = 0; o < ARRAY_SIZE(ops); o++) {
+				prog_start(&p);
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));
+				if (is64)
+					EMIT(&p, BPF_ALU64_IMM(ops[o].op, rd, ops[o].imm));
+				else
+					EMIT(&p, BPF_ALU32_IMM(ops[o].op, rd, ops[o].imm));
+				prog_end(&p, rd);
+				snprintf(desc, sizeof(desc), "alu%d op=0x%x dst=r%d imm=%d",
+					 is64 ? 64 : 32, ops[o].op, rd, ops[o].imm);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				for (j = 0; j < ARRAY_SIZE(inputs); j++) {
+					__u64 v = is64 ? inputs[j] : (__u32)inputs[j];
+					__u64 c = is64 ? (__u64)(__s64)ops[o].imm :
+						  (__u32)ops[o].imm;
+					__u64 r = alu_model(ops[o].op, v, c);
+
+					prog_run(fd, inputs[j], 0, is64 ? r : (__u32)r, desc);
+				}
+				close(fd);
+			}
+			if (is64)
+				break;
+		}
+	}
+}
+
+static void test_bswap(void)
+{
+	static const int widths[] = { 16, 32, 64 };
+	struct prog p;
+	char desc[64];
+	int d, w, o, j, fd;
+
+	for (d = 0; d < ARRAY_SIZE(pat_regs); d++) {
+		int rd = pat_regs[d];
+
+		for (w = 0; w < ARRAY_SIZE(widths); w++) {
+			int bits = widths[w];
+
+			/* To big endian, to little endian, and the unconditional swap */
+			for (o = 0; o < 3; o++) {
+				prog_start(&p);
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));
+				if (o == 0)
+					EMIT(&p, BPF_ENDIAN(BPF_TO_BE, rd, bits));
+				else if (o == 1)
+					EMIT(&p, BPF_ENDIAN(BPF_TO_LE, rd, bits));
+				else
+					EMIT(&p, BPF_RAW_INSN(BPF_ALU64 | BPF_END | BPF_TO_LE,
+							      rd, 0, 0, bits));
+				prog_end(&p, rd);
+				snprintf(desc, sizeof(desc), "%s%d dst=r%d",
+					 o == 0 ? "be" : o == 1 ? "le" : "bswap", bits, rd);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				for (j = 0; j < ARRAY_SIZE(inputs); j++) {
+					__u64 v = inputs[j], r;
+
+					if (bits == 16)
+						r = o == 0 ? htobe16(v) : o == 1 ? htole16(v) :
+						    __builtin_bswap16(v);
+					else if (bits == 32)
+						r = o == 0 ? htobe32(v) : o == 1 ? htole32(v) :
+						    __builtin_bswap32(v);
+					else
+						r = o == 0 ? htobe64(v) : o == 1 ? htole64(v) :
+						    __builtin_bswap64(v);
+					prog_run(fd, v, 0, r, desc);
+				}
+				close(fd);
+			}
+		}
+	}
+}
+
+static void test_probe_mem(void)
+{
+	int kfunc_id, type_id, b, k, j, fd;
+	struct btf *btf;
+	struct prog p;
+	char desc[64];
+
+	btf = btf__load_vmlinux_btf();
+	if (!ASSERT_OK_PTR(btf, "vmlinux btf"))
+		return;
+	kfunc_id = btf__find_by_name_kind(btf, "bpf_rdonly_cast", BTF_KIND_FUNC);
+	type_id = btf__find_by_name_kind(btf, "timespec64", BTF_KIND_STRUCT);
+	btf__free(btf);
+	if (!ASSERT_GT(kfunc_id, 0, "bpf_rdonly_cast id") ||
+	    !ASSERT_GT(type_id, 0, "timespec64 id"))
+		return;
+
+	/* The kernel copy of the ctx through an untrusted pointer in every register */
+	for (b = 0; b < ARRAY_SIZE(pat_regs); b++) {
+		int rb = pat_regs[b];
+
+		for (k = 0; k < NR_PAIRS; k++) {
+			int rd = pair_reg(b, k);
+
+			prog_start(&p);
+			EMIT(&p, BPF_MOV64_REG(BPF_REG_1, BPF_REG_6));
+			EMIT(&p, BPF_MOV32_IMM(BPF_REG_2, type_id));
+			EMIT(&p, BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, BPF_PSEUDO_KFUNC_CALL,
+					      0, kfunc_id));
+			if (rb != BPF_REG_0)
+				EMIT(&p, BPF_MOV64_REG(rb, BPF_REG_0));
+			EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, rb, 0));
+			prog_end(&p, rd);
+			snprintf(desc, sizeof(desc), "probe_mem base=r%d dst=r%d", rb, rd);
+			fd = prog_load(&p, desc);
+			if (fd < 0)
+				return;
+			for (j = 0; j < ARRAY_SIZE(inputs); j++)
+				prog_run(fd, inputs[j], 0, inputs[j], desc);
+			close(fd);
+		}
+	}
+
+	/* NULL and a user address are not touched and read as zero */
+	for (j = 0; j < 2; j++) {
+		__u64 addr = j ? 0x00007ffffffff000ULL : 0;
+
+		prog_start(&p);
+		EMIT(&p, BPF_RAW_INSN(BPF_LD | BPF_DW | BPF_IMM, BPF_REG_1, 0, 0, (__u32)addr));
+		EMIT(&p, BPF_RAW_INSN(0, 0, 0, 0, addr >> 32));
+		EMIT(&p, BPF_MOV32_IMM(BPF_REG_2, type_id));
+		EMIT(&p, BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, BPF_PSEUDO_KFUNC_CALL,
+				      0, kfunc_id));
+		EMIT(&p, BPF_LDX_MEM(BPF_DW, BPF_REG_3, BPF_REG_0, 0));
+		prog_end(&p, BPF_REG_3);
+		snprintf(desc, sizeof(desc), "probe_mem addr=0x%llx", addr);
+		fd = prog_load(&p, desc);
+		if (fd < 0)
+			return;
+		prog_run(fd, 0, 0, 0, desc);
+		close(fd);
+	}
+}
+
+/* Whether the JIT supports load-acquire and store-release */
+static bool acq_rel_ok(void)
+{
+	LIBBPF_OPTS(bpf_prog_load_opts, lopts, .prog_flags = BPF_F_SLEEPABLE);
+	struct prog p;
+	int fd;
+
+	prog_start(&p);
+	EMIT(&p, BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0));
+	EMIT(&p, BPF_ATOMIC_OP(BPF_DW, BPF_LOAD_ACQ, BPF_REG_0, BPF_REG_10, -8));
+	prog_end(&p, BPF_REG_0);
+	fd = bpf_prog_load(BPF_PROG_TYPE_SYSCALL, NULL, "GPL", p.insns, p.cnt, &lopts);
+	if (fd < 0)
+		return false;
+	close(fd);
+	return true;
+}
+
+/*
+ * Load-acquire and store-release of every size with every register as
+ * base, on a stack slot holding in0: the loads zero extend like the plain
+ * loads and the stores replace the first bytes of the slot like the plain
+ * stores.
+ */
+static void test_acq_rel(void)
+{
+	static const int sizes[] = { BPF_B, BPF_H, BPF_W, BPF_DW };
+	struct prog p;
+	char desc[64];
+	int b, k, s, j, fd;
+
+	if (!acq_rel_ok()) {
+		test__skip();
+		return;
+	}
+	for (b = 0; b < ARRAY_SIZE(pat_regs); b++) {
+		int rb = pat_regs[b];
+
+		for (s = 0; s < ARRAY_SIZE(sizes); s++) {
+			int size = sizes[s];
+
+			for (k = 0; k < NR_PAIRS; k++) {
+				int rd = pair_reg(b, k);
+
+				/* Load-acquire from the slot, also into the base */
+				prog_start(&p);
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));
+				EMIT(&p, BPF_STX_MEM(BPF_DW, BPF_REG_10, rd, -8));
+				EMIT(&p, BPF_MOV64_REG(rb, BPF_REG_10));
+				EMIT(&p, BPF_ALU64_IMM(BPF_ADD, rb, -8));
+				EMIT(&p, BPF_ATOMIC_OP(size, BPF_LOAD_ACQ, rd, rb, 0));
+				prog_end(&p, rd);
+				snprintf(desc, sizeof(desc), "load_acq size=%d base=r%d dst=r%d",
+					 size, rb, rd);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				for (j = 0; j < ARRAY_SIZE(inputs); j++)
+					prog_run(fd, inputs[j], 0,
+						 head_bytes(inputs[j], size), desc);
+				close(fd);
+
+				if (rd == rb)
+					continue;
+				/* Store-release of in1 over the slot holding in0 */
+				prog_start(&p);
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));
+				EMIT(&p, BPF_STX_MEM(BPF_DW, BPF_REG_10, rd, -8));
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN1));
+				EMIT(&p, BPF_MOV64_REG(rb, BPF_REG_10));
+				EMIT(&p, BPF_ALU64_IMM(BPF_ADD, rb, -8));
+				EMIT(&p, BPF_ATOMIC_OP(size, BPF_STORE_REL, rb, rd, 0));
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_10, -8));
+				prog_end(&p, rd);
+				snprintf(desc, sizeof(desc), "store_rel size=%d base=r%d src=r%d",
+					 size, rb, rd);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				for (j = 0; j < ARRAY_SIZE(inputs); j++) {
+					__u64 in1 = inputs[(j + 1) % ARRAY_SIZE(inputs)];
+
+					prog_run(fd, inputs[j], in1,
+						 head_merge(inputs[j], in1, size), desc);
+				}
+				close(fd);
+			}
+		}
+	}
+}
+
+/*
+ * A jump with the maximal offset over instructions which expand to several
+ * native ones, so that the native offset outgrows the field of a short
+ * branch and takes the JITs through their branch conversion. The region
+ * must not grow in the verifier, or the jump could not reach over it any
+ * more: the divisions are by constants, as a division by a register gets
+ * a zero check in front, and the region sticks to one width, as a 32-bit
+ * result read by a 64-bit instruction gets a zero extension on the JITs
+ * which need one. The region is the not taken path and ends with a result
+ * different from the taken one, so a jump landing inside it fails the run.
+ */
+static void max_jmp(bool alu32, bool taken)
+{
+	static const int ops[] = {
+		BPF_LSH, BPF_RSH, BPF_ARSH, BPF_ADD, BPF_SUB, BPF_MUL, BPF_DIV, BPF_MOD,
+	};
+	struct { __u64 r0, r2; } ctx = { taken, 0x0123456789abcdefULL };
+	LIBBPF_OPTS(bpf_test_run_opts, opts,
+		.ctx_in = &ctx,
+		.ctx_size_in = sizeof(ctx),
+	);
+	int len = INT16_MAX + 5, i = 0, fd;
+	struct bpf_insn *insns;
+	char desc[64];
+
+	snprintf(desc, sizeof(desc), "max jump alu%d %s", alu32 ? 32 : 64,
+		 taken ? "taken" : "not taken");
+	insns = malloc(len * sizeof(*insns));
+	if (!ASSERT_OK_PTR(insns, "insns"))
+		return;
+	insns[i++] = BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_1, 8);
+	insns[i++] = BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_1, 0);
+	insns[i++] = BPF_MOV64_REG(BPF_REG_3, BPF_REG_2);
+	insns[i++] = BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 1, INT16_MAX);
+	while (i < len - 2) {
+		int op = ops[(i >> 1) % ARRAY_SIZE(ops)];
+
+		if (op == BPF_DIV || op == BPF_MOD)
+			insns[i++] = alu32 ? BPF_ALU32_IMM(op, BPF_REG_3, 7) :
+					     BPF_ALU64_IMM(op, BPF_REG_3, 7);
+		else
+			insns[i++] = alu32 ? BPF_ALU32_REG(op, BPF_REG_3, BPF_REG_2) :
+					     BPF_ALU64_REG(op, BPF_REG_3, BPF_REG_2);
+	}
+	insns[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_0, 2);
+	insns[i++] = BPF_EXIT_INSN();
+	ASSERT_EQ(i, len, "insn count");
+
+	fd = load_prog(insns, i, desc);
+	if (fd >= 0) {
+		if (ASSERT_OK(bpf_prog_test_run_opts(fd, &opts), desc))
+			ASSERT_EQ(opts.retval, taken ? 1 : 2, desc);
+		close(fd);
+	}
+	free(insns);
+}
+
+static void test_max_jmp(void)
+{
+	max_jmp(false, true);
+	max_jmp(false, false);
+	max_jmp(true, true);
+	max_jmp(true, false);
+}
+
+void test_jit_insns(void)
+{
+	RUN_TESTS(jit_insns_arena);
+	if (test__start_subtest("alu_imm"))
+		test_alu_imm();
+	if (test__start_subtest("alu_reg"))
+		test_alu_reg();
+	if (test__start_subtest("alu_imm_regs"))
+		test_alu_imm_regs();
+	if (test__start_subtest("div_const"))
+		test_div_const();
+	if (test__start_subtest("alu_reg_pairs"))
+		test_alu_reg_pairs();
+	if (test__start_subtest("shifts"))
+		test_shifts();
+	if (test__start_subtest("atomics"))
+		test_atomics();
+	if (test__start_subtest("atomic_reg_pairs"))
+		test_atomic_reg_pairs();
+	if (test__start_subtest("xadd_chain"))
+		test_xadd_chain();
+	if (test__start_subtest("ld_imm64"))
+		test_ld_imm64();
+	if (test__start_subtest("jmp_imm"))
+		test_jmp_imm();
+	if (test__start_subtest("jmp_reg"))
+		test_jmp_reg();
+	if (test__start_subtest("jmp_reg_pairs"))
+		test_jmp_reg_pairs();
+	if (test__start_subtest("staggered_jumps"))
+		test_staggered_jumps();
+	if (test__start_subtest("max_jmp"))
+		test_max_jmp();
+	if (test__start_subtest("ldst_zero_off"))
+		test_ldst_zero_off();
+	if (test__start_subtest("ldst_offsets"))
+		test_ldst_offsets();
+	if (test__start_subtest("acq_rel"))
+		test_acq_rel();
+	if (test__start_subtest("movsx"))
+		test_movsx();
+	if (test__start_subtest("jset_imm"))
+		test_jset_imm();
+	if (test__start_subtest("cmp_imm"))
+		test_cmp_imm();
+	if (test__start_subtest("alu_consts"))
+		test_alu_consts();
+	if (test__start_subtest("bswap"))
+		test_bswap();
+	if (test__start_subtest("probe_mem"))
+		test_probe_mem();
+}
+
+/* The families with an immediate once more with the constants blinded */
+void serial_test_jit_insns_blinded(void)
+{
+	const char *harden = "/proc/sys/net/core/bpf_jit_harden";
+	char old[16] = {};
+
+	if (!is_jit_enabled()) {
+		test__skip();
+		return;
+	}
+	if (sysctl_set_or_fail(harden, old, "2"))
+		return;
+	if (test__start_subtest("alu_imm"))
+		test_alu_imm();
+	if (test__start_subtest("alu_imm_regs"))
+		test_alu_imm_regs();
+	if (test__start_subtest("div_const"))
+		test_div_const();
+	if (test__start_subtest("shifts"))
+		test_shifts();
+	if (test__start_subtest("xadd_chain"))
+		test_xadd_chain();
+	if (test__start_subtest("ld_imm64"))
+		test_ld_imm64();
+	if (test__start_subtest("jmp_imm"))
+		test_jmp_imm();
+	if (test__start_subtest("ldst_zero_off"))
+		test_ldst_zero_off();
+	if (test__start_subtest("ldst_offsets"))
+		test_ldst_offsets();
+	if (test__start_subtest("jset_imm"))
+		test_jset_imm();
+	if (test__start_subtest("cmp_imm"))
+		test_cmp_imm();
+	if (test__start_subtest("alu_consts"))
+		test_alu_consts();
+	sysctl_set_or_fail(harden, NULL, old);
+}
diff --git a/tools/testing/selftests/bpf/progs/jit_insns_arena.c b/tools/testing/selftests/bpf/progs/jit_insns_arena.c
new file mode 100644
index 0000000000000..b396d5aefb5a6
--- /dev/null
+++ b/tools/testing/selftests/bpf/progs/jit_insns_arena.c
@@ -0,0 +1,113 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * The arena accesses of jit_insns in their own object, so that a kernel
+ * without arena support fails only these programs.
+ */
+#define BPF_NO_KFUNC_PROTOTYPES
+#include <vmlinux.h>
+#include <bpf/bpf_helpers.h>
+#include "bpf_misc.h"
+#include "bpf_experimental.h"
+#include "bpf_arena_common.h"
+
+struct {
+	__uint(type, BPF_MAP_TYPE_ARENA);
+	__uint(map_flags, BPF_F_MMAPABLE);
+	__uint(max_entries, 1);
+} arena SEC(".maps");
+
+/*
+ * The first bytes in memory of the test value and its sum with the slot
+ * after the u32 store depend on the byte order.
+ */
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#define VAL_B0	0x88
+#define VAL_H0	0x7788
+#define VAL_W0	0x55667788
+#define VAL_SUM	0x22446688556689bc
+#else
+#define VAL_B0	0x11
+#define VAL_H0	0x1122
+#define VAL_W0	0x11223344
+#define VAL_SUM	0x11224578aaccef10
+#endif
+
+#if defined(__BPF_FEATURE_ADDR_SPACE_CAST)
+SEC("syscall")
+__description("arena access with zero offset")
+__success __retval(0)
+int arena_zero_off(void *ctx)
+{
+	void __arena *page;
+	__u64 res;
+
+	page = bpf_arena_alloc_pages(&arena, NULL, 1, NUMA_NO_NODE, 0);
+	if (!page)
+		return 1;
+	res = (__u32)(__u64)page;
+	/* Accesses through two base registers */
+	asm volatile ("					\
+	r7 = %[res];					\
+	r7 = addr_space_cast(r7, 0x0, 0x1);		\
+	r1 = r7;					\
+	r8 = 0x1122334455667788 ll;			\
+	*(u64 *)(r7 + 0) = r8;				\
+	r9 = *(u64 *)(r7 + 0);				\
+	r9 ^= r8;					\
+	*(u64 *)(r1 + 0) = r8;				\
+	r2 = *(u64 *)(r1 + 0);				\
+	r2 ^= r8;					\
+	r9 |= r2;					\
+	r3 = *(u8 *)(r1 + 0);				\
+	r3 ^= %[b0];					\
+	r9 |= r3;					\
+	r4 = *(u16 *)(r1 + 0);				\
+	r4 ^= %[h0];					\
+	r9 |= r4;					\
+	r5 = *(u32 *)(r1 + 0);				\
+	r5 ^= %[w0];					\
+	r9 |= r5;					\
+	*(u32 *)(r1 + 0) = 0x1234;			\
+	lock *(u64 *)(r7 + 0) += r8;			\
+	r2 = *(u64 *)(r1 + 0);				\
+	r8 = %[sum] ll;					\
+	r2 ^= r8;					\
+	r9 |= r2;					\
+	%[res] = r9;					\
+"	: [res]"+r"(res)
+	: __imm_const(b0, VAL_B0), __imm_const(h0, VAL_H0),
+	  __imm_const(w0, VAL_W0), __imm_const(sum, VAL_SUM)
+	: "r1", "r2", "r3", "r4", "r5", "r7", "r8", "r9");
+	return res != 0;
+}
+
+SEC("syscall")
+__description("cast to a user address")
+__success __retval(0)
+int cast_to_user(void *ctx)
+{
+	void __arena *page;
+	__u64 res;
+
+	page = bpf_arena_alloc_pages(&arena, NULL, 1, NUMA_NO_NODE, 0);
+	if (!page)
+		return 1;
+	/* The user address comes back from the kernel one, NULL stays NULL */
+	asm volatile ("					\
+	r7 = %[page];					\
+	r1 = addr_space_cast(r7, 0x0, 0x1);		\
+	r1 = addr_space_cast(r1, 0x1, 0x0);		\
+	r9 = r1;					\
+	r9 ^= r7;					\
+	r2 = 0;						\
+	r2 = addr_space_cast(r2, 0x1, 0x0);		\
+	r9 |= r2;					\
+	%[res] = r9;					\
+"	: [res]"=r"(res)
+	: [page]"r"(page)
+	: "r1", "r2", "r7", "r9");
+	return res != 0;
+}
+#endif
+
+char _license[] SEC("license") = "GPL";
diff --git a/tools/testing/selftests/bpf/test_kmod.sh b/tools/testing/selftests/bpf/test_kmod.sh
deleted file mode 100755
index 50dca53ac536a..0000000000000
--- a/tools/testing/selftests/bpf/test_kmod.sh
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-2.0
-
-# Usage:
-# ./test_kmod.sh [module_param]...
-# Ex.: ./test_kmod.sh test_range=1,3
-# All the parameters are passed to the kernel module.
-
-# Kselftest framework requirement - SKIP code is 4.
-ksft_skip=4
-
-msg="skip all tests:"
-if [ "$(id -u)" != "0" ]; then
-	echo $msg please run this as root >&2
-	exit $ksft_skip
-fi
-
-if [ "$building_out_of_srctree" ]; then
-	# We are in linux-build/kselftest/bpf
-	OUTPUT=../../
-else
-	# We are in linux/tools/testing/selftests/bpf
-	OUTPUT=../../../../
-fi
-
-test_run()
-{
-	sysctl -w net.core.bpf_jit_enable=$1 2>&1 > /dev/null
-	sysctl -w net.core.bpf_jit_harden=$2 2>&1 > /dev/null
-
-	echo "[ JIT enabled:$1 hardened:$2 ]"
-	shift 2
-	dmesg -C
-	if [ -f ${OUTPUT}/lib/test_bpf.ko ]; then
-		insmod ${OUTPUT}/lib/test_bpf.ko "$@" 2> /dev/null
-		if [ $? -ne 0 ]; then
-			rc=1
-		fi
-	else
-		# Use modprobe dry run to check for missing test_bpf module
-		if ! /sbin/modprobe -q -n test_bpf "$@"; then
-			echo "test_bpf: [SKIP]"
-		elif /sbin/modprobe -q test_bpf "$@"; then
-			echo "test_bpf: ok"
-		else
-			echo "test_bpf: [FAIL]"
-			rc=1
-		fi
-	fi
-	rmmod  test_bpf 2> /dev/null
-	dmesg | grep FAIL
-}
-
-test_save()
-{
-	JE=`sysctl -n net.core.bpf_jit_enable`
-	JH=`sysctl -n net.core.bpf_jit_harden`
-}
-
-test_restore()
-{
-	sysctl -w net.core.bpf_jit_enable=$JE 2>&1 > /dev/null
-	sysctl -w net.core.bpf_jit_harden=$JH 2>&1 > /dev/null
-}
-
-rc=0
-test_save
-test_run 0 0 "$@"
-test_run 1 0 "$@"
-test_run 1 1 "$@"
-test_run 1 2 "$@"
-test_restore
-exit $rc
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index 590b33e16d9fb..0ffce8efc6d0b 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -104,7 +104,6 @@ TEST_PROGS := \
 	stress_reuseport_listen.sh \
 	tcp_ecmp_failover.sh \
 	tcp_fastopen_backup_key.sh \
-	test_bpf.sh \
 	test_bridge_backup_port.sh \
 	test_bridge_neigh_suppress.sh \
 	test_ingress_egress_chaining.sh \
diff --git a/tools/testing/selftests/net/config b/tools/testing/selftests/net/config
index 737e7e6327b37..6223b00516fe9 100644
--- a/tools/testing/selftests/net/config
+++ b/tools/testing/selftests/net/config
@@ -127,7 +127,6 @@ CONFIG_TAP=m
 CONFIG_TCP_CONG_DCTCP=y
 CONFIG_TCP_MD5SIG=y
 CONFIG_TEST_BLACKHOLE_DEV=m
-CONFIG_TEST_BPF=m
 CONFIG_TLS=m
 CONFIG_TRACEPOINTS=y
 CONFIG_TUN=y
diff --git a/tools/testing/selftests/net/test_bpf.sh b/tools/testing/selftests/net/test_bpf.sh
deleted file mode 100755
index 65677909c574d..0000000000000
--- a/tools/testing/selftests/net/test_bpf.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-2.0
-# Runs bpf test using test_bpf kernel module
-
-if /sbin/modprobe -q test_bpf ; then
-	/sbin/modprobe -q -r test_bpf;
-	echo "test_bpf: ok";
-else
-	echo "test_bpf: [FAIL]";
-	exit 1;
-fi

3/2 2026/10/13 22:49 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 292487
							output: 56
							thoughts: 1429
						

Thoughts:
**BPF JIT Optimization Deep Dive: X86 Architecture**

Okay, so I'm looking at this patch series, and it's quite extensive, primarily focused on optimizing the BPF JIT compiler for x86_64. I'm seeing a significant cleanup of test infrastructure, removing old test files and configurations, and replacing them with new ones that appear to integrate better with the overall testing framework. More importantly, it seems they've dropped the `CONFIG_TEST_BPF` option, which likely simplifies the build process.

The removal of `EXPORT_SYMBOL_GPL(...)` symbols, specifically those used by the now-removed `test_bpf.c`, is expected, reflecting the consolidation and removal of redundant code.

Now, the real meat of this is in `arch/x86/net/bpf_jit_comp.c`. It looks like there have been some MAJOR changes. I see the usual parameter width changes for depth in `emit_add_rsp` and `emit_sub_rsp`. Optimizations in Rex prefix emission, the introduction of `base_needs_disp`, `emit_movzx_reg`, `emit_insn_suffix`, and `emit_insn_suffix_SIB` for more efficient instruction generation. The new `emit_alu_imm` helper looks particularly interesting, optimizing arithmetic operations with immediate values, which are very common in BPF programs. The addition of other helpers like `emit_alu_reg`, `emit_shift_imm`, and `emit_neg` suggest a concerted effort to streamline the code generation process. The changes to `emit_ldx` and `emit_st` (uses `emit_insn_suffix` here) show how they're optimizing memory loads and stores.

And then we get to the really clever stuff: the constant division and modulo strength reduction using Hacker's Delight algorithms via `bpf_magic_udiv`, `bpf_magic_sdiv`, and `emit_div_const`. Using "magic numbers" for divisions is a classic optimization technique, and this implementation suggests a deep understanding of the architecture. The `adjust_cmp_imm` function is also smart; it's simplifying comparisons against certain immediate values to more efficient forms.

Within `do_jit`, the changes are equally substantial. I'm seeing optimizations for tail calls, casts to user pointers, AND/XOR operations, division by constants, and multiplication with specific immediate values using LEA. There is also the use of BMI2 shifts. The rewriting of the BPF_PROBE_MEM check looks cleaner, and also the `LOAD_TAIL_CALL_CNT_PTR` calculation. Also, optimized handling of `BPF_JSET` and conditional jumps by leveraging short forms and optimized comparisons.

My expert assessment tells me this is not merely a set of incremental improvements; it's a fundamental re-engineering of the JIT compiler's code generation logic.

And this patch series is targeting amd64 (x86_64), so it applies to a wide range of systems. This isn't some obscure corner case; it's the core BPF JIT engine.

Now, the crucial question is, how *reachable* are these changes? Well, any unprivileged or privileged user loading BPF programs (or sockets attaching classic or eBPF filters, seccomp, tc, sock_ops, etc.) triggers `do_jit()` in `arch/x86/net/bpf_jit_comp.c` when JIT is enabled. This is absolutely critical; a large amount of the userland calls into the kernel utilize this code path. Even without root, BPF JIT can be enabled via sysctl net.core.bpf_jit_enable. So this is HIGHLY exposed.

And the changes themselves? Complex division algorithms, comparison rewriting, fundamental changes to assembly generation (LEA, SIB scale, short forms, etc.). There are so many places where errors could lurk, things like address calculations, jump targets, immediate value sizes, sign extensions, register clobbering. This looks like a prime candidate for fuzzing, and I will check the files to verify.



4/2 2026/10/13 22:50 tool grepper
0m Args:
{
  "Expression": "emit_div_const|adjust_cmp_imm|bpf_magic_udiv",
  "PathPrefixes": [
    "arch/x86/net/bpf_jit_comp.c"
  ]
}

Results:
{
  "Output": "arch/x86/net/bpf_jit_comp.c=1931=struct bpf_div_magic {\n--\narch/x86/net/bpf_jit_comp.c-1943- */\narch/x86/net/bpf_jit_comp.c:1944:static void bpf_magic_udiv(u64 d, int lz, struct bpf_div_magic *mag)\narch/x86/net/bpf_jit_comp.c-1945-{\n--\narch/x86/net/bpf_jit_comp.c=1991=static void bpf_magic_sdiv(s64 d, struct bpf_div_magic *mag)\n--\narch/x86/net/bpf_jit_comp.c-2029- * Divide dst_reg by the constant in insn-\u003eimm of a 64-bit division through\narch/x86/net/bpf_jit_comp.c:2030: * a multiplication with the magic number from bpf_magic_udiv() or\narch/x86/net/bpf_jit_comp.c-2031- * bpf_magic_sdiv(). The dividend goes through rax and the multiplier\n--\narch/x86/net/bpf_jit_comp.c-2034- */\narch/x86/net/bpf_jit_comp.c:2035:static bool emit_div_const(u8 **pprog, const struct bpf_insn *insn, u32 dst_reg)\narch/x86/net/bpf_jit_comp.c-2036-{\n--\narch/x86/net/bpf_jit_comp.c-2058-\t\t\treturn false;\narch/x86/net/bpf_jit_comp.c:2059:\t\tbpf_magic_udiv(imm32, 0, \u0026mag);\narch/x86/net/bpf_jit_comp.c-2060-\t\t/*\n--\narch/x86/net/bpf_jit_comp.c-2066-\t\t\tpre = __ffs(imm32);\narch/x86/net/bpf_jit_comp.c:2067:\t\t\tbpf_magic_udiv(imm32 \u003e\u003e pre, pre, \u0026mag);\narch/x86/net/bpf_jit_comp.c-2068-\t\t\tif (mag.add)\n--\narch/x86/net/bpf_jit_comp.c=2280=static int emit_kfunc_arena_args(struct bpf_prog *bpf_prog,\n--\narch/x86/net/bpf_jit_comp.c-2324- */\narch/x86/net/bpf_jit_comp.c:2325:static void adjust_cmp_imm(u32 *op, s32 *imm)\narch/x86/net/bpf_jit_comp.c-2326-{\n--\narch/x86/net/bpf_jit_comp.c=2367=static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *addrs, u8 *image,\n--\narch/x86/net/bpf_jit_comp.c-2647-\t\t\tif (is64 \u0026\u0026 BPF_SRC(insn-\u003ecode) == BPF_K \u0026\u0026\narch/x86/net/bpf_jit_comp.c:2648:\t\t\t    emit_div_const(\u0026prog, insn, dst_reg))\narch/x86/net/bpf_jit_comp.c-2649-\t\t\t\tgoto div_done;\n--\narch/x86/net/bpf_jit_comp.c-3450-\t\t\tcmp_imm = imm32;\narch/x86/net/bpf_jit_comp.c:3451:\t\t\tadjust_cmp_imm(\u0026jmp_op, \u0026cmp_imm);\narch/x86/net/bpf_jit_comp.c-3452-\n"
}

5/2 2026/10/13 22:50 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 295906
							output: 40
							thoughts: 63
						

Thoughts:
Here's my take on the thought process, as requested:

**Investigating `do_jit()` Entry Points in x86 BPF JIT Compilation**

Alright, let's dive into the `arch/x86/net/bpf_jit_comp.c` file and pinpoint the exact locations where `do_jit()` is actually invoked. I need to understand the control flow that leads to the JIT compilation process for BPF programs on x86. The best way to start is to search that source file for that `do_jit` call and see the various code pathways that trigger it. This should quickly highlight the relevant entry points. I'm looking for where the actual compilation gets initiated, what the surrounding context is, and what data is being passed to it. Knowing these call paths will give a more complete understanding of the x86 JIT compilation process.



6/2 2026/10/13 22:50 tool grepper
0m Args:
{
  "Expression": "do_jit",
  "PathPrefixes": [
    "arch/x86/net/bpf_jit_comp.c"
  ]
}

Results:
{
  "Output": "arch/x86/net/bpf_jit_comp.c=2325=static void adjust_cmp_imm(u32 *op, s32 *imm)\n--\narch/x86/net/bpf_jit_comp.c-2366-\narch/x86/net/bpf_jit_comp.c:2367:static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *addrs, u8 *image,\narch/x86/net/bpf_jit_comp.c-2368-\t\t  u8 *rw_image, int oldproglen, struct jit_context *ctx, bool jmp_padding)\n--\narch/x86/net/bpf_jit_comp.c=4656=struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)\n--\narch/x86/net/bpf_jit_comp.c-4733-\t\t\tpadding = true;\narch/x86/net/bpf_jit_comp.c:4734:\t\tproglen = do_jit(env, prog, addrs, image, rw_image, oldproglen,\narch/x86/net/bpf_jit_comp.c-4735-\t\t\t\t \u0026ctx, padding);\n"
}

7/2 2026/10/13 22:50 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 296551
							output: 51
							thoughts: 65
						

Thoughts:
Here's my analysis of the provided code snippet, thinking like an expert:

**Investigating the X86 BPF JIT Compiler**

Okay, so `bpf_int_jit_compile()` is flagged as the primary, non-static entry point in `arch/x86/net/bpf_jit_comp.c`. That's what I'd expect for the JIT compiler's main function. Now, I need to understand its role within the wider framework, and also what supporting functions are present in that file. I want to see how this function orchestrates the compilation process. To get the full picture, I need to check if there are any other non-static functions within that file. That should give me a good handle on its architecture and how it's broken down. Let's see what else we can find in that specific file.



8/2 2026/10/13 22:50 tool grepper
0m Args:
{
  "Expression": "^(struct|int|void|bool|long) bpf_",
  "PathPrefixes": [
    "arch/x86/net/bpf_jit_comp.c"
  ]
}

Results:
{
  "Output": "arch/x86/net/bpf_jit_comp.c=329=static void jit_fill_hole(void *area, unsigned int size)\n--\narch/x86/net/bpf_jit_comp.c-334-\narch/x86/net/bpf_jit_comp.c:335:int bpf_arch_text_invalidate(void *dst, size_t len)\narch/x86/net/bpf_jit_comp.c-336-{\n--\narch/x86/net/bpf_jit_comp.c=651=static int __bpf_arch_text_poke(void *ip, enum bpf_text_poke_type old_t,\n--\narch/x86/net/bpf_jit_comp.c-694-\narch/x86/net/bpf_jit_comp.c:695:int bpf_arch_text_poke(void *ip, enum bpf_text_poke_type old_t,\narch/x86/net/bpf_jit_comp.c-696-\t\t       enum bpf_text_poke_type new_t, void *old_addr,\n--\narch/x86/net/bpf_jit_comp.c=1920=static void emit_shiftx(u8 **pprog, u32 dst_reg, u8 src_reg, bool is64, u8 op)\n--\narch/x86/net/bpf_jit_comp.c-1930-\narch/x86/net/bpf_jit_comp.c:1931:struct bpf_div_magic {\narch/x86/net/bpf_jit_comp.c-1932-\tu64 m;\t\t/* multiplier, sign extended for signed division */\n--\narch/x86/net/bpf_jit_comp.c=4644=struct x64_jit_data {\n--\narch/x86/net/bpf_jit_comp.c-4655-\narch/x86/net/bpf_jit_comp.c:4656:struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)\narch/x86/net/bpf_jit_comp.c-4657-{\n--\narch/x86/net/bpf_jit_comp.c-4847-\narch/x86/net/bpf_jit_comp.c:4848:bool bpf_jit_supports_callx(void)\narch/x86/net/bpf_jit_comp.c-4849-{\n--\narch/x86/net/bpf_jit_comp.c-4857-\narch/x86/net/bpf_jit_comp.c:4858:bool bpf_jit_supports_kfunc_call(void)\narch/x86/net/bpf_jit_comp.c-4859-{\n--\narch/x86/net/bpf_jit_comp.c-4862-\narch/x86/net/bpf_jit_comp.c:4863:bool bpf_jit_supports_kfunc_ret_reg_pair(void)\narch/x86/net/bpf_jit_comp.c-4864-{\n--\narch/x86/net/bpf_jit_comp.c=4868=const struct bpf_jit_arg_abi *bpf_jit_arg_abi(void)\n--\narch/x86/net/bpf_jit_comp.c-4872-\narch/x86/net/bpf_jit_comp.c:4873:bool bpf_jit_supports_stack_args(void)\narch/x86/net/bpf_jit_comp.c-4874-{\n--\narch/x86/net/bpf_jit_comp.c-4877-\narch/x86/net/bpf_jit_comp.c:4878:bool bpf_jit_supports_arena_args(void)\narch/x86/net/bpf_jit_comp.c-4879-{\n--\narch/x86/net/bpf_jit_comp.c=4883=void *bpf_arch_text_copy(void *dst, void *src, size_t len)\n--\narch/x86/net/bpf_jit_comp.c-4890-/* Indicate the JIT backend supports mixing bpf2bpf and tailcalls. */\narch/x86/net/bpf_jit_comp.c:4891:bool bpf_jit_supports_subprog_tailcalls(void)\narch/x86/net/bpf_jit_comp.c-4892-{\n--\narch/x86/net/bpf_jit_comp.c-4902- */\narch/x86/net/bpf_jit_comp.c:4903:bool bpf_jit_supports_large_stack(void)\narch/x86/net/bpf_jit_comp.c-4904-{\n--\narch/x86/net/bpf_jit_comp.c-4907-\narch/x86/net/bpf_jit_comp.c:4908:bool bpf_jit_supports_percpu_insn(void)\narch/x86/net/bpf_jit_comp.c-4909-{\n--\narch/x86/net/bpf_jit_comp.c-4912-\narch/x86/net/bpf_jit_comp.c:4913:void bpf_jit_free(struct bpf_prog *prog)\narch/x86/net/bpf_jit_comp.c-4914-{\n--\narch/x86/net/bpf_jit_comp.c-4947-\narch/x86/net/bpf_jit_comp.c:4948:bool bpf_jit_supports_exceptions(void)\narch/x86/net/bpf_jit_comp.c-4949-{\n--\narch/x86/net/bpf_jit_comp.c-4956-\narch/x86/net/bpf_jit_comp.c:4957:bool bpf_jit_supports_private_stack(void)\narch/x86/net/bpf_jit_comp.c-4958-{\n--\narch/x86/net/bpf_jit_comp.c=4962=void arch_bpf_stack_walk(bool (*consume_fn)(void *cookie, u64 ip, u64 sp, u64 bp), void *cookie)\n--\narch/x86/net/bpf_jit_comp.c-4977-\narch/x86/net/bpf_jit_comp.c:4978:void bpf_arch_poke_desc_update(struct bpf_jit_poke_descriptor *poke,\narch/x86/net/bpf_jit_comp.c-4979-\t\t\t       struct bpf_prog *new, struct bpf_prog *old)\n--\narch/x86/net/bpf_jit_comp.c-5025-\narch/x86/net/bpf_jit_comp.c:5026:bool bpf_jit_supports_arena(void)\narch/x86/net/bpf_jit_comp.c-5027-{\n--\narch/x86/net/bpf_jit_comp.c-5030-\narch/x86/net/bpf_jit_comp.c:5031:bool bpf_jit_supports_arena_scalar(void)\narch/x86/net/bpf_jit_comp.c-5032-{\n--\narch/x86/net/bpf_jit_comp.c-5035-\narch/x86/net/bpf_jit_comp.c:5036:bool bpf_jit_supports_insn(struct bpf_insn *insn, bool in_arena)\narch/x86/net/bpf_jit_comp.c-5037-{\n--\narch/x86/net/bpf_jit_comp.c-5050-\narch/x86/net/bpf_jit_comp.c:5051:bool bpf_jit_supports_ptr_xchg(void)\narch/x86/net/bpf_jit_comp.c-5052-{\n--\narch/x86/net/bpf_jit_comp.c=5057=u64 bpf_arch_uaddress_limit(void)\n--\narch/x86/net/bpf_jit_comp.c-5061-\narch/x86/net/bpf_jit_comp.c:5062:bool bpf_jit_supports_timed_may_goto(void)\narch/x86/net/bpf_jit_comp.c-5063-{\n--\narch/x86/net/bpf_jit_comp.c-5066-\narch/x86/net/bpf_jit_comp.c:5067:bool bpf_jit_supports_fsession(void)\narch/x86/net/bpf_jit_comp.c-5068-{\n"
}

9/2 2026/10/13 22:50 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 299250
							output: 46
							thoughts: 49
						

Thoughts:
Here's my take on the thought process:

**eBPF Compilation Flow - Let's Dig In**

Okay, so I'm diving into the eBPF compilation pipeline. My current understanding is that `bpf_int_jit_compile` is the workhorse function. It's the one that ultimately kicks off the JIT compilation process using `do_jit`. Seems straightforward enough, but I always want to make sure I'm not missing any pieces.

Wait a second, what about the trampoline generation, specifically in architectures where this is relevant? I need to quickly refresh my memory on how this fits into the overall picture. I need to refresh what the trampoline generation is doing exactly. Let me check the `arch_prepare_bpf_trampoline` function and ensure I'm getting the complete picture and not just the central compilation step. Gotta ensure I haven't glossed over any crucial architectural details. Okay, now I have a more complete picture.



10/2 2026/10/13 22:50 tool grepper
0m Args:
{
  "Expression": "arch_prepare_bpf_trampoline",
  "PathPrefixes": [
    "arch/x86/net/bpf_jit_comp.c"
  ]
}

Results:
{
  "Output": "arch/x86/net/bpf_jit_comp.c=3920=static int invoke_bpf_prog(const struct btf_func_model *m, u8 **pprog,\n--\narch/x86/net/bpf_jit_comp.c-3941-\t * bpf_tramp_run_ctx is already preserved by\narch/x86/net/bpf_jit_comp.c:3942:\t * arch_prepare_bpf_trampoline().\narch/x86/net/bpf_jit_comp.c-3943-\t *\n--\narch/x86/net/bpf_jit_comp.c=4066=static int invoke_bpf_mod_ret(const struct btf_func_model *m, u8 **pprog,\n--\narch/x86/net/bpf_jit_comp.c-4168- */\narch/x86/net/bpf_jit_comp.c:4169:static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_image,\narch/x86/net/bpf_jit_comp.c-4170-\t\t\t\t\t void *rw_image_end, void *image,\n--\narch/x86/net/bpf_jit_comp.c=4479=int arch_protect_bpf_trampoline(void *image, unsigned int size)\n--\narch/x86/net/bpf_jit_comp.c-4483-\narch/x86/net/bpf_jit_comp.c:4484:int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *image_end,\narch/x86/net/bpf_jit_comp.c-4485-\t\t\t\tconst struct btf_func_model *m, u32 flags,\n--\narch/x86/net/bpf_jit_comp.c-4499-\narch/x86/net/bpf_jit_comp.c:4500:\tret = __arch_prepare_bpf_trampoline(im, rw_image, rw_image + size, image, m,\narch/x86/net/bpf_jit_comp.c-4501-\t\t\t\t\t    flags, tnodes, func_addr);\n--\narch/x86/net/bpf_jit_comp.c=4513=int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,\n--\narch/x86/net/bpf_jit_comp.c-4520-\narch/x86/net/bpf_jit_comp.c:4521:\treturn __arch_prepare_bpf_trampoline(\u0026im, trampoline_size_image,\narch/x86/net/bpf_jit_comp.c-4522-\t\t\t\t\t     trampoline_size_image + PAGE_SIZE,\n"
}

11/2 2026/10/13 22:50 llm patch-evaluator
1m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 300312
							output: 44
							thoughts: 67
						

Thoughts:
Here's my take on those thoughts:

**Analyzing BPF JIT Compilation Requirements**

Okay, so `arch_prepare_bpf_trampoline` isn't static either. Interesting. Now, I need to get a handle on the Kconfig options that are actually required for the BPF JIT to work correctly, specifically in the context of `bpf_int_jit_compile`. It's a good place to start, given the architectures I know are supported. Let me dive into the Kconfig options needed by `arch/x86/net/bpf_jit_comp.c`, because I want to ensure my BPF code has everything it needs to compile correctly on x86, too.



12/2 2026/10/13 22:51 tool grepper
0m Args:
{
  "Expression": "bpf_jit_comp",
  "PathPrefixes": [
    "arch/x86/net/",
    "arch/x86/"
  ]
}

Results:
{
  "Output": "arch/x86/net/Makefile=6=ifeq ($(CONFIG_X86_32),y)\narch/x86/net/Makefile:7:        obj-$(CONFIG_BPF_JIT) += bpf_jit_comp32.o\narch/x86/net/Makefile-8-else\narch/x86/net/Makefile:9:        obj-$(CONFIG_BPF_JIT) += bpf_jit_comp.o bpf_timed_may_goto.o\narch/x86/net/Makefile-10-endif\n"
}

13/2 2026/10/13 22:51 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 300724
							output: 22
							thoughts: 50
						

Thoughts:
Here's my summary, as though I'm thinking through this myself:

**Investigating BPF JIT Compilation in the x86 Architecture**

Okay, so I'm looking at `arch/x86/net/Makefile` and I see this line: `obj-$(CONFIG_BPF_JIT) += bpf_jit_comp.o`. Right away, my brain goes to "conditional compilation," as it should. It means the `bpf_jit_comp.o` object file, which I know is the BPF JIT compiler for x86, is only included in the build if `CONFIG_BPF_JIT` is set. Given the context, it's pretty clear that `CONFIG_BPF_JIT` probably refers to a Kconfig option that enables the BPF JIT. Now, I should double check what that option is, and perhaps remind myself of the current state of JIT-compilation with respect to the general x86 kernel build. It's a quick jump to Kconfig to make sure I have all the details straight regarding BPF_JIT.



14/2 2026/10/13 22:51 tool grepper
0m Args:
{
  "Expression": "config BPF_JIT\\b"
}

Results:
{
  "Output": "kernel/bpf/Kconfig=31=config BPF_SYSCALL\n--\nkernel/bpf/Kconfig-45-\nkernel/bpf/Kconfig:46:config BPF_JIT\nkernel/bpf/Kconfig-47-\tbool \"Enable BPF Just In Time compiler\"\n"
}

15/2 2026/10/13 22:51 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 301123
							output: 34
							thoughts: 23
						

Thoughts:
Okay, let's dive into this. Here's how I'd approach that prompt, keeping in mind my field of expertise:

**Examining the BPF Kconfig File**

Alright, I see the instruction to look at `kernel/bpf/Kconfig`. That's a good starting point. I understand that `Kconfig` files are the configuration files that drive the kernel's build system. They define the options that users can select to customize their kernel, and, in this specific directory, those options relate to the Berkeley Packet Filter (BPF) subsystem. I'm going to use a command such as `read-file` to grab the contents of that file. My focus will be around line 46, which will likely be describing some key feature or option related to BPF. I'm anticipating that line to reveal important configuration details like whether BPF support is enabled by default, which features are modularized, or perhaps the dependencies of some particular BPF-related options. This will help me build a mental map of what's configurable within BPF for this particular kernel version. I'll be looking for keywords like "config", "bool", "tristate", "depends on", and "select," to quickly glean the crucial relationships between the options. It's a quick and efficient way to refresh my understanding of the configuration landscape and identify any changes that have been introduced or are of particular interest.



16/2 2026/10/13 22:51 tool read-file
0m Args:
{
  "File": "kernel/bpf/Kconfig",
  "FirstLine": 40,
  "LineCount": 40
}

Results:
{
  "Contents": "  40:\t\tselect PAGE_POOL if NET\n  41:\t\tdefault n\n  42:\t\thelp\n  43:\t\t  Enable the bpf() system call that allows to manipulate BPF programs\n  44:\t\t  and maps via file descriptors.\n  45:\t\n  46:\tconfig BPF_JIT\n  47:\t\tbool \"Enable BPF Just In Time compiler\"\n  48:\t\tdepends on BPF\n  49:\t\tdepends on HAVE_CBPF_JIT || HAVE_EBPF_JIT\n  50:\t\tselect EXECMEM\n  51:\t\thelp\n  52:\t\t  BPF programs are normally handled by a BPF interpreter. This option\n  53:\t\t  allows the kernel to generate native code when a program is loaded\n  54:\t\t  into the kernel. This will significantly speed-up processing of BPF\n  55:\t\t  programs.\n  56:\t\n  57:\t\t  Note, an admin should enable this feature changing:\n  58:\t\t  /proc/sys/net/core/bpf_jit_enable\n  59:\t\t  /proc/sys/net/core/bpf_jit_harden   (optional)\n  60:\t\t  /proc/sys/net/core/bpf_jit_kallsyms (optional)\n  61:\t\n  62:\tconfig BPF_JIT_ALWAYS_ON\n  63:\t\tbool \"Permanently enable BPF JIT and remove BPF interpreter\"\n  64:\t\tdepends on BPF_SYSCALL \u0026\u0026 HAVE_EBPF_JIT \u0026\u0026 BPF_JIT\n  65:\t\thelp\n  66:\t\t  Enables BPF JIT and removes BPF interpreter to avoid speculative\n  67:\t\t  execution of BPF instructions by the interpreter.\n  68:\t\n  69:\t\t  When CONFIG_BPF_JIT_ALWAYS_ON is enabled, /proc/sys/net/core/bpf_jit_enable\n  70:\t\t  is permanently set to 1 and setting any other value than that will\n  71:\t\t  return failure.\n  72:\t\n  73:\tconfig BPF_JIT_DEFAULT_ON\n  74:\t\tdef_bool ARCH_WANT_DEFAULT_BPF_JIT || BPF_JIT_ALWAYS_ON\n  75:\t\tdepends on HAVE_EBPF_JIT \u0026\u0026 BPF_JIT\n  76:\t\n  77:\tconfig BPF_UNPRIV_DEFAULT_OFF\n  78:\t\tbool \"Disable unprivileged BPF by default\"\n  79:\t\tdefault y\n"
}

17/2 2026/10/13 22:51 llm patch-evaluator
1m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 302120
							output: 22
							thoughts: 926
						

Thoughts:
**Analyzing BPF JIT Compilation for FocusSymbols**

Okay, so I'm looking at how to effectively use `FocusSymbols` for this BPF JIT compilation work. First, I need to make sure the basics are in place: `CONFIG_BPF`, `CONFIG_BPF_SYSCALL`, and `CONFIG_BPF_JIT` are enabled. Good, that's the foundation. I also checked to confirm that `BPF_JIT` depends on `BPF` and `HAVE_EBPF_JIT`, and that `BPF_SYSCALL` is standard for `bpf()` syscalls.

Now, the main question is, what should I include in `FocusSymbols`? The rules are clear: avoid ubiquitous functions. This means steering clear of things like generic memory allocators, page fault handlers, or core synchronization primitives. Instead, I need to target *specific* feature logic or API entry points.

Given the changes are in `arch/x86/net/bpf_jit_comp.c`, I'm looking at the functions defined there. There's a mix of static and non-static functions like: `bpf_magic_udiv`, `bpf_magic_sdiv`, `emit_div_const`, `adjust_cmp_imm`, `emit_alu_imm`, `emit_alu_reg`, `emit_shift_imm`, `emit_neg`, `emit_movzx_reg`, `emit_movsx_reg`, `emit_insn_suffix`, `emit_insn_suffix_SIB`, `do_jit`, `__arch_prepare_bpf_trampoline`.

I need to understand if these functions are inlined or compiled as distinct symbols.  `do_jit()` is static, but is it a symbol in vmlinux?  Often static functions in `.c` files might be compiled as symbols, but could be inlined. I note that `bpf_int_jit_compile` and `arch_prepare_bpf_trampoline` are global symbols.

The guidance explicitly mentions *not* focusing on static inline functions in headers. So are these static functions in `.c` files fair game? The rules state to list functions that implement the logic being added, or API entrypoints. The document makes a specific exception for functions that are inlined via a header. Let's make sure `do_jit`, `bpf_int_jit_compile`, and `arch_prepare_bpf_trampoline` are distinct symbols.

The key is to avoid ubiquitous functions, and I need to determine if `bpf_int_jit_compile` falls into that category. It *shouldn't* be ubiquitous, right? It's only called during BPF program JIT compilation, and not by every syscall or regular program. It seems safe to say that `bpf_int_jit_compile` is only called by BPF test programs.

Okay, and what calls `bpf_int_jit_compile`?  `bpf_prog_select_runtime` calls it. So, that's where I need to focus my attention. It's likely `bpf_prog_select_runtime` will be a critical part of my `FocusSymbols` list, with perhaps `bpf_int_jit_compile` and `arch_prepare_bpf_trampoline` as well. Now let's just make certain by checking the callers of `bpf_int_jit_compile`.



18/2 2026/10/13 22:52 tool grepper
0m Args:
{
  "Expression": "bpf_int_jit_compile"
}

Results:
{
  "Output": "arch/arc/net/bpf_jit_core.c=1366=static struct bpf_prog *do_extra_pass(struct bpf_prog *prog)\n--\narch/arc/net/bpf_jit_core.c-1402- */\narch/arc/net/bpf_jit_core.c:1403:struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)\narch/arc/net/bpf_jit_core.c-1404-{\n--\narch/arm/net/bpf_jit_32.c=2146=bool bpf_jit_needs_zext(void)\n--\narch/arm/net/bpf_jit_32.c-2150-\narch/arm/net/bpf_jit_32.c:2151:struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)\narch/arm/net/bpf_jit_32.c-2152-{\n--\narch/arm64/net/bpf_jit_comp.c=2220=struct arm64_jit_data {\n--\narch/arm64/net/bpf_jit_comp.c-2226-\narch/arm64/net/bpf_jit_comp.c:2227:struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)\narch/arm64/net/bpf_jit_comp.c-2228-{\n--\narch/loongarch/net/bpf_jit.c=2199=int arch_bpf_trampoline_size(const struct btf_func_model *m, u32 flags,\n--\narch/loongarch/net/bpf_jit.c-2210-\narch/loongarch/net/bpf_jit.c:2211:struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)\narch/loongarch/net/bpf_jit.c-2212-{\n--\narch/mips/net/bpf_jit_comp.c=934=bool bpf_jit_needs_zext(void)\n--\narch/mips/net/bpf_jit_comp.c-938-\narch/mips/net/bpf_jit_comp.c:939:struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)\narch/mips/net/bpf_jit_comp.c-940-{\n--\narch/parisc/net/bpf_jit_core.c=39=bool bpf_jit_needs_zext(void)\n--\narch/parisc/net/bpf_jit_core.c-43-\narch/parisc/net/bpf_jit_core.c:44:struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)\narch/parisc/net/bpf_jit_core.c-45-{\n--\narch/powerpc/net/bpf_jit_comp.c=146=static void priv_stack_check_guard(void __percpu *priv_stack_ptr, int alloc_size,\n--\narch/powerpc/net/bpf_jit_comp.c-164-\narch/powerpc/net/bpf_jit_comp.c:165:struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *fp)\narch/powerpc/net/bpf_jit_comp.c-166-{\n--\narch/riscv/net/bpf_jit_core.c=42=bool bpf_jit_needs_zext(void)\n--\narch/riscv/net/bpf_jit_core.c-46-\narch/riscv/net/bpf_jit_core.c:47:struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)\narch/riscv/net/bpf_jit_core.c-48-{\n--\narch/s390/net/bpf_jit_comp.c=2344=static struct bpf_binary_header *bpf_jit_alloc(struct bpf_jit *jit,\n--\narch/s390/net/bpf_jit_comp.c-2385- */\narch/s390/net/bpf_jit_comp.c:2386:struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *fp)\narch/s390/net/bpf_jit_comp.c-2387-{\n--\narch/sparc/net/bpf_jit_comp_64.c=1474=struct sparc64_jit_data {\n--\narch/sparc/net/bpf_jit_comp_64.c-1479-\narch/sparc/net/bpf_jit_comp_64.c:1480:struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)\narch/sparc/net/bpf_jit_comp_64.c-1481-{\n--\narch/x86/net/bpf_jit_comp.c=4644=struct x64_jit_data {\n--\narch/x86/net/bpf_jit_comp.c-4655-\narch/x86/net/bpf_jit_comp.c:4656:struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)\narch/x86/net/bpf_jit_comp.c-4657-{\n--\narch/x86/net/bpf_jit_comp32.c=2516=bool bpf_jit_needs_zext(void)\n--\narch/x86/net/bpf_jit_comp32.c-2520-\narch/x86/net/bpf_jit_comp32.c:2521:struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)\narch/x86/net/bpf_jit_comp32.c-2522-{\n--\ninclude/linux/filter.h=1236=u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5);\ninclude/linux/filter.h-1237-\ninclude/linux/filter.h:1238:struct bpf_prog *bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog);\ninclude/linux/filter.h-1239-void bpf_jit_compile(struct bpf_prog *prog);\n--\nkernel/bpf/core.c=2640=static struct bpf_prog *bpf_prog_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)\n--\nkernel/bpf/core.c-2645-\tif (!bpf_prog_need_blind(prog))\nkernel/bpf/core.c:2646:\t\treturn bpf_int_jit_compile(env, prog);\nkernel/bpf/core.c-2647-\n--\nkernel/bpf/core.c-2659-\nkernel/bpf/core.c:2660:\tprog = bpf_int_jit_compile(env, prog);\nkernel/bpf/core.c-2661-\tif (prog-\u003ejited) {\n--\nkernel/bpf/core.c=2674=struct bpf_prog *__bpf_prog_select_runtime(struct bpf_verifier_env *env, struct bpf_prog *fp,\n--\nkernel/bpf/core.c-2691-\t * blinding is active. However, in case of error during\nkernel/bpf/core.c:2692:\t * blinding, bpf_int_jit_compile() must always return a\nkernel/bpf/core.c-2693-\t * valid program, which in this case would simply not\n--\nkernel/bpf/core.c=3226=const struct bpf_func_proto bpf_tail_call_proto = {\n--\nkernel/bpf/core.c-3238-/* Stub for JITs that only support cBPF. eBPF programs are interpreted.\nkernel/bpf/core.c:3239: * It is encouraged to implement bpf_int_jit_compile() instead, so that\nkernel/bpf/core.c-3240- * eBPF and implicitly also cBPF can get JITed!\nkernel/bpf/core.c-3241- */\nkernel/bpf/core.c:3242:struct bpf_prog * __weak bpf_int_jit_compile(struct bpf_verifier_env *env, struct bpf_prog *prog)\nkernel/bpf/core.c-3243-{\n--\nkernel/bpf/core.c-3247-/* Stub for JITs that support eBPF. All cBPF code gets transformed into\nkernel/bpf/core.c:3248: * eBPF by the kernel and is later compiled by bpf_int_jit_compile().\nkernel/bpf/core.c-3249- */\n--\nkernel/bpf/fixups.c=1259=static int jit_subprogs(struct bpf_verifier_env *env)\n--\nkernel/bpf/fixups.c-1395-\t\t\tfunc[i]-\u003eaux-\u003eexception_boundary = env-\u003eseen_exception;\nkernel/bpf/fixups.c:1396:\t\tfunc[i] = bpf_int_jit_compile(env, func[i]);\nkernel/bpf/fixups.c-1397-\t\tif (!func[i]-\u003ejited) {\n--\nkernel/bpf/fixups.c-1439-\t\told_bpf_func = func[i]-\u003ebpf_func;\nkernel/bpf/fixups.c:1440:\t\ttmp = bpf_int_jit_compile(env, func[i]);\nkernel/bpf/fixups.c-1441-\t\tif (tmp != func[i] || func[i]-\u003ebpf_func != old_bpf_func) {\n"
}

19/2 2026/10/13 22:52 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 306574
							output: 243
							thoughts: 1271
						

Thoughts:
**My Assessment of the eBPF JIT Compiler Changes on x86-64 for Fuzzing**

Okay, so I'm looking at this patch modifying the x86-64 eBPF JIT compiler. First, the key entry point for compilation is clearly `bpf_int_jit_compile`.  I need to identify which other functions are relevant to the patch. I've compiled a list: `do_jit`, `emit_div_const`, `adjust_cmp_imm`, `bpf_magic_udiv`, `bpf_magic_sdiv`, and `arch_prepare_bpf_trampoline`.

Good, `do_jit` is definitely in scope, given it's not inlined, which means KASAN and kcov symbol addresses exist in the vmlinux. Also, `emit_div_const`, `bpf_magic_udiv`, and `bpf_magic_sdiv` are not trivial functions, so these are critical to consider. The helper function `adjust_cmp_imm` is included as well, plus the modification of `arch_prepare_bpf_trampoline`.

Now, is this worth fuzzing? Yes, absolutely. The patch introduces significant changes to the JIT compiler, including strength-reduction optimizations for constant division and modulo using magic numbers via functions like `emit_div_const`, `bpf_magic_udiv`, and `bpf_magic_sdiv`. Also immediate comparison transformations via `adjust_cmp_imm`. Furthermore, it rewrites crucial assembly instruction encodings and register operand handling. This covers various instructions such as `emit_insn_suffix`, `emit_insn_suffix_SIB`, `emit_alu_imm`, and register operands like `emit_alu_reg`, `emit_shift_imm`, `emit_neg`, `emit_movzx_reg`, and `emit_movsx_reg`. Lastly, this changes the user address casting logic and `BPF_PROBE_MEM` bounds checking with LEA.

And the best part is, all of this is reachable via the standard `bpf()` syscall and socket filters, assuming `CONFIG_BPF_JIT` is enabled.

Let's look at the kernel configs. `BPF_JIT` is mandatory because the patch affects `arch/x86/net/bpf_jit_comp.c`. Also, `BPF_SYSCALL` is a requirement. Also, the `NET` config (or a socket filter) is important.

Based on this, my focus symbols are clear: `bpf_int_jit_compile` (the JIT entrypoint), `do_jit` (the core translation loop), `emit_div_const` (the constant division logic), `bpf_magic_udiv` and `bpf_magic_sdiv` (the magic multiplier generators), `adjust_cmp_imm` (the immediate adjustment), and `arch_prepare_bpf_trampoline` (the trampoline generator).

Now, none of these are ubiquitous hot paths. They are specifically tied to the modified JIT code, which makes them perfect targets for focused fuzzing.

I've verified that the changes have already been applied and that the code is reachable in standard virtualized environments. I'm confirming that the "WorthFuzzing" flag is set, and the required configs are `BPF_JIT` and `BPF_SYSCALL`.  I think I've got a concise explanation of all aspects of the patch and why these symbols are the right choice for fuzzing.

Time to call `set-results`.



20/2 2026/10/13 22:53 tool set-results
0m Args:
{
  "EnableConfigs": [
    "BPF_JIT",
    "BPF_SYSCALL"
  ],
  "FocusSymbols": [
    "bpf_int_jit_compile",
    "do_jit",
    "emit_div_const",
    "bpf_magic_udiv",
    "bpf_magic_sdiv",
    "adjust_cmp_imm",
    "arch_prepare_bpf_trampoline"
  ],
  "Reasoning": "The patch series introduces major optimizations and instruction encoding rewrites in the x86-64 BPF JIT compiler (arch/x86/net/bpf_jit_comp.c). Specifically, it adds constant division and modulo strength-reduction using magic multipliers (Hacker's Delight algorithms), comparison immediate adjustment, rewritten instruction suffix encodings, user address casting sequences, probe memory checks, and ALU immediate fast-paths. This code executes on amd64 when compiling eBPF programs via the bpf() syscall or socket filters, making it highly relevant and valuable for fuzzing to detect JIT encoding defects or arithmetic bugs.",
  "WorthFuzzing": true
}

Results:
{
  "EnableConfigs": [
    "BPF_JIT",
    "BPF_SYSCALL"
  ],
  "FocusSymbols": [
    "bpf_int_jit_compile",
    "do_jit",
    "emit_div_const",
    "bpf_magic_udiv",
    "bpf_magic_sdiv",
    "adjust_cmp_imm",
    "arch_prepare_bpf_trampoline"
  ],
  "Reasoning": "The patch series introduces major optimizations and instruction encoding rewrites in the x86-64 BPF JIT compiler (arch/x86/net/bpf_jit_comp.c). Specifically, it adds constant division and modulo strength-reduction using magic multipliers (Hacker's Delight algorithms), comparison immediate adjustment, rewritten instruction suffix encodings, user address casting sequences, probe memory checks, and ALU immediate fast-paths. This code executes on amd64 when compiling eBPF programs via the bpf() syscall or socket filters, making it highly relevant and valuable for fuzzing to detect JIT encoding defects or arithmetic bugs.",
  "WorthFuzzing": true
}

21/1 2026/10/13 22:53 action If
1m Args:
{
  "WorthFuzzing": true
}

Results:
null

22/2 2026/10/13 22:53 agent kmsan-evaluator
1m Model:
core

Args:
null

Results:
{
  "KMSANReasoning": "The patch series makes two main categories of changes:\n1. It deletes the legacy in-kernel BPF test module (`lib/test_bpf.c`) and associated symbols/config options, replacing them with user-space BPF selftests (`tools/testing/selftests/bpf/prog_tests/jit_insns.c`).\n2. It optimizes code generation in the x86-64 BPF JIT compiler (`arch/x86/net/bpf_jit_comp.c`), including strength reduction of 64-bit constant division and modulo operations into multiplications by magic numbers, zero-displacement ModR/M and SIB optimizations, peephole optimizations for ALU operations and comparisons, and helper refactoring for stack depth adjustments.\n\nThese modifications do not introduce or touch any kernel structures copied to user space, netlink skb attributes, ioctls, or socket options. No kernel memory allocations or initialization paths are altered in ways that could cause uninitialized heap/stack memory to be read or leaked. Potential bugs in BPF JIT emission would consist of incorrect native machine code generation, register clobbering, invalid jumps, or out-of-bounds memory accesses—issues that are caught by hardware traps, standard bug detectors, or KASAN. Therefore, there is no risk of uninitialized memory use or info-leak that would necessitate a dedicated KMSAN fuzzing session.",
  "NeedsKMSAN": false
}

Instruction:
You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.

CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
  a comprehensive suite of debugging tools and sanitizers, including KASAN
  (out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
  (locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
  or page allocations) and kernel-to-user memory info-leaks.

Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.

Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.

Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
   attributes, ioctl output arguments, socket options, or BPF buffers) where fields
   or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
   or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
   could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
   uninitialized bytes of existing buffers.

Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
  dereferences, locking deadlocks, or use-after-free bugs (these are already caught
  by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
  or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.

Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
Target architecture: amd64

For your convenience, here is the diff of the changes:
commit 84bac3838b12fe759c77e84095010fd4940a7bfb
Author: syz-cluster <triage@syzkaller.com>
Date:   Tue Oct 13 22:49:47 2026 +0000

    syz-cluster: applied patch under review

diff --git a/Documentation/bpf/bpf_devel_QA.rst b/Documentation/bpf/bpf_devel_QA.rst
index edf8107a7beba..4729efd657c33 100644
--- a/Documentation/bpf/bpf_devel_QA.rst
+++ b/Documentation/bpf/bpf_devel_QA.rst
@@ -374,9 +374,10 @@ developers in order to get the feature implemented in a timely manner.
 Please refer to the git log (``arch/*/net/``) to locate the necessary
 people for helping out.
 
-Also always make sure to add BPF test cases (e.g. test_bpf.c and
-test_verifier.c) for new instructions, so that they can receive
-broad test coverage and help run-time testing the various BPF JITs.
+Also always make sure to add BPF test cases (e.g. the jit_insns test
+in test_progs and test_verifier.c) for new instructions, so that they
+can receive broad test coverage and help run-time testing the various
+BPF JITs.
 
 In case of new BPF instructions, once the changes have been accepted
 into the Linux kernel, please implement support into LLVM's BPF back
@@ -514,10 +515,11 @@ A: If you run a kernel ``xyz``, then always run the BPF kernel selftests
 from that kernel ``xyz`` as well. Do not expect that the BPF selftest
 from the latest mainline tree will pass all the time.
 
-In particular, test_bpf.c and test_verifier.c have a large number of
-test cases and are constantly updated with new BPF test sequences, or
-existing ones are adapted to verifier changes e.g. due to verifier
-becoming smarter and being able to better track certain things.
+In particular, test_verifier.c and the instruction tests in test_progs
+have a large number of test cases and are constantly updated with new
+BPF test sequences, or existing ones are adapted to verifier changes
+e.g. due to verifier becoming smarter and being able to better track
+certain things.
 
 LLVM
 ====
diff --git a/Documentation/networking/filter.rst b/Documentation/networking/filter.rst
index 8eb9a5d40f31b..e0b9dc14a9bf2 100644
--- a/Documentation/networking/filter.rst
+++ b/Documentation/networking/filter.rst
@@ -656,16 +656,11 @@ from eBPF instruction set.
 Testing
 -------
 
-Next to the BPF toolchain, the kernel also ships a test module that contains
-various test cases for classic and eBPF that can be executed against
-the BPF interpreter and JIT compiler. It can be found in lib/test_bpf.c and
-enabled via Kconfig::
-
-  CONFIG_TEST_BPF=m
-
-After the module has been built and installed, the test suite can be executed
-via insmod or modprobe against 'test_bpf' module. Results of the test cases
-including timings in nsec can be found in the kernel log (dmesg).
+Next to the BPF toolchain, the BPF selftests under tools/testing/selftests/bpf
+ship instruction tests in test_progs, see jit_insns, which runs the eBPF
+instructions over a range of operand magnitudes and signs, register
+combinations, memory offsets and jump offsets against the BPF interpreter
+or the JIT compiler, depending on the net.core.bpf_jit_enable setting.
 
 Misc
 ----
diff --git a/MAINTAINERS b/MAINTAINERS
index fe99b7437a2dc..80845ba7dfb56 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4981,7 +4981,6 @@ F:	include/uapi/linux/filter.h
 F:	kernel/bpf/
 F:	kernel/trace/bpf_trace.c
 F:	lib/buildid.c
-F:	lib/test_bpf.c
 F:	net/bpf/
 F:	net/core/filter.c
 F:	net/sched/act_bpf.c
diff --git a/arch/m68k/configs/amiga_defconfig b/arch/m68k/configs/amiga_defconfig
index 8b7efe20dd128..0efd78d64a901 100644
--- a/arch/m68k/configs/amiga_defconfig
+++ b/arch/m68k/configs/amiga_defconfig
@@ -576,7 +576,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/apollo_defconfig b/arch/m68k/configs/apollo_defconfig
index c7f7705806f97..35b54dc7e79c7 100644
--- a/arch/m68k/configs/apollo_defconfig
+++ b/arch/m68k/configs/apollo_defconfig
@@ -531,7 +531,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/atari_defconfig b/arch/m68k/configs/atari_defconfig
index 2fb213161baec..265588b71b820 100644
--- a/arch/m68k/configs/atari_defconfig
+++ b/arch/m68k/configs/atari_defconfig
@@ -554,7 +554,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/bvme6000_defconfig b/arch/m68k/configs/bvme6000_defconfig
index 6730242d4d486..595601e229718 100644
--- a/arch/m68k/configs/bvme6000_defconfig
+++ b/arch/m68k/configs/bvme6000_defconfig
@@ -523,7 +523,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/hp300_defconfig b/arch/m68k/configs/hp300_defconfig
index 2b3ff26ac8fdf..568d80e3db22d 100644
--- a/arch/m68k/configs/hp300_defconfig
+++ b/arch/m68k/configs/hp300_defconfig
@@ -533,7 +533,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/mac_defconfig b/arch/m68k/configs/mac_defconfig
index 61f32ef2547e0..da1f4677aa6d3 100644
--- a/arch/m68k/configs/mac_defconfig
+++ b/arch/m68k/configs/mac_defconfig
@@ -552,7 +552,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig
index 2cbd6bf20a687..8e6466c514847 100644
--- a/arch/m68k/configs/multi_defconfig
+++ b/arch/m68k/configs/multi_defconfig
@@ -639,7 +639,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/mvme147_defconfig b/arch/m68k/configs/mvme147_defconfig
index 019f8b8070be8..8e7882354e530 100644
--- a/arch/m68k/configs/mvme147_defconfig
+++ b/arch/m68k/configs/mvme147_defconfig
@@ -523,7 +523,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig
index 3891632874258..d3e7049c2e433 100644
--- a/arch/m68k/configs/mvme16x_defconfig
+++ b/arch/m68k/configs/mvme16x_defconfig
@@ -524,7 +524,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/q40_defconfig b/arch/m68k/configs/q40_defconfig
index cbc41443cffa6..c517c32dbdc7c 100644
--- a/arch/m68k/configs/q40_defconfig
+++ b/arch/m68k/configs/q40_defconfig
@@ -542,7 +542,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/sun3_defconfig b/arch/m68k/configs/sun3_defconfig
index 273e840dc8d6a..924f5f05906fb 100644
--- a/arch/m68k/configs/sun3_defconfig
+++ b/arch/m68k/configs/sun3_defconfig
@@ -520,7 +520,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/m68k/configs/sun3x_defconfig b/arch/m68k/configs/sun3x_defconfig
index 843d72924bcb2..f63c6392d92ed 100644
--- a/arch/m68k/configs/sun3x_defconfig
+++ b/arch/m68k/configs/sun3x_defconfig
@@ -521,7 +521,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_WORKQUEUE=m
-CONFIG_TEST_BPF=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
 CONFIG_TEST_SYSCTL=m
diff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig
index 1eb8e3457e8bf..e0b7901add11b 100644
--- a/arch/powerpc/configs/ppc64_defconfig
+++ b/arch/powerpc/configs/ppc64_defconfig
@@ -442,7 +442,6 @@ CONFIG_TEST_IDA=m
 CONFIG_TEST_BITOPS=m
 CONFIG_TEST_VMALLOC=m
 CONFIG_TEST_USER_COPY=m
-CONFIG_TEST_BPF=m
 CONFIG_TEST_BLACKHOLE_DEV=m
 CONFIG_FIND_BIT_BENCHMARK=m
 CONFIG_TEST_FIRMWARE=m
diff --git a/arch/s390/configs/debug_defconfig b/arch/s390/configs/debug_defconfig
index 3dae714743330..d597b4b532a34 100644
--- a/arch/s390/configs/debug_defconfig
+++ b/arch/s390/configs/debug_defconfig
@@ -927,6 +927,5 @@ CONFIG_INTERVAL_TREE_TEST=m
 CONFIG_PERCPU_TEST=m
 CONFIG_ATOMIC64_SELFTEST=y
 CONFIG_TEST_BITOPS=m
-CONFIG_TEST_BPF=m
 CONFIG_PAGE_TABLE_CHECK=y
 CONFIG_PAGE_TABLE_CHECK_ENFORCED=y
diff --git a/arch/s390/configs/defconfig b/arch/s390/configs/defconfig
index 6f5722634b4d3..c417b1717e895 100644
--- a/arch/s390/configs/defconfig
+++ b/arch/s390/configs/defconfig
@@ -851,4 +851,3 @@ CONFIG_LKDTM=m
 CONFIG_KPROBES_SANITY_TEST=m
 CONFIG_PERCPU_TEST=m
 CONFIG_ATOMIC64_SELFTEST=y
-CONFIG_TEST_BPF=m
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 083fcd6cf15b7..3975a94ac812d 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -421,7 +421,7 @@ static void pop_callee_regs(u8 **pprog, bool *callee_regs_used)
 }
 
 /* add rsp, depth */
-static void emit_add_rsp(u8 **pprog, u16 depth)
+static void emit_add_rsp(u8 **pprog, u32 depth)
 {
 	u8 *prog = *pprog;
 
@@ -435,7 +435,7 @@ static void emit_add_rsp(u8 **pprog, u16 depth)
 }
 
 /* sub rsp, depth */
-static void emit_sub_rsp(u8 **pprog, u16 depth)
+static void emit_sub_rsp(u8 **pprog, u32 depth)
 {
 	u8 *prog = *pprog;
 
@@ -472,6 +472,9 @@ static void emit_nops(u8 **pprog, int len)
  * in arch/x86/kernel/alternative.c
  */
 static int emit_call(u8 **prog, void *func, void *ip);
+static void emit_ldx(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, int off);
+static void emit_mov_reg(u8 **pprog, bool is64, u32 dst_reg, u32 src_reg);
+static void emit_alu_imm(u8 **pprog, u32 op, u32 dst_reg, s32 imm, bool is64);
 
 static void emit_fineibt(u8 **pprog, u8 *ip, u32 hash, int arity)
 {
@@ -607,8 +610,7 @@ static void emit_prologue(u8 **pprog, u8 *ip, u32 stack_depth, bool ebpf_from_cb
 	EMIT_ENDBR();
 
 	/* sub rsp, rounded_stack_depth */
-	if (stack_depth)
-		EMIT3_off32(0x48, 0x81, 0xEC, round_up(stack_depth, 8));
+	emit_sub_rsp(&prog, round_up(stack_depth, 8));
 	if (tail_call_reachable)
 		emit_prologue_tail_call(&prog, is_subprog);
 	*pprog = prog;
@@ -840,7 +842,7 @@ static void emit_bpf_tail_call_indirect(struct bpf_prog *bpf_prog,
 	 * if (index >= array->map.max_entries)
 	 *	goto out;
 	 */
-	EMIT2(0x89, 0xD2);                        /* mov edx, edx */
+	emit_mov_reg(&prog, false, BPF_REG_3, BPF_REG_3); /* mov edx, edx */
 	EMIT3(0x39, 0x56,                         /* cmp dword ptr [rsi + 16], edx */
 	      offsetof(struct bpf_array, map.max_entries));
 
@@ -851,7 +853,8 @@ static void emit_bpf_tail_call_indirect(struct bpf_prog *bpf_prog,
 	 * if ((*tcc_ptr)++ >= MAX_TAIL_CALL_CNT)
 	 *	goto out;
 	 */
-	EMIT3_off32(0x48, 0x8B, 0x85, tcc_ptr_off); /* mov rax, qword ptr [rbp - tcc_ptr_off] */
+	/* mov rax, qword ptr [rbp - tcc_ptr_off] */
+	emit_ldx(&prog, BPF_DW, BPF_REG_0, BPF_REG_FP, tcc_ptr_off);
 	EMIT4(0x48, 0x83, 0x38, MAX_TAIL_CALL_CNT); /* cmp qword ptr [rax], MAX_TAIL_CALL_CNT */
 
 	offset = ctx->tail_call_indirect_label - (prog + 2 - start);
@@ -888,15 +891,13 @@ static void emit_bpf_tail_call_indirect(struct bpf_prog *bpf_prog,
 	 * Pop tail_call_cnt_ptr, if it's subprog.
 	 */
 	EMIT1(0x58);                              /* pop rax */
-	if (stack_depth)
-		EMIT3_off32(0x48, 0x81, 0xC4,     /* add rsp, sd */
-			    round_up(stack_depth, 8));
+	emit_add_rsp(&prog, round_up(stack_depth, 8)); /* add rsp, sd */
 
 	/* goto *(prog->bpf_func + X86_TAIL_CALL_OFFSET); */
 	EMIT4(0x48, 0x8B, 0x49,                   /* mov rcx, qword ptr [rcx + 32] */
 	      offsetof(struct bpf_prog, bpf_func));
-	EMIT4(0x48, 0x83, 0xC1,                   /* add rcx, X86_TAIL_CALL_OFFSET */
-	      X86_TAIL_CALL_OFFSET);
+	/* add rcx, X86_TAIL_CALL_OFFSET */
+	emit_alu_imm(&prog, BPF_ADD, BPF_REG_4, X86_TAIL_CALL_OFFSET, true);
 	/*
 	 * Now we're ready to jump into next BPF program
 	 * rdi == ctx (1st arg)
@@ -923,7 +924,8 @@ static void emit_bpf_tail_call_direct(struct bpf_prog *bpf_prog,
 	 * if ((*tcc_ptr)++ >= MAX_TAIL_CALL_CNT)
 	 *	goto out;
 	 */
-	EMIT3_off32(0x48, 0x8B, 0x85, tcc_ptr_off);   /* mov rax, qword ptr [rbp - tcc_ptr_off] */
+	/* mov rax, qword ptr [rbp - tcc_ptr_off] */
+	emit_ldx(&prog, BPF_DW, BPF_REG_0, BPF_REG_FP, tcc_ptr_off);
 	EMIT4(0x48, 0x83, 0x38, MAX_TAIL_CALL_CNT);   /* cmp qword ptr [rax], MAX_TAIL_CALL_CNT */
 
 	offset = ctx->tail_call_direct_label - (prog + 2 - start);
@@ -955,8 +957,7 @@ static void emit_bpf_tail_call_direct(struct bpf_prog *bpf_prog,
 	 * Pop tail_call_cnt_ptr, if it's subprog.
 	 */
 	EMIT1(0x58);                                  /* pop rax */
-	if (stack_depth)
-		EMIT3_off32(0x48, 0x81, 0xC4, round_up(stack_depth, 8));
+	emit_add_rsp(&prog, round_up(stack_depth, 8));
 
 	emit_nops(&prog, X86_PATCH_SIZE);
 
@@ -1106,8 +1107,9 @@ static void emit_movsx_reg(u8 **pprog, int num_bits, bool is64, u32 dst_reg,
 	} else {
 		/* movs[b,w]l dst, src */
 		if (num_bits == 8) {
-			EMIT4(add_2mod(0x40, src_reg, dst_reg), 0x0f, 0xbe,
-			      add_2reg(0xC0, src_reg, dst_reg));
+			if (is_ereg(dst_reg) || is_ereg_8l(src_reg))
+				EMIT1(add_2mod(0x40, src_reg, dst_reg));
+			EMIT3(0x0f, 0xbe, add_2reg(0xC0, src_reg, dst_reg));
 		} else if (num_bits == 16) {
 			if (is_ereg(dst_reg) || is_ereg(src_reg))
 				EMIT1(add_2mod(0x40, src_reg, dst_reg));
@@ -1119,18 +1121,40 @@ static void emit_movsx_reg(u8 **pprog, int num_bits, bool is64, u32 dst_reg,
 	*pprog = prog;
 }
 
+/*
+ * rbp and r13 as base register always need a displacement, since mod 00
+ * with r/m 101 encodes a RIP-relative disp32 and with SIB base 101 a
+ * disp32 without base instead.
+ */
+static bool base_needs_disp(u32 reg)
+{
+	return reg2hex[reg] == 5;
+}
+
+static void emit_movzx_reg(u8 **pprog, int num_bits, u32 dst_reg, u32 src_reg)
+{
+	u8 *prog = *pprog;
+
+	/* movz[b,w]l dst, src */
+	if (is_ereg(dst_reg) ||
+	    (num_bits == 8 ? is_ereg_8l(src_reg) : is_ereg(src_reg)))
+		EMIT1(add_2mod(0x40, src_reg, dst_reg));
+	EMIT3(0x0F, num_bits == 8 ? 0xB6 : 0xB7,
+	      add_2reg(0xC0, src_reg, dst_reg));
+
+	*pprog = prog;
+}
+
 /* Emit the suffix (ModR/M etc) for addressing *(ptr_reg + off) and val_reg */
 static void emit_insn_suffix(u8 **pprog, u32 ptr_reg, u32 val_reg, int off)
 {
 	u8 *prog = *pprog;
 
-	if (is_imm8(off)) {
-		/* 1-byte signed displacement.
-		 *
-		 * If off == 0 we could skip this and save one extra byte, but
-		 * special case of x86 R13 which always needs an offset is not
-		 * worth the hassle
-		 */
+	if (!off && !base_needs_disp(ptr_reg)) {
+		/* No displacement */
+		EMIT1(add_2reg(0x00, ptr_reg, val_reg));
+	} else if (is_imm8(off)) {
+		/* 1-byte signed displacement */
 		EMIT2(add_2reg(0x40, ptr_reg, val_reg), off);
 	} else {
 		/* 4-byte signed displacement */
@@ -1139,14 +1163,22 @@ static void emit_insn_suffix(u8 **pprog, u32 ptr_reg, u32 val_reg, int off)
 	*pprog = prog;
 }
 
-static void emit_insn_suffix_SIB(u8 **pprog, u32 ptr_reg, u32 val_reg, u32 index_reg, int off)
+/*
+ * Emit the suffix for addressing *(ptr_reg + (index_reg << scale) + off)
+ * and val_reg, with a SIB byte
+ */
+static void emit_insn_suffix_SIB(u8 **pprog, u32 ptr_reg, u32 val_reg, u32 index_reg, int off,
+				 u8 scale)
 {
+	u8 sib = (scale << 6) | add_2reg(0, ptr_reg, index_reg);
 	u8 *prog = *pprog;
 
-	if (is_imm8(off)) {
-		EMIT3(add_2reg(0x44, BPF_REG_0, val_reg), add_2reg(0, ptr_reg, index_reg) /* SIB */, off);
+	if (!off && !base_needs_disp(ptr_reg)) {
+		EMIT2(add_2reg(0x04, BPF_REG_0, val_reg), sib);
+	} else if (is_imm8(off)) {
+		EMIT3(add_2reg(0x44, BPF_REG_0, val_reg), sib, off);
 	} else {
-		EMIT2_off32(add_2reg(0x84, BPF_REG_0, val_reg), add_2reg(0, ptr_reg, index_reg) /* SIB */, off);
+		EMIT2_off32(add_2reg(0x84, BPF_REG_0, val_reg), sib, off);
 	}
 	*pprog = prog;
 }
@@ -1179,6 +1211,85 @@ static void maybe_emit_1mod(u8 **pprog, u32 reg, bool is64)
 	*pprog = prog;
 }
 
+/* add/sub/and/or/xor dst_reg, imm with the imm8 and the rax short forms */
+static void emit_alu_imm(u8 **pprog, u32 op, u32 dst_reg, s32 imm, bool is64)
+{
+	/* ModR/M opcode extension and rax short form per operation */
+	static const u8 modrm[] = {
+		[BPF_ADD] = 0xC0, [BPF_SUB] = 0xE8, [BPF_AND] = 0xE0,
+		[BPF_OR] = 0xC8, [BPF_XOR] = 0xF0,
+	};
+	static const u8 short_op[] = {
+		[BPF_ADD] = 0x05, [BPF_SUB] = 0x2D, [BPF_AND] = 0x25,
+		[BPF_OR] = 0x0D, [BPF_XOR] = 0x35,
+	};
+	u8 *prog = *pprog;
+	bool inc;
+
+	/* A non-negative mask clears the upper half like the 32-bit and does */
+	if (op == BPF_AND && imm >= 0)
+		is64 = false;
+	/* add 128 is sub -128 and the other way round, which fit into an imm8 */
+	if ((op == BPF_ADD || op == BPF_SUB) && imm == 128) {
+		op = op == BPF_ADD ? BPF_SUB : BPF_ADD;
+		imm = -128;
+	}
+	inc = op == BPF_ADD ? imm == 1 : imm == -1;
+	maybe_emit_1mod(&prog, dst_reg, is64);
+	/* inc or dec for +-1, the flags are not read across instructions */
+	if ((op == BPF_ADD || op == BPF_SUB) && (imm == 1 || imm == -1))
+		EMIT2(0xFF, add_1reg(inc ? 0xC0 : 0xC8, dst_reg));
+	else if (is_imm8(imm))
+		EMIT3(0x83, add_1reg(modrm[op], dst_reg), imm);
+	else if (is_axreg(dst_reg))
+		EMIT1_off32(short_op[op], imm);
+	else
+		EMIT2_off32(0x81, add_1reg(modrm[op], dst_reg), imm);
+
+	*pprog = prog;
+}
+
+/* add/sub/and/or/xor dst_reg, src_reg */
+static void emit_alu_reg(u8 **pprog, u32 op, u32 dst_reg, u32 src_reg, bool is64)
+{
+	u8 *prog = *pprog;
+
+	maybe_emit_mod(&prog, dst_reg, src_reg, is64);
+	EMIT2(simple_alu_opcodes[op], add_2reg(0xC0, dst_reg, src_reg));
+
+	*pprog = prog;
+}
+
+/* shl/shr/sar reg, imm */
+static void emit_shift_imm(u8 **pprog, u32 op, u32 reg, u8 imm, bool is64)
+{
+	u8 *prog = *pprog;
+
+	/* The shift left by one is an add of the register to itself */
+	if (op == BPF_LSH && imm == 1) {
+		emit_alu_reg(&prog, BPF_ADD, reg, reg, is64);
+	} else {
+		maybe_emit_1mod(&prog, reg, is64);
+		if (imm == 1)
+			EMIT2(0xD1, add_1reg(simple_alu_opcodes[op], reg));
+		else
+			EMIT3(0xC1, add_1reg(simple_alu_opcodes[op], reg), imm);
+	}
+
+	*pprog = prog;
+}
+
+/* neg dst_reg */
+static void emit_neg(u8 **pprog, u32 dst_reg, bool is64)
+{
+	u8 *prog = *pprog;
+
+	maybe_emit_1mod(&prog, dst_reg, is64);
+	EMIT2(0xF7, add_1reg(0xD8, dst_reg));
+
+	*pprog = prog;
+}
+
 static int emit_kasan_check(struct bpf_verifier_env *env, u8 **pprog,
 			    u32 addr_reg, s32 off, u32 bpf_size, u8 *ip,
 			    bool is_write)
@@ -1233,15 +1344,8 @@ static int emit_kasan_check(struct bpf_verifier_env *env, u8 **pprog,
 	EMIT_mov(BPF_REG_1, addr_reg);
 
 	/* add rdi, off (if offset is non-zero) */
-	if (off) {
-		if (is_imm8(off)) {
-			/* add rdi, imm8 */
-			EMIT4(0x48, 0x83, 0xC7, (u8)off);
-		} else {
-			/* add rdi, imm32 */
-			EMIT3_off32(0x48, 0x81, 0xC7, off);
-		}
-	}
+	if (off)
+		emit_alu_imm(&prog, BPF_ADD, BPF_REG_1, off, true);
 
 	/* Adjust ip to account for the instrumentation generated so far */
 	ip += (prog - *pprog);
@@ -1273,12 +1377,16 @@ static void emit_ldx(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, int off)
 
 	switch (size) {
 	case BPF_B:
-		/* Emit 'movzx rax, byte ptr [rax + off]' */
-		EMIT3(add_2mod(0x48, src_reg, dst_reg), 0x0F, 0xB6);
+		/* Emit 'movzx eax, byte ptr [rax + off]' */
+		if (is_ereg(dst_reg) || is_ereg(src_reg))
+			EMIT1(add_2mod(0x40, src_reg, dst_reg));
+		EMIT2(0x0F, 0xB6);
 		break;
 	case BPF_H:
-		/* Emit 'movzx rax, word ptr [rax + off]' */
-		EMIT3(add_2mod(0x48, src_reg, dst_reg), 0x0F, 0xB7);
+		/* Emit 'movzx eax, word ptr [rax + off]' */
+		if (is_ereg(dst_reg) || is_ereg(src_reg))
+			EMIT1(add_2mod(0x40, src_reg, dst_reg));
+		EMIT2(0x0F, 0xB7);
 		break;
 	case BPF_W:
 		/* Emit 'mov eax, dword ptr [rax+0x14]' */
@@ -1341,7 +1449,7 @@ static void emit_ldx_index(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, u32 i
 		EMIT2(add_3mod(0x48, src_reg, dst_reg, index_reg), 0x8B);
 		break;
 	}
-	emit_insn_suffix_SIB(&prog, src_reg, dst_reg, index_reg, off);
+	emit_insn_suffix_SIB(&prog, src_reg, dst_reg, index_reg, off, 0);
 	*pprog = prog;
 }
 
@@ -1363,7 +1471,7 @@ static void emit_ldsx_index(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, u32
 		EMIT2(add_3mod(0x48, src_reg, dst_reg, index_reg), 0x63);
 		break;
 	}
-	emit_insn_suffix_SIB(&prog, src_reg, dst_reg, index_reg, off);
+	emit_insn_suffix_SIB(&prog, src_reg, dst_reg, index_reg, off, 0);
 	*pprog = prog;
 }
 
@@ -1434,7 +1542,7 @@ static void emit_stx_index(u8 **pprog, u32 size, u32 dst_reg, u32 src_reg, u32 i
 		EMIT2(add_3mod(0x48, dst_reg, src_reg, index_reg), 0x89);
 		break;
 	}
-	emit_insn_suffix_SIB(&prog, dst_reg, src_reg, index_reg, off);
+	emit_insn_suffix_SIB(&prog, dst_reg, src_reg, index_reg, off, 0);
 	*pprog = prog;
 }
 
@@ -1466,7 +1574,7 @@ static void emit_st_index(u8 **pprog, u32 size, u32 dst_reg, u32 index_reg, int
 		EMIT2(add_3mod(0x48, dst_reg, 0, index_reg), 0xC7);
 		break;
 	}
-	emit_insn_suffix_SIB(&prog, dst_reg, 0, index_reg, off);
+	emit_insn_suffix_SIB(&prog, dst_reg, 0, index_reg, off, 0);
 	EMIT(imm, bpf_size_to_x86_bytes(size));
 	*pprog = prog;
 }
@@ -1502,11 +1610,7 @@ static void emit_st(u8 **pprog, struct bpf_insn *insn, u32 dst_reg,
 		break;
 	}
 
-	if (is_imm8(insn_off))
-		EMIT2(add_1reg(0x40, dst_reg), insn_off);
-	else
-		EMIT1_off32(add_1reg(0x80, dst_reg), insn_off);
-
+	emit_insn_suffix(&prog, dst_reg, BPF_REG_0, insn_off);
 	EMIT(imm32, bpf_size_to_x86_bytes(BPF_SIZE(insn->code)));
 	*pprog = prog;
 }
@@ -1614,7 +1718,7 @@ static int emit_atomic_rmw_index(u8 **pprog, u32 atomic_op, u32 size,
 		pr_err("bpf_jit: unknown atomic opcode %02x\n", atomic_op);
 		return -EFAULT;
 	}
-	emit_insn_suffix_SIB(&prog, dst_reg, src_reg, index_reg, off);
+	emit_insn_suffix_SIB(&prog, dst_reg, src_reg, index_reg, off, 0);
 	*pprog = prog;
 	return 0;
 }
@@ -1824,6 +1928,218 @@ static void emit_shiftx(u8 **pprog, u32 dst_reg, u8 src_reg, bool is64, u8 op)
 	*pprog = prog;
 }
 
+struct bpf_div_magic {
+	u64 m;		/* multiplier, sign extended for signed division */
+	int s;		/* shift of the high half of the product */
+	bool add;	/* multiplier has 65 bits, use the add sequence */
+};
+
+/*
+ * Multiplier and shift for an unsigned division by the constant d, with
+ * 2 <= d < 2^64 and a dividend below 2^(64 - lz): n / d == (mulhu(n, m)
+ * >> s), or with the add sequence when m needs 65 bits, (((n - t) >> 1)
+ * + t) >> (s - 1) with t = mulhu(n, m). Hacker's Delight, 2nd ed., figure
+ * 10-2.
+ */
+static void bpf_magic_udiv(u64 d, int lz, struct bpf_div_magic *mag)
+{
+	u64 mask = ~0ULL >> lz;
+	u64 nc, delta, q1, r1, q2, r2;
+	int p;
+
+	mag->add = false;
+	/* Largest value with nc mod d == d - 1 */
+	nc = mask - (mask % d + 1) % d;
+	p = 63;
+	q1 = (1ULL << 63) / nc;			/* 2^p / nc */
+	r1 = (1ULL << 63) - q1 * nc;		/* 2^p mod nc */
+	q2 = (~0ULL >> 1) / d;			/* (2^p - 1) / d */
+	r2 = (~0ULL >> 1) - q2 * d;		/* (2^p - 1) mod d */
+	do {
+		p++;
+		if (r1 >= nc - r1) {
+			q1 = 2 * q1 + 1;
+			r1 = 2 * r1 - nc;
+		} else {
+			q1 = 2 * q1;
+			r1 = 2 * r1;
+		}
+		if (r2 + 1 >= d - r2) {
+			if (q2 >= (~0ULL >> 1))
+				mag->add = true;
+			q2 = 2 * q2 + 1;
+			r2 = 2 * r2 + 1 - d;
+		} else {
+			if (q2 >= (1ULL << 63))
+				mag->add = true;
+			q2 = 2 * q2;
+			r2 = 2 * r2 + 1;
+		}
+		delta = d - 1 - r2;
+	} while (p < 128 && (q1 < delta || (q1 == delta && r1 == 0)));
+
+	mag->m = q2 + 1;
+	mag->s = p - 64;
+}
+
+/*
+ * Multiplier and shift for a signed division by the constant d, with
+ * 2 <= |d| < 2^63: q = mulhs(n, m), q += n if d > 0 and m < 0, q -= n
+ * if d < 0 and m > 0, q >>= s (arithmetic), n / d == q + (q >>> 63).
+ * Hacker's Delight, 2nd ed., figure 10-1.
+ */
+static void bpf_magic_sdiv(s64 d, struct bpf_div_magic *mag)
+{
+	u64 ad = d < 0 ? -(u64)d : (u64)d;
+	u64 t, anc, delta, q1, r1, q2, r2;
+	int p;
+
+	t = (1ULL << 63) + (d < 0);
+	anc = t - 1 - t % ad;			/* |nc| */
+	p = 63;
+	q1 = (1ULL << 63) / anc;		/* 2^p / |nc| */
+	r1 = (1ULL << 63) - q1 * anc;		/* 2^p mod |nc| */
+	q2 = (1ULL << 63) / ad;			/* 2^p / |d| */
+	r2 = (1ULL << 63) - q2 * ad;		/* 2^p mod |d| */
+	do {
+		p++;
+		q1 = 2 * q1;
+		r1 = 2 * r1;
+		if (r1 >= anc) {
+			q1++;
+			r1 -= anc;
+		}
+		q2 = 2 * q2;
+		r2 = 2 * r2;
+		if (r2 >= ad) {
+			q2++;
+			r2 -= ad;
+		}
+		delta = ad - r2;
+	} while (q1 < delta || (q1 == delta && r1 == 0));
+
+	mag->m = q2 + 1;
+	if (d < 0)
+		mag->m = -mag->m;
+	mag->s = p - 64;
+	mag->add = false;
+}
+
+/*
+ * Divide dst_reg by the constant in insn->imm of a 64-bit division through
+ * a multiplication with the magic number from bpf_magic_udiv() or
+ * bpf_magic_sdiv(). The dividend goes through rax and the multiplier
+ * through r11, the caller saves rax and rdx unless they are dst_reg, and
+ * r10 is scratch. Returns false for the divisors left to div/idiv.
+ */
+static bool emit_div_const(u8 **pprog, const struct bpf_insn *insn, u32 dst_reg)
+{
+	bool is_mod = BPF_OP(insn->code) == BPF_MOD;
+	bool is_signed = insn->off == 1;
+	u32 n_reg = dst_reg, q_reg;
+	s32 imm32 = insn->imm;
+	struct bpf_div_magic mag;
+	u8 *prog = *pprog;
+	int corr = 0, pre = 0, s;
+
+	if (is_signed) {
+		/* |d| >= 2, the verifier already rewrote d == -1 */
+		if (imm32 >= -1 && imm32 <= 1)
+			return false;
+		bpf_magic_sdiv(imm32, &mag);
+		/* q += n for d > 0 and m < 0, q -= n for d < 0 and m > 0 */
+		if (imm32 > 0 && (s64)mag.m < 0)
+			corr = 1;
+		else if (imm32 < 0 && (s64)mag.m > 0)
+			corr = -1;
+	} else {
+		/* d >= 2, a negative imm32 is a divisor above 2^63 */
+		if (imm32 < 2)
+			return false;
+		bpf_magic_udiv(imm32, 0, &mag);
+		/*
+		 * Shift the dividend by the trailing zeros of an even divisor
+		 * first, the magic number of the odd part then fits without
+		 * the add sequence.
+		 */
+		if (mag.add && !(imm32 & 1)) {
+			pre = __ffs(imm32);
+			bpf_magic_udiv(imm32 >> pre, pre, &mag);
+			if (mag.add)
+				return false;
+		}
+	}
+	s = mag.s;
+	/*
+	 * The shift is at most 63, or 64 with the add sequence which shifts
+	 * by s - 1 and needs s >= 1. Never hit for d >= 2, kept as a guard
+	 * against an unencodable count.
+	 */
+	if (s > 64 - !mag.add || (mag.add && !s))
+		return false;
+
+	/* Keep the dividend when the multiplication clobbers it */
+	if ((is_mod || mag.add || corr) &&
+	    (dst_reg == BPF_REG_0 || dst_reg == BPF_REG_3)) {
+		emit_mov_reg(&prog, true, BPF_REG_AX, dst_reg);
+		n_reg = BPF_REG_AX;
+	}
+
+	/* mov rax, dst_reg; shr rax, pre; mov r11, m; mul r11 or imul r11 */
+	if (dst_reg != BPF_REG_0)
+		emit_mov_reg(&prog, true, BPF_REG_0, dst_reg);
+	if (pre)
+		emit_shift_imm(&prog, BPF_RSH, BPF_REG_0, pre, true);
+	emit_mov_imm64(&prog, AUX_REG, mag.m >> 32, (u32)mag.m);
+	EMIT3(0x49, 0xF7, is_signed ? 0xEB : 0xE3);
+	if (is_signed) {
+		/* add rdx, n_reg or sub rdx, n_reg */
+		if (corr)
+			emit_alu_reg(&prog, corr > 0 ? BPF_ADD : BPF_SUB,
+				     BPF_REG_3, n_reg, true);
+		/* sar rdx, s */
+		if (s)
+			emit_shift_imm(&prog, BPF_ARSH, BPF_REG_3, s, true);
+		/* mov rax, rdx; shr rax, 63; add rdx, rax */
+		emit_mov_reg(&prog, true, BPF_REG_0, BPF_REG_3);
+		emit_shift_imm(&prog, BPF_RSH, BPF_REG_0, 63, true);
+		emit_alu_reg(&prog, BPF_ADD, BPF_REG_3, BPF_REG_0, true);
+		q_reg = BPF_REG_3;
+	} else if (!mag.add) {
+		/* shr rdx, s */
+		if (s)
+			emit_shift_imm(&prog, BPF_RSH, BPF_REG_3, s, true);
+		q_reg = BPF_REG_3;
+	} else {
+		/* mov rax, n_reg; sub rax, rdx; shr rax, 1 */
+		emit_mov_reg(&prog, true, BPF_REG_0, n_reg);
+		emit_alu_reg(&prog, BPF_SUB, BPF_REG_0, BPF_REG_3, true);
+		emit_shift_imm(&prog, BPF_RSH, BPF_REG_0, 1, true);
+		/* add rax, rdx; shr rax, s - 1 */
+		emit_alu_reg(&prog, BPF_ADD, BPF_REG_0, BPF_REG_3, true);
+		if (s > 1)
+			emit_shift_imm(&prog, BPF_RSH, BPF_REG_0, s - 1, true);
+		q_reg = BPF_REG_0;
+	}
+
+	if (is_mod) {
+		/* imul q_reg, q_reg, imm32 */
+		maybe_emit_mod(&prog, q_reg, q_reg, true);
+		if (is_imm8(imm32))
+			EMIT3(0x6B, add_2reg(0xC0, q_reg, q_reg), imm32);
+		else
+			EMIT2_off32(0x69, add_2reg(0xC0, q_reg, q_reg), imm32);
+		/* sub n_reg, q_reg */
+		emit_alu_reg(&prog, BPF_SUB, n_reg, q_reg, true);
+		q_reg = n_reg;
+	}
+	if (q_reg != dst_reg)
+		emit_mov_reg(&prog, true, dst_reg, q_reg);
+
+	*pprog = prog;
+	return true;
+}
+
 static void emit_priv_frame_ptr(u8 **pprog, void __percpu *priv_frame_ptr)
 {
 	u8 *prog = *pprog;
@@ -1845,7 +2161,7 @@ static void emit_priv_frame_ptr(u8 **pprog, void __percpu *priv_frame_ptr)
 #define INSN_SZ_DIFF (((addrs[i] - addrs[i - 1]) - (prog - temp)))
 
 #define __LOAD_TCC_PTR(off)			\
-	EMIT3_off32(0x48, 0x8B, 0x85, off)
+	emit_ldx(&prog, BPF_DW, BPF_REG_0, BPF_REG_FP, off)
 /* mov rax, qword ptr [rbp - rounded_stack_depth - 16] */
 #define LOAD_TAIL_CALL_CNT_PTR(stack)				\
 	__LOAD_TCC_PTR(BPF_TAIL_CALL_CNT_PTR_STACK_OFF(stack))
@@ -2000,6 +2316,54 @@ static int emit_kfunc_arena_args(struct bpf_prog *bpf_prog,
 	return prog - start;
 }
 
+/*
+ * A strict compare against 1 or 128 is the non-strict one against 0 or
+ * 127, a strict one against -129 or, with a signed condition, -1 the
+ * non-strict one against -128 or 0: the compare against 0 is a test
+ * without immediate, 127 and -128 fit into an imm8.
+ */
+static void adjust_cmp_imm(u32 *op, s32 *imm)
+{
+	if (*imm == 1 || *imm == 128) {
+		switch (*op) {
+		case BPF_JLT:
+			*op = BPF_JLE;
+			break;
+		case BPF_JGE:
+			*op = BPF_JGT;
+			break;
+		case BPF_JSLT:
+			*op = BPF_JSLE;
+			break;
+		case BPF_JSGE:
+			*op = BPF_JSGT;
+			break;
+		default:
+			return;
+		}
+		*imm -= 1;
+	} else if (*imm == -1 || *imm == -129) {
+		switch (*op) {
+		case BPF_JGT:
+		case BPF_JLE:
+			/* -1 is the largest unsigned value */
+			if (*imm == -1)
+				return;
+			*op = *op == BPF_JGT ? BPF_JGE : BPF_JLT;
+			break;
+		case BPF_JSGT:
+			*op = BPF_JSGE;
+			break;
+		case BPF_JSLE:
+			*op = BPF_JSLT;
+			break;
+		default:
+			return;
+		}
+		*imm += 1;
+	}
+}
+
 static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *addrs, u8 *image,
 		  u8 *rw_image, int oldproglen, struct jit_context *ctx, bool jmp_padding)
 {
@@ -2134,7 +2498,7 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 		u32 dst_reg = insn->dst_reg;
 		u32 src_reg = insn->src_reg;
 		bool accesses_stack_only;
-		u8 b2 = 0, b3 = 0;
+		u8 b3 = 0;
 		u8 *start_of_ldx;
 		s64 jmp_offset;
 		s32 insn_off;
@@ -2142,6 +2506,8 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 		u8 jmp_cond;
 		u8 *func;
 		int nops;
+		u32 jmp_op = BPF_OP(insn->code);
+		s32 cmp_imm;
 
 		if (priv_frame_ptr) {
 			if (src_reg == BPF_REG_FP)
@@ -2172,43 +2538,24 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 		case BPF_ALU64 | BPF_AND | BPF_X:
 		case BPF_ALU64 | BPF_OR | BPF_X:
 		case BPF_ALU64 | BPF_XOR | BPF_X:
-			maybe_emit_mod(&prog, dst_reg, src_reg,
-				       BPF_CLASS(insn->code) == BPF_ALU64);
-			b2 = simple_alu_opcodes[BPF_OP(insn->code)];
-			EMIT2(b2, add_2reg(0xC0, dst_reg, src_reg));
+			emit_alu_reg(&prog, BPF_OP(insn->code), dst_reg, src_reg,
+				     BPF_CLASS(insn->code) == BPF_ALU64);
 			break;
 
 		case BPF_ALU64 | BPF_MOV | BPF_X:
 			if (insn_is_cast_user(insn)) {
-				if (dst_reg != src_reg)
-					/* 32-bit mov */
-					emit_mov_reg(&prog, false, dst_reg, src_reg);
-				/* shl dst_reg, 32 */
-				maybe_emit_1mod(&prog, dst_reg, true);
-				EMIT3(0xC1, add_1reg(0xE0, dst_reg), 32);
-
-				/* or dst_reg, user_vm_start */
-				maybe_emit_1mod(&prog, dst_reg, true);
-				if (is_axreg(dst_reg))
-					EMIT1_off32(0x0D,  user_vm_start >> 32);
-				else
-					EMIT2_off32(0x81, add_1reg(0xC8, dst_reg),  user_vm_start >> 32);
-
-				/* rol dst_reg, 32 */
-				maybe_emit_1mod(&prog, dst_reg, true);
-				EMIT3(0xC1, add_1reg(0xC0, dst_reg), 32);
-
-				/* xor r11, r11 */
-				EMIT3(0x4D, 0x31, 0xDB);
-
-				/* test dst_reg32, dst_reg32; check if lower 32-bit are zero */
+				/* mov dst_reg32, src_reg32 to zero extend the low half */
+				emit_mov_reg(&prog, false, dst_reg, src_reg);
+				/* mov r11, the high half of user_vm_start; or r11, dst_reg */
+				emit_mov_imm64(&prog, AUX_REG, user_vm_start >> 32, 0);
+				emit_alu_reg(&prog, BPF_OR, AUX_REG, dst_reg, true);
+				/* test dst_reg32, dst_reg32; a NULL pointer stays NULL */
 				maybe_emit_mod(&prog, dst_reg, dst_reg, false);
 				EMIT2(0x85, add_2reg(0xC0, dst_reg, dst_reg));
-
-				/* cmove r11, dst_reg; if so, set dst_reg to zero */
+				/* cmovne dst_reg, r11 */
 				/* WARNING: Intel swapped src/dst register encoding in CMOVcc !!! */
 				maybe_emit_mod(&prog, AUX_REG, dst_reg, true);
-				EMIT3(0x0F, 0x44, add_2reg(0xC0, AUX_REG, dst_reg));
+				EMIT3(0x0F, 0x45, add_2reg(0xC0, AUX_REG, dst_reg));
 				break;
 			} else if (insn_is_mov_percpu_addr(insn)) {
 				/* mov <dst>, <src> (if necessary) */
@@ -2236,9 +2583,7 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 			/* neg dst */
 		case BPF_ALU | BPF_NEG:
 		case BPF_ALU64 | BPF_NEG:
-			maybe_emit_1mod(&prog, dst_reg,
-					BPF_CLASS(insn->code) == BPF_ALU64);
-			EMIT2(0xF7, add_1reg(0xD8, dst_reg));
+			emit_neg(&prog, dst_reg, BPF_CLASS(insn->code) == BPF_ALU64);
 			break;
 
 		case BPF_ALU | BPF_ADD | BPF_K:
@@ -2251,42 +2596,23 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 		case BPF_ALU64 | BPF_AND | BPF_K:
 		case BPF_ALU64 | BPF_OR | BPF_K:
 		case BPF_ALU64 | BPF_XOR | BPF_K:
-			maybe_emit_1mod(&prog, dst_reg,
-					BPF_CLASS(insn->code) == BPF_ALU64);
-
-			/*
-			 * b3 holds 'normal' opcode, b2 short form only valid
-			 * in case dst is eax/rax.
-			 */
-			switch (BPF_OP(insn->code)) {
-			case BPF_ADD:
-				b3 = 0xC0;
-				b2 = 0x05;
-				break;
-			case BPF_SUB:
-				b3 = 0xE8;
-				b2 = 0x2D;
-				break;
-			case BPF_AND:
-				b3 = 0xE0;
-				b2 = 0x25;
+			if (BPF_OP(insn->code) == BPF_AND &&
+			    (imm32 == 0xff || imm32 == 0xffff)) {
+				/* movzx dst_reg, dst_reg8/16 */
+				emit_movzx_reg(&prog, imm32 == 0xff ? 8 : 16,
+					       dst_reg, dst_reg);
 				break;
-			case BPF_OR:
-				b3 = 0xC8;
-				b2 = 0x0D;
-				break;
-			case BPF_XOR:
-				b3 = 0xF0;
-				b2 = 0x35;
+			}
+			if (BPF_OP(insn->code) == BPF_XOR && imm32 == -1) {
+				/* not dst_reg */
+				maybe_emit_1mod(&prog, dst_reg,
+						BPF_CLASS(insn->code) == BPF_ALU64);
+				EMIT2(0xF7, add_1reg(0xD0, dst_reg));
 				break;
 			}
 
-			if (is_imm8(imm32))
-				EMIT3(0x83, add_1reg(b3, dst_reg), imm32);
-			else if (is_axreg(dst_reg))
-				EMIT1_off32(b2, imm32);
-			else
-				EMIT2_off32(0x81, add_1reg(b3, dst_reg), imm32);
+			emit_alu_imm(&prog, BPF_OP(insn->code), dst_reg, imm32,
+				     BPF_CLASS(insn->code) == BPF_ALU64);
 			break;
 
 		case BPF_ALU64 | BPF_MOV | BPF_K:
@@ -2317,6 +2643,11 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 			if (dst_reg != BPF_REG_3)
 				EMIT1(0x52); /* push rdx */
 
+			/* LLVM strength-reduces the 32-bit ones itself */
+			if (is64 && BPF_SRC(insn->code) == BPF_K &&
+			    emit_div_const(&prog, insn, dst_reg))
+				goto div_done;
+
 			if (BPF_SRC(insn->code) == BPF_X) {
 				if (src_reg == BPF_REG_0 ||
 				    src_reg == BPF_REG_3) {
@@ -2339,7 +2670,7 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 				 * xor edx, edx
 				 * equivalent to 'xor rdx, rdx', but one byte less
 				 */
-				EMIT2(0x31, 0xd2);
+				emit_mov_imm32(&prog, false, BPF_REG_3, 0);
 
 				/* div src_reg */
 				maybe_emit_1mod(&prog, src_reg, is64);
@@ -2363,7 +2694,7 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 				 dst_reg != BPF_REG_0)
 				/* mov dst_reg, rax */
 				emit_mov_reg(&prog, is64, dst_reg, BPF_REG_0);
-
+div_done:
 			if (dst_reg != BPF_REG_3)
 				EMIT1(0x5A); /* pop rdx */
 			if (dst_reg != BPF_REG_0)
@@ -2373,6 +2704,25 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 
 		case BPF_ALU | BPF_MUL | BPF_K:
 		case BPF_ALU64 | BPF_MUL | BPF_K:
+			/*
+			 * lea for 3, 5 and 9, which LLVM leaves as a
+			 * multiplication, but not for r13, which needs a
+			 * displacement as base and makes the lea a slow three
+			 * operand form on Intel.
+			 */
+			if ((imm32 == 3 || imm32 == 5 || imm32 == 9) &&
+			    !base_needs_disp(dst_reg)) {
+				/* lea dst_reg, [dst_reg + dst_reg * (imm32 - 1)] */
+				if (BPF_CLASS(insn->code) == BPF_ALU64)
+					EMIT1(add_3mod(0x48, dst_reg, dst_reg, dst_reg));
+				else if (is_ereg(dst_reg))
+					EMIT1(add_3mod(0x40, dst_reg, dst_reg, dst_reg));
+				EMIT1(0x8D);
+				emit_insn_suffix_SIB(&prog, dst_reg, dst_reg, dst_reg, 0,
+						     ilog2(imm32 - 1));
+				break;
+			}
+
 			maybe_emit_mod(&prog, dst_reg, dst_reg,
 				       BPF_CLASS(insn->code) == BPF_ALU64);
 
@@ -2403,14 +2753,8 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 		case BPF_ALU64 | BPF_LSH | BPF_K:
 		case BPF_ALU64 | BPF_RSH | BPF_K:
 		case BPF_ALU64 | BPF_ARSH | BPF_K:
-			maybe_emit_1mod(&prog, dst_reg,
-					BPF_CLASS(insn->code) == BPF_ALU64);
-
-			b3 = simple_alu_opcodes[BPF_OP(insn->code)];
-			if (imm32 == 1)
-				EMIT2(0xD1, add_1reg(b3, dst_reg));
-			else
-				EMIT3(0xC1, add_1reg(b3, dst_reg), imm32);
+			emit_shift_imm(&prog, BPF_OP(insn->code), dst_reg,
+				       imm32, BPF_CLASS(insn->code) == BPF_ALU64);
 			break;
 
 		case BPF_ALU | BPF_LSH | BPF_X:
@@ -2419,8 +2763,12 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 		case BPF_ALU64 | BPF_LSH | BPF_X:
 		case BPF_ALU64 | BPF_RSH | BPF_X:
 		case BPF_ALU64 | BPF_ARSH | BPF_X:
-			/* BMI2 shifts aren't better when shift count is already in rcx */
-			if (boot_cpu_has(X86_FEATURE_BMI2) && src_reg != BPF_REG_4) {
+			/*
+			 * BMI2 shifts take the count from any register and,
+			 * unlike the cl forms, are a single uop on Intel, so
+			 * prefer them also when the count already is in rcx.
+			 */
+			if (boot_cpu_has(X86_FEATURE_BMI2)) {
 				/* shrx/sarx/shlx dst_reg, dst_reg, src_reg */
 				bool w = (BPF_CLASS(insn->code) == BPF_ALU64);
 				u8 op;
@@ -2476,18 +2824,16 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 		case BPF_ALU64 | BPF_END | BPF_FROM_LE:
 			switch (imm32) {
 			case 16:
-				/* Emit 'ror %ax, 8' to swap lower 2 bytes */
-				EMIT1(0x66);
+				/* Emit 'bswap eax' to swap lower 4 bytes */
 				if (is_ereg(dst_reg))
 					EMIT1(0x41);
-				EMIT3(0xC1, add_1reg(0xC8, dst_reg), 8);
+				EMIT2(0x0F, add_1reg(0xC8, dst_reg));
 
-				/* Emit 'movzwl eax, ax' */
-				if (is_ereg(dst_reg))
-					EMIT3(0x45, 0x0F, 0xB7);
-				else
-					EMIT2(0x0F, 0xB7);
-				EMIT1(add_2reg(0xC0, dst_reg, dst_reg));
+				/*
+				 * Emit 'shr eax, 16' to move the swapped lower
+				 * 2 bytes back down and zero extend
+				 */
+				emit_shift_imm(&prog, BPF_RSH, dst_reg, 16, false);
 				break;
 			case 32:
 				/* Emit 'bswap eax' to swap lower 4 bytes */
@@ -2512,11 +2858,7 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 				 * Emit 'movzwl eax, ax' to zero extend 16-bit
 				 * into 64 bit
 				 */
-				if (is_ereg(dst_reg))
-					EMIT3(0x45, 0x0F, 0xB7);
-				else
-					EMIT2(0x0F, 0xB7);
-				EMIT1(add_2reg(0xC0, dst_reg, dst_reg));
+				emit_movzx_reg(&prog, 16, dst_reg, dst_reg);
 				break;
 			case 32:
 				/* Emit 'mov eax, eax' to clear upper 32-bits */
@@ -2730,38 +3072,32 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 				 *   src_reg + insn->off > TASK_SIZE_MAX + PAGE_SIZE
 				 *   and
 				 *   src_reg + insn->off < VSYSCALL_ADDR
+				 *
+				 * The check is done on src_reg + insn->off - VSYSCALL_ADDR
+				 * against the next power of two above the limit. Addresses
+				 * between the limit and that power of two are non-canonical
+				 * and would fault anyway, so they get zeroed a bit earlier.
 				 */
 
 				u64 limit = TASK_SIZE_MAX + PAGE_SIZE - VSYSCALL_ADDR;
 				u8 *end_of_jmp;
 
-				/* movabsq r10, VSYSCALL_ADDR */
-				emit_mov_imm64(&prog, BPF_REG_AX, (long)VSYSCALL_ADDR >> 32,
-					       (u32)(long)VSYSCALL_ADDR);
-
-				/* mov src_reg, r11 */
-				EMIT_mov(AUX_REG, src_reg);
-
-				if (insn->off) {
-					/* add r11, insn->off */
-					maybe_emit_1mod(&prog, AUX_REG, true);
-					EMIT2_off32(0x81, add_1reg(0xC0, AUX_REG), insn->off);
-				}
-
-				/* sub r11, r10 */
-				maybe_emit_mod(&prog, AUX_REG, BPF_REG_AX, true);
-				EMIT2(0x29, add_2reg(0xC0, AUX_REG, BPF_REG_AX));
-
-				/* movabsq r10, limit */
-				emit_mov_imm64(&prog, BPF_REG_AX, (long)limit >> 32,
-					       (u32)(long)limit);
+				/*
+				 * lea r11, [src_reg + insn->off - VSYSCALL_ADDR]
+				 *
+				 * VSYSCALL_ADDR is a small negative number, so the
+				 * whole offset fits into the 32-bit displacement.
+				 */
+				BUILD_BUG_ON((long)(s32)VSYSCALL_ADDR != (long)VSYSCALL_ADDR);
+				EMIT2(add_2mod(0x48, src_reg, AUX_REG), 0x8D);
+				emit_insn_suffix(&prog, src_reg, AUX_REG,
+						 insn->off - (s32)VSYSCALL_ADDR);
 
-				/* cmp r10, r11 */
-				maybe_emit_mod(&prog, AUX_REG, BPF_REG_AX, true);
-				EMIT2(0x39, add_2reg(0xC0, AUX_REG, BPF_REG_AX));
+				/* shr r11, fls64(limit) */
+				emit_shift_imm(&prog, BPF_RSH, AUX_REG, fls64(limit), true);
 
-				/* if unsigned '>', goto load */
-				EMIT2(X86_JA, 0);
+				/* if not zero, goto load */
+				EMIT2(X86_JNE, 0);
 				end_of_jmp = prog;
 
 				/* xor dst_reg, dst_reg */
@@ -2769,7 +3105,7 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 				/* jmp byte_after_ldx */
 				EMIT2(0xEB, 0);
 
-				/* populate jmp_offset for JAE above to jump to start_of_ldx */
+				/* populate jmp_offset for JNE above to jump to start_of_ldx */
 				start_of_ldx = prog;
 				end_of_jmp[-1] = start_of_ldx - end_of_jmp;
 			} else if (!accesses_stack_only) {
@@ -2946,8 +3282,10 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 
 			func = (u8 *) __bpf_call_base + imm32;
 			if (src_reg == BPF_PSEUDO_CALL && tail_call_reachable) {
+				u8 *tcc_load = prog;
+
 				LOAD_TAIL_CALL_CNT_PTR(stack_depth);
-				ip += 7;
+				ip += prog - tcc_load;
 			}
 			if (!imm32)
 				return -EINVAL;
@@ -3067,10 +3405,26 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 
 		case BPF_JMP | BPF_JSET | BPF_K:
 		case BPF_JMP32 | BPF_JSET | BPF_K:
+			if ((u32)imm32 <= U8_MAX) {
+				/*
+				 * test dst_reg8, imm8: with the upper bits of the
+				 * mask clear the result only depends on the low byte.
+				 */
+				if (is_ereg_8l(dst_reg))
+					EMIT1(add_1mod(0x40, dst_reg));
+				if (is_axreg(dst_reg))
+					EMIT2(0xA8, imm32);
+				else
+					EMIT3(0xF6, add_1reg(0xC0, dst_reg), imm32);
+				goto emit_cond_jmp;
+			}
 			/* test dst_reg, imm32 */
 			maybe_emit_1mod(&prog, dst_reg,
 					BPF_CLASS(insn->code) == BPF_JMP);
-			EMIT2_off32(0xF7, add_1reg(0xC0, dst_reg), imm32);
+			if (is_axreg(dst_reg))
+				EMIT1_off32(0xA9, imm32);
+			else
+				EMIT2_off32(0xF7, add_1reg(0xC0, dst_reg), imm32);
 			goto emit_cond_jmp;
 
 		case BPF_JMP | BPF_JEQ | BPF_K:
@@ -3093,8 +3447,11 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 		case BPF_JMP32 | BPF_JSLT | BPF_K:
 		case BPF_JMP32 | BPF_JSGE | BPF_K:
 		case BPF_JMP32 | BPF_JSLE | BPF_K:
+			cmp_imm = imm32;
+			adjust_cmp_imm(&jmp_op, &cmp_imm);
+
 			/* test dst_reg, dst_reg to save one extra byte */
-			if (imm32 == 0) {
+			if (cmp_imm == 0) {
 				maybe_emit_mod(&prog, dst_reg, dst_reg,
 					       BPF_CLASS(insn->code) == BPF_JMP);
 				EMIT2(0x85, add_2reg(0xC0, dst_reg, dst_reg));
@@ -3105,13 +3462,15 @@ static int do_jit(struct bpf_verifier_env *env, struct bpf_prog *bpf_prog, int *
 			maybe_emit_1mod(&prog, dst_reg,
 					BPF_CLASS(insn->code) == BPF_JMP);
 
-			if (is_imm8(imm32))
-				EMIT3(0x83, add_1reg(0xF8, dst_reg), imm32);
+			if (is_imm8(cmp_imm))
+				EMIT3(0x83, add_1reg(0xF8, dst_reg), cmp_imm);
+			else if (is_axreg(dst_reg))
+				EMIT1_off32(0x3D, cmp_imm);
 			else
-				EMIT2_off32(0x81, add_1reg(0xF8, dst_reg), imm32);
+				EMIT2_off32(0x81, add_1reg(0xF8, dst_reg), cmp_imm);
 
 emit_cond_jmp:		/* Convert BPF opcode to x86 */
-			switch (BPF_OP(insn->code)) {
+			switch (jmp_op) {
 			case BPF_JEQ:
 				jmp_cond = X86_JE;
 				break;
@@ -3949,13 +4308,8 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im
 	if (im)
 		im->ksym.fp_start = prog - (u8 *)rw_image;
 
-	if (!is_imm8(stack_size)) {
-		/* sub rsp, stack_size */
-		EMIT3_off32(0x48, 0x81, 0xEC, stack_size);
-	} else {
-		/* sub rsp, stack_size */
-		EMIT4(0x48, 0x83, 0xEC, stack_size);
-	}
+	/* sub rsp, stack_size */
+	emit_sub_rsp(&prog, stack_size);
 	if (flags & BPF_TRAMP_F_TAIL_CALL_CTX)
 		EMIT1(0x50);		/* push rax */
 	/* mov QWORD PTR [rbp - rbx_off], rbx */
@@ -4097,7 +4451,7 @@ static int __arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *rw_im
 
 	if (flags & BPF_TRAMP_F_SKIP_FRAME) {
 		/* skip our return address and return to parent */
-		EMIT4(0x48, 0x83, 0xC4, 8); /* add rsp, 8 */
+		emit_add_rsp(&prog, 8); /* add rsp, 8 */
 	}
 	emit_return(&prog, image + (prog - (u8 *)rw_image));
 	/* Make sure the trampoline generation logic doesn't overflow */
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 05c89396119ad..642f0ab8eb2d8 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -172,7 +172,6 @@ struct bpf_prog *bpf_prog_alloc(unsigned int size, gfp_t gfp_extra_flags)
 	}
 	return prog;
 }
-EXPORT_SYMBOL_GPL(bpf_prog_alloc);
 
 int bpf_prog_alloc_jited_linfo(struct bpf_prog *prog)
 {
@@ -1681,7 +1680,6 @@ noinline u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)
 {
 	return 0;
 }
-EXPORT_SYMBOL_GPL(__bpf_call_base);
 
 /* All UAPI available opcodes. */
 #define BPF_INSN_MAP(INSN_2, INSN_3)		\
@@ -2747,7 +2745,6 @@ struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err)
 {
 	return __bpf_prog_select_runtime(NULL, fp, err);
 }
-EXPORT_SYMBOL_GPL(bpf_prog_select_runtime);
 
 static unsigned int __bpf_prog_ret1(const void *ctx,
 				    const struct bpf_insn *insn)
@@ -3138,7 +3135,6 @@ void bpf_prog_free(struct bpf_prog *fp)
 	INIT_WORK(&aux->work, bpf_prog_free_deferred);
 	schedule_work(&aux->work);
 }
-EXPORT_SYMBOL_GPL(bpf_prog_free);
 
 /* RNG for unprivileged user space with separated state from prandom_u32(). */
 static DEFINE_PER_CPU(struct rnd_state, bpf_user_rnd_state);
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 2f34619905b60..d3d3604bedcff 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -2638,19 +2638,6 @@ config TEST_WORKQUEUE
 
 	  If unsure, say N.
 
-config TEST_BPF
-	tristate "Test BPF filter functionality"
-	depends on m && NET
-	help
-	  This builds the "test_bpf" module that runs various test vectors
-	  against the BPF interpreter or BPF JIT compiler depending on the
-	  current setting. This is in particular useful for BPF JIT compiler
-	  development, but also to run regression tests against changes in
-	  the interpreter code. It also enables test stubs for eBPF maps and
-	  verifier used by user space verifier testsuite.
-
-	  If unsure, say N.
-
 config FIND_BIT_BENCHMARK
 	tristate "Test find_bit functions"
 	help
diff --git a/lib/Makefile b/lib/Makefile
index dfab958327c5c..361b02903bef0 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -66,7 +66,6 @@ obj-y += kstrtox.o
 obj-$(CONFIG_FIND_BIT_BENCHMARK) += find_bit_benchmark.o
 obj-$(CONFIG_REGION_ALLOC_BENCHMARK) += region_alloc_benchmark.o
 obj-$(CONFIG_FIND_BIT_BENCHMARK_RUST) += find_bit_benchmark_rust.o
-obj-$(CONFIG_TEST_BPF) += test_bpf.o
 test_dhry-objs := dhry_1.o dhry_2.o dhry_run.o
 obj-$(CONFIG_TEST_DHRY) += test_dhry.o
 obj-$(CONFIG_TEST_FIRMWARE) += test_firmware.o
diff --git a/lib/test_bpf.c b/lib/test_bpf.c
deleted file mode 100644
index af6f3340c034f..0000000000000
--- a/lib/test_bpf.c
+++ /dev/null
@@ -1,15934 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-only
-/*
- * Testsuite for BPF interpreter and BPF JIT compiler
- *
- * Copyright (c) 2011-2014 PLUMgrid, http://plumgrid.com
- */
-
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/filter.h>
-#include <linux/bpf.h>
-#include <linux/skbuff.h>
-#include <linux/netdevice.h>
-#include <linux/if_vlan.h>
-#include <linux/prandom.h>
-#include <linux/highmem.h>
-#include <linux/sched.h>
-
-/* General test specific settings */
-#define MAX_SUBTESTS	3
-#define MAX_TESTRUNS	1000
-#define MAX_DATA	128
-#define MAX_INSNS	512
-#define MAX_K		0xffffFFFF
-
-/* Few constants used to init test 'skb' */
-#define SKB_TYPE	3
-#define SKB_MARK	0x1234aaaa
-#define SKB_HASH	0x1234aaab
-#define SKB_QUEUE_MAP	123
-#define SKB_VLAN_TCI	0xffff
-#define SKB_VLAN_PRESENT	1
-#define SKB_DEV_IFINDEX	577
-#define SKB_DEV_TYPE	588
-
-/* Redefine REGs to make tests less verbose */
-#define R0		BPF_REG_0
-#define R1		BPF_REG_1
-#define R2		BPF_REG_2
-#define R3		BPF_REG_3
-#define R4		BPF_REG_4
-#define R5		BPF_REG_5
-#define R6		BPF_REG_6
-#define R7		BPF_REG_7
-#define R8		BPF_REG_8
-#define R9		BPF_REG_9
-#define R10		BPF_REG_10
-
-/* Flags that can be passed to test cases */
-#define FLAG_NO_DATA		BIT(0)
-#define FLAG_EXPECTED_FAIL	BIT(1)
-#define FLAG_SKB_FRAG		BIT(2)
-#define FLAG_VERIFIER_ZEXT	BIT(3)
-#define FLAG_LARGE_MEM		BIT(4)
-
-enum {
-	CLASSIC  = BIT(6),	/* Old BPF instructions only. */
-	INTERNAL = BIT(7),	/* Extended instruction set.  */
-};
-
-#define TEST_TYPE_MASK		(CLASSIC | INTERNAL)
-
-struct bpf_test {
-	const char *descr;
-	union {
-		struct sock_filter insns[MAX_INSNS];
-		struct bpf_insn insns_int[MAX_INSNS];
-		struct {
-			void *insns;
-			unsigned int len;
-		} ptr;
-	} u;
-	__u8 aux;
-	__u8 data[MAX_DATA];
-	struct {
-		int data_size;
-		__u32 result;
-	} test[MAX_SUBTESTS];
-	int (*fill_helper)(struct bpf_test *self);
-	int expected_errcode; /* used when FLAG_EXPECTED_FAIL is set in the aux */
-	__u8 frag_data[MAX_DATA];
-	int stack_depth; /* for eBPF only, since tests don't call verifier */
-	int nr_testruns; /* Custom run count, defaults to MAX_TESTRUNS if 0 */
-};
-
-/* Large test cases need separate allocation and fill handler. */
-
-static int bpf_fill_maxinsns1(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	__u32 k = ~0;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	for (i = 0; i < len; i++, k--)
-		insn[i] = __BPF_STMT(BPF_RET | BPF_K, k);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns2(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	for (i = 0; i < len; i++)
-		insn[i] = __BPF_STMT(BPF_RET | BPF_K, 0xfefefefe);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns3(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	struct rnd_state rnd;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	prandom_seed_state(&rnd, 3141592653589793238ULL);
-
-	for (i = 0; i < len - 1; i++) {
-		__u32 k = prandom_u32_state(&rnd);
-
-		insn[i] = __BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, k);
-	}
-
-	insn[len - 1] = __BPF_STMT(BPF_RET | BPF_A, 0);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns4(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS + 1;
-	struct sock_filter *insn;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	for (i = 0; i < len; i++)
-		insn[i] = __BPF_STMT(BPF_RET | BPF_K, 0xfefefefe);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns5(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	insn[0] = __BPF_JUMP(BPF_JMP | BPF_JA, len - 2, 0, 0);
-
-	for (i = 1; i < len - 1; i++)
-		insn[i] = __BPF_STMT(BPF_RET | BPF_K, 0xfefefefe);
-
-	insn[len - 1] = __BPF_STMT(BPF_RET | BPF_K, 0xabababab);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns6(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	for (i = 0; i < len - 1; i++)
-		insn[i] = __BPF_STMT(BPF_LD | BPF_W | BPF_ABS, SKF_AD_OFF +
-				     SKF_AD_VLAN_TAG_PRESENT);
-
-	insn[len - 1] = __BPF_STMT(BPF_RET | BPF_A, 0);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns7(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	for (i = 0; i < len - 4; i++)
-		insn[i] = __BPF_STMT(BPF_LD | BPF_W | BPF_ABS, SKF_AD_OFF +
-				     SKF_AD_CPU);
-
-	insn[len - 4] = __BPF_STMT(BPF_MISC | BPF_TAX, 0);
-	insn[len - 3] = __BPF_STMT(BPF_LD | BPF_W | BPF_ABS, SKF_AD_OFF +
-				   SKF_AD_CPU);
-	insn[len - 2] = __BPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0);
-	insn[len - 1] = __BPF_STMT(BPF_RET | BPF_A, 0);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns8(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	int i, jmp_off = len - 3;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	insn[0] = __BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff);
-
-	for (i = 1; i < len - 1; i++)
-		insn[i] = __BPF_JUMP(BPF_JMP | BPF_JGT, 0xffffffff, jmp_off--, 0);
-
-	insn[len - 1] = __BPF_STMT(BPF_RET | BPF_A, 0);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns9(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct bpf_insn *insn;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	insn[0] = BPF_JMP_IMM(BPF_JA, 0, 0, len - 2);
-	insn[1] = BPF_ALU32_IMM(BPF_MOV, R0, 0xcbababab);
-	insn[2] = BPF_EXIT_INSN();
-
-	for (i = 3; i < len - 2; i++)
-		insn[i] = BPF_ALU32_IMM(BPF_MOV, R0, 0xfefefefe);
-
-	insn[len - 2] = BPF_EXIT_INSN();
-	insn[len - 1] = BPF_JMP_IMM(BPF_JA, 0, 0, -(len - 1));
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns10(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS, hlen = len - 2;
-	struct bpf_insn *insn;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	for (i = 0; i < hlen / 2; i++)
-		insn[i] = BPF_JMP_IMM(BPF_JA, 0, 0, hlen - 2 - 2 * i);
-	for (i = hlen - 1; i > hlen / 2; i--)
-		insn[i] = BPF_JMP_IMM(BPF_JA, 0, 0, hlen - 1 - 2 * i);
-
-	insn[hlen / 2] = BPF_JMP_IMM(BPF_JA, 0, 0, hlen / 2 - 1);
-	insn[hlen]     = BPF_ALU32_IMM(BPF_MOV, R0, 0xabababac);
-	insn[hlen + 1] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int __bpf_fill_ja(struct bpf_test *self, unsigned int len,
-			 unsigned int plen)
-{
-	struct sock_filter *insn;
-	unsigned int rlen;
-	int i, j;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	rlen = (len % plen) - 1;
-
-	for (i = 0; i + plen < len; i += plen)
-		for (j = 0; j < plen; j++)
-			insn[i + j] = __BPF_JUMP(BPF_JMP | BPF_JA,
-						 plen - 1 - j, 0, 0);
-	for (j = 0; j < rlen; j++)
-		insn[i + j] = __BPF_JUMP(BPF_JMP | BPF_JA, rlen - 1 - j,
-					 0, 0);
-
-	insn[len - 1] = __BPF_STMT(BPF_RET | BPF_K, 0xababcbac);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns11(struct bpf_test *self)
-{
-	/* Hits 70 passes on x86_64 and triggers NOPs padding. */
-	return __bpf_fill_ja(self, BPF_MAXINSNS, 68);
-}
-
-static int bpf_fill_maxinsns12(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	int i = 0;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	insn[0] = __BPF_JUMP(BPF_JMP | BPF_JA, len - 2, 0, 0);
-
-	for (i = 1; i < len - 1; i++)
-		insn[i] = __BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0);
-
-	insn[len - 1] = __BPF_STMT(BPF_RET | BPF_K, 0xabababab);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_maxinsns13(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	int i = 0;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	for (i = 0; i < len - 3; i++)
-		insn[i] = __BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0);
-
-	insn[len - 3] = __BPF_STMT(BPF_LD | BPF_IMM, 0xabababab);
-	insn[len - 2] = __BPF_STMT(BPF_ALU | BPF_XOR | BPF_X, 0);
-	insn[len - 1] = __BPF_STMT(BPF_RET | BPF_A, 0);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int bpf_fill_ja(struct bpf_test *self)
-{
-	/* Hits exactly 11 passes on x86_64 JIT. */
-	return __bpf_fill_ja(self, 12, 9);
-}
-
-static int bpf_fill_ld_abs_get_processor_id(struct bpf_test *self)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct sock_filter *insn;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	for (i = 0; i < len - 1; i += 2) {
-		insn[i] = __BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 0);
-		insn[i + 1] = __BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-					 SKF_AD_OFF + SKF_AD_CPU);
-	}
-
-	insn[len - 1] = __BPF_STMT(BPF_RET | BPF_K, 0xbee);
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-static int __bpf_fill_stxdw(struct bpf_test *self, int size)
-{
-	unsigned int len = BPF_MAXINSNS;
-	struct bpf_insn *insn;
-	int i;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	insn[0] = BPF_ALU32_IMM(BPF_MOV, R0, 1);
-	insn[1] = BPF_ST_MEM(size, R10, -40, 42);
-
-	for (i = 2; i < len - 2; i++)
-		insn[i] = BPF_STX_XADD(size, R10, R0, -40);
-
-	insn[len - 2] = BPF_LDX_MEM(size, R0, R10, -40);
-	insn[len - 1] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-	self->stack_depth = 40;
-
-	return 0;
-}
-
-static int bpf_fill_stxw(struct bpf_test *self)
-{
-	return __bpf_fill_stxdw(self, BPF_W);
-}
-
-static int bpf_fill_stxdw(struct bpf_test *self)
-{
-	return __bpf_fill_stxdw(self, BPF_DW);
-}
-
-static int __bpf_ld_imm64(struct bpf_insn insns[2], u8 reg, s64 imm64)
-{
-	struct bpf_insn tmp[] = {BPF_LD_IMM64(reg, imm64)};
-
-	memcpy(insns, tmp, sizeof(tmp));
-	return 2;
-}
-
-/*
- * Branch conversion tests. Complex operations can expand to a lot
- * of instructions when JITed. This in turn may cause jump offsets
- * to overflow the field size of the native instruction, triggering
- * a branch conversion mechanism in some JITs.
- */
-static int __bpf_fill_max_jmp(struct bpf_test *self, int jmp, int imm, bool alu32)
-{
-	struct bpf_insn *insns;
-	int len = S16_MAX + 5;
-	int i;
-
-	insns = kmalloc_objs(*insns, len);
-	if (!insns)
-		return -ENOMEM;
-
-	i = __bpf_ld_imm64(insns, R1, 0x0123456789abcdefULL);
-	insns[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 1);
-	insns[i++] = BPF_JMP_IMM(jmp, R0, imm, S16_MAX);
-	insns[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 2);
-	insns[i++] = BPF_EXIT_INSN();
-
-	while (i < len - 1) {
-		static const int ops[] = {
-			BPF_LSH, BPF_RSH, BPF_ARSH, BPF_ADD,
-			BPF_SUB, BPF_MUL, BPF_DIV, BPF_MOD,
-		};
-		int op = ops[(i >> 1) % ARRAY_SIZE(ops)];
-
-		if ((i & 1) || alu32)
-			insns[i++] = BPF_ALU32_REG(op, R0, R1);
-		else
-			insns[i++] = BPF_ALU64_REG(op, R0, R1);
-	}
-
-	insns[i++] = BPF_EXIT_INSN();
-	self->u.ptr.insns = insns;
-	self->u.ptr.len = len;
-	BUG_ON(i != len);
-
-	return 0;
-}
-
-/* Branch taken by runtime decision */
-static int bpf_fill_max_jmp_taken_32(struct bpf_test *self)
-{
-	return __bpf_fill_max_jmp(self, BPF_JEQ, 1, true);
-}
-
-static int bpf_fill_max_jmp_taken(struct bpf_test *self)
-{
-	return __bpf_fill_max_jmp(self, BPF_JEQ, 1, false);
-}
-
-/* Branch not taken by runtime decision */
-static int bpf_fill_max_jmp_not_taken_32(struct bpf_test *self)
-{
-	return __bpf_fill_max_jmp(self, BPF_JEQ, 0, true);
-}
-
-static int bpf_fill_max_jmp_not_taken(struct bpf_test *self)
-{
-	return __bpf_fill_max_jmp(self, BPF_JEQ, 0, false);
-}
-
-/* Branch always taken, known at JIT time */
-static int bpf_fill_max_jmp_always_taken_32(struct bpf_test *self)
-{
-	return __bpf_fill_max_jmp(self, BPF_JGE, 0, true);
-}
-
-static int bpf_fill_max_jmp_always_taken(struct bpf_test *self)
-{
-	return __bpf_fill_max_jmp(self, BPF_JGE, 0, false);
-}
-
-/* Branch never taken, known at JIT time */
-static int bpf_fill_max_jmp_never_taken_32(struct bpf_test *self)
-{
-	return __bpf_fill_max_jmp(self, BPF_JLT, 0, true);
-}
-
-static int bpf_fill_max_jmp_never_taken(struct bpf_test *self)
-{
-	return __bpf_fill_max_jmp(self, BPF_JLT, 0, false);
-}
-
-/* ALU result computation used in tests */
-enum { F_ALU32 = 1, F_SIGNED = 2 };
-
-static bool __bpf_alu_result(u64 *res, u64 v1, u64 v2, u8 op, u32 flags)
-{
-	bool is_signed = flags & F_SIGNED;
-
-	/* Narrow operands for ALU32 */
-	if (flags & F_ALU32) {
-		if (is_signed) {
-			v1 = (u64)(s32)v1;
-			v2 = (u64)(s32)v2;
-		} else {
-			v1 = (u32)v1;
-			v2 = (u32)v2;
-		}
-	}
-
-	*res = 0;
-	switch (op) {
-	case BPF_MOV:
-		*res = v2;
-		break;
-	case BPF_AND:
-		*res = v1 & v2;
-		break;
-	case BPF_OR:
-		*res = v1 | v2;
-		break;
-	case BPF_XOR:
-		*res = v1 ^ v2;
-		break;
-	case BPF_LSH:
-		*res = v1 << v2;
-		break;
-	case BPF_RSH:
-		*res = v1 >> v2;
-		break;
-	case BPF_ARSH:
-		*res = v1 >> v2;
-		if (v2 > 0 && v1 > S64_MAX)
-			*res |= ~0ULL << (64 - v2);
-		break;
-	case BPF_ADD:
-		*res = v1 + v2;
-		break;
-	case BPF_SUB:
-		*res = v1 - v2;
-		break;
-	case BPF_MUL:
-		*res = v1 * v2;
-		break;
-	case BPF_DIV:
-		if (v2 == 0)
-			return false;
-		if (!is_signed) {
-			*res = div64_u64(v1, v2);
-		} else {
-			if ((s64)v2 == -1) /* Handled by verifier */
-				return false;
-			*res = (u64)div64_s64(v1, v2);
-		}
-		break;
-	case BPF_MOD:
-		if (v2 == 0)
-			return false;
-		if (!is_signed) {
-			div64_u64_rem(v1, v2, res);
-		} else {
-			if ((s64)v2 == -1)
-				return false;
-			/*
-			 * Avoid s64 % s64 which generates __moddi3 on
-			 * 32-bit architectures. Use div64_s64 instead.
-			 */
-			*res = (u64)((s64)v1 - div64_s64(v1, v2) * (s64)v2);
-		}
-		break;
-	}
-	return true;
-}
-
-/* Test an ALU shift operation for all valid shift values */
-static int __bpf_fill_alu_shift(struct bpf_test *self, u8 op,
-				u8 mode, u32 flags)
-{
-	static const s64 regs[] = {
-		0x0123456789abcdefLL, /* dword > 0, word < 0 */
-		0xfedcba9876543210LL, /* dword < 0, word > 0 */
-		0xfedcba0198765432LL, /* dword < 0, word < 0 */
-		0x0123458967abcdefLL, /* dword > 0, word > 0 */
-	};
-	int bits = (flags & F_ALU32) ? 32 : 64;
-	int len = (2 + 7 * bits) * ARRAY_SIZE(regs) + 3;
-	struct bpf_insn *insn;
-	int imm, k;
-	int i = 0;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	insn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 0);
-
-	for (k = 0; k < ARRAY_SIZE(regs); k++) {
-		s64 reg = regs[k];
-
-		i += __bpf_ld_imm64(&insn[i], R3, reg);
-
-		for (imm = 0; imm < bits; imm++) {
-			u64 val;
-
-			/* Perform operation */
-			insn[i++] = BPF_ALU64_REG(BPF_MOV, R1, R3);
-			insn[i++] = BPF_ALU64_IMM(BPF_MOV, R2, imm);
-			if (flags & F_ALU32) {
-				if (mode == BPF_K)
-					insn[i++] = BPF_ALU32_IMM(op, R1, imm);
-				else
-					insn[i++] = BPF_ALU32_REG(op, R1, R2);
-
-				if (op == BPF_ARSH)
-					reg = (s32)reg;
-				else
-					reg = (u32)reg;
-				__bpf_alu_result(&val, reg, imm, op, 0);
-				val = (u32)val;
-			} else {
-				if (mode == BPF_K)
-					insn[i++] = BPF_ALU64_IMM(op, R1, imm);
-				else
-					insn[i++] = BPF_ALU64_REG(op, R1, R2);
-				__bpf_alu_result(&val, reg, imm, op, 0);
-			}
-
-			/*
-			 * When debugging a JIT that fails this test, one
-			 * can write the immediate value to R0 here to find
-			 * out which operand values that fail.
-			 */
-
-			/* Load reference and check the result */
-			i += __bpf_ld_imm64(&insn[i], R4, val);
-			insn[i++] = BPF_JMP_REG(BPF_JEQ, R1, R4, 1);
-			insn[i++] = BPF_EXIT_INSN();
-		}
-	}
-
-	insn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 1);
-	insn[i++] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-	BUG_ON(i != len);
-
-	return 0;
-}
-
-static int bpf_fill_alu64_lsh_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_LSH, BPF_K, 0);
-}
-
-static int bpf_fill_alu64_rsh_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_RSH, BPF_K, 0);
-}
-
-static int bpf_fill_alu64_arsh_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_ARSH, BPF_K, 0);
-}
-
-static int bpf_fill_alu64_lsh_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_LSH, BPF_X, 0);
-}
-
-static int bpf_fill_alu64_rsh_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_RSH, BPF_X, 0);
-}
-
-static int bpf_fill_alu64_arsh_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_ARSH, BPF_X, 0);
-}
-
-static int bpf_fill_alu32_lsh_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_LSH, BPF_K, F_ALU32);
-}
-
-static int bpf_fill_alu32_rsh_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_RSH, BPF_K, F_ALU32);
-}
-
-static int bpf_fill_alu32_arsh_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_ARSH, BPF_K, F_ALU32);
-}
-
-static int bpf_fill_alu32_lsh_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_LSH, BPF_X, F_ALU32);
-}
-
-static int bpf_fill_alu32_rsh_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_RSH, BPF_X, F_ALU32);
-}
-
-static int bpf_fill_alu32_arsh_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift(self, BPF_ARSH, BPF_X, F_ALU32);
-}
-
-/*
- * Test an ALU register shift operation for all valid shift values
- * for the case when the source and destination are the same.
- */
-static int __bpf_fill_alu_shift_same_reg(struct bpf_test *self, u8 op,
-					 u32 flags)
-{
-	int bits = (flags & F_ALU32) ? 32 : 64;
-	int len = 3 + 6 * bits;
-	struct bpf_insn *insn;
-	int i = 0;
-	u64 val;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	insn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 0);
-
-	for (val = 0; val < bits; val++) {
-		u64 res;
-
-		/* Perform operation */
-		insn[i++] = BPF_ALU64_IMM(BPF_MOV, R1, val);
-		if (flags & F_ALU32)
-			insn[i++] = BPF_ALU32_REG(op, R1, R1);
-		else
-			insn[i++] = BPF_ALU64_REG(op, R1, R1);
-
-		/* Compute the reference result */
-		__bpf_alu_result(&res, val, val, op, 0);
-		if (flags & F_ALU32)
-			res = (u32)res;
-		i += __bpf_ld_imm64(&insn[i], R2, res);
-
-		/* Check the actual result */
-		insn[i++] = BPF_JMP_REG(BPF_JEQ, R1, R2, 1);
-		insn[i++] = BPF_EXIT_INSN();
-	}
-
-	insn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 1);
-	insn[i++] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-	BUG_ON(i != len);
-
-	return 0;
-}
-
-static int bpf_fill_alu64_lsh_same_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift_same_reg(self, BPF_LSH, 0);
-}
-
-static int bpf_fill_alu64_rsh_same_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift_same_reg(self, BPF_RSH, 0);
-}
-
-static int bpf_fill_alu64_arsh_same_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift_same_reg(self, BPF_ARSH, 0);
-}
-
-static int bpf_fill_alu32_lsh_same_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift_same_reg(self, BPF_LSH, F_ALU32);
-}
-
-static int bpf_fill_alu32_rsh_same_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift_same_reg(self, BPF_RSH, F_ALU32);
-}
-
-static int bpf_fill_alu32_arsh_same_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu_shift_same_reg(self, BPF_ARSH, F_ALU32);
-}
-
-/*
- * Common operand pattern generator for exhaustive power-of-two magnitudes
- * tests. The block size parameters can be adjusted to increase/reduce the
- * number of combinatons tested and thereby execution speed and memory
- * footprint.
- */
-
-static inline s64 value(int msb, int delta, int sign)
-{
-	return sign * (1LL << msb) + delta;
-}
-
-static int __bpf_fill_pattern(struct bpf_test *self, void *arg,
-			      int dbits, int sbits, int block1, int block2,
-			      int (*emit)(struct bpf_test*, void*,
-					  struct bpf_insn*, s64, s64))
-{
-	static const int sgn[][2] = {{1, 1}, {1, -1}, {-1, 1}, {-1, -1}};
-	struct bpf_insn *insns;
-	int di, si, bt, db, sb;
-	int count, len, k;
-	int extra = 1 + 2;
-	int i = 0;
-
-	/* Total number of iterations for the two pattern */
-	count = (dbits - 1) * (sbits - 1) * block1 * block1 * ARRAY_SIZE(sgn);
-	count += (max(dbits, sbits) - 1) * block2 * block2 * ARRAY_SIZE(sgn);
-
-	/* Compute the maximum number of insns and allocate the buffer */
-	len = extra + count * (*emit)(self, arg, NULL, 0, 0);
-	insns = kmalloc_array(len, sizeof(*insns), GFP_KERNEL);
-	if (!insns)
-		return -ENOMEM;
-
-	/* Add head instruction(s) */
-	insns[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 0);
-
-	/*
-	 * Pattern 1: all combinations of power-of-two magnitudes and sign,
-	 * and with a block of contiguous values around each magnitude.
-	 */
-	for (di = 0; di < dbits - 1; di++)                 /* Dst magnitudes */
-		for (si = 0; si < sbits - 1; si++)         /* Src magnitudes */
-			for (k = 0; k < ARRAY_SIZE(sgn); k++) /* Sign combos */
-				for (db = -(block1 / 2);
-				     db < (block1 + 1) / 2; db++)
-					for (sb = -(block1 / 2);
-					     sb < (block1 + 1) / 2; sb++) {
-						s64 dst, src;
-
-						dst = value(di, db, sgn[k][0]);
-						src = value(si, sb, sgn[k][1]);
-						i += (*emit)(self, arg,
-							     &insns[i],
-							     dst, src);
-					}
-	/*
-	 * Pattern 2: all combinations for a larger block of values
-	 * for each power-of-two magnitude and sign, where the magnitude is
-	 * the same for both operands.
-	 */
-	for (bt = 0; bt < max(dbits, sbits) - 1; bt++)        /* Magnitude   */
-		for (k = 0; k < ARRAY_SIZE(sgn); k++)         /* Sign combos */
-			for (db = -(block2 / 2); db < (block2 + 1) / 2; db++)
-				for (sb = -(block2 / 2);
-				     sb < (block2 + 1) / 2; sb++) {
-					s64 dst, src;
-
-					dst = value(bt % dbits, db, sgn[k][0]);
-					src = value(bt % sbits, sb, sgn[k][1]);
-					i += (*emit)(self, arg, &insns[i],
-						     dst, src);
-				}
-
-	/* Append tail instructions */
-	insns[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 1);
-	insns[i++] = BPF_EXIT_INSN();
-	BUG_ON(i > len);
-
-	self->u.ptr.insns = insns;
-	self->u.ptr.len = i;
-
-	return 0;
-}
-
-/*
- * Block size parameters used in pattern tests below. une as needed to
- * increase/reduce the number combinations tested, see following examples.
- *        block   values per operand MSB
- * ----------------------------------------
- *           0     none
- *           1     (1 << MSB)
- *           2     (1 << MSB) + [-1, 0]
- *           3     (1 << MSB) + [-1, 0, 1]
- */
-#define PATTERN_BLOCK1 1
-#define PATTERN_BLOCK2 5
-
-/* Number of test runs for a pattern test */
-#define NR_PATTERN_RUNS 1
-
-/*
- * Exhaustive tests of ALU operations for all combinations of power-of-two
- * magnitudes of the operands, both for positive and negative values. The
- * test is designed to verify e.g. the ALU and ALU64 operations for JITs that
- * emit different code depending on the magnitude of the immediate value.
- */
-static int __bpf_emit_alu64_imm(struct bpf_test *self, void *arg,
-				struct bpf_insn *insns, s64 dst, s64 imm)
-{
-	int *a = arg;
-	int op = a[0];
-	u32 flags = a[1];
-	s16 off = (flags & F_SIGNED) ? 1 : 0;
-	int i = 0;
-	u64 res;
-
-	if (!insns)
-		return 7;
-
-	if (__bpf_alu_result(&res, dst, (s32)imm, op, flags)) {
-		i += __bpf_ld_imm64(&insns[i], R1, dst);
-		i += __bpf_ld_imm64(&insns[i], R3, res);
-		insns[i++] = BPF_ALU64_IMM_OFF(op, R1, imm, off);
-		insns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 1);
-		insns[i++] = BPF_EXIT_INSN();
-	}
-
-	return i;
-}
-
-static int __bpf_emit_alu32_imm(struct bpf_test *self, void *arg,
-				struct bpf_insn *insns, s64 dst, s64 imm)
-{
-	int *a = arg;
-	int op = a[0];
-	u32 flags = a[1];
-	s16 off = (flags & F_SIGNED) ? 1 : 0;
-	int i = 0;
-	u64 res;
-
-	if (!insns)
-		return 7;
-
-	if (__bpf_alu_result(&res, dst, (s32)imm, op, flags | F_ALU32)) {
-		i += __bpf_ld_imm64(&insns[i], R1, dst);
-		i += __bpf_ld_imm64(&insns[i], R3, (u32)res);
-		insns[i++] = BPF_ALU32_IMM_OFF(op, R1, imm, off);
-		insns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 1);
-		insns[i++] = BPF_EXIT_INSN();
-	}
-
-	return i;
-}
-
-static int __bpf_emit_alu64_reg(struct bpf_test *self, void *arg,
-				struct bpf_insn *insns, s64 dst, s64 src)
-{
-	int op = *(int *)arg;
-	int i = 0;
-	u64 res;
-
-	if (!insns)
-		return 9;
-
-	if (__bpf_alu_result(&res, dst, src, op, 0)) {
-		i += __bpf_ld_imm64(&insns[i], R1, dst);
-		i += __bpf_ld_imm64(&insns[i], R2, src);
-		i += __bpf_ld_imm64(&insns[i], R3, res);
-		insns[i++] = BPF_ALU64_REG(op, R1, R2);
-		insns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 1);
-		insns[i++] = BPF_EXIT_INSN();
-	}
-
-	return i;
-}
-
-static int __bpf_emit_alu32_reg(struct bpf_test *self, void *arg,
-				struct bpf_insn *insns, s64 dst, s64 src)
-{
-	int op = *(int *)arg;
-	int i = 0;
-	u64 res;
-
-	if (!insns)
-		return 9;
-
-	if (__bpf_alu_result(&res, (u32)dst, (u32)src, op, 0)) {
-		i += __bpf_ld_imm64(&insns[i], R1, dst);
-		i += __bpf_ld_imm64(&insns[i], R2, src);
-		i += __bpf_ld_imm64(&insns[i], R3, (u32)res);
-		insns[i++] = BPF_ALU32_REG(op, R1, R2);
-		insns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 1);
-		insns[i++] = BPF_EXIT_INSN();
-	}
-
-	return i;
-}
-
-static int __bpf_fill_alu64_imm(struct bpf_test *self, int op, u32 flags)
-{
-	int arg[2] = {op, flags};
-
-	return __bpf_fill_pattern(self, &arg, 64, 32,
-				  PATTERN_BLOCK1, PATTERN_BLOCK2,
-				  &__bpf_emit_alu64_imm);
-}
-
-static int __bpf_fill_alu32_imm(struct bpf_test *self, int op, u32 flags)
-{
-	int arg[2] = {op, flags};
-
-	return __bpf_fill_pattern(self, &arg, 64, 32,
-				  PATTERN_BLOCK1, PATTERN_BLOCK2,
-				  &__bpf_emit_alu32_imm);
-}
-
-static int __bpf_fill_alu64_reg(struct bpf_test *self, int op)
-{
-	return __bpf_fill_pattern(self, &op, 64, 64,
-				  PATTERN_BLOCK1, PATTERN_BLOCK2,
-				  &__bpf_emit_alu64_reg);
-}
-
-static int __bpf_fill_alu32_reg(struct bpf_test *self, int op)
-{
-	return __bpf_fill_pattern(self, &op, 64, 64,
-				  PATTERN_BLOCK1, PATTERN_BLOCK2,
-				  &__bpf_emit_alu32_reg);
-}
-
-/* ALU64 immediate operations */
-static int bpf_fill_alu64_mov_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_MOV, 0);
-}
-
-static int bpf_fill_alu64_and_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_AND, 0);
-}
-
-static int bpf_fill_alu64_or_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_OR, 0);
-}
-
-static int bpf_fill_alu64_xor_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_XOR, 0);
-}
-
-static int bpf_fill_alu64_add_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_ADD, 0);
-}
-
-static int bpf_fill_alu64_sub_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_SUB, 0);
-}
-
-static int bpf_fill_alu64_mul_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_MUL, 0);
-}
-
-static int bpf_fill_alu64_div_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_DIV, 0);
-}
-
-static int bpf_fill_alu64_mod_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_MOD, 0);
-}
-
-/* Signed ALU64 immediate operations */
-static int bpf_fill_alu64_sdiv_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_DIV, F_SIGNED);
-}
-
-static int bpf_fill_alu64_smod_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_imm(self, BPF_MOD, F_SIGNED);
-}
-
-/* Signed ALU32 immediate operations */
-static int bpf_fill_alu32_sdiv_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_DIV, F_SIGNED);
-}
-
-static int bpf_fill_alu32_smod_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_MOD, F_SIGNED);
-}
-
-/* ALU32 immediate operations */
-static int bpf_fill_alu32_mov_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_MOV, 0);
-}
-
-static int bpf_fill_alu32_and_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_AND, 0);
-}
-
-static int bpf_fill_alu32_or_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_OR, 0);
-}
-
-static int bpf_fill_alu32_xor_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_XOR, 0);
-}
-
-static int bpf_fill_alu32_add_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_ADD, 0);
-}
-
-static int bpf_fill_alu32_sub_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_SUB, 0);
-}
-
-static int bpf_fill_alu32_mul_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_MUL, 0);
-}
-
-static int bpf_fill_alu32_div_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_DIV, 0);
-}
-
-static int bpf_fill_alu32_mod_imm(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_imm(self, BPF_MOD, 0);
-}
-
-/* ALU64 register operations */
-static int bpf_fill_alu64_mov_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_reg(self, BPF_MOV);
-}
-
-static int bpf_fill_alu64_and_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_reg(self, BPF_AND);
-}
-
-static int bpf_fill_alu64_or_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_reg(self, BPF_OR);
-}
-
-static int bpf_fill_alu64_xor_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_reg(self, BPF_XOR);
-}
-
-static int bpf_fill_alu64_add_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_reg(self, BPF_ADD);
-}
-
-static int bpf_fill_alu64_sub_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_reg(self, BPF_SUB);
-}
-
-static int bpf_fill_alu64_mul_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_reg(self, BPF_MUL);
-}
-
-static int bpf_fill_alu64_div_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_reg(self, BPF_DIV);
-}
-
-static int bpf_fill_alu64_mod_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu64_reg(self, BPF_MOD);
-}
-
-/* ALU32 register operations */
-static int bpf_fill_alu32_mov_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_reg(self, BPF_MOV);
-}
-
-static int bpf_fill_alu32_and_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_reg(self, BPF_AND);
-}
-
-static int bpf_fill_alu32_or_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_reg(self, BPF_OR);
-}
-
-static int bpf_fill_alu32_xor_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_reg(self, BPF_XOR);
-}
-
-static int bpf_fill_alu32_add_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_reg(self, BPF_ADD);
-}
-
-static int bpf_fill_alu32_sub_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_reg(self, BPF_SUB);
-}
-
-static int bpf_fill_alu32_mul_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_reg(self, BPF_MUL);
-}
-
-static int bpf_fill_alu32_div_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_reg(self, BPF_DIV);
-}
-
-static int bpf_fill_alu32_mod_reg(struct bpf_test *self)
-{
-	return __bpf_fill_alu32_reg(self, BPF_MOD);
-}
-
-/*
- * Test JITs that implement complex ALU operations as function
- * calls, and must re-arrange operands for argument passing.
- */
-static int __bpf_fill_alu_imm_regs(struct bpf_test *self, u8 op,
-				    u32 flags)
-{
-	int len = 2 + 10 * 10;
-	struct bpf_insn *insns;
-	u64 dst, res;
-	int i = 0;
-	u32 imm;
-	int rd;
-
-	insns = kmalloc_objs(*insns, len);
-	if (!insns)
-		return -ENOMEM;
-
-	/* Operand and result values according to operation */
-	if (flags & F_SIGNED) {
-		if (flags & F_ALU32)
-			dst = -76543210;
-		else
-			dst = -7654321076543210LL;
-	} else {
-		if (flags & F_ALU32)
-			dst = 0x76543210U;
-		else
-			dst = 0x7edcba9876543210ULL;
-	}
-	imm = 0x01234567U;
-
-	if (op == BPF_LSH || op == BPF_RSH || op == BPF_ARSH)
-		imm &= 31;
-
-	__bpf_alu_result(&res, dst, imm, op, flags);
-
-	if (flags & F_ALU32)
-		res = (u32)res;
-
-	/* Check all operand registers */
-	for (rd = R0; rd <= R9; rd++) {
-		i += __bpf_ld_imm64(&insns[i], rd, dst);
-
-		s16 off = (flags & F_SIGNED) ? 1 : 0;
-
-		if (flags & F_ALU32)
-			insns[i++] = BPF_ALU32_IMM_OFF(op, rd, imm, off);
-		else
-			insns[i++] = BPF_ALU64_IMM_OFF(op, rd, imm, off);
-
-		insns[i++] = BPF_JMP32_IMM(BPF_JEQ, rd, res, 2);
-		insns[i++] = BPF_MOV64_IMM(R0, __LINE__);
-		insns[i++] = BPF_EXIT_INSN();
-
-		insns[i++] = BPF_ALU64_IMM(BPF_RSH, rd, 32);
-		insns[i++] = BPF_JMP32_IMM(BPF_JEQ, rd, res >> 32, 2);
-		insns[i++] = BPF_MOV64_IMM(R0, __LINE__);
-		insns[i++] = BPF_EXIT_INSN();
-	}
-
-	insns[i++] = BPF_MOV64_IMM(R0, 1);
-	insns[i++] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insns;
-	self->u.ptr.len = len;
-	BUG_ON(i != len);
-
-	return 0;
-}
-
-/* ALU64 K registers */
-static int bpf_fill_alu64_mov_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_MOV, 0);
-}
-
-static int bpf_fill_alu64_and_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_AND, 0);
-}
-
-static int bpf_fill_alu64_or_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_OR, 0);
-}
-
-static int bpf_fill_alu64_xor_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_XOR, 0);
-}
-
-static int bpf_fill_alu64_lsh_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_LSH, 0);
-}
-
-static int bpf_fill_alu64_rsh_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_RSH, 0);
-}
-
-static int bpf_fill_alu64_arsh_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_ARSH, 0);
-}
-
-static int bpf_fill_alu64_add_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_ADD, 0);
-}
-
-static int bpf_fill_alu64_sub_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_SUB, 0);
-}
-
-static int bpf_fill_alu64_mul_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_MUL, 0);
-}
-
-static int bpf_fill_alu64_div_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_DIV, 0);
-}
-
-static int bpf_fill_alu64_mod_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_MOD, 0);
-}
-
-/* Signed ALU64 K registers */
-static int bpf_fill_alu64_sdiv_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_DIV, F_SIGNED);
-}
-
-static int bpf_fill_alu64_smod_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_MOD, F_SIGNED);
-}
-
-/* ALU32 K registers */
-static int bpf_fill_alu32_mov_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_MOV, F_ALU32);
-}
-
-static int bpf_fill_alu32_and_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_AND, F_ALU32);
-}
-
-static int bpf_fill_alu32_or_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_OR, F_ALU32);
-}
-
-static int bpf_fill_alu32_xor_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_XOR, F_ALU32);
-}
-
-static int bpf_fill_alu32_lsh_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_LSH, F_ALU32);
-}
-
-static int bpf_fill_alu32_rsh_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_RSH, F_ALU32);
-}
-
-static int bpf_fill_alu32_arsh_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_ARSH, F_ALU32);
-}
-
-static int bpf_fill_alu32_add_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_ADD, F_ALU32);
-}
-
-static int bpf_fill_alu32_sub_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_SUB, F_ALU32);
-}
-
-static int bpf_fill_alu32_mul_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_MUL, F_ALU32);
-}
-
-static int bpf_fill_alu32_div_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_DIV, F_ALU32);
-}
-
-static int bpf_fill_alu32_mod_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_MOD, F_ALU32);
-}
-
-/* Signed ALU32 K registers */
-static int bpf_fill_alu32_sdiv_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_DIV, F_ALU32 | F_SIGNED);
-}
-
-static int bpf_fill_alu32_smod_imm_regs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_imm_regs(self, BPF_MOD, F_ALU32 | F_SIGNED);
-}
-
-/*
- * Test JITs that implement complex ALU operations as function
- * calls, and must re-arrange operands for argument passing.
- */
-static int __bpf_fill_alu_reg_pairs(struct bpf_test *self, u8 op, bool alu32)
-{
-	int len = 2 + 10 * 10 * 12;
-	u64 dst, src, res, same;
-	struct bpf_insn *insns;
-	int rd, rs;
-	int i = 0;
-
-	insns = kmalloc_objs(*insns, len);
-	if (!insns)
-		return -ENOMEM;
-
-	/* Operand and result values according to operation */
-	if (alu32) {
-		dst = 0x76543210U;
-		src = 0x01234567U;
-	} else {
-		dst = 0x7edcba9876543210ULL;
-		src = 0x0123456789abcdefULL;
-	}
-
-	if (op == BPF_LSH || op == BPF_RSH || op == BPF_ARSH)
-		src &= 31;
-
-	__bpf_alu_result(&res, dst, src, op, 0);
-	__bpf_alu_result(&same, src, src, op, 0);
-
-	if (alu32) {
-		res = (u32)res;
-		same = (u32)same;
-	}
-
-	/* Check all combinations of operand registers */
-	for (rd = R0; rd <= R9; rd++) {
-		for (rs = R0; rs <= R9; rs++) {
-			u64 val = rd == rs ? same : res;
-
-			i += __bpf_ld_imm64(&insns[i], rd, dst);
-			i += __bpf_ld_imm64(&insns[i], rs, src);
-
-			if (alu32)
-				insns[i++] = BPF_ALU32_REG(op, rd, rs);
-			else
-				insns[i++] = BPF_ALU64_REG(op, rd, rs);
-
-			insns[i++] = BPF_JMP32_IMM(BPF_JEQ, rd, val, 2);
-			insns[i++] = BPF_MOV64_IMM(R0, __LINE__);
-			insns[i++] = BPF_EXIT_INSN();
-
-			insns[i++] = BPF_ALU64_IMM(BPF_RSH, rd, 32);
-			insns[i++] = BPF_JMP32_IMM(BPF_JEQ, rd, val >> 32, 2);
-			insns[i++] = BPF_MOV64_IMM(R0, __LINE__);
-			insns[i++] = BPF_EXIT_INSN();
-		}
-	}
-
-	insns[i++] = BPF_MOV64_IMM(R0, 1);
-	insns[i++] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insns;
-	self->u.ptr.len = len;
-	BUG_ON(i != len);
-
-	return 0;
-}
-
-/* ALU64 X register combinations */
-static int bpf_fill_alu64_mov_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_MOV, false);
-}
-
-static int bpf_fill_alu64_and_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_AND, false);
-}
-
-static int bpf_fill_alu64_or_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_OR, false);
-}
-
-static int bpf_fill_alu64_xor_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_XOR, false);
-}
-
-static int bpf_fill_alu64_lsh_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_LSH, false);
-}
-
-static int bpf_fill_alu64_rsh_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_RSH, false);
-}
-
-static int bpf_fill_alu64_arsh_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_ARSH, false);
-}
-
-static int bpf_fill_alu64_add_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_ADD, false);
-}
-
-static int bpf_fill_alu64_sub_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_SUB, false);
-}
-
-static int bpf_fill_alu64_mul_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_MUL, false);
-}
-
-static int bpf_fill_alu64_div_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_DIV, false);
-}
-
-static int bpf_fill_alu64_mod_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_MOD, false);
-}
-
-/* ALU32 X register combinations */
-static int bpf_fill_alu32_mov_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_MOV, true);
-}
-
-static int bpf_fill_alu32_and_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_AND, true);
-}
-
-static int bpf_fill_alu32_or_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_OR, true);
-}
-
-static int bpf_fill_alu32_xor_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_XOR, true);
-}
-
-static int bpf_fill_alu32_lsh_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_LSH, true);
-}
-
-static int bpf_fill_alu32_rsh_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_RSH, true);
-}
-
-static int bpf_fill_alu32_arsh_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_ARSH, true);
-}
-
-static int bpf_fill_alu32_add_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_ADD, true);
-}
-
-static int bpf_fill_alu32_sub_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_SUB, true);
-}
-
-static int bpf_fill_alu32_mul_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_MUL, true);
-}
-
-static int bpf_fill_alu32_div_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_DIV, true);
-}
-
-static int bpf_fill_alu32_mod_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_alu_reg_pairs(self, BPF_MOD, true);
-}
-
-/*
- * Exhaustive tests of atomic operations for all power-of-two operand
- * magnitudes, both for positive and negative values.
- */
-
-static int __bpf_emit_atomic64(struct bpf_test *self, void *arg,
-			       struct bpf_insn *insns, s64 dst, s64 src)
-{
-	int op = *(int *)arg;
-	u64 keep, fetch, res;
-	int i = 0;
-
-	if (!insns)
-		return 21;
-
-	switch (op) {
-	case BPF_XCHG:
-		res = src;
-		break;
-	default:
-		__bpf_alu_result(&res, dst, src, BPF_OP(op), 0);
-	}
-
-	keep = 0x0123456789abcdefULL;
-	if (op & BPF_FETCH)
-		fetch = dst;
-	else
-		fetch = src;
-
-	i += __bpf_ld_imm64(&insns[i], R0, keep);
-	i += __bpf_ld_imm64(&insns[i], R1, dst);
-	i += __bpf_ld_imm64(&insns[i], R2, src);
-	i += __bpf_ld_imm64(&insns[i], R3, res);
-	i += __bpf_ld_imm64(&insns[i], R4, fetch);
-	i += __bpf_ld_imm64(&insns[i], R5, keep);
-
-	insns[i++] = BPF_STX_MEM(BPF_DW, R10, R1, -8);
-	insns[i++] = BPF_ATOMIC_OP(BPF_DW, op, R10, R2, -8);
-	insns[i++] = BPF_LDX_MEM(BPF_DW, R1, R10, -8);
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 1);
-	insns[i++] = BPF_EXIT_INSN();
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R2, R4, 1);
-	insns[i++] = BPF_EXIT_INSN();
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R0, R5, 1);
-	insns[i++] = BPF_EXIT_INSN();
-
-	return i;
-}
-
-static int __bpf_emit_atomic32(struct bpf_test *self, void *arg,
-			       struct bpf_insn *insns, s64 dst, s64 src)
-{
-	int op = *(int *)arg;
-	u64 keep, fetch, res;
-	int i = 0;
-
-	if (!insns)
-		return 21;
-
-	switch (op) {
-	case BPF_XCHG:
-		res = src;
-		break;
-	default:
-		__bpf_alu_result(&res, (u32)dst, (u32)src, BPF_OP(op), 0);
-	}
-
-	keep = 0x0123456789abcdefULL;
-	if (op & BPF_FETCH)
-		fetch = (u32)dst;
-	else
-		fetch = src;
-
-	i += __bpf_ld_imm64(&insns[i], R0, keep);
-	i += __bpf_ld_imm64(&insns[i], R1, (u32)dst);
-	i += __bpf_ld_imm64(&insns[i], R2, src);
-	i += __bpf_ld_imm64(&insns[i], R3, (u32)res);
-	i += __bpf_ld_imm64(&insns[i], R4, fetch);
-	i += __bpf_ld_imm64(&insns[i], R5, keep);
-
-	insns[i++] = BPF_STX_MEM(BPF_W, R10, R1, -4);
-	insns[i++] = BPF_ATOMIC_OP(BPF_W, op, R10, R2, -4);
-	insns[i++] = BPF_LDX_MEM(BPF_W, R1, R10, -4);
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 1);
-	insns[i++] = BPF_EXIT_INSN();
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R2, R4, 1);
-	insns[i++] = BPF_EXIT_INSN();
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R0, R5, 1);
-	insns[i++] = BPF_EXIT_INSN();
-
-	return i;
-}
-
-static int __bpf_emit_cmpxchg64(struct bpf_test *self, void *arg,
-				struct bpf_insn *insns, s64 dst, s64 src)
-{
-	int i = 0;
-
-	if (!insns)
-		return 23;
-
-	i += __bpf_ld_imm64(&insns[i], R0, ~dst);
-	i += __bpf_ld_imm64(&insns[i], R1, dst);
-	i += __bpf_ld_imm64(&insns[i], R2, src);
-
-	/* Result unsuccessful */
-	insns[i++] = BPF_STX_MEM(BPF_DW, R10, R1, -8);
-	insns[i++] = BPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -8);
-	insns[i++] = BPF_LDX_MEM(BPF_DW, R3, R10, -8);
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R1, R3, 2);
-	insns[i++] = BPF_MOV64_IMM(R0, __LINE__);
-	insns[i++] = BPF_EXIT_INSN();
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R0, R3, 2);
-	insns[i++] = BPF_MOV64_IMM(R0, __LINE__);
-	insns[i++] = BPF_EXIT_INSN();
-
-	/* Result successful */
-	insns[i++] = BPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -8);
-	insns[i++] = BPF_LDX_MEM(BPF_DW, R3, R10, -8);
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R2, R3, 2);
-	insns[i++] = BPF_MOV64_IMM(R0, __LINE__);
-	insns[i++] = BPF_EXIT_INSN();
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R0, R1, 2);
-	insns[i++] = BPF_MOV64_IMM(R0, __LINE__);
-	insns[i++] = BPF_EXIT_INSN();
-
-	return i;
-}
-
-static int __bpf_emit_cmpxchg32(struct bpf_test *self, void *arg,
-				struct bpf_insn *insns, s64 dst, s64 src)
-{
-	int i = 0;
-
-	if (!insns)
-		return 27;
-
-	i += __bpf_ld_imm64(&insns[i], R0, ~dst);
-	i += __bpf_ld_imm64(&insns[i], R1, (u32)dst);
-	i += __bpf_ld_imm64(&insns[i], R2, src);
-
-	/* Result unsuccessful */
-	insns[i++] = BPF_STX_MEM(BPF_W, R10, R1, -4);
-	insns[i++] = BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R2, -4);
-	insns[i++] = BPF_ZEXT_REG(R0); /* Zext always inserted by verifier */
-	insns[i++] = BPF_LDX_MEM(BPF_W, R3, R10, -4);
-
-	insns[i++] = BPF_JMP32_REG(BPF_JEQ, R1, R3, 2);
-	insns[i++] = BPF_MOV32_IMM(R0, __LINE__);
-	insns[i++] = BPF_EXIT_INSN();
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R0, R3, 2);
-	insns[i++] = BPF_MOV32_IMM(R0, __LINE__);
-	insns[i++] = BPF_EXIT_INSN();
-
-	/* Result successful */
-	i += __bpf_ld_imm64(&insns[i], R0, dst);
-	insns[i++] = BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R2, -4);
-	insns[i++] = BPF_ZEXT_REG(R0); /* Zext always inserted by verifier */
-	insns[i++] = BPF_LDX_MEM(BPF_W, R3, R10, -4);
-
-	insns[i++] = BPF_JMP32_REG(BPF_JEQ, R2, R3, 2);
-	insns[i++] = BPF_MOV32_IMM(R0, __LINE__);
-	insns[i++] = BPF_EXIT_INSN();
-
-	insns[i++] = BPF_JMP_REG(BPF_JEQ, R0, R1, 2);
-	insns[i++] = BPF_MOV32_IMM(R0, __LINE__);
-	insns[i++] = BPF_EXIT_INSN();
-
-	return i;
-}
-
-static int __bpf_fill_atomic64(struct bpf_test *self, int op)
-{
-	return __bpf_fill_pattern(self, &op, 64, 64,
-				  0, PATTERN_BLOCK2,
-				  &__bpf_emit_atomic64);
-}
-
-static int __bpf_fill_atomic32(struct bpf_test *self, int op)
-{
-	return __bpf_fill_pattern(self, &op, 64, 64,
-				  0, PATTERN_BLOCK2,
-				  &__bpf_emit_atomic32);
-}
-
-/* 64-bit atomic operations */
-static int bpf_fill_atomic64_add(struct bpf_test *self)
-{
-	return __bpf_fill_atomic64(self, BPF_ADD);
-}
-
-static int bpf_fill_atomic64_and(struct bpf_test *self)
-{
-	return __bpf_fill_atomic64(self, BPF_AND);
-}
-
-static int bpf_fill_atomic64_or(struct bpf_test *self)
-{
-	return __bpf_fill_atomic64(self, BPF_OR);
-}
-
-static int bpf_fill_atomic64_xor(struct bpf_test *self)
-{
-	return __bpf_fill_atomic64(self, BPF_XOR);
-}
-
-static int bpf_fill_atomic64_add_fetch(struct bpf_test *self)
-{
-	return __bpf_fill_atomic64(self, BPF_ADD | BPF_FETCH);
-}
-
-static int bpf_fill_atomic64_and_fetch(struct bpf_test *self)
-{
-	return __bpf_fill_atomic64(self, BPF_AND | BPF_FETCH);
-}
-
-static int bpf_fill_atomic64_or_fetch(struct bpf_test *self)
-{
-	return __bpf_fill_atomic64(self, BPF_OR | BPF_FETCH);
-}
-
-static int bpf_fill_atomic64_xor_fetch(struct bpf_test *self)
-{
-	return __bpf_fill_atomic64(self, BPF_XOR | BPF_FETCH);
-}
-
-static int bpf_fill_atomic64_xchg(struct bpf_test *self)
-{
-	return __bpf_fill_atomic64(self, BPF_XCHG);
-}
-
-static int bpf_fill_cmpxchg64(struct bpf_test *self)
-{
-	return __bpf_fill_pattern(self, NULL, 64, 64, 0, PATTERN_BLOCK2,
-				  &__bpf_emit_cmpxchg64);
-}
-
-/* 32-bit atomic operations */
-static int bpf_fill_atomic32_add(struct bpf_test *self)
-{
-	return __bpf_fill_atomic32(self, BPF_ADD);
-}
-
-static int bpf_fill_atomic32_and(struct bpf_test *self)
-{
-	return __bpf_fill_atomic32(self, BPF_AND);
-}
-
-static int bpf_fill_atomic32_or(struct bpf_test *self)
-{
-	return __bpf_fill_atomic32(self, BPF_OR);
-}
-
-static int bpf_fill_atomic32_xor(struct bpf_test *self)
-{
-	return __bpf_fill_atomic32(self, BPF_XOR);
-}
-
-static int bpf_fill_atomic32_add_fetch(struct bpf_test *self)
-{
-	return __bpf_fill_atomic32(self, BPF_ADD | BPF_FETCH);
-}
-
-static int bpf_fill_atomic32_and_fetch(struct bpf_test *self)
-{
-	return __bpf_fill_atomic32(self, BPF_AND | BPF_FETCH);
-}
-
-static int bpf_fill_atomic32_or_fetch(struct bpf_test *self)
-{
-	return __bpf_fill_atomic32(self, BPF_OR | BPF_FETCH);
-}
-
-static int bpf_fill_atomic32_xor_fetch(struct bpf_test *self)
-{
-	return __bpf_fill_atomic32(self, BPF_XOR | BPF_FETCH);
-}
-
-static int bpf_fill_atomic32_xchg(struct bpf_test *self)
-{
-	return __bpf_fill_atomic32(self, BPF_XCHG);
-}
-
-static int bpf_fill_cmpxchg32(struct bpf_test *self)
-{
-	return __bpf_fill_pattern(self, NULL, 64, 64, 0, PATTERN_BLOCK2,
-				  &__bpf_emit_cmpxchg32);
-}
-
-/*
- * Test JITs that implement ATOMIC operations as function calls or
- * other primitives, and must re-arrange operands for argument passing.
- */
-static int __bpf_fill_atomic_reg_pairs(struct bpf_test *self, u8 width, u8 op)
-{
-	struct bpf_insn *insn;
-	int len = 2 + 34 * 10 * 10;
-	u64 mem, upd, res;
-	int rd, rs, i = 0;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	/* Operand and memory values */
-	if (width == BPF_DW) {
-		mem = 0x0123456789abcdefULL;
-		upd = 0xfedcba9876543210ULL;
-	} else { /* BPF_W */
-		mem = 0x01234567U;
-		upd = 0x76543210U;
-	}
-
-	/* Memory updated according to operation */
-	switch (op) {
-	case BPF_XCHG:
-		res = upd;
-		break;
-	case BPF_CMPXCHG:
-		res = mem;
-		break;
-	default:
-		__bpf_alu_result(&res, mem, upd, BPF_OP(op), 0);
-	}
-
-	/* Test all operand registers */
-	for (rd = R0; rd <= R9; rd++) {
-		for (rs = R0; rs <= R9; rs++) {
-			u64 cmp, src;
-
-			/* Initialize value in memory */
-			i += __bpf_ld_imm64(&insn[i], R0, mem);
-			insn[i++] = BPF_STX_MEM(width, R10, R0, -8);
-
-			/* Initialize registers in order */
-			i += __bpf_ld_imm64(&insn[i], R0, ~mem);
-			i += __bpf_ld_imm64(&insn[i], rs, upd);
-			insn[i++] = BPF_MOV64_REG(rd, R10);
-
-			/* Perform atomic operation */
-			insn[i++] = BPF_ATOMIC_OP(width, op, rd, rs, -8);
-			if (op == BPF_CMPXCHG && width == BPF_W)
-				insn[i++] = BPF_ZEXT_REG(R0);
-
-			/* Check R0 register value */
-			if (op == BPF_CMPXCHG)
-				cmp = mem;  /* Expect value from memory */
-			else if (R0 == rd || R0 == rs)
-				cmp = 0;    /* Aliased, checked below */
-			else
-				cmp = ~mem; /* Expect value to be preserved */
-			if (cmp) {
-				insn[i++] = BPF_JMP32_IMM(BPF_JEQ, R0,
-							   (u32)cmp, 2);
-				insn[i++] = BPF_MOV32_IMM(R0, __LINE__);
-				insn[i++] = BPF_EXIT_INSN();
-				insn[i++] = BPF_ALU64_IMM(BPF_RSH, R0, 32);
-				insn[i++] = BPF_JMP32_IMM(BPF_JEQ, R0,
-							   cmp >> 32, 2);
-				insn[i++] = BPF_MOV32_IMM(R0, __LINE__);
-				insn[i++] = BPF_EXIT_INSN();
-			}
-
-			/* Check source register value */
-			if (rs == R0 && op == BPF_CMPXCHG)
-				src = 0;   /* Aliased with R0, checked above */
-			else if (rs == rd && (op == BPF_CMPXCHG ||
-					      !(op & BPF_FETCH)))
-				src = 0;   /* Aliased with rd, checked below */
-			else if (op == BPF_CMPXCHG)
-				src = upd; /* Expect value to be preserved */
-			else if (op & BPF_FETCH)
-				src = mem; /* Expect fetched value from mem */
-			else /* no fetch */
-				src = upd; /* Expect value to be preserved */
-			if (src) {
-				insn[i++] = BPF_JMP32_IMM(BPF_JEQ, rs,
-							   (u32)src, 2);
-				insn[i++] = BPF_MOV32_IMM(R0, __LINE__);
-				insn[i++] = BPF_EXIT_INSN();
-				insn[i++] = BPF_ALU64_IMM(BPF_RSH, rs, 32);
-				insn[i++] = BPF_JMP32_IMM(BPF_JEQ, rs,
-							   src >> 32, 2);
-				insn[i++] = BPF_MOV32_IMM(R0, __LINE__);
-				insn[i++] = BPF_EXIT_INSN();
-			}
-
-			/* Check destination register value */
-			if (!(rd == R0 && op == BPF_CMPXCHG) &&
-			    !(rd == rs && (op & BPF_FETCH))) {
-				insn[i++] = BPF_JMP_REG(BPF_JEQ, rd, R10, 2);
-				insn[i++] = BPF_MOV32_IMM(R0, __LINE__);
-				insn[i++] = BPF_EXIT_INSN();
-			}
-
-			/* Check value in memory */
-			if (rs != rd) {                  /* No aliasing */
-				i += __bpf_ld_imm64(&insn[i], R1, res);
-			} else if (op == BPF_XCHG) {     /* Aliased, XCHG */
-				insn[i++] = BPF_MOV64_REG(R1, R10);
-			} else if (op == BPF_CMPXCHG) {  /* Aliased, CMPXCHG */
-				i += __bpf_ld_imm64(&insn[i], R1, mem);
-			} else {                        /* Aliased, ALU oper */
-				i += __bpf_ld_imm64(&insn[i], R1, mem);
-				insn[i++] = BPF_ALU64_REG(BPF_OP(op), R1, R10);
-			}
-
-			insn[i++] = BPF_LDX_MEM(width, R0, R10, -8);
-			if (width == BPF_DW)
-				insn[i++] = BPF_JMP_REG(BPF_JEQ, R0, R1, 2);
-			else /* width == BPF_W */
-				insn[i++] = BPF_JMP32_REG(BPF_JEQ, R0, R1, 2);
-			insn[i++] = BPF_MOV32_IMM(R0, __LINE__);
-			insn[i++] = BPF_EXIT_INSN();
-		}
-	}
-
-	insn[i++] = BPF_MOV64_IMM(R0, 1);
-	insn[i++] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = i;
-	BUG_ON(i > len);
-
-	return 0;
-}
-
-/* 64-bit atomic register tests */
-static int bpf_fill_atomic64_add_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_ADD);
-}
-
-static int bpf_fill_atomic64_and_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_AND);
-}
-
-static int bpf_fill_atomic64_or_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_OR);
-}
-
-static int bpf_fill_atomic64_xor_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_XOR);
-}
-
-static int bpf_fill_atomic64_add_fetch_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_ADD | BPF_FETCH);
-}
-
-static int bpf_fill_atomic64_and_fetch_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_AND | BPF_FETCH);
-}
-
-static int bpf_fill_atomic64_or_fetch_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_OR | BPF_FETCH);
-}
-
-static int bpf_fill_atomic64_xor_fetch_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_XOR | BPF_FETCH);
-}
-
-static int bpf_fill_atomic64_xchg_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_XCHG);
-}
-
-static int bpf_fill_atomic64_cmpxchg_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_DW, BPF_CMPXCHG);
-}
-
-/* 32-bit atomic register tests */
-static int bpf_fill_atomic32_add_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_ADD);
-}
-
-static int bpf_fill_atomic32_and_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_AND);
-}
-
-static int bpf_fill_atomic32_or_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_OR);
-}
-
-static int bpf_fill_atomic32_xor_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_XOR);
-}
-
-static int bpf_fill_atomic32_add_fetch_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_ADD | BPF_FETCH);
-}
-
-static int bpf_fill_atomic32_and_fetch_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_AND | BPF_FETCH);
-}
-
-static int bpf_fill_atomic32_or_fetch_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_OR | BPF_FETCH);
-}
-
-static int bpf_fill_atomic32_xor_fetch_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_XOR | BPF_FETCH);
-}
-
-static int bpf_fill_atomic32_xchg_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_XCHG);
-}
-
-static int bpf_fill_atomic32_cmpxchg_reg_pairs(struct bpf_test *self)
-{
-	return __bpf_fill_atomic_reg_pairs(self, BPF_W, BPF_CMPXCHG);
-}
-
-/*
- * Test the two-instruction 64-bit immediate load operation for all
- * power-of-two magnitudes of the immediate operand. For each MSB, a block
- * of immediate values centered around the power-of-two MSB are tested,
- * both for positive and negative values. The test is designed to verify
- * the operation for JITs that emit different code depending on the magnitude
- * of the immediate value. This is often the case if the native instruction
- * immediate field width is narrower than 32 bits.
- */
-static int bpf_fill_ld_imm64_magn(struct bpf_test *self)
-{
-	int block = 64; /* Increase for more tests per MSB position */
-	int len = 3 + 8 * 63 * block * 2;
-	struct bpf_insn *insn;
-	int bit, adj, sign;
-	int i = 0;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	insn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 0);
-
-	for (bit = 0; bit <= 62; bit++) {
-		for (adj = -block / 2; adj < block / 2; adj++) {
-			for (sign = -1; sign <= 1; sign += 2) {
-				s64 imm = sign * ((1LL << bit) + adj);
-
-				/* Perform operation */
-				i += __bpf_ld_imm64(&insn[i], R1, imm);
-
-				/* Load reference */
-				insn[i++] = BPF_ALU32_IMM(BPF_MOV, R2, imm);
-				insn[i++] = BPF_ALU32_IMM(BPF_MOV, R3,
-							  (u32)(imm >> 32));
-				insn[i++] = BPF_ALU64_IMM(BPF_LSH, R3, 32);
-				insn[i++] = BPF_ALU64_REG(BPF_OR, R2, R3);
-
-				/* Check result */
-				insn[i++] = BPF_JMP_REG(BPF_JEQ, R1, R2, 1);
-				insn[i++] = BPF_EXIT_INSN();
-			}
-		}
-	}
-
-	insn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 1);
-	insn[i++] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-	BUG_ON(i != len);
-
-	return 0;
-}
-
-/*
- * Test the two-instruction 64-bit immediate load operation for different
- * combinations of bytes. Each byte in the 64-bit word is constructed as
- * (base & mask) | (rand() & ~mask), where rand() is a deterministic LCG.
- * All patterns (base1, mask1) and (base2, mask2) bytes are tested.
- */
-static int __bpf_fill_ld_imm64_bytes(struct bpf_test *self,
-				     u8 base1, u8 mask1,
-				     u8 base2, u8 mask2)
-{
-	struct bpf_insn *insn;
-	int len = 3 + 8 * BIT(8);
-	int pattern, index;
-	u32 rand = 1;
-	int i = 0;
-
-	insn = kmalloc_objs(*insn, len);
-	if (!insn)
-		return -ENOMEM;
-
-	insn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 0);
-
-	for (pattern = 0; pattern < BIT(8); pattern++) {
-		u64 imm = 0;
-
-		for (index = 0; index < 8; index++) {
-			int byte;
-
-			if (pattern & BIT(index))
-				byte = (base1 & mask1) | (rand & ~mask1);
-			else
-				byte = (base2 & mask2) | (rand & ~mask2);
-			imm = (imm << 8) | byte;
-		}
-
-		/* Update our LCG */
-		rand = rand * 1664525 + 1013904223;
-
-		/* Perform operation */
-		i += __bpf_ld_imm64(&insn[i], R1, imm);
-
-		/* Load reference */
-		insn[i++] = BPF_ALU32_IMM(BPF_MOV, R2, imm);
-		insn[i++] = BPF_ALU32_IMM(BPF_MOV, R3, (u32)(imm >> 32));
-		insn[i++] = BPF_ALU64_IMM(BPF_LSH, R3, 32);
-		insn[i++] = BPF_ALU64_REG(BPF_OR, R2, R3);
-
-		/* Check result */
-		insn[i++] = BPF_JMP_REG(BPF_JEQ, R1, R2, 1);
-		insn[i++] = BPF_EXIT_INSN();
-	}
-
-	insn[i++] = BPF_ALU64_IMM(BPF_MOV, R0, 1);
-	insn[i++] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insn;
-	self->u.ptr.len = len;
-	BUG_ON(i != len);
-
-	return 0;
-}
-
-static int bpf_fill_ld_imm64_checker(struct bpf_test *self)
-{
-	return __bpf_fill_ld_imm64_bytes(self, 0, 0xff, 0xff, 0xff);
-}
-
-static int bpf_fill_ld_imm64_pos_neg(struct bpf_test *self)
-{
-	return __bpf_fill_ld_imm64_bytes(self, 1, 0x81, 0x80, 0x80);
-}
-
-static int bpf_fill_ld_imm64_pos_zero(struct bpf_test *self)
-{
-	return __bpf_fill_ld_imm64_bytes(self, 1, 0x81, 0, 0xff);
-}
-
-static int bpf_fill_ld_imm64_neg_zero(struct bpf_test *self)
-{
-	return __bpf_fill_ld_imm64_bytes(self, 0x80, 0x80, 0, 0xff);
-}
-
-/*
- * Exhaustive tests of JMP operations for all combinations of power-of-two
- * magnitudes of the operands, both for positive and negative values. The
- * test is designed to verify e.g. the JMP and JMP32 operations for JITs that
- * emit different code depending on the magnitude of the immediate value.
- */
-
-static bool __bpf_match_jmp_cond(s64 v1, s64 v2, u8 op)
-{
-	switch (op) {
-	case BPF_JSET:
-		return !!(v1 & v2);
-	case BPF_JEQ:
-		return v1 == v2;
-	case BPF_JNE:
-		return v1 != v2;
-	case BPF_JGT:
-		return (u64)v1 > (u64)v2;
-	case BPF_JGE:
-		return (u64)v1 >= (u64)v2;
-	case BPF_JLT:
-		return (u64)v1 < (u64)v2;
-	case BPF_JLE:
-		return (u64)v1 <= (u64)v2;
-	case BPF_JSGT:
-		return v1 > v2;
-	case BPF_JSGE:
-		return v1 >= v2;
-	case BPF_JSLT:
-		return v1 < v2;
-	case BPF_JSLE:
-		return v1 <= v2;
-	}
-	return false;
-}
-
-static int __bpf_emit_jmp_imm(struct bpf_test *self, void *arg,
-			      struct bpf_insn *insns, s64 dst, s64 imm)
-{
-	int op = *(int *)arg;
-
-	if (insns) {
-		bool match = __bpf_match_jmp_cond(dst, (s32)imm, op);
-		int i = 0;
-
-		insns[i++] = BPF_ALU32_IMM(BPF_MOV, R0, match);
-
-		i += __bpf_ld_imm64(&insns[i], R1, dst);
-		insns[i++] = BPF_JMP_IMM(op, R1, imm, 1);
-		if (!match)
-			insns[i++] = BPF_JMP_IMM(BPF_JA, 0, 0, 1);
-		insns[i++] = BPF_EXIT_INSN();
-
-		return i;
-	}
-
-	return 5 + 1;
-}
-
-static int __bpf_emit_jmp32_imm(struct bpf_test *self, void *arg,
-				struct bpf_insn *insns, s64 dst, s64 imm)
-{
-	int op = *(int *)arg;
-
-	if (insns) {
-		bool match = __bpf_match_jmp_cond((s32)dst, (s32)imm, op);
-		int i = 0;
-
-		i += __bpf_ld_imm64(&insns[i], R1, dst);
-		insns[i++] = BPF_JMP32_IMM(op, R1, imm, 1);
-		if (!match)
-			insns[i++] = BPF_JMP_IMM(BPF_JA, 0, 0, 1);
-		insns[i++] = BPF_EXIT_INSN();
-
-		return i;
-	}
-
-	return 5;
-}
-
-static int __bpf_emit_jmp_reg(struct bpf_test *self, void *arg,
-			      struct bpf_insn *insns, s64 dst, s64 src)
-{
-	int op = *(int *)arg;
-
-	if (insns) {
-		bool match = __bpf_match_jmp_cond(dst, src, op);
-		int i = 0;
-
-		i += __bpf_ld_imm64(&insns[i], R1, dst);
-		i += __bpf_ld_imm64(&insns[i], R2, src);
-		insns[i++] = BPF_JMP_REG(op, R1, R2, 1);
-		if (!match)
-			insns[i++] = BPF_JMP_IMM(BPF_JA, 0, 0, 1);
-		insns[i++] = BPF_EXIT_INSN();
-
-		return i;
-	}
-
-	return 7;
-}
-
-static int __bpf_emit_jmp32_reg(struct bpf_test *self, void *arg,
-				struct bpf_insn *insns, s64 dst, s64 src)
-{
-	int op = *(int *)arg;
-
-	if (insns) {
-		bool match = __bpf_match_jmp_cond((s32)dst, (s32)src, op);
-		int i = 0;
-
-		i += __bpf_ld_imm64(&insns[i], R1, dst);
-		i += __bpf_ld_imm64(&insns[i], R2, src);
-		insns[i++] = BPF_JMP32_REG(op, R1, R2, 1);
-		if (!match)
-			insns[i++] = BPF_JMP_IMM(BPF_JA, 0, 0, 1);
-		insns[i++] = BPF_EXIT_INSN();
-
-		return i;
-	}
-
-	return 7;
-}
-
-static int __bpf_fill_jmp_imm(struct bpf_test *self, int op)
-{
-	return __bpf_fill_pattern(self, &op, 64, 32,
-				  PATTERN_BLOCK1, PATTERN_BLOCK2,
-				  &__bpf_emit_jmp_imm);
-}
-
-static int __bpf_fill_jmp32_imm(struct bpf_test *self, int op)
-{
-	return __bpf_fill_pattern(self, &op, 64, 32,
-				  PATTERN_BLOCK1, PATTERN_BLOCK2,
-				  &__bpf_emit_jmp32_imm);
-}
-
-static int __bpf_fill_jmp_reg(struct bpf_test *self, int op)
-{
-	return __bpf_fill_pattern(self, &op, 64, 64,
-				  PATTERN_BLOCK1, PATTERN_BLOCK2,
-				  &__bpf_emit_jmp_reg);
-}
-
-static int __bpf_fill_jmp32_reg(struct bpf_test *self, int op)
-{
-	return __bpf_fill_pattern(self, &op, 64, 64,
-				  PATTERN_BLOCK1, PATTERN_BLOCK2,
-				  &__bpf_emit_jmp32_reg);
-}
-
-/* JMP immediate tests */
-static int bpf_fill_jmp_jset_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JSET);
-}
-
-static int bpf_fill_jmp_jeq_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JEQ);
-}
-
-static int bpf_fill_jmp_jne_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JNE);
-}
-
-static int bpf_fill_jmp_jgt_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JGT);
-}
-
-static int bpf_fill_jmp_jge_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JGE);
-}
-
-static int bpf_fill_jmp_jlt_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JLT);
-}
-
-static int bpf_fill_jmp_jle_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JLE);
-}
-
-static int bpf_fill_jmp_jsgt_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JSGT);
-}
-
-static int bpf_fill_jmp_jsge_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JSGE);
-}
-
-static int bpf_fill_jmp_jslt_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JSLT);
-}
-
-static int bpf_fill_jmp_jsle_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_imm(self, BPF_JSLE);
-}
-
-/* JMP32 immediate tests */
-static int bpf_fill_jmp32_jset_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JSET);
-}
-
-static int bpf_fill_jmp32_jeq_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JEQ);
-}
-
-static int bpf_fill_jmp32_jne_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JNE);
-}
-
-static int bpf_fill_jmp32_jgt_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JGT);
-}
-
-static int bpf_fill_jmp32_jge_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JGE);
-}
-
-static int bpf_fill_jmp32_jlt_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JLT);
-}
-
-static int bpf_fill_jmp32_jle_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JLE);
-}
-
-static int bpf_fill_jmp32_jsgt_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JSGT);
-}
-
-static int bpf_fill_jmp32_jsge_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JSGE);
-}
-
-static int bpf_fill_jmp32_jslt_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JSLT);
-}
-
-static int bpf_fill_jmp32_jsle_imm(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_imm(self, BPF_JSLE);
-}
-
-/* JMP register tests */
-static int bpf_fill_jmp_jset_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JSET);
-}
-
-static int bpf_fill_jmp_jeq_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JEQ);
-}
-
-static int bpf_fill_jmp_jne_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JNE);
-}
-
-static int bpf_fill_jmp_jgt_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JGT);
-}
-
-static int bpf_fill_jmp_jge_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JGE);
-}
-
-static int bpf_fill_jmp_jlt_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JLT);
-}
-
-static int bpf_fill_jmp_jle_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JLE);
-}
-
-static int bpf_fill_jmp_jsgt_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JSGT);
-}
-
-static int bpf_fill_jmp_jsge_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JSGE);
-}
-
-static int bpf_fill_jmp_jslt_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JSLT);
-}
-
-static int bpf_fill_jmp_jsle_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp_reg(self, BPF_JSLE);
-}
-
-/* JMP32 register tests */
-static int bpf_fill_jmp32_jset_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JSET);
-}
-
-static int bpf_fill_jmp32_jeq_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JEQ);
-}
-
-static int bpf_fill_jmp32_jne_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JNE);
-}
-
-static int bpf_fill_jmp32_jgt_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JGT);
-}
-
-static int bpf_fill_jmp32_jge_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JGE);
-}
-
-static int bpf_fill_jmp32_jlt_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JLT);
-}
-
-static int bpf_fill_jmp32_jle_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JLE);
-}
-
-static int bpf_fill_jmp32_jsgt_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JSGT);
-}
-
-static int bpf_fill_jmp32_jsge_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JSGE);
-}
-
-static int bpf_fill_jmp32_jslt_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JSLT);
-}
-
-static int bpf_fill_jmp32_jsle_reg(struct bpf_test *self)
-{
-	return __bpf_fill_jmp32_reg(self, BPF_JSLE);
-}
-
-/*
- * Set up a sequence of staggered jumps, forwards and backwards with
- * increasing offset. This tests the conversion of relative jumps to
- * JITed native jumps. On some architectures, for example MIPS, a large
- * PC-relative jump offset may overflow the immediate field of the native
- * conditional branch instruction, triggering a conversion to use an
- * absolute jump instead. Since this changes the jump offsets, another
- * offset computation pass is necessary, and that may in turn trigger
- * another branch conversion. This jump sequence is particularly nasty
- * in that regard.
- *
- * The sequence generation is parameterized by size and jump type.
- * The size must be even, and the expected result is always size + 1.
- * Below is an example with size=8 and result=9.
- *
- *                     ________________________Start
- *                     R0 = 0
- *                     R1 = r1
- *                     R2 = r2
- *            ,------- JMP +4 * 3______________Preamble: 4 insns
- * ,----------|-ind 0- if R0 != 7 JMP 8 * 3 + 1 <--------------------.
- * |          |        R0 = 8                                        |
- * |          |        JMP +7 * 3               ------------------------.
- * | ,--------|-----1- if R0 != 5 JMP 7 * 3 + 1 <--------------.     |  |
- * | |        |        R0 = 6                                  |     |  |
- * | |        |        JMP +5 * 3               ------------------.  |  |
- * | | ,------|-----2- if R0 != 3 JMP 6 * 3 + 1 <--------.     |  |  |  |
- * | | |      |        R0 = 4                            |     |  |  |  |
- * | | |      |        JMP +3 * 3               ------------.  |  |  |  |
- * | | | ,----|-----3- if R0 != 1 JMP 5 * 3 + 1 <--.     |  |  |  |  |  |
- * | | | |    |        R0 = 2                      |     |  |  |  |  |  |
- * | | | |    |        JMP +1 * 3               ------.  |  |  |  |  |  |
- * | | | | ,--t=====4> if R0 != 0 JMP 4 * 3 + 1    1  2  3  4  5  6  7  8 loc
- * | | | | |           R0 = 1                     -1 +2 -3 +4 -5 +6 -7 +8 off
- * | | | | |           JMP -2 * 3               ---'  |  |  |  |  |  |  |
- * | | | | | ,------5- if R0 != 2 JMP 3 * 3 + 1 <-----'  |  |  |  |  |  |
- * | | | | | |         R0 = 3                            |  |  |  |  |  |
- * | | | | | |         JMP -4 * 3               ---------'  |  |  |  |  |
- * | | | | | | ,----6- if R0 != 4 JMP 2 * 3 + 1 <-----------'  |  |  |  |
- * | | | | | | |       R0 = 5                                  |  |  |  |
- * | | | | | | |       JMP -6 * 3               ---------------'  |  |  |
- * | | | | | | | ,--7- if R0 != 6 JMP 1 * 3 + 1 <-----------------'  |  |
- * | | | | | | | |     R0 = 7                                        |  |
- * | | Error | | |     JMP -8 * 3               ---------------------'  |
- * | | paths | | | ,8- if R0 != 8 JMP 0 * 3 + 1 <-----------------------'
- * | | | | | | | | |   R0 = 9__________________Sequence: 3 * size - 1 insns
- * `-+-+-+-+-+-+-+-+-> EXIT____________________Return: 1 insn
- *
- */
-
-/* The maximum size parameter */
-#define MAX_STAGGERED_JMP_SIZE ((0x7fff / 3) & ~1)
-
-/* We use a reduced number of iterations to get a reasonable execution time */
-#define NR_STAGGERED_JMP_RUNS 10
-
-static int __bpf_fill_staggered_jumps(struct bpf_test *self,
-				      const struct bpf_insn *jmp,
-				      u64 r1, u64 r2)
-{
-	int size = self->test[0].result - 1;
-	int len = 4 + 3 * (size + 1);
-	struct bpf_insn *insns;
-	int off, ind;
-
-	insns = kmalloc_objs(*insns, len);
-	if (!insns)
-		return -ENOMEM;
-
-	/* Preamble */
-	insns[0] = BPF_ALU64_IMM(BPF_MOV, R0, 0);
-	insns[1] = BPF_ALU64_IMM(BPF_MOV, R1, r1);
-	insns[2] = BPF_ALU64_IMM(BPF_MOV, R2, r2);
-	insns[3] = BPF_JMP_IMM(BPF_JA, 0, 0, 3 * size / 2);
-
-	/* Sequence */
-	for (ind = 0, off = size; ind <= size; ind++, off -= 2) {
-		struct bpf_insn *ins = &insns[4 + 3 * ind];
-		int loc;
-
-		if (off == 0)
-			off--;
-
-		loc = abs(off);
-		ins[0] = BPF_JMP_IMM(BPF_JNE, R0, loc - 1,
-				     3 * (size - ind) + 1);
-		ins[1] = BPF_ALU64_IMM(BPF_MOV, R0, loc);
-		ins[2] = *jmp;
-		ins[2].off = 3 * (off - 1);
-	}
-
-	/* Return */
-	insns[len - 1] = BPF_EXIT_INSN();
-
-	self->u.ptr.insns = insns;
-	self->u.ptr.len = len;
-
-	return 0;
-}
-
-/* 64-bit unconditional jump */
-static int bpf_fill_staggered_ja(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JA, 0, 0, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 0, 0);
-}
-
-/* 64-bit immediate jumps */
-static int bpf_fill_staggered_jeq_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JEQ, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
-}
-
-static int bpf_fill_staggered_jne_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JNE, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 4321, 0);
-}
-
-static int bpf_fill_staggered_jset_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JSET, R1, 0x82, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 0x86, 0);
-}
-
-static int bpf_fill_staggered_jgt_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JGT, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 0x80000000, 0);
-}
-
-static int bpf_fill_staggered_jge_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JGE, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
-}
-
-static int bpf_fill_staggered_jlt_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JLT, R1, 0x80000000, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
-}
-
-static int bpf_fill_staggered_jle_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JLE, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
-}
-
-static int bpf_fill_staggered_jsgt_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JSGT, R1, -2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -1, 0);
-}
-
-static int bpf_fill_staggered_jsge_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JSGE, R1, -2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -2, 0);
-}
-
-static int bpf_fill_staggered_jslt_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JSLT, R1, -1, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -2, 0);
-}
-
-static int bpf_fill_staggered_jsle_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_IMM(BPF_JSLE, R1, -1, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -1, 0);
-}
-
-/* 64-bit register jumps */
-static int bpf_fill_staggered_jeq_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JEQ, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 1234);
-}
-
-static int bpf_fill_staggered_jne_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JNE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 4321, 1234);
-}
-
-static int bpf_fill_staggered_jset_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JSET, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 0x86, 0x82);
-}
-
-static int bpf_fill_staggered_jgt_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JGT, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 0x80000000, 1234);
-}
-
-static int bpf_fill_staggered_jge_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JGE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 1234);
-}
-
-static int bpf_fill_staggered_jlt_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JLT, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0x80000000);
-}
-
-static int bpf_fill_staggered_jle_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JLE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 1234);
-}
-
-static int bpf_fill_staggered_jsgt_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JSGT, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -1, -2);
-}
-
-static int bpf_fill_staggered_jsge_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JSGE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -2, -2);
-}
-
-static int bpf_fill_staggered_jslt_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JSLT, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -2, -1);
-}
-
-static int bpf_fill_staggered_jsle_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP_REG(BPF_JSLE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -1, -1);
-}
-
-/* 32-bit immediate jumps */
-static int bpf_fill_staggered_jeq32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JEQ, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
-}
-
-static int bpf_fill_staggered_jne32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JNE, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 4321, 0);
-}
-
-static int bpf_fill_staggered_jset32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JSET, R1, 0x82, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 0x86, 0);
-}
-
-static int bpf_fill_staggered_jgt32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JGT, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 0x80000000, 0);
-}
-
-static int bpf_fill_staggered_jge32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JGE, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
-}
-
-static int bpf_fill_staggered_jlt32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JLT, R1, 0x80000000, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
-}
-
-static int bpf_fill_staggered_jle32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JLE, R1, 1234, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0);
-}
-
-static int bpf_fill_staggered_jsgt32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JSGT, R1, -2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -1, 0);
-}
-
-static int bpf_fill_staggered_jsge32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JSGE, R1, -2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -2, 0);
-}
-
-static int bpf_fill_staggered_jslt32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JSLT, R1, -1, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -2, 0);
-}
-
-static int bpf_fill_staggered_jsle32_imm(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_IMM(BPF_JSLE, R1, -1, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -1, 0);
-}
-
-/* 32-bit register jumps */
-static int bpf_fill_staggered_jeq32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JEQ, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 1234);
-}
-
-static int bpf_fill_staggered_jne32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JNE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 4321, 1234);
-}
-
-static int bpf_fill_staggered_jset32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JSET, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 0x86, 0x82);
-}
-
-static int bpf_fill_staggered_jgt32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JGT, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 0x80000000, 1234);
-}
-
-static int bpf_fill_staggered_jge32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JGE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 1234);
-}
-
-static int bpf_fill_staggered_jlt32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JLT, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 0x80000000);
-}
-
-static int bpf_fill_staggered_jle32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JLE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, 1234, 1234);
-}
-
-static int bpf_fill_staggered_jsgt32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JSGT, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -1, -2);
-}
-
-static int bpf_fill_staggered_jsge32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JSGE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -2, -2);
-}
-
-static int bpf_fill_staggered_jslt32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JSLT, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -2, -1);
-}
-
-static int bpf_fill_staggered_jsle32_reg(struct bpf_test *self)
-{
-	struct bpf_insn jmp = BPF_JMP32_REG(BPF_JSLE, R1, R2, 0);
-
-	return __bpf_fill_staggered_jumps(self, &jmp, -1, -1);
-}
-
-
-static struct bpf_test tests[] = {
-	{
-		"TAX",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_ALU | BPF_NEG, 0), /* A == -3 */
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_LEN, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0), /* X == len - 3 */
-			BPF_STMT(BPF_LD | BPF_B | BPF_IND, 1),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ 10, 20, 30, 40, 50 },
-		{ { 2, 10 }, { 3, 20 }, { 4, 30 } },
-	},
-	{
-		"TXA",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0) /* A == len * 2 */
-		},
-		CLASSIC,
-		{ 10, 20, 30, 40, 50 },
-		{ { 1, 2 }, { 3, 6 }, { 4, 8 } },
-	},
-	{
-		"ADD_SUB_MUL_K",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 1),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 2),
-			BPF_STMT(BPF_LDX | BPF_IMM, 3),
-			BPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 0xffffffff),
-			BPF_STMT(BPF_ALU | BPF_MUL | BPF_K, 3),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0xfffffffd } }
-	},
-	{
-		"DIV_MOD_KX",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 8),
-			BPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 2),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff),
-			BPF_STMT(BPF_ALU | BPF_DIV | BPF_X, 0),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff),
-			BPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 0x70000000),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff),
-			BPF_STMT(BPF_ALU | BPF_MOD | BPF_X, 0),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffffffff),
-			BPF_STMT(BPF_ALU | BPF_MOD | BPF_K, 0x70000000),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0x20000000 } }
-	},
-	{
-		"AND_OR_LSH_K",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0xff),
-			BPF_STMT(BPF_ALU | BPF_AND | BPF_K, 0xf0),
-			BPF_STMT(BPF_ALU | BPF_LSH | BPF_K, 27),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_IMM, 0xf),
-			BPF_STMT(BPF_ALU | BPF_OR | BPF_K, 0xf0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0x800000ff }, { 1, 0x800000ff } },
-	},
-	{
-		"LD_IMM_0",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0), /* ld #0 */
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 0),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-		},
-		CLASSIC,
-		{ },
-		{ { 1, 1 } },
-	},
-	{
-		"LD_IND",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_IND, MAX_K),
-			BPF_STMT(BPF_RET | BPF_K, 1)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, 0 }, { 10, 0 }, { 60, 0 } },
-	},
-	{
-		"LD_ABS",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS, 1000),
-			BPF_STMT(BPF_RET | BPF_K, 1)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, 0 }, { 10, 0 }, { 60, 0 } },
-	},
-	{
-		"LD_ABS_LL",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, SKF_LL_OFF),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, SKF_LL_OFF + 1),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ 1, 2, 3 },
-		{ { 1, 0 }, { 2, 3 } },
-	},
-	{
-		"LD_IND_LL",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, SKF_LL_OFF - 1),
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_IND, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ 1, 2, 3, 0xff },
-		{ { 1, 1 }, { 3, 3 }, { 4, 0xff } },
-	},
-	{
-		"LD_ABS_NET",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, SKF_NET_OFF),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, SKF_NET_OFF + 1),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3 },
-		{ { 15, 0 }, { 16, 3 } },
-	},
-	{
-		"LD_IND_NET",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, SKF_NET_OFF - 15),
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_IND, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3 },
-		{ { 14, 0 }, { 15, 1 }, { 17, 3 } },
-	},
-	{
-		"LD_PKTTYPE",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_PKTTYPE),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, SKB_TYPE, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_PKTTYPE),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, SKB_TYPE, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_PKTTYPE),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, SKB_TYPE, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, 3 }, { 10, 3 } },
-	},
-	{
-		"LD_MARK",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_MARK),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, SKB_MARK}, { 10, SKB_MARK} },
-	},
-	{
-		"LD_RXHASH",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_RXHASH),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, SKB_HASH}, { 10, SKB_HASH} },
-	},
-	{
-		"LD_QUEUE",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_QUEUE),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, SKB_QUEUE_MAP }, { 10, SKB_QUEUE_MAP } },
-	},
-	{
-		"LD_PROTOCOL",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 1),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 20, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 0),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_PROTOCOL),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 2),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 30, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 0),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ 10, 20, 30 },
-		{ { 10, ETH_P_IP }, { 100, ETH_P_IP } },
-	},
-	{
-		"LD_VLAN_TAG",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_VLAN_TAG),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{
-			{ 1, SKB_VLAN_TCI },
-			{ 10, SKB_VLAN_TCI }
-		},
-	},
-	{
-		"LD_VLAN_TAG_PRESENT",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_VLAN_TAG_PRESENT),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{
-			{ 1, SKB_VLAN_PRESENT },
-			{ 10, SKB_VLAN_PRESENT }
-		},
-	},
-	{
-		"LD_IFINDEX",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_IFINDEX),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, SKB_DEV_IFINDEX }, { 10, SKB_DEV_IFINDEX } },
-	},
-	{
-		"LD_HATYPE",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_HATYPE),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, SKB_DEV_TYPE }, { 10, SKB_DEV_TYPE } },
-	},
-	{
-		"LD_CPU",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_CPU),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_CPU),
-			BPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, 0 }, { 10, 0 } },
-	},
-	{
-		"LD_NLATTR",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 2),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_LDX | BPF_IMM, 3),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_NLATTR),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-#ifdef __BIG_ENDIAN
-		{ 0xff, 0xff, 0, 4, 0, 2, 0, 4, 0, 3 },
-#else
-		{ 0xff, 0xff, 4, 0, 2, 0, 4, 0, 3, 0 },
-#endif
-		{ { 4, 0 }, { 20, 6 } },
-	},
-	{
-		"LD_NLATTR_NEST",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_LDX | BPF_IMM, 3),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_NLATTR_NEST),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-#ifdef __BIG_ENDIAN
-		{ 0xff, 0xff, 0, 12, 0, 1, 0, 4, 0, 2, 0, 4, 0, 3 },
-#else
-		{ 0xff, 0xff, 12, 0, 1, 0, 4, 0, 2, 0, 4, 0, 3, 0 },
-#endif
-		{ { 4, 0 }, { 20, 10 } },
-	},
-	{
-		"LD_PAYLOAD_OFF",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_PAY_OFFSET),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_PAY_OFFSET),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_PAY_OFFSET),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_PAY_OFFSET),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_PAY_OFFSET),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		/* 00:00:00:00:00:00 > 00:00:00:00:00:00, ethtype IPv4 (0x0800),
-		 * length 98: 127.0.0.1 > 127.0.0.1: ICMP echo request,
-		 * id 9737, seq 1, length 64
-		 */
-		{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		  0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-		  0x08, 0x00,
-		  0x45, 0x00, 0x00, 0x54, 0xac, 0x8b, 0x40, 0x00, 0x40,
-		  0x01, 0x90, 0x1b, 0x7f, 0x00, 0x00, 0x01 },
-		{ { 30, 0 }, { 100, 42 } },
-	},
-	{
-		"LD_ANC_XOR",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 10),
-			BPF_STMT(BPF_LDX | BPF_IMM, 300),
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_ALU_XOR_X),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ { 4, 0xA ^ 300 }, { 20, 0xA ^ 300 } },
-	},
-	{
-		"SPILL_FILL",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_LD | BPF_IMM, 2),
-			BPF_STMT(BPF_ALU | BPF_RSH, 1),
-			BPF_STMT(BPF_ALU | BPF_XOR | BPF_X, 0),
-			BPF_STMT(BPF_ST, 1), /* M1 = 1 ^ len */
-			BPF_STMT(BPF_ALU | BPF_XOR | BPF_K, 0x80000000),
-			BPF_STMT(BPF_ST, 2), /* M2 = 1 ^ len ^ 0x80000000 */
-			BPF_STMT(BPF_STX, 15), /* M3 = len */
-			BPF_STMT(BPF_LDX | BPF_MEM, 1),
-			BPF_STMT(BPF_LD | BPF_MEM, 2),
-			BPF_STMT(BPF_ALU | BPF_XOR | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 15),
-			BPF_STMT(BPF_ALU | BPF_XOR | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ { 1, 0x80000001 }, { 2, 0x80000002 }, { 60, 0x80000000 ^ 60 } }
-	},
-	{
-		"JEQ",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 2),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_X, 0, 0, 1),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-			BPF_STMT(BPF_RET | BPF_K, MAX_K)
-		},
-		CLASSIC,
-		{ 3, 3, 3, 3, 3 },
-		{ { 1, 0 }, { 3, 1 }, { 4, MAX_K } },
-	},
-	{
-		"JGT",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 2),
-			BPF_JUMP(BPF_JMP | BPF_JGT | BPF_X, 0, 0, 1),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-			BPF_STMT(BPF_RET | BPF_K, MAX_K)
-		},
-		CLASSIC,
-		{ 4, 4, 4, 3, 3 },
-		{ { 2, 0 }, { 3, 1 }, { 4, MAX_K } },
-	},
-	{
-		"JGE (jt 0), test 1",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 2),
-			BPF_JUMP(BPF_JMP | BPF_JGE | BPF_X, 0, 0, 1),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-			BPF_STMT(BPF_RET | BPF_K, MAX_K)
-		},
-		CLASSIC,
-		{ 4, 4, 4, 3, 3 },
-		{ { 2, 0 }, { 3, 1 }, { 4, 1 } },
-	},
-	{
-		"JGE (jt 0), test 2",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 2),
-			BPF_JUMP(BPF_JMP | BPF_JGE | BPF_X, 0, 0, 1),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-			BPF_STMT(BPF_RET | BPF_K, MAX_K)
-		},
-		CLASSIC,
-		{ 4, 4, 5, 3, 3 },
-		{ { 4, 1 }, { 5, 1 }, { 6, MAX_K } },
-	},
-	{
-		"JGE",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_LD | BPF_B | BPF_IND, MAX_K),
-			BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 1, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 10),
-			BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 2, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 20),
-			BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 3, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 30),
-			BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 4, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 40),
-			BPF_STMT(BPF_RET | BPF_K, MAX_K)
-		},
-		CLASSIC,
-		{ 1, 2, 3, 4, 5 },
-		{ { 1, 20 }, { 3, 40 }, { 5, MAX_K } },
-	},
-	{
-		"JSET",
-		.u.insns = {
-			BPF_JUMP(BPF_JMP | BPF_JA, 0, 0, 0),
-			BPF_JUMP(BPF_JMP | BPF_JA, 1, 1, 1),
-			BPF_JUMP(BPF_JMP | BPF_JA, 0, 0, 0),
-			BPF_JUMP(BPF_JMP | BPF_JA, 0, 0, 0),
-			BPF_STMT(BPF_LDX | BPF_LEN, 0),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_SUB | BPF_K, 4),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_W | BPF_IND, 0),
-			BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 1, 0, 1),
-			BPF_STMT(BPF_RET | BPF_K, 10),
-			BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0x80000000, 0, 1),
-			BPF_STMT(BPF_RET | BPF_K, 20),
-			BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 30),
-			BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 30),
-			BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 30),
-			BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 30),
-			BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0xffffff, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 30),
-			BPF_STMT(BPF_RET | BPF_K, MAX_K)
-		},
-		CLASSIC,
-		{ 0, 0xAA, 0x55, 1 },
-		{ { 4, 10 }, { 5, 20 }, { 6, MAX_K } },
-	},
-	{
-		"tcpdump port 22",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 12),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x86dd, 0, 8), /* IPv6 */
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 20),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x84, 2, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x6, 1, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x11, 0, 17),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 54),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 14, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 56),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 12, 13),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x0800, 0, 12), /* IPv4 */
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 23),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x84, 2, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x6, 1, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x11, 0, 8),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 20),
-			BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0x1fff, 6, 0),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 14),
-			BPF_STMT(BPF_LD | BPF_H | BPF_IND, 14),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 2, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_IND, 16),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 0, 1),
-			BPF_STMT(BPF_RET | BPF_K, 0xffff),
-			BPF_STMT(BPF_RET | BPF_K, 0),
-		},
-		CLASSIC,
-		/* 3c:07:54:43:e5:76 > 10:bf:48:d6:43:d6, ethertype IPv4(0x0800)
-		 * length 114: 10.1.1.149.49700 > 10.1.2.10.22: Flags [P.],
-		 * seq 1305692979:1305693027, ack 3650467037, win 65535,
-		 * options [nop,nop,TS val 2502645400 ecr 3971138], length 48
-		 */
-		{ 0x10, 0xbf, 0x48, 0xd6, 0x43, 0xd6,
-		  0x3c, 0x07, 0x54, 0x43, 0xe5, 0x76,
-		  0x08, 0x00,
-		  0x45, 0x10, 0x00, 0x64, 0x75, 0xb5,
-		  0x40, 0x00, 0x40, 0x06, 0xad, 0x2e, /* IP header */
-		  0x0a, 0x01, 0x01, 0x95, /* ip src */
-		  0x0a, 0x01, 0x02, 0x0a, /* ip dst */
-		  0xc2, 0x24,
-		  0x00, 0x16 /* dst port */ },
-		{ { 10, 0 }, { 30, 0 }, { 100, 65535 } },
-	},
-	{
-		"tcpdump complex",
-		.u.insns = {
-			/* tcpdump -nei eth0 'tcp port 22 and (((ip[2:2] -
-			 * ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0) and
-			 * (len > 115 or len < 30000000000)' -d
-			 */
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 12),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x86dd, 30, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x800, 0, 29),
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 23),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x6, 0, 27),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 20),
-			BPF_JUMP(BPF_JMP | BPF_JSET | BPF_K, 0x1fff, 25, 0),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 14),
-			BPF_STMT(BPF_LD | BPF_H | BPF_IND, 14),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 2, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_IND, 16),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 22, 0, 20),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 16),
-			BPF_STMT(BPF_ST, 1),
-			BPF_STMT(BPF_LD | BPF_B | BPF_ABS, 14),
-			BPF_STMT(BPF_ALU | BPF_AND | BPF_K, 0xf),
-			BPF_STMT(BPF_ALU | BPF_LSH | BPF_K, 2),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0x5), /* libpcap emits K on TAX */
-			BPF_STMT(BPF_LD | BPF_MEM, 1),
-			BPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0),
-			BPF_STMT(BPF_ST, 5),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 14),
-			BPF_STMT(BPF_LD | BPF_B | BPF_IND, 26),
-			BPF_STMT(BPF_ALU | BPF_AND | BPF_K, 0xf0),
-			BPF_STMT(BPF_ALU | BPF_RSH | BPF_K, 2),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0x9), /* libpcap emits K on TAX */
-			BPF_STMT(BPF_LD | BPF_MEM, 5),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_X, 0, 4, 0),
-			BPF_STMT(BPF_LD | BPF_LEN, 0),
-			BPF_JUMP(BPF_JMP | BPF_JGT | BPF_K, 0x73, 1, 0),
-			BPF_JUMP(BPF_JMP | BPF_JGE | BPF_K, 0xfc23ac00, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 0xffff),
-			BPF_STMT(BPF_RET | BPF_K, 0),
-		},
-		CLASSIC,
-		{ 0x10, 0xbf, 0x48, 0xd6, 0x43, 0xd6,
-		  0x3c, 0x07, 0x54, 0x43, 0xe5, 0x76,
-		  0x08, 0x00,
-		  0x45, 0x10, 0x00, 0x64, 0x75, 0xb5,
-		  0x40, 0x00, 0x40, 0x06, 0xad, 0x2e, /* IP header */
-		  0x0a, 0x01, 0x01, 0x95, /* ip src */
-		  0x0a, 0x01, 0x02, 0x0a, /* ip dst */
-		  0xc2, 0x24,
-		  0x00, 0x16 /* dst port */ },
-		{ { 10, 0 }, { 30, 0 }, { 100, 65535 } },
-	},
-	{
-		"RET_A",
-		.u.insns = {
-			/* check that uninitialized X and A contain zeros */
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0)
-		},
-		CLASSIC,
-		{ },
-		{ {1, 0}, {2, 0} },
-	},
-	{
-		"INT: ADD trivial",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R1, 1),
-			BPF_ALU64_IMM(BPF_ADD, R1, 2),
-			BPF_ALU64_IMM(BPF_MOV, R2, 3),
-			BPF_ALU64_REG(BPF_SUB, R1, R2),
-			BPF_ALU64_IMM(BPF_ADD, R1, -1),
-			BPF_ALU64_IMM(BPF_MUL, R1, 3),
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffd } }
-	},
-	{
-		"INT: MUL_X",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, -1),
-			BPF_ALU64_IMM(BPF_MOV, R1, -1),
-			BPF_ALU64_IMM(BPF_MOV, R2, 3),
-			BPF_ALU64_REG(BPF_MUL, R1, R2),
-			BPF_JMP_IMM(BPF_JEQ, R1, 0xfffffffd, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		"INT: MUL_X2",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -1),
-			BPF_ALU32_IMM(BPF_MOV, R1, -1),
-			BPF_ALU32_IMM(BPF_MOV, R2, 3),
-			BPF_ALU64_REG(BPF_MUL, R1, R2),
-			BPF_ALU64_IMM(BPF_RSH, R1, 8),
-			BPF_JMP_IMM(BPF_JEQ, R1, 0x2ffffff, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		"INT: MUL32_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -1),
-			BPF_ALU64_IMM(BPF_MOV, R1, -1),
-			BPF_ALU32_IMM(BPF_MOV, R2, 3),
-			BPF_ALU32_REG(BPF_MUL, R1, R2),
-			BPF_ALU64_IMM(BPF_RSH, R1, 8),
-			BPF_JMP_IMM(BPF_JEQ, R1, 0xffffff, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		/* Have to test all register combinations, since
-		 * JITing of different registers will produce
-		 * different asm code.
-		 */
-		"INT: ADD 64-bit",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_ALU64_IMM(BPF_MOV, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R2, 2),
-			BPF_ALU64_IMM(BPF_MOV, R3, 3),
-			BPF_ALU64_IMM(BPF_MOV, R4, 4),
-			BPF_ALU64_IMM(BPF_MOV, R5, 5),
-			BPF_ALU64_IMM(BPF_MOV, R6, 6),
-			BPF_ALU64_IMM(BPF_MOV, R7, 7),
-			BPF_ALU64_IMM(BPF_MOV, R8, 8),
-			BPF_ALU64_IMM(BPF_MOV, R9, 9),
-			BPF_ALU64_IMM(BPF_ADD, R0, 20),
-			BPF_ALU64_IMM(BPF_ADD, R1, 20),
-			BPF_ALU64_IMM(BPF_ADD, R2, 20),
-			BPF_ALU64_IMM(BPF_ADD, R3, 20),
-			BPF_ALU64_IMM(BPF_ADD, R4, 20),
-			BPF_ALU64_IMM(BPF_ADD, R5, 20),
-			BPF_ALU64_IMM(BPF_ADD, R6, 20),
-			BPF_ALU64_IMM(BPF_ADD, R7, 20),
-			BPF_ALU64_IMM(BPF_ADD, R8, 20),
-			BPF_ALU64_IMM(BPF_ADD, R9, 20),
-			BPF_ALU64_IMM(BPF_SUB, R0, 10),
-			BPF_ALU64_IMM(BPF_SUB, R1, 10),
-			BPF_ALU64_IMM(BPF_SUB, R2, 10),
-			BPF_ALU64_IMM(BPF_SUB, R3, 10),
-			BPF_ALU64_IMM(BPF_SUB, R4, 10),
-			BPF_ALU64_IMM(BPF_SUB, R5, 10),
-			BPF_ALU64_IMM(BPF_SUB, R6, 10),
-			BPF_ALU64_IMM(BPF_SUB, R7, 10),
-			BPF_ALU64_IMM(BPF_SUB, R8, 10),
-			BPF_ALU64_IMM(BPF_SUB, R9, 10),
-			BPF_ALU64_REG(BPF_ADD, R0, R0),
-			BPF_ALU64_REG(BPF_ADD, R0, R1),
-			BPF_ALU64_REG(BPF_ADD, R0, R2),
-			BPF_ALU64_REG(BPF_ADD, R0, R3),
-			BPF_ALU64_REG(BPF_ADD, R0, R4),
-			BPF_ALU64_REG(BPF_ADD, R0, R5),
-			BPF_ALU64_REG(BPF_ADD, R0, R6),
-			BPF_ALU64_REG(BPF_ADD, R0, R7),
-			BPF_ALU64_REG(BPF_ADD, R0, R8),
-			BPF_ALU64_REG(BPF_ADD, R0, R9), /* R0 == 155 */
-			BPF_JMP_IMM(BPF_JEQ, R0, 155, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_ADD, R1, R0),
-			BPF_ALU64_REG(BPF_ADD, R1, R1),
-			BPF_ALU64_REG(BPF_ADD, R1, R2),
-			BPF_ALU64_REG(BPF_ADD, R1, R3),
-			BPF_ALU64_REG(BPF_ADD, R1, R4),
-			BPF_ALU64_REG(BPF_ADD, R1, R5),
-			BPF_ALU64_REG(BPF_ADD, R1, R6),
-			BPF_ALU64_REG(BPF_ADD, R1, R7),
-			BPF_ALU64_REG(BPF_ADD, R1, R8),
-			BPF_ALU64_REG(BPF_ADD, R1, R9), /* R1 == 456 */
-			BPF_JMP_IMM(BPF_JEQ, R1, 456, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_ADD, R2, R0),
-			BPF_ALU64_REG(BPF_ADD, R2, R1),
-			BPF_ALU64_REG(BPF_ADD, R2, R2),
-			BPF_ALU64_REG(BPF_ADD, R2, R3),
-			BPF_ALU64_REG(BPF_ADD, R2, R4),
-			BPF_ALU64_REG(BPF_ADD, R2, R5),
-			BPF_ALU64_REG(BPF_ADD, R2, R6),
-			BPF_ALU64_REG(BPF_ADD, R2, R7),
-			BPF_ALU64_REG(BPF_ADD, R2, R8),
-			BPF_ALU64_REG(BPF_ADD, R2, R9), /* R2 == 1358 */
-			BPF_JMP_IMM(BPF_JEQ, R2, 1358, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_ADD, R3, R0),
-			BPF_ALU64_REG(BPF_ADD, R3, R1),
-			BPF_ALU64_REG(BPF_ADD, R3, R2),
-			BPF_ALU64_REG(BPF_ADD, R3, R3),
-			BPF_ALU64_REG(BPF_ADD, R3, R4),
-			BPF_ALU64_REG(BPF_ADD, R3, R5),
-			BPF_ALU64_REG(BPF_ADD, R3, R6),
-			BPF_ALU64_REG(BPF_ADD, R3, R7),
-			BPF_ALU64_REG(BPF_ADD, R3, R8),
-			BPF_ALU64_REG(BPF_ADD, R3, R9), /* R3 == 4063 */
-			BPF_JMP_IMM(BPF_JEQ, R3, 4063, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_ADD, R4, R0),
-			BPF_ALU64_REG(BPF_ADD, R4, R1),
-			BPF_ALU64_REG(BPF_ADD, R4, R2),
-			BPF_ALU64_REG(BPF_ADD, R4, R3),
-			BPF_ALU64_REG(BPF_ADD, R4, R4),
-			BPF_ALU64_REG(BPF_ADD, R4, R5),
-			BPF_ALU64_REG(BPF_ADD, R4, R6),
-			BPF_ALU64_REG(BPF_ADD, R4, R7),
-			BPF_ALU64_REG(BPF_ADD, R4, R8),
-			BPF_ALU64_REG(BPF_ADD, R4, R9), /* R4 == 12177 */
-			BPF_JMP_IMM(BPF_JEQ, R4, 12177, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_ADD, R5, R0),
-			BPF_ALU64_REG(BPF_ADD, R5, R1),
-			BPF_ALU64_REG(BPF_ADD, R5, R2),
-			BPF_ALU64_REG(BPF_ADD, R5, R3),
-			BPF_ALU64_REG(BPF_ADD, R5, R4),
-			BPF_ALU64_REG(BPF_ADD, R5, R5),
-			BPF_ALU64_REG(BPF_ADD, R5, R6),
-			BPF_ALU64_REG(BPF_ADD, R5, R7),
-			BPF_ALU64_REG(BPF_ADD, R5, R8),
-			BPF_ALU64_REG(BPF_ADD, R5, R9), /* R5 == 36518 */
-			BPF_JMP_IMM(BPF_JEQ, R5, 36518, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_ADD, R6, R0),
-			BPF_ALU64_REG(BPF_ADD, R6, R1),
-			BPF_ALU64_REG(BPF_ADD, R6, R2),
-			BPF_ALU64_REG(BPF_ADD, R6, R3),
-			BPF_ALU64_REG(BPF_ADD, R6, R4),
-			BPF_ALU64_REG(BPF_ADD, R6, R5),
-			BPF_ALU64_REG(BPF_ADD, R6, R6),
-			BPF_ALU64_REG(BPF_ADD, R6, R7),
-			BPF_ALU64_REG(BPF_ADD, R6, R8),
-			BPF_ALU64_REG(BPF_ADD, R6, R9), /* R6 == 109540 */
-			BPF_JMP_IMM(BPF_JEQ, R6, 109540, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_ADD, R7, R0),
-			BPF_ALU64_REG(BPF_ADD, R7, R1),
-			BPF_ALU64_REG(BPF_ADD, R7, R2),
-			BPF_ALU64_REG(BPF_ADD, R7, R3),
-			BPF_ALU64_REG(BPF_ADD, R7, R4),
-			BPF_ALU64_REG(BPF_ADD, R7, R5),
-			BPF_ALU64_REG(BPF_ADD, R7, R6),
-			BPF_ALU64_REG(BPF_ADD, R7, R7),
-			BPF_ALU64_REG(BPF_ADD, R7, R8),
-			BPF_ALU64_REG(BPF_ADD, R7, R9), /* R7 == 328605 */
-			BPF_JMP_IMM(BPF_JEQ, R7, 328605, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_ADD, R8, R0),
-			BPF_ALU64_REG(BPF_ADD, R8, R1),
-			BPF_ALU64_REG(BPF_ADD, R8, R2),
-			BPF_ALU64_REG(BPF_ADD, R8, R3),
-			BPF_ALU64_REG(BPF_ADD, R8, R4),
-			BPF_ALU64_REG(BPF_ADD, R8, R5),
-			BPF_ALU64_REG(BPF_ADD, R8, R6),
-			BPF_ALU64_REG(BPF_ADD, R8, R7),
-			BPF_ALU64_REG(BPF_ADD, R8, R8),
-			BPF_ALU64_REG(BPF_ADD, R8, R9), /* R8 == 985799 */
-			BPF_JMP_IMM(BPF_JEQ, R8, 985799, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_ADD, R9, R0),
-			BPF_ALU64_REG(BPF_ADD, R9, R1),
-			BPF_ALU64_REG(BPF_ADD, R9, R2),
-			BPF_ALU64_REG(BPF_ADD, R9, R3),
-			BPF_ALU64_REG(BPF_ADD, R9, R4),
-			BPF_ALU64_REG(BPF_ADD, R9, R5),
-			BPF_ALU64_REG(BPF_ADD, R9, R6),
-			BPF_ALU64_REG(BPF_ADD, R9, R7),
-			BPF_ALU64_REG(BPF_ADD, R9, R8),
-			BPF_ALU64_REG(BPF_ADD, R9, R9), /* R9 == 2957380 */
-			BPF_ALU64_REG(BPF_MOV, R0, R9),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2957380 } }
-	},
-	{
-		"INT: ADD 32-bit",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 20),
-			BPF_ALU32_IMM(BPF_MOV, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R2, 2),
-			BPF_ALU32_IMM(BPF_MOV, R3, 3),
-			BPF_ALU32_IMM(BPF_MOV, R4, 4),
-			BPF_ALU32_IMM(BPF_MOV, R5, 5),
-			BPF_ALU32_IMM(BPF_MOV, R6, 6),
-			BPF_ALU32_IMM(BPF_MOV, R7, 7),
-			BPF_ALU32_IMM(BPF_MOV, R8, 8),
-			BPF_ALU32_IMM(BPF_MOV, R9, 9),
-			BPF_ALU64_IMM(BPF_ADD, R1, 10),
-			BPF_ALU64_IMM(BPF_ADD, R2, 10),
-			BPF_ALU64_IMM(BPF_ADD, R3, 10),
-			BPF_ALU64_IMM(BPF_ADD, R4, 10),
-			BPF_ALU64_IMM(BPF_ADD, R5, 10),
-			BPF_ALU64_IMM(BPF_ADD, R6, 10),
-			BPF_ALU64_IMM(BPF_ADD, R7, 10),
-			BPF_ALU64_IMM(BPF_ADD, R8, 10),
-			BPF_ALU64_IMM(BPF_ADD, R9, 10),
-			BPF_ALU32_REG(BPF_ADD, R0, R1),
-			BPF_ALU32_REG(BPF_ADD, R0, R2),
-			BPF_ALU32_REG(BPF_ADD, R0, R3),
-			BPF_ALU32_REG(BPF_ADD, R0, R4),
-			BPF_ALU32_REG(BPF_ADD, R0, R5),
-			BPF_ALU32_REG(BPF_ADD, R0, R6),
-			BPF_ALU32_REG(BPF_ADD, R0, R7),
-			BPF_ALU32_REG(BPF_ADD, R0, R8),
-			BPF_ALU32_REG(BPF_ADD, R0, R9), /* R0 == 155 */
-			BPF_JMP_IMM(BPF_JEQ, R0, 155, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_REG(BPF_ADD, R1, R0),
-			BPF_ALU32_REG(BPF_ADD, R1, R1),
-			BPF_ALU32_REG(BPF_ADD, R1, R2),
-			BPF_ALU32_REG(BPF_ADD, R1, R3),
-			BPF_ALU32_REG(BPF_ADD, R1, R4),
-			BPF_ALU32_REG(BPF_ADD, R1, R5),
-			BPF_ALU32_REG(BPF_ADD, R1, R6),
-			BPF_ALU32_REG(BPF_ADD, R1, R7),
-			BPF_ALU32_REG(BPF_ADD, R1, R8),
-			BPF_ALU32_REG(BPF_ADD, R1, R9), /* R1 == 456 */
-			BPF_JMP_IMM(BPF_JEQ, R1, 456, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_REG(BPF_ADD, R2, R0),
-			BPF_ALU32_REG(BPF_ADD, R2, R1),
-			BPF_ALU32_REG(BPF_ADD, R2, R2),
-			BPF_ALU32_REG(BPF_ADD, R2, R3),
-			BPF_ALU32_REG(BPF_ADD, R2, R4),
-			BPF_ALU32_REG(BPF_ADD, R2, R5),
-			BPF_ALU32_REG(BPF_ADD, R2, R6),
-			BPF_ALU32_REG(BPF_ADD, R2, R7),
-			BPF_ALU32_REG(BPF_ADD, R2, R8),
-			BPF_ALU32_REG(BPF_ADD, R2, R9), /* R2 == 1358 */
-			BPF_JMP_IMM(BPF_JEQ, R2, 1358, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_REG(BPF_ADD, R3, R0),
-			BPF_ALU32_REG(BPF_ADD, R3, R1),
-			BPF_ALU32_REG(BPF_ADD, R3, R2),
-			BPF_ALU32_REG(BPF_ADD, R3, R3),
-			BPF_ALU32_REG(BPF_ADD, R3, R4),
-			BPF_ALU32_REG(BPF_ADD, R3, R5),
-			BPF_ALU32_REG(BPF_ADD, R3, R6),
-			BPF_ALU32_REG(BPF_ADD, R3, R7),
-			BPF_ALU32_REG(BPF_ADD, R3, R8),
-			BPF_ALU32_REG(BPF_ADD, R3, R9), /* R3 == 4063 */
-			BPF_JMP_IMM(BPF_JEQ, R3, 4063, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_REG(BPF_ADD, R4, R0),
-			BPF_ALU32_REG(BPF_ADD, R4, R1),
-			BPF_ALU32_REG(BPF_ADD, R4, R2),
-			BPF_ALU32_REG(BPF_ADD, R4, R3),
-			BPF_ALU32_REG(BPF_ADD, R4, R4),
-			BPF_ALU32_REG(BPF_ADD, R4, R5),
-			BPF_ALU32_REG(BPF_ADD, R4, R6),
-			BPF_ALU32_REG(BPF_ADD, R4, R7),
-			BPF_ALU32_REG(BPF_ADD, R4, R8),
-			BPF_ALU32_REG(BPF_ADD, R4, R9), /* R4 == 12177 */
-			BPF_JMP_IMM(BPF_JEQ, R4, 12177, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_REG(BPF_ADD, R5, R0),
-			BPF_ALU32_REG(BPF_ADD, R5, R1),
-			BPF_ALU32_REG(BPF_ADD, R5, R2),
-			BPF_ALU32_REG(BPF_ADD, R5, R3),
-			BPF_ALU32_REG(BPF_ADD, R5, R4),
-			BPF_ALU32_REG(BPF_ADD, R5, R5),
-			BPF_ALU32_REG(BPF_ADD, R5, R6),
-			BPF_ALU32_REG(BPF_ADD, R5, R7),
-			BPF_ALU32_REG(BPF_ADD, R5, R8),
-			BPF_ALU32_REG(BPF_ADD, R5, R9), /* R5 == 36518 */
-			BPF_JMP_IMM(BPF_JEQ, R5, 36518, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_REG(BPF_ADD, R6, R0),
-			BPF_ALU32_REG(BPF_ADD, R6, R1),
-			BPF_ALU32_REG(BPF_ADD, R6, R2),
-			BPF_ALU32_REG(BPF_ADD, R6, R3),
-			BPF_ALU32_REG(BPF_ADD, R6, R4),
-			BPF_ALU32_REG(BPF_ADD, R6, R5),
-			BPF_ALU32_REG(BPF_ADD, R6, R6),
-			BPF_ALU32_REG(BPF_ADD, R6, R7),
-			BPF_ALU32_REG(BPF_ADD, R6, R8),
-			BPF_ALU32_REG(BPF_ADD, R6, R9), /* R6 == 109540 */
-			BPF_JMP_IMM(BPF_JEQ, R6, 109540, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_REG(BPF_ADD, R7, R0),
-			BPF_ALU32_REG(BPF_ADD, R7, R1),
-			BPF_ALU32_REG(BPF_ADD, R7, R2),
-			BPF_ALU32_REG(BPF_ADD, R7, R3),
-			BPF_ALU32_REG(BPF_ADD, R7, R4),
-			BPF_ALU32_REG(BPF_ADD, R7, R5),
-			BPF_ALU32_REG(BPF_ADD, R7, R6),
-			BPF_ALU32_REG(BPF_ADD, R7, R7),
-			BPF_ALU32_REG(BPF_ADD, R7, R8),
-			BPF_ALU32_REG(BPF_ADD, R7, R9), /* R7 == 328605 */
-			BPF_JMP_IMM(BPF_JEQ, R7, 328605, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_REG(BPF_ADD, R8, R0),
-			BPF_ALU32_REG(BPF_ADD, R8, R1),
-			BPF_ALU32_REG(BPF_ADD, R8, R2),
-			BPF_ALU32_REG(BPF_ADD, R8, R3),
-			BPF_ALU32_REG(BPF_ADD, R8, R4),
-			BPF_ALU32_REG(BPF_ADD, R8, R5),
-			BPF_ALU32_REG(BPF_ADD, R8, R6),
-			BPF_ALU32_REG(BPF_ADD, R8, R7),
-			BPF_ALU32_REG(BPF_ADD, R8, R8),
-			BPF_ALU32_REG(BPF_ADD, R8, R9), /* R8 == 985799 */
-			BPF_JMP_IMM(BPF_JEQ, R8, 985799, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_REG(BPF_ADD, R9, R0),
-			BPF_ALU32_REG(BPF_ADD, R9, R1),
-			BPF_ALU32_REG(BPF_ADD, R9, R2),
-			BPF_ALU32_REG(BPF_ADD, R9, R3),
-			BPF_ALU32_REG(BPF_ADD, R9, R4),
-			BPF_ALU32_REG(BPF_ADD, R9, R5),
-			BPF_ALU32_REG(BPF_ADD, R9, R6),
-			BPF_ALU32_REG(BPF_ADD, R9, R7),
-			BPF_ALU32_REG(BPF_ADD, R9, R8),
-			BPF_ALU32_REG(BPF_ADD, R9, R9), /* R9 == 2957380 */
-			BPF_ALU32_REG(BPF_MOV, R0, R9),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2957380 } }
-	},
-	{	/* Mainly checking JIT here. */
-		"INT: SUB",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_ALU64_IMM(BPF_MOV, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R2, 2),
-			BPF_ALU64_IMM(BPF_MOV, R3, 3),
-			BPF_ALU64_IMM(BPF_MOV, R4, 4),
-			BPF_ALU64_IMM(BPF_MOV, R5, 5),
-			BPF_ALU64_IMM(BPF_MOV, R6, 6),
-			BPF_ALU64_IMM(BPF_MOV, R7, 7),
-			BPF_ALU64_IMM(BPF_MOV, R8, 8),
-			BPF_ALU64_IMM(BPF_MOV, R9, 9),
-			BPF_ALU64_REG(BPF_SUB, R0, R0),
-			BPF_ALU64_REG(BPF_SUB, R0, R1),
-			BPF_ALU64_REG(BPF_SUB, R0, R2),
-			BPF_ALU64_REG(BPF_SUB, R0, R3),
-			BPF_ALU64_REG(BPF_SUB, R0, R4),
-			BPF_ALU64_REG(BPF_SUB, R0, R5),
-			BPF_ALU64_REG(BPF_SUB, R0, R6),
-			BPF_ALU64_REG(BPF_SUB, R0, R7),
-			BPF_ALU64_REG(BPF_SUB, R0, R8),
-			BPF_ALU64_REG(BPF_SUB, R0, R9),
-			BPF_ALU64_IMM(BPF_SUB, R0, 10),
-			BPF_JMP_IMM(BPF_JEQ, R0, -55, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_SUB, R1, R0),
-			BPF_ALU64_REG(BPF_SUB, R1, R2),
-			BPF_ALU64_REG(BPF_SUB, R1, R3),
-			BPF_ALU64_REG(BPF_SUB, R1, R4),
-			BPF_ALU64_REG(BPF_SUB, R1, R5),
-			BPF_ALU64_REG(BPF_SUB, R1, R6),
-			BPF_ALU64_REG(BPF_SUB, R1, R7),
-			BPF_ALU64_REG(BPF_SUB, R1, R8),
-			BPF_ALU64_REG(BPF_SUB, R1, R9),
-			BPF_ALU64_IMM(BPF_SUB, R1, 10),
-			BPF_ALU64_REG(BPF_SUB, R2, R0),
-			BPF_ALU64_REG(BPF_SUB, R2, R1),
-			BPF_ALU64_REG(BPF_SUB, R2, R3),
-			BPF_ALU64_REG(BPF_SUB, R2, R4),
-			BPF_ALU64_REG(BPF_SUB, R2, R5),
-			BPF_ALU64_REG(BPF_SUB, R2, R6),
-			BPF_ALU64_REG(BPF_SUB, R2, R7),
-			BPF_ALU64_REG(BPF_SUB, R2, R8),
-			BPF_ALU64_REG(BPF_SUB, R2, R9),
-			BPF_ALU64_IMM(BPF_SUB, R2, 10),
-			BPF_ALU64_REG(BPF_SUB, R3, R0),
-			BPF_ALU64_REG(BPF_SUB, R3, R1),
-			BPF_ALU64_REG(BPF_SUB, R3, R2),
-			BPF_ALU64_REG(BPF_SUB, R3, R4),
-			BPF_ALU64_REG(BPF_SUB, R3, R5),
-			BPF_ALU64_REG(BPF_SUB, R3, R6),
-			BPF_ALU64_REG(BPF_SUB, R3, R7),
-			BPF_ALU64_REG(BPF_SUB, R3, R8),
-			BPF_ALU64_REG(BPF_SUB, R3, R9),
-			BPF_ALU64_IMM(BPF_SUB, R3, 10),
-			BPF_ALU64_REG(BPF_SUB, R4, R0),
-			BPF_ALU64_REG(BPF_SUB, R4, R1),
-			BPF_ALU64_REG(BPF_SUB, R4, R2),
-			BPF_ALU64_REG(BPF_SUB, R4, R3),
-			BPF_ALU64_REG(BPF_SUB, R4, R5),
-			BPF_ALU64_REG(BPF_SUB, R4, R6),
-			BPF_ALU64_REG(BPF_SUB, R4, R7),
-			BPF_ALU64_REG(BPF_SUB, R4, R8),
-			BPF_ALU64_REG(BPF_SUB, R4, R9),
-			BPF_ALU64_IMM(BPF_SUB, R4, 10),
-			BPF_ALU64_REG(BPF_SUB, R5, R0),
-			BPF_ALU64_REG(BPF_SUB, R5, R1),
-			BPF_ALU64_REG(BPF_SUB, R5, R2),
-			BPF_ALU64_REG(BPF_SUB, R5, R3),
-			BPF_ALU64_REG(BPF_SUB, R5, R4),
-			BPF_ALU64_REG(BPF_SUB, R5, R6),
-			BPF_ALU64_REG(BPF_SUB, R5, R7),
-			BPF_ALU64_REG(BPF_SUB, R5, R8),
-			BPF_ALU64_REG(BPF_SUB, R5, R9),
-			BPF_ALU64_IMM(BPF_SUB, R5, 10),
-			BPF_ALU64_REG(BPF_SUB, R6, R0),
-			BPF_ALU64_REG(BPF_SUB, R6, R1),
-			BPF_ALU64_REG(BPF_SUB, R6, R2),
-			BPF_ALU64_REG(BPF_SUB, R6, R3),
-			BPF_ALU64_REG(BPF_SUB, R6, R4),
-			BPF_ALU64_REG(BPF_SUB, R6, R5),
-			BPF_ALU64_REG(BPF_SUB, R6, R7),
-			BPF_ALU64_REG(BPF_SUB, R6, R8),
-			BPF_ALU64_REG(BPF_SUB, R6, R9),
-			BPF_ALU64_IMM(BPF_SUB, R6, 10),
-			BPF_ALU64_REG(BPF_SUB, R7, R0),
-			BPF_ALU64_REG(BPF_SUB, R7, R1),
-			BPF_ALU64_REG(BPF_SUB, R7, R2),
-			BPF_ALU64_REG(BPF_SUB, R7, R3),
-			BPF_ALU64_REG(BPF_SUB, R7, R4),
-			BPF_ALU64_REG(BPF_SUB, R7, R5),
-			BPF_ALU64_REG(BPF_SUB, R7, R6),
-			BPF_ALU64_REG(BPF_SUB, R7, R8),
-			BPF_ALU64_REG(BPF_SUB, R7, R9),
-			BPF_ALU64_IMM(BPF_SUB, R7, 10),
-			BPF_ALU64_REG(BPF_SUB, R8, R0),
-			BPF_ALU64_REG(BPF_SUB, R8, R1),
-			BPF_ALU64_REG(BPF_SUB, R8, R2),
-			BPF_ALU64_REG(BPF_SUB, R8, R3),
-			BPF_ALU64_REG(BPF_SUB, R8, R4),
-			BPF_ALU64_REG(BPF_SUB, R8, R5),
-			BPF_ALU64_REG(BPF_SUB, R8, R6),
-			BPF_ALU64_REG(BPF_SUB, R8, R7),
-			BPF_ALU64_REG(BPF_SUB, R8, R9),
-			BPF_ALU64_IMM(BPF_SUB, R8, 10),
-			BPF_ALU64_REG(BPF_SUB, R9, R0),
-			BPF_ALU64_REG(BPF_SUB, R9, R1),
-			BPF_ALU64_REG(BPF_SUB, R9, R2),
-			BPF_ALU64_REG(BPF_SUB, R9, R3),
-			BPF_ALU64_REG(BPF_SUB, R9, R4),
-			BPF_ALU64_REG(BPF_SUB, R9, R5),
-			BPF_ALU64_REG(BPF_SUB, R9, R6),
-			BPF_ALU64_REG(BPF_SUB, R9, R7),
-			BPF_ALU64_REG(BPF_SUB, R9, R8),
-			BPF_ALU64_IMM(BPF_SUB, R9, 10),
-			BPF_ALU64_IMM(BPF_SUB, R0, 10),
-			BPF_ALU64_IMM(BPF_NEG, R0, 0),
-			BPF_ALU64_REG(BPF_SUB, R0, R1),
-			BPF_ALU64_REG(BPF_SUB, R0, R2),
-			BPF_ALU64_REG(BPF_SUB, R0, R3),
-			BPF_ALU64_REG(BPF_SUB, R0, R4),
-			BPF_ALU64_REG(BPF_SUB, R0, R5),
-			BPF_ALU64_REG(BPF_SUB, R0, R6),
-			BPF_ALU64_REG(BPF_SUB, R0, R7),
-			BPF_ALU64_REG(BPF_SUB, R0, R8),
-			BPF_ALU64_REG(BPF_SUB, R0, R9),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 11 } }
-	},
-	{	/* Mainly checking JIT here. */
-		"INT: XOR",
-		.u.insns_int = {
-			BPF_ALU64_REG(BPF_SUB, R0, R0),
-			BPF_ALU64_REG(BPF_XOR, R1, R1),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_IMM(BPF_MOV, R0, 10),
-			BPF_ALU64_IMM(BPF_MOV, R1, -1),
-			BPF_ALU64_REG(BPF_SUB, R1, R1),
-			BPF_ALU64_REG(BPF_XOR, R2, R2),
-			BPF_JMP_REG(BPF_JEQ, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_SUB, R2, R2),
-			BPF_ALU64_REG(BPF_XOR, R3, R3),
-			BPF_ALU64_IMM(BPF_MOV, R0, 10),
-			BPF_ALU64_IMM(BPF_MOV, R1, -1),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_SUB, R3, R3),
-			BPF_ALU64_REG(BPF_XOR, R4, R4),
-			BPF_ALU64_IMM(BPF_MOV, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R5, -1),
-			BPF_JMP_REG(BPF_JEQ, R3, R4, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_SUB, R4, R4),
-			BPF_ALU64_REG(BPF_XOR, R5, R5),
-			BPF_ALU64_IMM(BPF_MOV, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R7, -1),
-			BPF_JMP_REG(BPF_JEQ, R5, R4, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_IMM(BPF_MOV, R5, 1),
-			BPF_ALU64_REG(BPF_SUB, R5, R5),
-			BPF_ALU64_REG(BPF_XOR, R6, R6),
-			BPF_ALU64_IMM(BPF_MOV, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R8, -1),
-			BPF_JMP_REG(BPF_JEQ, R5, R6, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_SUB, R6, R6),
-			BPF_ALU64_REG(BPF_XOR, R7, R7),
-			BPF_JMP_REG(BPF_JEQ, R7, R6, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_SUB, R7, R7),
-			BPF_ALU64_REG(BPF_XOR, R8, R8),
-			BPF_JMP_REG(BPF_JEQ, R7, R8, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_SUB, R8, R8),
-			BPF_ALU64_REG(BPF_XOR, R9, R9),
-			BPF_JMP_REG(BPF_JEQ, R9, R8, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_SUB, R9, R9),
-			BPF_ALU64_REG(BPF_XOR, R0, R0),
-			BPF_JMP_REG(BPF_JEQ, R9, R0, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_SUB, R1, R1),
-			BPF_ALU64_REG(BPF_XOR, R0, R0),
-			BPF_JMP_REG(BPF_JEQ, R9, R0, 2),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{	/* Mainly checking JIT here. */
-		"INT: MUL",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 11),
-			BPF_ALU64_IMM(BPF_MOV, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R2, 2),
-			BPF_ALU64_IMM(BPF_MOV, R3, 3),
-			BPF_ALU64_IMM(BPF_MOV, R4, 4),
-			BPF_ALU64_IMM(BPF_MOV, R5, 5),
-			BPF_ALU64_IMM(BPF_MOV, R6, 6),
-			BPF_ALU64_IMM(BPF_MOV, R7, 7),
-			BPF_ALU64_IMM(BPF_MOV, R8, 8),
-			BPF_ALU64_IMM(BPF_MOV, R9, 9),
-			BPF_ALU64_REG(BPF_MUL, R0, R0),
-			BPF_ALU64_REG(BPF_MUL, R0, R1),
-			BPF_ALU64_REG(BPF_MUL, R0, R2),
-			BPF_ALU64_REG(BPF_MUL, R0, R3),
-			BPF_ALU64_REG(BPF_MUL, R0, R4),
-			BPF_ALU64_REG(BPF_MUL, R0, R5),
-			BPF_ALU64_REG(BPF_MUL, R0, R6),
-			BPF_ALU64_REG(BPF_MUL, R0, R7),
-			BPF_ALU64_REG(BPF_MUL, R0, R8),
-			BPF_ALU64_REG(BPF_MUL, R0, R9),
-			BPF_ALU64_IMM(BPF_MUL, R0, 10),
-			BPF_JMP_IMM(BPF_JEQ, R0, 439084800, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_MUL, R1, R0),
-			BPF_ALU64_REG(BPF_MUL, R1, R2),
-			BPF_ALU64_REG(BPF_MUL, R1, R3),
-			BPF_ALU64_REG(BPF_MUL, R1, R4),
-			BPF_ALU64_REG(BPF_MUL, R1, R5),
-			BPF_ALU64_REG(BPF_MUL, R1, R6),
-			BPF_ALU64_REG(BPF_MUL, R1, R7),
-			BPF_ALU64_REG(BPF_MUL, R1, R8),
-			BPF_ALU64_REG(BPF_MUL, R1, R9),
-			BPF_ALU64_IMM(BPF_MUL, R1, 10),
-			BPF_ALU64_REG(BPF_MOV, R2, R1),
-			BPF_ALU64_IMM(BPF_RSH, R2, 32),
-			BPF_JMP_IMM(BPF_JEQ, R2, 0x5a924, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_IMM(BPF_LSH, R1, 32),
-			BPF_ALU64_IMM(BPF_ARSH, R1, 32),
-			BPF_JMP_IMM(BPF_JEQ, R1, 0xebb90000, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_REG(BPF_MUL, R2, R0),
-			BPF_ALU64_REG(BPF_MUL, R2, R1),
-			BPF_ALU64_REG(BPF_MUL, R2, R3),
-			BPF_ALU64_REG(BPF_MUL, R2, R4),
-			BPF_ALU64_REG(BPF_MUL, R2, R5),
-			BPF_ALU64_REG(BPF_MUL, R2, R6),
-			BPF_ALU64_REG(BPF_MUL, R2, R7),
-			BPF_ALU64_REG(BPF_MUL, R2, R8),
-			BPF_ALU64_REG(BPF_MUL, R2, R9),
-			BPF_ALU64_IMM(BPF_MUL, R2, 10),
-			BPF_ALU64_IMM(BPF_RSH, R2, 32),
-			BPF_ALU64_REG(BPF_MOV, R0, R2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x35d97ef2 } }
-	},
-	{	/* Mainly checking JIT here. */
-		"MOV REG64",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xffffffffffffffffLL),
-			BPF_MOV64_REG(R1, R0),
-			BPF_MOV64_REG(R2, R1),
-			BPF_MOV64_REG(R3, R2),
-			BPF_MOV64_REG(R4, R3),
-			BPF_MOV64_REG(R5, R4),
-			BPF_MOV64_REG(R6, R5),
-			BPF_MOV64_REG(R7, R6),
-			BPF_MOV64_REG(R8, R7),
-			BPF_MOV64_REG(R9, R8),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_ALU64_IMM(BPF_MOV, R1, 0),
-			BPF_ALU64_IMM(BPF_MOV, R2, 0),
-			BPF_ALU64_IMM(BPF_MOV, R3, 0),
-			BPF_ALU64_IMM(BPF_MOV, R4, 0),
-			BPF_ALU64_IMM(BPF_MOV, R5, 0),
-			BPF_ALU64_IMM(BPF_MOV, R6, 0),
-			BPF_ALU64_IMM(BPF_MOV, R7, 0),
-			BPF_ALU64_IMM(BPF_MOV, R8, 0),
-			BPF_ALU64_IMM(BPF_MOV, R9, 0),
-			BPF_ALU64_REG(BPF_ADD, R0, R0),
-			BPF_ALU64_REG(BPF_ADD, R0, R1),
-			BPF_ALU64_REG(BPF_ADD, R0, R2),
-			BPF_ALU64_REG(BPF_ADD, R0, R3),
-			BPF_ALU64_REG(BPF_ADD, R0, R4),
-			BPF_ALU64_REG(BPF_ADD, R0, R5),
-			BPF_ALU64_REG(BPF_ADD, R0, R6),
-			BPF_ALU64_REG(BPF_ADD, R0, R7),
-			BPF_ALU64_REG(BPF_ADD, R0, R8),
-			BPF_ALU64_REG(BPF_ADD, R0, R9),
-			BPF_ALU64_IMM(BPF_ADD, R0, 0xfefe),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfefe } }
-	},
-	{	/* Mainly checking JIT here. */
-		"MOV REG32",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xffffffffffffffffLL),
-			BPF_MOV64_REG(R1, R0),
-			BPF_MOV64_REG(R2, R1),
-			BPF_MOV64_REG(R3, R2),
-			BPF_MOV64_REG(R4, R3),
-			BPF_MOV64_REG(R5, R4),
-			BPF_MOV64_REG(R6, R5),
-			BPF_MOV64_REG(R7, R6),
-			BPF_MOV64_REG(R8, R7),
-			BPF_MOV64_REG(R9, R8),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0),
-			BPF_ALU32_IMM(BPF_MOV, R2, 0),
-			BPF_ALU32_IMM(BPF_MOV, R3, 0),
-			BPF_ALU32_IMM(BPF_MOV, R4, 0),
-			BPF_ALU32_IMM(BPF_MOV, R5, 0),
-			BPF_ALU32_IMM(BPF_MOV, R6, 0),
-			BPF_ALU32_IMM(BPF_MOV, R7, 0),
-			BPF_ALU32_IMM(BPF_MOV, R8, 0),
-			BPF_ALU32_IMM(BPF_MOV, R9, 0),
-			BPF_ALU64_REG(BPF_ADD, R0, R0),
-			BPF_ALU64_REG(BPF_ADD, R0, R1),
-			BPF_ALU64_REG(BPF_ADD, R0, R2),
-			BPF_ALU64_REG(BPF_ADD, R0, R3),
-			BPF_ALU64_REG(BPF_ADD, R0, R4),
-			BPF_ALU64_REG(BPF_ADD, R0, R5),
-			BPF_ALU64_REG(BPF_ADD, R0, R6),
-			BPF_ALU64_REG(BPF_ADD, R0, R7),
-			BPF_ALU64_REG(BPF_ADD, R0, R8),
-			BPF_ALU64_REG(BPF_ADD, R0, R9),
-			BPF_ALU64_IMM(BPF_ADD, R0, 0xfefe),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfefe } }
-	},
-	{	/* Mainly checking JIT here. */
-		"LD IMM64",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xffffffffffffffffLL),
-			BPF_MOV64_REG(R1, R0),
-			BPF_MOV64_REG(R2, R1),
-			BPF_MOV64_REG(R3, R2),
-			BPF_MOV64_REG(R4, R3),
-			BPF_MOV64_REG(R5, R4),
-			BPF_MOV64_REG(R6, R5),
-			BPF_MOV64_REG(R7, R6),
-			BPF_MOV64_REG(R8, R7),
-			BPF_MOV64_REG(R9, R8),
-			BPF_LD_IMM64(R0, 0x0LL),
-			BPF_LD_IMM64(R1, 0x0LL),
-			BPF_LD_IMM64(R2, 0x0LL),
-			BPF_LD_IMM64(R3, 0x0LL),
-			BPF_LD_IMM64(R4, 0x0LL),
-			BPF_LD_IMM64(R5, 0x0LL),
-			BPF_LD_IMM64(R6, 0x0LL),
-			BPF_LD_IMM64(R7, 0x0LL),
-			BPF_LD_IMM64(R8, 0x0LL),
-			BPF_LD_IMM64(R9, 0x0LL),
-			BPF_ALU64_REG(BPF_ADD, R0, R0),
-			BPF_ALU64_REG(BPF_ADD, R0, R1),
-			BPF_ALU64_REG(BPF_ADD, R0, R2),
-			BPF_ALU64_REG(BPF_ADD, R0, R3),
-			BPF_ALU64_REG(BPF_ADD, R0, R4),
-			BPF_ALU64_REG(BPF_ADD, R0, R5),
-			BPF_ALU64_REG(BPF_ADD, R0, R6),
-			BPF_ALU64_REG(BPF_ADD, R0, R7),
-			BPF_ALU64_REG(BPF_ADD, R0, R8),
-			BPF_ALU64_REG(BPF_ADD, R0, R9),
-			BPF_ALU64_IMM(BPF_ADD, R0, 0xfefe),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfefe } }
-	},
-	{
-		"INT: ALU MIX",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 11),
-			BPF_ALU64_IMM(BPF_ADD, R0, -1),
-			BPF_ALU64_IMM(BPF_MOV, R2, 2),
-			BPF_ALU64_IMM(BPF_XOR, R2, 3),
-			BPF_ALU64_REG(BPF_DIV, R0, R2),
-			BPF_JMP_IMM(BPF_JEQ, R0, 10, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_IMM(BPF_MOD, R0, 3),
-			BPF_JMP_IMM(BPF_JEQ, R0, 1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_IMM(BPF_MOV, R0, -1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } }
-	},
-	{
-		"INT: shifts by register",
-		.u.insns_int = {
-			BPF_MOV64_IMM(R0, -1234),
-			BPF_MOV64_IMM(R1, 1),
-			BPF_ALU32_REG(BPF_RSH, R0, R1),
-			BPF_JMP_IMM(BPF_JEQ, R0, 0x7ffffd97, 1),
-			BPF_EXIT_INSN(),
-			BPF_MOV64_IMM(R2, 1),
-			BPF_ALU64_REG(BPF_LSH, R0, R2),
-			BPF_MOV32_IMM(R4, -1234),
-			BPF_JMP_REG(BPF_JEQ, R0, R4, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU64_IMM(BPF_AND, R4, 63),
-			BPF_ALU64_REG(BPF_LSH, R0, R4), /* R0 <= 46 */
-			BPF_MOV64_IMM(R3, 47),
-			BPF_ALU64_REG(BPF_ARSH, R0, R3),
-			BPF_JMP_IMM(BPF_JEQ, R0, -617, 1),
-			BPF_EXIT_INSN(),
-			BPF_MOV64_IMM(R2, 1),
-			BPF_ALU64_REG(BPF_LSH, R4, R2), /* R4 = 46 << 1 */
-			BPF_JMP_IMM(BPF_JEQ, R4, 92, 1),
-			BPF_EXIT_INSN(),
-			BPF_MOV64_IMM(R4, 4),
-			BPF_ALU64_REG(BPF_LSH, R4, R4), /* R4 = 4 << 4 */
-			BPF_JMP_IMM(BPF_JEQ, R4, 64, 1),
-			BPF_EXIT_INSN(),
-			BPF_MOV64_IMM(R4, 5),
-			BPF_ALU32_REG(BPF_LSH, R4, R4), /* R4 = 5 << 5 */
-			BPF_JMP_IMM(BPF_JEQ, R4, 160, 1),
-			BPF_EXIT_INSN(),
-			BPF_MOV64_IMM(R0, -1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } }
-	},
-#ifdef CONFIG_32BIT
-	{
-		"INT: 32-bit context pointer word order and zero-extension",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_JMP32_IMM(BPF_JEQ, R1, 0, 3),
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),
-			BPF_JMP32_IMM(BPF_JNE, R1, 0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-#endif
-	{
-		"check: missing ret",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 1),
-		},
-		CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-		{ },
-		{ },
-		.fill_helper = NULL,
-		.expected_errcode = -EINVAL,
-	},
-	{
-		"check: div_k_0",
-		.u.insns = {
-			BPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 0),
-			BPF_STMT(BPF_RET | BPF_K, 0)
-		},
-		CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-		{ },
-		{ },
-		.fill_helper = NULL,
-		.expected_errcode = -EINVAL,
-	},
-	{
-		"check: unknown insn",
-		.u.insns = {
-			/* seccomp insn, rejected in socket filter */
-			BPF_STMT(BPF_LDX | BPF_W | BPF_ABS, 0),
-			BPF_STMT(BPF_RET | BPF_K, 0)
-		},
-		CLASSIC | FLAG_EXPECTED_FAIL,
-		{ },
-		{ },
-		.fill_helper = NULL,
-		.expected_errcode = -EINVAL,
-	},
-	{
-		"check: out of range spill/fill",
-		.u.insns = {
-			BPF_STMT(BPF_STX, 16),
-			BPF_STMT(BPF_RET | BPF_K, 0)
-		},
-		CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-		{ },
-		{ },
-		.fill_helper = NULL,
-		.expected_errcode = -EINVAL,
-	},
-	{
-		"JUMPS + HOLES",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_JUMP(BPF_JMP | BPF_JGE, 0, 13, 15),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ, 0x90c2894d, 3, 4),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ, 0x90c2894d, 1, 2),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_JUMP(BPF_JMP | BPF_JGE, 0, 14, 15),
-			BPF_JUMP(BPF_JMP | BPF_JGE, 0, 13, 14),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ, 0x2ac28349, 2, 3),
-			BPF_JUMP(BPF_JMP | BPF_JEQ, 0x2ac28349, 1, 2),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_JUMP(BPF_JMP | BPF_JGE, 0, 14, 15),
-			BPF_JUMP(BPF_JMP | BPF_JGE, 0, 13, 14),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ, 0x90d2ff41, 2, 3),
-			BPF_JUMP(BPF_JMP | BPF_JEQ, 0x90d2ff41, 1, 2),
-			BPF_STMT(BPF_LD | BPF_H | BPF_ABS, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0),
-		},
-		CLASSIC,
-		{ 0x00, 0x1b, 0x21, 0x3c, 0x9d, 0xf8,
-		  0x90, 0xe2, 0xba, 0x0a, 0x56, 0xb4,
-		  0x08, 0x00,
-		  0x45, 0x00, 0x00, 0x28, 0x00, 0x00,
-		  0x20, 0x00, 0x40, 0x11, 0x00, 0x00, /* IP header */
-		  0xc0, 0xa8, 0x33, 0x01,
-		  0xc0, 0xa8, 0x33, 0x02,
-		  0xbb, 0xb6,
-		  0xa9, 0xfa,
-		  0x00, 0x14, 0x00, 0x00,
-		  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-		  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-		  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-		  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-		  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-		  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-		  0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc,
-		  0xcc, 0xcc, 0xcc, 0xcc },
-		{ { 88, 0x001b } }
-	},
-	{
-		"check: RET X",
-		.u.insns = {
-			BPF_STMT(BPF_RET | BPF_X, 0),
-		},
-		CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-		{ },
-		{ },
-		.fill_helper = NULL,
-		.expected_errcode = -EINVAL,
-	},
-	{
-		"check: LDX + RET X",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 42),
-			BPF_STMT(BPF_RET | BPF_X, 0),
-		},
-		CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-		{ },
-		{ },
-		.fill_helper = NULL,
-		.expected_errcode = -EINVAL,
-	},
-	{	/* Mainly checking JIT here. */
-		"M[]: alt STX + LDX",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 100),
-			BPF_STMT(BPF_STX, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 0),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 1),
-			BPF_STMT(BPF_LDX | BPF_MEM, 1),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 2),
-			BPF_STMT(BPF_LDX | BPF_MEM, 2),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 3),
-			BPF_STMT(BPF_LDX | BPF_MEM, 3),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 4),
-			BPF_STMT(BPF_LDX | BPF_MEM, 4),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 5),
-			BPF_STMT(BPF_LDX | BPF_MEM, 5),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 6),
-			BPF_STMT(BPF_LDX | BPF_MEM, 6),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 7),
-			BPF_STMT(BPF_LDX | BPF_MEM, 7),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 8),
-			BPF_STMT(BPF_LDX | BPF_MEM, 8),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 9),
-			BPF_STMT(BPF_LDX | BPF_MEM, 9),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 10),
-			BPF_STMT(BPF_LDX | BPF_MEM, 10),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 11),
-			BPF_STMT(BPF_LDX | BPF_MEM, 11),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 12),
-			BPF_STMT(BPF_LDX | BPF_MEM, 12),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 13),
-			BPF_STMT(BPF_LDX | BPF_MEM, 13),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 14),
-			BPF_STMT(BPF_LDX | BPF_MEM, 14),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_STX, 15),
-			BPF_STMT(BPF_LDX | BPF_MEM, 15),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 1),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 116 } },
-	},
-	{	/* Mainly checking JIT here. */
-		"M[]: full STX + full LDX",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xbadfeedb),
-			BPF_STMT(BPF_STX, 0),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xecabedae),
-			BPF_STMT(BPF_STX, 1),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xafccfeaf),
-			BPF_STMT(BPF_STX, 2),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xbffdcedc),
-			BPF_STMT(BPF_STX, 3),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xfbbbdccb),
-			BPF_STMT(BPF_STX, 4),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xfbabcbda),
-			BPF_STMT(BPF_STX, 5),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xaedecbdb),
-			BPF_STMT(BPF_STX, 6),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xadebbade),
-			BPF_STMT(BPF_STX, 7),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xfcfcfaec),
-			BPF_STMT(BPF_STX, 8),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xbcdddbdc),
-			BPF_STMT(BPF_STX, 9),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xfeefdfac),
-			BPF_STMT(BPF_STX, 10),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xcddcdeea),
-			BPF_STMT(BPF_STX, 11),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xaccfaebb),
-			BPF_STMT(BPF_STX, 12),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xbdcccdcf),
-			BPF_STMT(BPF_STX, 13),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xaaedecde),
-			BPF_STMT(BPF_STX, 14),
-			BPF_STMT(BPF_LDX | BPF_IMM, 0xfaeacdad),
-			BPF_STMT(BPF_STX, 15),
-			BPF_STMT(BPF_LDX | BPF_MEM, 0),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 1),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 2),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 3),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 4),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 5),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 6),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 7),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 8),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 9),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 10),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 11),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 12),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 13),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 14),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_LDX | BPF_MEM, 15),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0x2a5a5e5 } },
-	},
-	{
-		"check: SKF_AD_MAX",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF + SKF_AD_MAX),
-			BPF_STMT(BPF_RET | BPF_A, 0),
-		},
-		CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-		{ },
-		{ },
-		.fill_helper = NULL,
-		.expected_errcode = -EINVAL,
-	},
-	{	/* Passes checker but fails during runtime. */
-		"LD [SKF_AD_OFF-1]",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_W | BPF_ABS,
-				 SKF_AD_OFF - 1),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-		},
-		CLASSIC,
-		{ },
-		{ { 1, 0 } },
-	},
-	{
-		"load 64-bit immediate",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x567800001234LL),
-			BPF_MOV64_REG(R2, R1),
-			BPF_MOV64_REG(R3, R2),
-			BPF_ALU64_IMM(BPF_RSH, R2, 32),
-			BPF_ALU64_IMM(BPF_LSH, R3, 32),
-			BPF_ALU64_IMM(BPF_RSH, R3, 32),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_JMP_IMM(BPF_JEQ, R2, 0x5678, 1),
-			BPF_EXIT_INSN(),
-			BPF_JMP_IMM(BPF_JEQ, R3, 0x1234, 1),
-			BPF_EXIT_INSN(),
-			BPF_LD_IMM64(R0, 0x1ffffffffLL),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32), /* R0 = 1 */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	/* BPF_ALU | BPF_MOV | BPF_X */
-	{
-		"ALU_MOV_X: dst = 2",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU32_REG(BPF_MOV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU_MOV_X: dst = 4294967295",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R1, 4294967295U),
-			BPF_ALU32_REG(BPF_MOV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 4294967295U } },
-	},
-	{
-		"ALU64_MOV_X: dst = 2",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_MOV_X: dst = 4294967295",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R1, 4294967295U),
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 4294967295U } },
-	},
-	/* BPF_ALU | BPF_MOV | BPF_K */
-	{
-		"ALU_MOV_K: dst = 2",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU_MOV_K: dst = 4294967295",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 4294967295U),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 4294967295U } },
-	},
-	{
-		"ALU_MOV_K: 0x0000ffffffff0000 = 0x00000000ffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000ffffffff0000LL),
-			BPF_LD_IMM64(R3, 0x00000000ffffffffLL),
-			BPF_ALU32_IMM(BPF_MOV, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU_MOV_K: small negative",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123 } }
-	},
-	{
-		"ALU_MOV_K: small negative zero extension",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU_MOV_K: large negative",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123456789),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123456789 } }
-	},
-	{
-		"ALU_MOV_K: large negative zero extension",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123456789),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU64_MOV_K: dst = 2",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_MOV_K: dst = 2147483647",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 2147483647),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2147483647 } },
-	},
-	{
-		"ALU64_OR_K: dst = 0x0",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000ffffffff0000LL),
-			BPF_LD_IMM64(R3, 0x0),
-			BPF_ALU64_IMM(BPF_MOV, R2, 0x0),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_MOV_K: dst = -1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000ffffffff0000LL),
-			BPF_LD_IMM64(R3, 0xffffffffffffffffLL),
-			BPF_ALU64_IMM(BPF_MOV, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_MOV_K: small negative",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, -123),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123 } }
-	},
-	{
-		"ALU64_MOV_K: small negative sign extension",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, -123),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } }
-	},
-	{
-		"ALU64_MOV_K: large negative",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, -123456789),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123456789 } }
-	},
-	{
-		"ALU64_MOV_K: large negative sign extension",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, -123456789),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } }
-	},
-	/* MOVSX32 */
-	{
-		"ALU_MOVSX | BPF_B",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x00000000ffffffefLL),
-			BPF_LD_IMM64(R3, 0xdeadbeefdeadbeefLL),
-			BPF_MOVSX32_REG(R1, R3, 8),
-			BPF_JMP_REG(BPF_JEQ, R2, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU_MOVSX | BPF_H",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x00000000ffffbeefLL),
-			BPF_LD_IMM64(R3, 0xdeadbeefdeadbeefLL),
-			BPF_MOVSX32_REG(R1, R3, 16),
-			BPF_JMP_REG(BPF_JEQ, R2, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	/* MOVSX64 REG */
-	{
-		"ALU64_MOVSX | BPF_B",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0xffffffffffffffefLL),
-			BPF_LD_IMM64(R3, 0xdeadbeefdeadbeefLL),
-			BPF_MOVSX64_REG(R1, R3, 8),
-			BPF_JMP_REG(BPF_JEQ, R2, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_MOVSX | BPF_H",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0xffffffffffffbeefLL),
-			BPF_LD_IMM64(R3, 0xdeadbeefdeadbeefLL),
-			BPF_MOVSX64_REG(R1, R3, 16),
-			BPF_JMP_REG(BPF_JEQ, R2, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_MOVSX | BPF_W",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0xffffffffdeadbeefLL),
-			BPF_LD_IMM64(R3, 0xdeadbeefdeadbeefLL),
-			BPF_MOVSX64_REG(R1, R3, 32),
-			BPF_JMP_REG(BPF_JEQ, R2, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	/* BPF_ALU | BPF_ADD | BPF_X */
-	{
-		"ALU_ADD_X: 1 + 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU32_REG(BPF_ADD, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_ADD_X: 1 + 4294967294 = 4294967295",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 4294967294U),
-			BPF_ALU32_REG(BPF_ADD, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 4294967295U } },
-	},
-	{
-		"ALU_ADD_X: 2 + 4294967294 = 0",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_LD_IMM64(R1, 4294967294U),
-			BPF_ALU32_REG(BPF_ADD, R0, R1),
-			BPF_JMP_IMM(BPF_JEQ, R0, 0, 2),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_ADD_X: 1 + 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU64_REG(BPF_ADD, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_ADD_X: 1 + 4294967294 = 4294967295",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 4294967294U),
-			BPF_ALU64_REG(BPF_ADD, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 4294967295U } },
-	},
-	{
-		"ALU64_ADD_X: 2 + 4294967294 = 4294967296",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_LD_IMM64(R1, 4294967294U),
-			BPF_LD_IMM64(R2, 4294967296ULL),
-			BPF_ALU64_REG(BPF_ADD, R0, R1),
-			BPF_JMP_REG(BPF_JEQ, R0, R2, 2),
-			BPF_MOV32_IMM(R0, 0),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_ALU | BPF_ADD | BPF_K */
-	{
-		"ALU_ADD_K: 1 + 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_ADD, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_ADD_K: 3 + 0 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_ADD, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_ADD_K: 1 + 4294967294 = 4294967295",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_ADD, R0, 4294967294U),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 4294967295U } },
-	},
-	{
-		"ALU_ADD_K: 4294967294 + 2 = 0",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967294U),
-			BPF_ALU32_IMM(BPF_ADD, R0, 2),
-			BPF_JMP_IMM(BPF_JEQ, R0, 0, 2),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU_ADD_K: 0 + (-1) = 0x00000000ffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0x00000000ffffffff),
-			BPF_ALU32_IMM(BPF_ADD, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU_ADD_K: 0 + 0xffff = 0xffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0xffff),
-			BPF_ALU32_IMM(BPF_ADD, R2, 0xffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU_ADD_K: 0 + 0x7fffffff = 0x7fffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0x7fffffff),
-			BPF_ALU32_IMM(BPF_ADD, R2, 0x7fffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU_ADD_K: 0 + 0x80000000 = 0x80000000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0x80000000),
-			BPF_ALU32_IMM(BPF_ADD, R2, 0x80000000),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU_ADD_K: 0 + 0x80008000 = 0x80008000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0x80008000),
-			BPF_ALU32_IMM(BPF_ADD, R2, 0x80008000),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_ADD_K: 1 + 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU64_IMM(BPF_ADD, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_ADD_K: 3 + 0 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU64_IMM(BPF_ADD, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_ADD_K: 1 + 2147483646 = 2147483647",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU64_IMM(BPF_ADD, R0, 2147483646),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2147483647 } },
-	},
-	{
-		"ALU64_ADD_K: 4294967294 + 2 = 4294967296",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967294U),
-			BPF_LD_IMM64(R1, 4294967296ULL),
-			BPF_ALU64_IMM(BPF_ADD, R0, 2),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_ADD_K: 2147483646 + -2147483647 = -1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2147483646),
-			BPF_ALU64_IMM(BPF_ADD, R0, -2147483647),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } },
-	},
-	{
-		"ALU64_ADD_K: 1 + 0 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x1),
-			BPF_LD_IMM64(R3, 0x1),
-			BPF_ALU64_IMM(BPF_ADD, R2, 0x0),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_ADD_K: 0 + (-1) = 0xffffffffffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0xffffffffffffffffLL),
-			BPF_ALU64_IMM(BPF_ADD, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_ADD_K: 0 + 0xffff = 0xffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0xffff),
-			BPF_ALU64_IMM(BPF_ADD, R2, 0xffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_ADD_K: 0 + 0x7fffffff = 0x7fffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0x7fffffff),
-			BPF_ALU64_IMM(BPF_ADD, R2, 0x7fffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_ADD_K: 0 + 0x80000000 = 0xffffffff80000000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0xffffffff80000000LL),
-			BPF_ALU64_IMM(BPF_ADD, R2, 0x80000000),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU_ADD_K: 0 + 0x80008000 = 0xffffffff80008000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0),
-			BPF_LD_IMM64(R3, 0xffffffff80008000LL),
-			BPF_ALU64_IMM(BPF_ADD, R2, 0x80008000),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	/* BPF_ALU | BPF_SUB | BPF_X */
-	{
-		"ALU_SUB_X: 3 - 1 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_MOV, R1, 1),
-			BPF_ALU32_REG(BPF_SUB, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU_SUB_X: 4294967295 - 4294967294 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967295U),
-			BPF_ALU32_IMM(BPF_MOV, R1, 4294967294U),
-			BPF_ALU32_REG(BPF_SUB, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_SUB_X: 3 - 1 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_MOV, R1, 1),
-			BPF_ALU64_REG(BPF_SUB, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_SUB_X: 4294967295 - 4294967294 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967295U),
-			BPF_ALU32_IMM(BPF_MOV, R1, 4294967294U),
-			BPF_ALU64_REG(BPF_SUB, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_ALU | BPF_SUB | BPF_K */
-	{
-		"ALU_SUB_K: 3 - 1 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_SUB, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU_SUB_K: 3 - 0 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_SUB, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_SUB_K: 4294967295 - 4294967294 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967295U),
-			BPF_ALU32_IMM(BPF_SUB, R0, 4294967294U),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_SUB_K: 3 - 1 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU64_IMM(BPF_SUB, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_SUB_K: 3 - 0 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU64_IMM(BPF_SUB, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_SUB_K: 4294967294 - 4294967295 = -1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967294U),
-			BPF_ALU64_IMM(BPF_SUB, R0, 4294967295U),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } },
-	},
-	{
-		"ALU64_ADD_K: 2147483646 - 2147483647 = -1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2147483646),
-			BPF_ALU64_IMM(BPF_SUB, R0, 2147483647),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } },
-	},
-	/* BPF_ALU | BPF_MUL | BPF_X */
-	{
-		"ALU_MUL_X: 2 * 3 = 6",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 3),
-			BPF_ALU32_REG(BPF_MUL, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 6 } },
-	},
-	{
-		"ALU_MUL_X: 2 * 0x7FFFFFF8 = 0xFFFFFFF0",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0x7FFFFFF8),
-			BPF_ALU32_REG(BPF_MUL, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xFFFFFFF0 } },
-	},
-	{
-		"ALU_MUL_X: -1 * -1 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -1),
-			BPF_ALU32_IMM(BPF_MOV, R1, -1),
-			BPF_ALU32_REG(BPF_MUL, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_MUL_X: 2 * 3 = 6",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 3),
-			BPF_ALU64_REG(BPF_MUL, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 6 } },
-	},
-	{
-		"ALU64_MUL_X: 1 * 2147483647 = 2147483647",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2147483647),
-			BPF_ALU64_REG(BPF_MUL, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2147483647 } },
-	},
-	{
-		"ALU64_MUL_X: 64x64 multiply, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0fedcba987654321LL),
-			BPF_LD_IMM64(R1, 0x123456789abcdef0LL),
-			BPF_ALU64_REG(BPF_MUL, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xe5618cf0 } }
-	},
-	{
-		"ALU64_MUL_X: 64x64 multiply, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0fedcba987654321LL),
-			BPF_LD_IMM64(R1, 0x123456789abcdef0LL),
-			BPF_ALU64_REG(BPF_MUL, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x2236d88f } }
-	},
-	/* BPF_ALU | BPF_MUL | BPF_K */
-	{
-		"ALU_MUL_K: 2 * 3 = 6",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU32_IMM(BPF_MUL, R0, 3),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 6 } },
-	},
-	{
-		"ALU_MUL_K: 3 * 1 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_MUL, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_MUL_K: 2 * 0x7FFFFFF8 = 0xFFFFFFF0",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU32_IMM(BPF_MUL, R0, 0x7FFFFFF8),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xFFFFFFF0 } },
-	},
-	{
-		"ALU_MUL_K: 1 * (-1) = 0x00000000ffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x1),
-			BPF_LD_IMM64(R3, 0x00000000ffffffff),
-			BPF_ALU32_IMM(BPF_MUL, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_MUL_K: 2 * 3 = 6",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU64_IMM(BPF_MUL, R0, 3),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 6 } },
-	},
-	{
-		"ALU64_MUL_K: 3 * 1 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU64_IMM(BPF_MUL, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_MUL_K: 1 * 2147483647 = 2147483647",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU64_IMM(BPF_MUL, R0, 2147483647),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2147483647 } },
-	},
-	{
-		"ALU64_MUL_K: 1 * -2147483647 = -2147483647",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU64_IMM(BPF_MUL, R0, -2147483647),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -2147483647 } },
-	},
-	{
-		"ALU64_MUL_K: 1 * (-1) = 0xffffffffffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x1),
-			BPF_LD_IMM64(R3, 0xffffffffffffffffLL),
-			BPF_ALU64_IMM(BPF_MUL, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_MUL_K: 64x32 multiply, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_MUL, R0, 0x12345678),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xe242d208 } }
-	},
-	{
-		"ALU64_MUL_K: 64x32 multiply, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_MUL, R0, 0x12345678),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xc28f5c28 } }
-	},
-	/* BPF_ALU | BPF_DIV | BPF_X */
-	{
-		"ALU_DIV_X: 6 / 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 6),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU32_REG(BPF_DIV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_DIV_X: 4294967295 / 4294967295 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967295U),
-			BPF_ALU32_IMM(BPF_MOV, R1, 4294967295U),
-			BPF_ALU32_REG(BPF_DIV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_DIV_X: 6 / 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 6),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU64_REG(BPF_DIV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_DIV_X: 2147483647 / 2147483647 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2147483647),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2147483647),
-			BPF_ALU64_REG(BPF_DIV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_DIV_X: 0xffffffffffffffff / (-1) = 0x0000000000000001",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0xffffffffffffffffLL),
-			BPF_LD_IMM64(R4, 0xffffffffffffffffLL),
-			BPF_LD_IMM64(R3, 0x0000000000000001LL),
-			BPF_ALU64_REG(BPF_DIV, R2, R4),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	/* BPF_ALU | BPF_DIV | BPF_K */
-	{
-		"ALU_DIV_K: 6 / 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 6),
-			BPF_ALU32_IMM(BPF_DIV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_DIV_K: 3 / 1 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_DIV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_DIV_K: 4294967295 / 4294967295 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967295U),
-			BPF_ALU32_IMM(BPF_DIV, R0, 4294967295U),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU_DIV_K: 0xffffffffffffffff / (-1) = 0x1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0xffffffffffffffffLL),
-			BPF_LD_IMM64(R3, 0x1UL),
-			BPF_ALU32_IMM(BPF_DIV, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_DIV_K: 6 / 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 6),
-			BPF_ALU64_IMM(BPF_DIV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_DIV_K: 3 / 1 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU64_IMM(BPF_DIV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_DIV_K: 2147483647 / 2147483647 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2147483647),
-			BPF_ALU64_IMM(BPF_DIV, R0, 2147483647),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_DIV_K: 0xffffffffffffffff / (-1) = 0x0000000000000001",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0xffffffffffffffffLL),
-			BPF_LD_IMM64(R3, 0x0000000000000001LL),
-			BPF_ALU64_IMM(BPF_DIV, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	/* BPF_ALU | BPF_MOD | BPF_X */
-	{
-		"ALU_MOD_X: 3 % 2 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU32_REG(BPF_MOD, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU_MOD_X: 4294967295 % 4294967293 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967295U),
-			BPF_ALU32_IMM(BPF_MOV, R1, 4294967293U),
-			BPF_ALU32_REG(BPF_MOD, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_MOD_X: 3 % 2 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU64_REG(BPF_MOD, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_MOD_X: 2147483647 % 2147483645 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2147483647),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2147483645),
-			BPF_ALU64_REG(BPF_MOD, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	/* BPF_ALU | BPF_MOD | BPF_K */
-	{
-		"ALU_MOD_K: 3 % 2 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_MOD, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU_MOD_K: 3 % 1 = 0",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_MOD, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"ALU_MOD_K: 4294967295 % 4294967293 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 4294967295U),
-			BPF_ALU32_IMM(BPF_MOD, R0, 4294967293U),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_MOD_K: 3 % 2 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU64_IMM(BPF_MOD, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_MOD_K: 3 % 1 = 0",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU64_IMM(BPF_MOD, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"ALU64_MOD_K: 2147483647 % 2147483645 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2147483647),
-			BPF_ALU64_IMM(BPF_MOD, R0, 2147483645),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	/* BPF_ALU | BPF_DIV | BPF_X off=1 (SDIV) */
-	{
-		"ALU_SDIV_X: -6 / 2 = -3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -6),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU32_REG_OFF(BPF_DIV, R0, R1, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -3 } },
-	},
-	/* BPF_ALU | BPF_DIV | BPF_K off=1 (SDIV) */
-	{
-		"ALU_SDIV_K: -6 / 2 = -3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -6),
-			BPF_ALU32_IMM_OFF(BPF_DIV, R0, 2, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -3 } },
-	},
-	/* BPF_ALU64 | BPF_DIV | BPF_X off=1 (SDIV64) */
-	{
-		"ALU64_SDIV_X: -6 / 2 = -3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -6),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU64_REG_OFF(BPF_DIV, R0, R1, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -3 } },
-	},
-	/* BPF_ALU64 | BPF_DIV | BPF_K off=1 (SDIV64) */
-	{
-		"ALU64_SDIV_K: -6 / 2 = -3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -6),
-			BPF_ALU64_IMM_OFF(BPF_DIV, R0, 2, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -3 } },
-	},
-	/* BPF_ALU | BPF_MOD | BPF_X off=1 (SMOD) */
-	{
-		"ALU_SMOD_X: -7 % 2 = -1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -7),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU32_REG_OFF(BPF_MOD, R0, R1, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } },
-	},
-	/* BPF_ALU | BPF_MOD | BPF_K off=1 (SMOD) */
-	{
-		"ALU_SMOD_K: -7 % 2 = -1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -7),
-			BPF_ALU32_IMM_OFF(BPF_MOD, R0, 2, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } },
-	},
-	/* BPF_ALU64 | BPF_MOD | BPF_X off=1 (SMOD64) */
-	{
-		"ALU64_SMOD_X: -7 % 2 = -1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -7),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU64_REG_OFF(BPF_MOD, R0, R1, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } },
-	},
-	/* BPF_ALU64 | BPF_MOD | BPF_K off=1 (SMOD64) */
-	{
-		"ALU64_SMOD_K: -7 % 2 = -1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -7),
-			BPF_ALU64_IMM_OFF(BPF_MOD, R0, 2, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } },
-	},
-	/* BPF_ALU | BPF_AND | BPF_X */
-	{
-		"ALU_AND_X: 3 & 2 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU32_REG(BPF_AND, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU_AND_X: 0xffffffff & 0xffffffff = 0xffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xffffffff),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
-			BPF_ALU32_REG(BPF_AND, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-	},
-	{
-		"ALU64_AND_X: 3 & 2 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU64_REG(BPF_AND, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_AND_X: 0xffffffff & 0xffffffff = 0xffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xffffffff),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
-			BPF_ALU64_REG(BPF_AND, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-	},
-	/* BPF_ALU | BPF_AND | BPF_K */
-	{
-		"ALU_AND_K: 3 & 2 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU32_IMM(BPF_AND, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU_AND_K: 0xffffffff & 0xffffffff = 0xffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xffffffff),
-			BPF_ALU32_IMM(BPF_AND, R0, 0xffffffff),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-	},
-	{
-		"ALU_AND_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x01020304),
-			BPF_ALU32_IMM(BPF_AND, R0, 15),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 4 } }
-	},
-	{
-		"ALU_AND_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xf1f2f3f4),
-			BPF_ALU32_IMM(BPF_AND, R0, 0xafbfcfdf),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xa1b2c3d4 } }
-	},
-	{
-		"ALU_AND_K: Zero extension",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_LD_IMM64(R1, 0x0000000080a0c0e0LL),
-			BPF_ALU32_IMM(BPF_AND, R0, 0xf0f0f0f0),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		"ALU64_AND_K: 3 & 2 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU64_IMM(BPF_AND, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_AND_K: 0xffffffff & 0xffffffff = 0xffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xffffffff),
-			BPF_ALU64_IMM(BPF_AND, R0, 0xffffffff),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-	},
-	{
-		"ALU64_AND_K: 0x0000ffffffff0000 & 0x0 = 0x0000000000000000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000ffffffff0000LL),
-			BPF_LD_IMM64(R3, 0x0000000000000000LL),
-			BPF_ALU64_IMM(BPF_AND, R2, 0x0),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_AND_K: 0x0000ffffffff0000 & -1 = 0x0000ffffffff0000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000ffffffff0000LL),
-			BPF_LD_IMM64(R3, 0x0000ffffffff0000LL),
-			BPF_ALU64_IMM(BPF_AND, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_AND_K: 0xffffffffffffffff & -1 = 0xffffffffffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0xffffffffffffffffLL),
-			BPF_LD_IMM64(R3, 0xffffffffffffffffLL),
-			BPF_ALU64_IMM(BPF_AND, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_AND_K: Sign extension 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_LD_IMM64(R1, 0x00000000090b0d0fLL),
-			BPF_ALU64_IMM(BPF_AND, R0, 0x0f0f0f0f),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		"ALU64_AND_K: Sign extension 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_LD_IMM64(R1, 0x0123456780a0c0e0LL),
-			BPF_ALU64_IMM(BPF_AND, R0, 0xf0f0f0f0),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	/* BPF_ALU | BPF_OR | BPF_X */
-	{
-		"ALU_OR_X: 1 | 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU32_REG(BPF_OR, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_OR_X: 0x0 | 0xffffffff = 0xffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
-			BPF_ALU32_REG(BPF_OR, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-	},
-	{
-		"ALU64_OR_X: 1 | 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 2),
-			BPF_ALU64_REG(BPF_OR, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_OR_X: 0 | 0xffffffff = 0xffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
-			BPF_ALU64_REG(BPF_OR, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-	},
-	/* BPF_ALU | BPF_OR | BPF_K */
-	{
-		"ALU_OR_K: 1 | 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_OR, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_OR_K: 0 & 0xffffffff = 0xffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_ALU32_IMM(BPF_OR, R0, 0xffffffff),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-	},
-	{
-		"ALU_OR_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x01020304),
-			BPF_ALU32_IMM(BPF_OR, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x01020305 } }
-	},
-	{
-		"ALU_OR_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x01020304),
-			BPF_ALU32_IMM(BPF_OR, R0, 0xa0b0c0d0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xa1b2c3d4 } }
-	},
-	{
-		"ALU_OR_K: Zero extension",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_LD_IMM64(R1, 0x00000000f9fbfdffLL),
-			BPF_ALU32_IMM(BPF_OR, R0, 0xf0f0f0f0),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		"ALU64_OR_K: 1 | 2 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU64_IMM(BPF_OR, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_OR_K: 0 & 0xffffffff = 0xffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_ALU64_IMM(BPF_OR, R0, 0xffffffff),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-	},
-	{
-		"ALU64_OR_K: 0x0000ffffffff0000 | 0x0 = 0x0000ffffffff0000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000ffffffff0000LL),
-			BPF_LD_IMM64(R3, 0x0000ffffffff0000LL),
-			BPF_ALU64_IMM(BPF_OR, R2, 0x0),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_OR_K: 0x0000ffffffff0000 | -1 = 0xffffffffffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000ffffffff0000LL),
-			BPF_LD_IMM64(R3, 0xffffffffffffffffLL),
-			BPF_ALU64_IMM(BPF_OR, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_OR_K: 0x000000000000000 | -1 = 0xffffffffffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000000000000000LL),
-			BPF_LD_IMM64(R3, 0xffffffffffffffffLL),
-			BPF_ALU64_IMM(BPF_OR, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_OR_K: Sign extension 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_LD_IMM64(R1, 0x012345678fafcfefLL),
-			BPF_ALU64_IMM(BPF_OR, R0, 0x0f0f0f0f),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		"ALU64_OR_K: Sign extension 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_LD_IMM64(R1, 0xfffffffff9fbfdffLL),
-			BPF_ALU64_IMM(BPF_OR, R0, 0xf0f0f0f0),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	/* BPF_ALU | BPF_XOR | BPF_X */
-	{
-		"ALU_XOR_X: 5 ^ 6 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 5),
-			BPF_ALU32_IMM(BPF_MOV, R1, 6),
-			BPF_ALU32_REG(BPF_XOR, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_XOR_X: 0x1 ^ 0xffffffff = 0xfffffffe",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
-			BPF_ALU32_REG(BPF_XOR, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } },
-	},
-	{
-		"ALU64_XOR_X: 5 ^ 6 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 5),
-			BPF_ALU32_IMM(BPF_MOV, R1, 6),
-			BPF_ALU64_REG(BPF_XOR, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_XOR_X: 1 ^ 0xffffffff = 0xfffffffe",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
-			BPF_ALU64_REG(BPF_XOR, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } },
-	},
-	/* BPF_ALU | BPF_XOR | BPF_K */
-	{
-		"ALU_XOR_K: 5 ^ 6 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 5),
-			BPF_ALU32_IMM(BPF_XOR, R0, 6),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU_XOR_K: 1 ^ 0xffffffff = 0xfffffffe",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_XOR, R0, 0xffffffff),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } },
-	},
-	{
-		"ALU_XOR_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x01020304),
-			BPF_ALU32_IMM(BPF_XOR, R0, 15),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x0102030b } }
-	},
-	{
-		"ALU_XOR_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xf1f2f3f4),
-			BPF_ALU32_IMM(BPF_XOR, R0, 0xafbfcfdf),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x5e4d3c2b } }
-	},
-	{
-		"ALU_XOR_K: Zero extension",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_LD_IMM64(R1, 0x00000000795b3d1fLL),
-			BPF_ALU32_IMM(BPF_XOR, R0, 0xf0f0f0f0),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		"ALU64_XOR_K: 5 ^ 6 = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 5),
-			BPF_ALU64_IMM(BPF_XOR, R0, 6),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_XOR_K: 1 ^ 0xffffffff = 0xfffffffe",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU64_IMM(BPF_XOR, R0, 0xffffffff),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } },
-	},
-	{
-		"ALU64_XOR_K: 0x0000ffffffff0000 ^ 0x0 = 0x0000ffffffff0000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000ffffffff0000LL),
-			BPF_LD_IMM64(R3, 0x0000ffffffff0000LL),
-			BPF_ALU64_IMM(BPF_XOR, R2, 0x0),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_XOR_K: 0x0000ffffffff0000 ^ -1 = 0xffff00000000ffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000ffffffff0000LL),
-			BPF_LD_IMM64(R3, 0xffff00000000ffffLL),
-			BPF_ALU64_IMM(BPF_XOR, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_XOR_K: 0x000000000000000 ^ -1 = 0xffffffffffffffff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x0000000000000000LL),
-			BPF_LD_IMM64(R3, 0xffffffffffffffffLL),
-			BPF_ALU64_IMM(BPF_XOR, R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-	},
-	{
-		"ALU64_XOR_K: Sign extension 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_LD_IMM64(R1, 0x0123456786a4c2e0LL),
-			BPF_ALU64_IMM(BPF_XOR, R0, 0x0f0f0f0f),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		"ALU64_XOR_K: Sign extension 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_LD_IMM64(R1, 0xfedcba98795b3d1fLL),
-			BPF_ALU64_IMM(BPF_XOR, R0, 0xf0f0f0f0),
-			BPF_JMP_REG(BPF_JEQ, R0, R1, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	/* BPF_ALU | BPF_LSH | BPF_X */
-	{
-		"ALU_LSH_X: 1 << 1 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 1),
-			BPF_ALU32_REG(BPF_LSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU_LSH_X: 1 << 31 = 0x80000000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 31),
-			BPF_ALU32_REG(BPF_LSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x80000000 } },
-	},
-	{
-		"ALU_LSH_X: 0x12345678 << 12 = 0x45678000",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x12345678),
-			BPF_ALU32_IMM(BPF_MOV, R1, 12),
-			BPF_ALU32_REG(BPF_LSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x45678000 } }
-	},
-	{
-		"ALU64_LSH_X: 1 << 1 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 1),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_LSH_X: 1 << 31 = 0x80000000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_MOV, R1, 31),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x80000000 } },
-	},
-	{
-		"ALU64_LSH_X: Shift < 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 12),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xbcdef000 } }
-	},
-	{
-		"ALU64_LSH_X: Shift < 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 12),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x3456789a } }
-	},
-	{
-		"ALU64_LSH_X: Shift > 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 36),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU64_LSH_X: Shift > 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 36),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x9abcdef0 } }
-	},
-	{
-		"ALU64_LSH_X: Shift == 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 32),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU64_LSH_X: Shift == 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 32),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } }
-	},
-	{
-		"ALU64_LSH_X: Zero shift, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } }
-	},
-	{
-		"ALU64_LSH_X: Zero shift, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0),
-			BPF_ALU64_REG(BPF_LSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x01234567 } }
-	},
-	/* BPF_ALU | BPF_LSH | BPF_K */
-	{
-		"ALU_LSH_K: 1 << 1 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_LSH, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU_LSH_K: 1 << 31 = 0x80000000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU32_IMM(BPF_LSH, R0, 31),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x80000000 } },
-	},
-	{
-		"ALU_LSH_K: 0x12345678 << 12 = 0x45678000",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x12345678),
-			BPF_ALU32_IMM(BPF_LSH, R0, 12),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x45678000 } }
-	},
-	{
-		"ALU_LSH_K: 0x12345678 << 0 = 0x12345678",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x12345678),
-			BPF_ALU32_IMM(BPF_LSH, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x12345678 } }
-	},
-	{
-		"ALU64_LSH_K: 1 << 1 = 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU64_IMM(BPF_LSH, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"ALU64_LSH_K: 1 << 31 = 0x80000000",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 1),
-			BPF_ALU64_IMM(BPF_LSH, R0, 31),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x80000000 } },
-	},
-	{
-		"ALU64_LSH_K: Shift < 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_LSH, R0, 12),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xbcdef000 } }
-	},
-	{
-		"ALU64_LSH_K: Shift < 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_LSH, R0, 12),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x3456789a } }
-	},
-	{
-		"ALU64_LSH_K: Shift > 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_LSH, R0, 36),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU64_LSH_K: Shift > 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_LSH, R0, 36),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x9abcdef0 } }
-	},
-	{
-		"ALU64_LSH_K: Shift == 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_LSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU64_LSH_K: Shift == 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_LSH, R0, 32),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } }
-	},
-	{
-		"ALU64_LSH_K: Zero shift",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_LSH, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } }
-	},
-	/* BPF_ALU | BPF_RSH | BPF_X */
-	{
-		"ALU_RSH_X: 2 >> 1 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 1),
-			BPF_ALU32_REG(BPF_RSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU_RSH_X: 0x80000000 >> 31 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x80000000),
-			BPF_ALU32_IMM(BPF_MOV, R1, 31),
-			BPF_ALU32_REG(BPF_RSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU_RSH_X: 0x12345678 >> 20 = 0x123",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x12345678),
-			BPF_ALU32_IMM(BPF_MOV, R1, 20),
-			BPF_ALU32_REG(BPF_RSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x123 } }
-	},
-	{
-		"ALU64_RSH_X: 2 >> 1 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 1),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_RSH_X: 0x80000000 >> 31 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x80000000),
-			BPF_ALU32_IMM(BPF_MOV, R1, 31),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_RSH_X: Shift < 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 12),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x56789abc } }
-	},
-	{
-		"ALU64_RSH_X: Shift < 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 12),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x00081234 } }
-	},
-	{
-		"ALU64_RSH_X: Shift > 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 36),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x08123456 } }
-	},
-	{
-		"ALU64_RSH_X: Shift > 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 36),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU64_RSH_X: Shift == 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 32),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x81234567 } }
-	},
-	{
-		"ALU64_RSH_X: Shift == 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 32),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU64_RSH_X: Zero shift, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } }
-	},
-	{
-		"ALU64_RSH_X: Zero shift, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0),
-			BPF_ALU64_REG(BPF_RSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x81234567 } }
-	},
-	/* BPF_ALU | BPF_RSH | BPF_K */
-	{
-		"ALU_RSH_K: 2 >> 1 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU32_IMM(BPF_RSH, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU_RSH_K: 0x80000000 >> 31 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x80000000),
-			BPF_ALU32_IMM(BPF_RSH, R0, 31),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU_RSH_K: 0x12345678 >> 20 = 0x123",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x12345678),
-			BPF_ALU32_IMM(BPF_RSH, R0, 20),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x123 } }
-	},
-	{
-		"ALU_RSH_K: 0x12345678 >> 0 = 0x12345678",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x12345678),
-			BPF_ALU32_IMM(BPF_RSH, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x12345678 } }
-	},
-	{
-		"ALU64_RSH_K: 2 >> 1 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 2),
-			BPF_ALU64_IMM(BPF_RSH, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_RSH_K: 0x80000000 >> 31 = 1",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x80000000),
-			BPF_ALU64_IMM(BPF_RSH, R0, 31),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"ALU64_RSH_K: Shift < 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_RSH, R0, 12),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x56789abc } }
-	},
-	{
-		"ALU64_RSH_K: Shift < 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_RSH, R0, 12),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x00081234 } }
-	},
-	{
-		"ALU64_RSH_K: Shift > 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_RSH, R0, 36),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x08123456 } }
-	},
-	{
-		"ALU64_RSH_K: Shift > 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_RSH, R0, 36),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU64_RSH_K: Shift == 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x81234567 } }
-	},
-	{
-		"ALU64_RSH_K: Shift == 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } }
-	},
-	{
-		"ALU64_RSH_K: Zero shift",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_RSH, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } }
-	},
-	/* BPF_ALU | BPF_ARSH | BPF_X */
-	{
-		"ALU32_ARSH_X: -1234 >> 7 = -10",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -1234),
-			BPF_ALU32_IMM(BPF_MOV, R1, 7),
-			BPF_ALU32_REG(BPF_ARSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -10 } }
-	},
-	{
-		"ALU64_ARSH_X: 0xff00ff0000000000 >> 40 = 0xffffffffffff00ff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xff00ff0000000000LL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 40),
-			BPF_ALU64_REG(BPF_ARSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffff00ff } },
-	},
-	{
-		"ALU64_ARSH_X: Shift < 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 12),
-			BPF_ALU64_REG(BPF_ARSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x56789abc } }
-	},
-	{
-		"ALU64_ARSH_X: Shift < 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 12),
-			BPF_ALU64_REG(BPF_ARSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfff81234 } }
-	},
-	{
-		"ALU64_ARSH_X: Shift > 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 36),
-			BPF_ALU64_REG(BPF_ARSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xf8123456 } }
-	},
-	{
-		"ALU64_ARSH_X: Shift > 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 36),
-			BPF_ALU64_REG(BPF_ARSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } }
-	},
-	{
-		"ALU64_ARSH_X: Shift == 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 32),
-			BPF_ALU64_REG(BPF_ARSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x81234567 } }
-	},
-	{
-		"ALU64_ARSH_X: Shift == 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 32),
-			BPF_ALU64_REG(BPF_ARSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } }
-	},
-	{
-		"ALU64_ARSH_X: Zero shift, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0),
-			BPF_ALU64_REG(BPF_ARSH, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } }
-	},
-	{
-		"ALU64_ARSH_X: Zero shift, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0),
-			BPF_ALU64_REG(BPF_ARSH, R0, R1),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x81234567 } }
-	},
-	/* BPF_ALU | BPF_ARSH | BPF_K */
-	{
-		"ALU32_ARSH_K: -1234 >> 7 = -10",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -1234),
-			BPF_ALU32_IMM(BPF_ARSH, R0, 7),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -10 } }
-	},
-	{
-		"ALU32_ARSH_K: -1234 >> 0 = -1234",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -1234),
-			BPF_ALU32_IMM(BPF_ARSH, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1234 } }
-	},
-	{
-		"ALU64_ARSH_K: 0xff00ff0000000000 >> 40 = 0xffffffffffff00ff",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xff00ff0000000000LL),
-			BPF_ALU64_IMM(BPF_ARSH, R0, 40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffff00ff } },
-	},
-	{
-		"ALU64_ARSH_K: Shift < 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_RSH, R0, 12),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x56789abc } }
-	},
-	{
-		"ALU64_ARSH_K: Shift < 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_ARSH, R0, 12),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfff81234 } }
-	},
-	{
-		"ALU64_ARSH_K: Shift > 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_ARSH, R0, 36),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xf8123456 } }
-	},
-	{
-		"ALU64_ARSH_K: Shift > 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xf123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_ARSH, R0, 36),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } }
-	},
-	{
-		"ALU64_ARSH_K: Shift == 32, low word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_ARSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x81234567 } }
-	},
-	{
-		"ALU64_ARSH_K: Shift == 32, high word",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_ARSH, R0, 32),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -1 } }
-	},
-	{
-		"ALU64_ARSH_K: Zero shift",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x8123456789abcdefLL),
-			BPF_ALU64_IMM(BPF_ARSH, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } }
-	},
-	/* BPF_ALU | BPF_NEG */
-	{
-		"ALU_NEG: -(3) = -3",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 3),
-			BPF_ALU32_IMM(BPF_NEG, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -3 } },
-	},
-	{
-		"ALU_NEG: -(-3) = 3",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -3),
-			BPF_ALU32_IMM(BPF_NEG, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	{
-		"ALU64_NEG: -(3) = -3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 3),
-			BPF_ALU64_IMM(BPF_NEG, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -3 } },
-	},
-	{
-		"ALU64_NEG: -(-3) = 3",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, -3),
-			BPF_ALU64_IMM(BPF_NEG, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 3 } },
-	},
-	/* BPF_ALU | BPF_END | BPF_FROM_BE */
-	{
-		"ALU_END_FROM_BE 16: 0x0123456789abcdef -> 0xcdef",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ENDIAN(BPF_FROM_BE, R0, 16),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0,  cpu_to_be16(0xcdef) } },
-	},
-	{
-		"ALU_END_FROM_BE 32: 0x0123456789abcdef -> 0x89abcdef",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ENDIAN(BPF_FROM_BE, R0, 32),
-			BPF_ALU64_REG(BPF_MOV, R1, R0),
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),
-			BPF_ALU32_REG(BPF_ADD, R0, R1), /* R1 = 0 */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, cpu_to_be32(0x89abcdef) } },
-	},
-	{
-		"ALU_END_FROM_BE 64: 0x0123456789abcdef -> 0x89abcdef",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ENDIAN(BPF_FROM_BE, R0, 64),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, (u32) cpu_to_be64(0x0123456789abcdefLL) } },
-	},
-	{
-		"ALU_END_FROM_BE 64: 0x0123456789abcdef >> 32 -> 0x01234567",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ENDIAN(BPF_FROM_BE, R0, 64),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, (u32) (cpu_to_be64(0x0123456789abcdefLL) >> 32) } },
-	},
-	/* BPF_ALU | BPF_END | BPF_FROM_BE, reversed */
-	{
-		"ALU_END_FROM_BE 16: 0xfedcba9876543210 -> 0x3210",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_ENDIAN(BPF_FROM_BE, R0, 16),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0,  cpu_to_be16(0x3210) } },
-	},
-	{
-		"ALU_END_FROM_BE 32: 0xfedcba9876543210 -> 0x76543210",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_ENDIAN(BPF_FROM_BE, R0, 32),
-			BPF_ALU64_REG(BPF_MOV, R1, R0),
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),
-			BPF_ALU32_REG(BPF_ADD, R0, R1), /* R1 = 0 */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, cpu_to_be32(0x76543210) } },
-	},
-	{
-		"ALU_END_FROM_BE 64: 0xfedcba9876543210 -> 0x76543210",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_ENDIAN(BPF_FROM_BE, R0, 64),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, (u32) cpu_to_be64(0xfedcba9876543210ULL) } },
-	},
-	{
-		"ALU_END_FROM_BE 64: 0xfedcba9876543210 >> 32 -> 0xfedcba98",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_ENDIAN(BPF_FROM_BE, R0, 64),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, (u32) (cpu_to_be64(0xfedcba9876543210ULL) >> 32) } },
-	},
-	/* BPF_ALU | BPF_END | BPF_FROM_LE */
-	{
-		"ALU_END_FROM_LE 16: 0x0123456789abcdef -> 0xefcd",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ENDIAN(BPF_FROM_LE, R0, 16),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, cpu_to_le16(0xcdef) } },
-	},
-	{
-		"ALU_END_FROM_LE 32: 0x0123456789abcdef -> 0xefcdab89",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ENDIAN(BPF_FROM_LE, R0, 32),
-			BPF_ALU64_REG(BPF_MOV, R1, R0),
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),
-			BPF_ALU32_REG(BPF_ADD, R0, R1), /* R1 = 0 */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, cpu_to_le32(0x89abcdef) } },
-	},
-	{
-		"ALU_END_FROM_LE 64: 0x0123456789abcdef -> 0x67452301",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ENDIAN(BPF_FROM_LE, R0, 64),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, (u32) cpu_to_le64(0x0123456789abcdefLL) } },
-	},
-	{
-		"ALU_END_FROM_LE 64: 0x0123456789abcdef >> 32 -> 0xefcdab89",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_ENDIAN(BPF_FROM_LE, R0, 64),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, (u32) (cpu_to_le64(0x0123456789abcdefLL) >> 32) } },
-	},
-	/* BPF_ALU | BPF_END | BPF_FROM_LE, reversed */
-	{
-		"ALU_END_FROM_LE 16: 0xfedcba9876543210 -> 0x1032",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_ENDIAN(BPF_FROM_LE, R0, 16),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0,  cpu_to_le16(0x3210) } },
-	},
-	{
-		"ALU_END_FROM_LE 32: 0xfedcba9876543210 -> 0x10325476",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_ENDIAN(BPF_FROM_LE, R0, 32),
-			BPF_ALU64_REG(BPF_MOV, R1, R0),
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),
-			BPF_ALU32_REG(BPF_ADD, R0, R1), /* R1 = 0 */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, cpu_to_le32(0x76543210) } },
-	},
-	{
-		"ALU_END_FROM_LE 64: 0xfedcba9876543210 -> 0x10325476",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_ENDIAN(BPF_FROM_LE, R0, 64),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, (u32) cpu_to_le64(0xfedcba9876543210ULL) } },
-	},
-	{
-		"ALU_END_FROM_LE 64: 0xfedcba9876543210 >> 32 -> 0x98badcfe",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_ENDIAN(BPF_FROM_LE, R0, 64),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, (u32) (cpu_to_le64(0xfedcba9876543210ULL) >> 32) } },
-	},
-	/* BSWAP */
-	{
-		"BSWAP 16: 0x0123456789abcdef -> 0xefcd",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_BSWAP(R0, 16),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xefcd } },
-	},
-	{
-		"BSWAP 32: 0x0123456789abcdef -> 0xefcdab89",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_BSWAP(R0, 32),
-			BPF_ALU64_REG(BPF_MOV, R1, R0),
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),
-			BPF_ALU32_REG(BPF_ADD, R0, R1), /* R1 = 0 */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xefcdab89 } },
-	},
-	{
-		"BSWAP 64: 0x0123456789abcdef -> 0x67452301",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_BSWAP(R0, 64),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x67452301 } },
-	},
-	{
-		"BSWAP 64: 0x0123456789abcdef >> 32 -> 0xefcdab89",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0x0123456789abcdefLL),
-			BPF_BSWAP(R0, 64),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xefcdab89 } },
-	},
-	/* BSWAP, reversed */
-	{
-		"BSWAP 16: 0xfedcba9876543210 -> 0x1032",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_BSWAP(R0, 16),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1032 } },
-	},
-	{
-		"BSWAP 32: 0xfedcba9876543210 -> 0x10325476",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_BSWAP(R0, 32),
-			BPF_ALU64_REG(BPF_MOV, R1, R0),
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),
-			BPF_ALU32_REG(BPF_ADD, R0, R1), /* R1 = 0 */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x10325476 } },
-	},
-	{
-		"BSWAP 64: 0xfedcba9876543210 -> 0x98badcfe",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_BSWAP(R0, 64),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x98badcfe } },
-	},
-	{
-		"BSWAP 64: 0xfedcba9876543210 >> 32 -> 0x10325476",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_BSWAP(R0, 64),
-			BPF_ALU64_IMM(BPF_RSH, R0, 32),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x10325476 } },
-	},
-	/* BPF_LDX_MEM B/H/W/DW */
-	{
-		"BPF_LDX_MEM | BPF_B, base",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0102030405060708ULL),
-			BPF_LD_IMM64(R2, 0x0000000000000008ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_LDX_MEM(BPF_B, R0, R10, -1),
-#else
-			BPF_LDX_MEM(BPF_B, R0, R10, -8),
-#endif
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEM | BPF_B, MSB set",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R2, 0x0000000000000088ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_LDX_MEM(BPF_B, R0, R10, -1),
-#else
-			BPF_LDX_MEM(BPF_B, R0, R10, -8),
-#endif
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEM | BPF_B, negative offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000000000088ULL),
-			BPF_ALU64_IMM(BPF_ADD, R1, 512),
-			BPF_STX_MEM(BPF_B, R1, R2, -256),
-			BPF_LDX_MEM(BPF_B, R0, R1, -256),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 512, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_B, small positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000000000088ULL),
-			BPF_STX_MEM(BPF_B, R1, R2, 256),
-			BPF_LDX_MEM(BPF_B, R0, R1, 256),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 512, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_B, large positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000000000088ULL),
-			BPF_STX_MEM(BPF_B, R1, R2, 4096),
-			BPF_LDX_MEM(BPF_B, R0, R1, 4096),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 4096 + 16, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_H, base",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0102030405060708ULL),
-			BPF_LD_IMM64(R2, 0x0000000000000708ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_LDX_MEM(BPF_H, R0, R10, -2),
-#else
-			BPF_LDX_MEM(BPF_H, R0, R10, -8),
-#endif
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEM | BPF_H, MSB set",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R2, 0x0000000000008788ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_LDX_MEM(BPF_H, R0, R10, -2),
-#else
-			BPF_LDX_MEM(BPF_H, R0, R10, -8),
-#endif
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEM | BPF_H, negative offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000000008788ULL),
-			BPF_ALU64_IMM(BPF_ADD, R1, 512),
-			BPF_STX_MEM(BPF_H, R1, R2, -256),
-			BPF_LDX_MEM(BPF_H, R0, R1, -256),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 512, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_H, small positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000000008788ULL),
-			BPF_STX_MEM(BPF_H, R1, R2, 256),
-			BPF_LDX_MEM(BPF_H, R0, R1, 256),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 512, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_H, large positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000000008788ULL),
-			BPF_STX_MEM(BPF_H, R1, R2, 8192),
-			BPF_LDX_MEM(BPF_H, R0, R1, 8192),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 8192 + 16, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_H, unaligned positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000000008788ULL),
-			BPF_STX_MEM(BPF_H, R1, R2, 13),
-			BPF_LDX_MEM(BPF_H, R0, R1, 13),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 32, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_W, base",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0102030405060708ULL),
-			BPF_LD_IMM64(R2, 0x0000000005060708ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_LDX_MEM(BPF_W, R0, R10, -4),
-#else
-			BPF_LDX_MEM(BPF_W, R0, R10, -8),
-#endif
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEM | BPF_W, MSB set",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R2, 0x0000000085868788ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_LDX_MEM(BPF_W, R0, R10, -4),
-#else
-			BPF_LDX_MEM(BPF_W, R0, R10, -8),
-#endif
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEM | BPF_W, negative offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000085868788ULL),
-			BPF_ALU64_IMM(BPF_ADD, R1, 512),
-			BPF_STX_MEM(BPF_W, R1, R2, -256),
-			BPF_LDX_MEM(BPF_W, R0, R1, -256),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 512, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_W, small positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000085868788ULL),
-			BPF_STX_MEM(BPF_W, R1, R2, 256),
-			BPF_LDX_MEM(BPF_W, R0, R1, 256),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 512, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_W, large positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000085868788ULL),
-			BPF_STX_MEM(BPF_W, R1, R2, 16384),
-			BPF_LDX_MEM(BPF_W, R0, R1, 16384),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 16384 + 16, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_W, unaligned positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x0000000085868788ULL),
-			BPF_STX_MEM(BPF_W, R1, R2, 13),
-			BPF_LDX_MEM(BPF_W, R0, R1, 13),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 32, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_DW, base",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0102030405060708ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-			BPF_LDX_MEM(BPF_DW, R0, R10, -8),
-			BPF_JMP_REG(BPF_JNE, R0, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEM | BPF_DW, MSB set",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8182838485868788ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-			BPF_LDX_MEM(BPF_DW, R0, R10, -8),
-			BPF_JMP_REG(BPF_JNE, R0, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEM | BPF_DW, negative offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_ALU64_IMM(BPF_ADD, R1, 512),
-			BPF_STX_MEM(BPF_DW, R1, R2, -256),
-			BPF_LDX_MEM(BPF_DW, R0, R1, -256),
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 512, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_DW, small positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_STX_MEM(BPF_DW, R1, R2, 256),
-			BPF_LDX_MEM(BPF_DW, R0, R1, 256),
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 512, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEM | BPF_DW, large positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_STX_MEM(BPF_DW, R1, R2, 32760),
-			BPF_LDX_MEM(BPF_DW, R0, R1, 32760),
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 32768, 0 } },
-		.stack_depth = 0,
-	},
-	{
-		"BPF_LDX_MEM | BPF_DW, unaligned positive offset",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_STX_MEM(BPF_DW, R1, R2, 13),
-			BPF_LDX_MEM(BPF_DW, R0, R1, 13),
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_LARGE_MEM,
-		{ },
-		{ { 32, 0 } },
-		.stack_depth = 0,
-	},
-	/* BPF_LDX_MEMSX B/H/W */
-	{
-		"BPF_LDX_MEMSX | BPF_B",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0xdead0000000000f0ULL),
-			BPF_LD_IMM64(R2, 0xfffffffffffffff0ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_LDX_MEMSX(BPF_B, R0, R10, -1),
-#else
-			BPF_LDX_MEMSX(BPF_B, R0, R10, -8),
-#endif
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEMSX | BPF_H",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0xdead00000000f123ULL),
-			BPF_LD_IMM64(R2, 0xfffffffffffff123ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_LDX_MEMSX(BPF_H, R0, R10, -2),
-#else
-			BPF_LDX_MEMSX(BPF_H, R0, R10, -8),
-#endif
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_LDX_MEMSX | BPF_W",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x00000000deadbeefULL),
-			BPF_LD_IMM64(R2, 0xffffffffdeadbeefULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_LDX_MEMSX(BPF_W, R0, R10, -4),
-#else
-			BPF_LDX_MEMSX(BPF_W, R0, R10, -8),
-#endif
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	/* BPF_STX_MEM B/H/W/DW */
-	{
-		"BPF_STX_MEM | BPF_B",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8090a0b0c0d0e0f0ULL),
-			BPF_LD_IMM64(R2, 0x0102030405060708ULL),
-			BPF_LD_IMM64(R3, 0x8090a0b0c0d0e008ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_STX_MEM(BPF_B, R10, R2, -1),
-#else
-			BPF_STX_MEM(BPF_B, R10, R2, -8),
-#endif
-			BPF_LDX_MEM(BPF_DW, R0, R10, -8),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_STX_MEM | BPF_B, MSB set",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8090a0b0c0d0e0f0ULL),
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x8090a0b0c0d0e088ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_STX_MEM(BPF_B, R10, R2, -1),
-#else
-			BPF_STX_MEM(BPF_B, R10, R2, -8),
-#endif
-			BPF_LDX_MEM(BPF_DW, R0, R10, -8),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_STX_MEM | BPF_H",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8090a0b0c0d0e0f0ULL),
-			BPF_LD_IMM64(R2, 0x0102030405060708ULL),
-			BPF_LD_IMM64(R3, 0x8090a0b0c0d00708ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_STX_MEM(BPF_H, R10, R2, -2),
-#else
-			BPF_STX_MEM(BPF_H, R10, R2, -8),
-#endif
-			BPF_LDX_MEM(BPF_DW, R0, R10, -8),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_STX_MEM | BPF_H, MSB set",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8090a0b0c0d0e0f0ULL),
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x8090a0b0c0d08788ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_STX_MEM(BPF_H, R10, R2, -2),
-#else
-			BPF_STX_MEM(BPF_H, R10, R2, -8),
-#endif
-			BPF_LDX_MEM(BPF_DW, R0, R10, -8),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_STX_MEM | BPF_W",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8090a0b0c0d0e0f0ULL),
-			BPF_LD_IMM64(R2, 0x0102030405060708ULL),
-			BPF_LD_IMM64(R3, 0x8090a0b005060708ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_STX_MEM(BPF_W, R10, R2, -4),
-#else
-			BPF_STX_MEM(BPF_W, R10, R2, -8),
-#endif
-			BPF_LDX_MEM(BPF_DW, R0, R10, -8),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	{
-		"BPF_STX_MEM | BPF_W, MSB set",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x8090a0b0c0d0e0f0ULL),
-			BPF_LD_IMM64(R2, 0x8182838485868788ULL),
-			BPF_LD_IMM64(R3, 0x8090a0b085868788ULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-#ifdef __BIG_ENDIAN
-			BPF_STX_MEM(BPF_W, R10, R2, -4),
-#else
-			BPF_STX_MEM(BPF_W, R10, R2, -8),
-#endif
-			BPF_LDX_MEM(BPF_DW, R0, R10, -8),
-			BPF_JMP_REG(BPF_JNE, R0, R3, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	/* BPF_ST(X) | BPF_MEM | BPF_B/H/W/DW */
-	{
-		"ST_MEM_B: Store/Load byte: max negative",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_ST_MEM(BPF_B, R10, -40, 0xff),
-			BPF_LDX_MEM(BPF_B, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xff } },
-		.stack_depth = 40,
-	},
-	{
-		"ST_MEM_B: Store/Load byte: max positive",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_ST_MEM(BPF_H, R10, -40, 0x7f),
-			BPF_LDX_MEM(BPF_H, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x7f } },
-		.stack_depth = 40,
-	},
-	{
-		"STX_MEM_B: Store/Load byte: max negative",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_LD_IMM64(R1, 0xffLL),
-			BPF_STX_MEM(BPF_B, R10, R1, -40),
-			BPF_LDX_MEM(BPF_B, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xff } },
-		.stack_depth = 40,
-	},
-	{
-		"ST_MEM_H: Store/Load half word: max negative",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_ST_MEM(BPF_H, R10, -40, 0xffff),
-			BPF_LDX_MEM(BPF_H, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffff } },
-		.stack_depth = 40,
-	},
-	{
-		"ST_MEM_H: Store/Load half word: max positive",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_ST_MEM(BPF_H, R10, -40, 0x7fff),
-			BPF_LDX_MEM(BPF_H, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x7fff } },
-		.stack_depth = 40,
-	},
-	{
-		"STX_MEM_H: Store/Load half word: max negative",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_LD_IMM64(R1, 0xffffLL),
-			BPF_STX_MEM(BPF_H, R10, R1, -40),
-			BPF_LDX_MEM(BPF_H, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffff } },
-		.stack_depth = 40,
-	},
-	{
-		"ST_MEM_W: Store/Load word: max negative",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_ST_MEM(BPF_W, R10, -40, 0xffffffff),
-			BPF_LDX_MEM(BPF_W, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-		.stack_depth = 40,
-	},
-	{
-		"ST_MEM_W: Store/Load word: max positive",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_ST_MEM(BPF_W, R10, -40, 0x7fffffff),
-			BPF_LDX_MEM(BPF_W, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x7fffffff } },
-		.stack_depth = 40,
-	},
-	{
-		"STX_MEM_W: Store/Load word: max negative",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_LD_IMM64(R1, 0xffffffffLL),
-			BPF_STX_MEM(BPF_W, R10, R1, -40),
-			BPF_LDX_MEM(BPF_W, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-		.stack_depth = 40,
-	},
-	{
-		"ST_MEM_DW: Store/Load double word: max negative",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_ST_MEM(BPF_DW, R10, -40, 0xffffffff),
-			BPF_LDX_MEM(BPF_DW, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-		.stack_depth = 40,
-	},
-	{
-		"ST_MEM_DW: Store/Load double word: max negative 2",
-		.u.insns_int = {
-			BPF_LD_IMM64(R2, 0xffff00000000ffffLL),
-			BPF_LD_IMM64(R3, 0xffffffffffffffffLL),
-			BPF_ST_MEM(BPF_DW, R10, -40, 0xffffffff),
-			BPF_LDX_MEM(BPF_DW, R2, R10, -40),
-			BPF_JMP_REG(BPF_JEQ, R2, R3, 2),
-			BPF_MOV32_IMM(R0, 2),
-			BPF_EXIT_INSN(),
-			BPF_MOV32_IMM(R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x1 } },
-		.stack_depth = 40,
-	},
-	{
-		"ST_MEM_DW: Store/Load double word: max positive",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_ST_MEM(BPF_DW, R10, -40, 0x7fffffff),
-			BPF_LDX_MEM(BPF_DW, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x7fffffff } },
-		.stack_depth = 40,
-	},
-	{
-		"STX_MEM_DW: Store/Load double word: max negative",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_LD_IMM64(R1, 0xffffffffffffffffLL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -40),
-			BPF_LDX_MEM(BPF_DW, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffff } },
-		.stack_depth = 40,
-	},
-	{
-		"STX_MEM_DW: Store double word: first word in memory",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_LD_IMM64(R1, 0x0123456789abcdefLL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -40),
-			BPF_LDX_MEM(BPF_W, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-#ifdef __BIG_ENDIAN
-		{ { 0, 0x01234567 } },
-#else
-		{ { 0, 0x89abcdef } },
-#endif
-		.stack_depth = 40,
-	},
-	{
-		"STX_MEM_DW: Store double word: second word in memory",
-		.u.insns_int = {
-			BPF_LD_IMM64(R0, 0),
-			BPF_LD_IMM64(R1, 0x0123456789abcdefLL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -40),
-			BPF_LDX_MEM(BPF_W, R0, R10, -36),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-#ifdef __BIG_ENDIAN
-		{ { 0, 0x89abcdef } },
-#else
-		{ { 0, 0x01234567 } },
-#endif
-		.stack_depth = 40,
-	},
-	/* BPF_STX | BPF_ATOMIC | BPF_W/DW */
-	{
-		"STX_XADD_W: X + 1 + 1 + 1 + ...",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 4134 } },
-		.fill_helper = bpf_fill_stxw,
-	},
-	{
-		"STX_XADD_DW: X + 1 + 1 + 1 + ...",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 4134 } },
-		.fill_helper = bpf_fill_stxdw,
-	},
-	/*
-	 * Exhaustive tests of atomic operation variants.
-	 * Individual tests are expanded from template macros for all
-	 * combinations of ALU operation, word size and fetching.
-	 */
-#define BPF_ATOMIC_POISON(width) ((width) == BPF_W ? (0xbaadf00dULL << 32) : 0)
-
-#define BPF_ATOMIC_OP_TEST1(width, op, logic, old, update, result)	\
-{									\
-	"BPF_ATOMIC | " #width ", " #op ": Test: "			\
-		#old " " #logic " " #update " = " #result,		\
-	.u.insns_int = {						\
-		BPF_LD_IMM64(R5, (update) | BPF_ATOMIC_POISON(width)),	\
-		BPF_ST_MEM(width, R10, -40, old),			\
-		BPF_ATOMIC_OP(width, op, R10, R5, -40),			\
-		BPF_LDX_MEM(width, R0, R10, -40),			\
-		BPF_ALU64_REG(BPF_MOV, R1, R0),				\
-		BPF_ALU64_IMM(BPF_RSH, R1, 32),				\
-		BPF_ALU64_REG(BPF_OR, R0, R1),				\
-		BPF_EXIT_INSN(),					\
-	},								\
-	INTERNAL,							\
-	{ },								\
-	{ { 0, result } },						\
-	.stack_depth = 40,						\
-}
-#define BPF_ATOMIC_OP_TEST2(width, op, logic, old, update, result)	\
-{									\
-	"BPF_ATOMIC | " #width ", " #op ": Test side effects, r10: "	\
-		#old " " #logic " " #update " = " #result,		\
-	.u.insns_int = {						\
-		BPF_ALU64_REG(BPF_MOV, R1, R10),			\
-		BPF_LD_IMM64(R0, (update) | BPF_ATOMIC_POISON(width)),	\
-		BPF_ST_MEM(BPF_W, R10, -40, old),			\
-		BPF_ATOMIC_OP(width, op, R10, R0, -40),			\
-		BPF_ALU64_REG(BPF_MOV, R0, R10),			\
-		BPF_ALU64_REG(BPF_SUB, R0, R1),				\
-		BPF_ALU64_REG(BPF_MOV, R1, R0),				\
-		BPF_ALU64_IMM(BPF_RSH, R1, 32),				\
-		BPF_ALU64_REG(BPF_OR, R0, R1),				\
-		BPF_EXIT_INSN(),					\
-	},								\
-	INTERNAL,							\
-	{ },								\
-	{ { 0, 0 } },							\
-	.stack_depth = 40,						\
-}
-#define BPF_ATOMIC_OP_TEST3(width, op, logic, old, update, result)	\
-{									\
-	"BPF_ATOMIC | " #width ", " #op ": Test side effects, r0: "	\
-		#old " " #logic " " #update " = " #result,		\
-	.u.insns_int = {						\
-		BPF_ALU64_REG(BPF_MOV, R0, R10),			\
-		BPF_LD_IMM64(R1, (update) | BPF_ATOMIC_POISON(width)),	\
-		BPF_ST_MEM(width, R10, -40, old),			\
-		BPF_ATOMIC_OP(width, op, R10, R1, -40),			\
-		BPF_ALU64_REG(BPF_SUB, R0, R10),			\
-		BPF_ALU64_REG(BPF_MOV, R1, R0),				\
-		BPF_ALU64_IMM(BPF_RSH, R1, 32),				\
-		BPF_ALU64_REG(BPF_OR, R0, R1),				\
-		BPF_EXIT_INSN(),					\
-	},								\
-	INTERNAL,                                                       \
-	{ },                                                            \
-	{ { 0, 0 } },                                                   \
-	.stack_depth = 40,                                              \
-}
-#define BPF_ATOMIC_OP_TEST4(width, op, logic, old, update, result)	\
-{									\
-	"BPF_ATOMIC | " #width ", " #op ": Test fetch: "		\
-		#old " " #logic " " #update " = " #result,		\
-	.u.insns_int = {						\
-		BPF_LD_IMM64(R3, (update) | BPF_ATOMIC_POISON(width)),	\
-		BPF_ST_MEM(width, R10, -40, old),			\
-		BPF_ATOMIC_OP(width, op, R10, R3, -40),			\
-		BPF_ALU32_REG(BPF_MOV, R0, R3),                         \
-		BPF_EXIT_INSN(),					\
-	},								\
-	INTERNAL,                                                       \
-	{ },                                                            \
-	{ { 0, (op) & BPF_FETCH ? old : update } },			\
-	.stack_depth = 40,                                              \
-}
-	/* BPF_ATOMIC | BPF_W: BPF_ADD */
-	BPF_ATOMIC_OP_TEST1(BPF_W, BPF_ADD, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST2(BPF_W, BPF_ADD, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST3(BPF_W, BPF_ADD, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST4(BPF_W, BPF_ADD, +, 0x12, 0xab, 0xbd),
-	/* BPF_ATOMIC | BPF_W: BPF_ADD | BPF_FETCH */
-	BPF_ATOMIC_OP_TEST1(BPF_W, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST2(BPF_W, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST3(BPF_W, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST4(BPF_W, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),
-	/* BPF_ATOMIC | BPF_DW: BPF_ADD */
-	BPF_ATOMIC_OP_TEST1(BPF_DW, BPF_ADD, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST2(BPF_DW, BPF_ADD, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST3(BPF_DW, BPF_ADD, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST4(BPF_DW, BPF_ADD, +, 0x12, 0xab, 0xbd),
-	/* BPF_ATOMIC | BPF_DW: BPF_ADD | BPF_FETCH */
-	BPF_ATOMIC_OP_TEST1(BPF_DW, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST2(BPF_DW, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST3(BPF_DW, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),
-	BPF_ATOMIC_OP_TEST4(BPF_DW, BPF_ADD | BPF_FETCH, +, 0x12, 0xab, 0xbd),
-	/* BPF_ATOMIC | BPF_W: BPF_AND */
-	BPF_ATOMIC_OP_TEST1(BPF_W, BPF_AND, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST2(BPF_W, BPF_AND, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST3(BPF_W, BPF_AND, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST4(BPF_W, BPF_AND, &, 0x12, 0xab, 0x02),
-	/* BPF_ATOMIC | BPF_W: BPF_AND | BPF_FETCH */
-	BPF_ATOMIC_OP_TEST1(BPF_W, BPF_AND | BPF_FETCH, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST2(BPF_W, BPF_AND | BPF_FETCH, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST3(BPF_W, BPF_AND | BPF_FETCH, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST4(BPF_W, BPF_AND | BPF_FETCH, &, 0x12, 0xab, 0x02),
-	/* BPF_ATOMIC | BPF_DW: BPF_AND */
-	BPF_ATOMIC_OP_TEST1(BPF_DW, BPF_AND, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST2(BPF_DW, BPF_AND, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST3(BPF_DW, BPF_AND, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST4(BPF_DW, BPF_AND, &, 0x12, 0xab, 0x02),
-	/* BPF_ATOMIC | BPF_DW: BPF_AND | BPF_FETCH */
-	BPF_ATOMIC_OP_TEST1(BPF_DW, BPF_AND | BPF_FETCH, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST2(BPF_DW, BPF_AND | BPF_FETCH, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST3(BPF_DW, BPF_AND | BPF_FETCH, &, 0x12, 0xab, 0x02),
-	BPF_ATOMIC_OP_TEST4(BPF_DW, BPF_AND | BPF_FETCH, &, 0x12, 0xab, 0x02),
-	/* BPF_ATOMIC | BPF_W: BPF_OR */
-	BPF_ATOMIC_OP_TEST1(BPF_W, BPF_OR, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST2(BPF_W, BPF_OR, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST3(BPF_W, BPF_OR, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST4(BPF_W, BPF_OR, |, 0x12, 0xab, 0xbb),
-	/* BPF_ATOMIC | BPF_W: BPF_OR | BPF_FETCH */
-	BPF_ATOMIC_OP_TEST1(BPF_W, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST2(BPF_W, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST3(BPF_W, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST4(BPF_W, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),
-	/* BPF_ATOMIC | BPF_DW: BPF_OR */
-	BPF_ATOMIC_OP_TEST1(BPF_DW, BPF_OR, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST2(BPF_DW, BPF_OR, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST3(BPF_DW, BPF_OR, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST4(BPF_DW, BPF_OR, |, 0x12, 0xab, 0xbb),
-	/* BPF_ATOMIC | BPF_DW: BPF_OR | BPF_FETCH */
-	BPF_ATOMIC_OP_TEST1(BPF_DW, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST2(BPF_DW, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST3(BPF_DW, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),
-	BPF_ATOMIC_OP_TEST4(BPF_DW, BPF_OR | BPF_FETCH, |, 0x12, 0xab, 0xbb),
-	/* BPF_ATOMIC | BPF_W: BPF_XOR */
-	BPF_ATOMIC_OP_TEST1(BPF_W, BPF_XOR, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST2(BPF_W, BPF_XOR, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST3(BPF_W, BPF_XOR, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST4(BPF_W, BPF_XOR, ^, 0x12, 0xab, 0xb9),
-	/* BPF_ATOMIC | BPF_W: BPF_XOR | BPF_FETCH */
-	BPF_ATOMIC_OP_TEST1(BPF_W, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST2(BPF_W, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST3(BPF_W, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST4(BPF_W, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),
-	/* BPF_ATOMIC | BPF_DW: BPF_XOR */
-	BPF_ATOMIC_OP_TEST1(BPF_DW, BPF_XOR, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST2(BPF_DW, BPF_XOR, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST3(BPF_DW, BPF_XOR, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST4(BPF_DW, BPF_XOR, ^, 0x12, 0xab, 0xb9),
-	/* BPF_ATOMIC | BPF_DW: BPF_XOR | BPF_FETCH */
-	BPF_ATOMIC_OP_TEST1(BPF_DW, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST2(BPF_DW, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST3(BPF_DW, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),
-	BPF_ATOMIC_OP_TEST4(BPF_DW, BPF_XOR | BPF_FETCH, ^, 0x12, 0xab, 0xb9),
-	/* BPF_ATOMIC | BPF_W: BPF_XCHG */
-	BPF_ATOMIC_OP_TEST1(BPF_W, BPF_XCHG, xchg, 0x12, 0xab, 0xab),
-	BPF_ATOMIC_OP_TEST2(BPF_W, BPF_XCHG, xchg, 0x12, 0xab, 0xab),
-	BPF_ATOMIC_OP_TEST3(BPF_W, BPF_XCHG, xchg, 0x12, 0xab, 0xab),
-	BPF_ATOMIC_OP_TEST4(BPF_W, BPF_XCHG, xchg, 0x12, 0xab, 0xab),
-	/* BPF_ATOMIC | BPF_DW: BPF_XCHG */
-	BPF_ATOMIC_OP_TEST1(BPF_DW, BPF_XCHG, xchg, 0x12, 0xab, 0xab),
-	BPF_ATOMIC_OP_TEST2(BPF_DW, BPF_XCHG, xchg, 0x12, 0xab, 0xab),
-	BPF_ATOMIC_OP_TEST3(BPF_DW, BPF_XCHG, xchg, 0x12, 0xab, 0xab),
-	BPF_ATOMIC_OP_TEST4(BPF_DW, BPF_XCHG, xchg, 0x12, 0xab, 0xab),
-#undef BPF_ATOMIC_POISON
-#undef BPF_ATOMIC_OP_TEST1
-#undef BPF_ATOMIC_OP_TEST2
-#undef BPF_ATOMIC_OP_TEST3
-#undef BPF_ATOMIC_OP_TEST4
-	/* BPF_ATOMIC | BPF_W, BPF_CMPXCHG */
-	{
-		"BPF_ATOMIC | BPF_W, BPF_CMPXCHG: Test successful return",
-		.u.insns_int = {
-			BPF_ST_MEM(BPF_W, R10, -40, 0x01234567),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x01234567),
-			BPF_ALU32_IMM(BPF_MOV, R3, 0x89abcdef),
-			BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R3, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x01234567 } },
-		.stack_depth = 40,
-	},
-	{
-		"BPF_ATOMIC | BPF_W, BPF_CMPXCHG: Test successful store",
-		.u.insns_int = {
-			BPF_ST_MEM(BPF_W, R10, -40, 0x01234567),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x01234567),
-			BPF_ALU32_IMM(BPF_MOV, R3, 0x89abcdef),
-			BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R3, -40),
-			BPF_LDX_MEM(BPF_W, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } },
-		.stack_depth = 40,
-	},
-	{
-		"BPF_ATOMIC | BPF_W, BPF_CMPXCHG: Test failure return",
-		.u.insns_int = {
-			BPF_ST_MEM(BPF_W, R10, -40, 0x01234567),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x76543210),
-			BPF_ALU32_IMM(BPF_MOV, R3, 0x89abcdef),
-			BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R3, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x01234567 } },
-		.stack_depth = 40,
-	},
-	{
-		"BPF_ATOMIC | BPF_W, BPF_CMPXCHG: Test failure store",
-		.u.insns_int = {
-			BPF_ST_MEM(BPF_W, R10, -40, 0x01234567),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x76543210),
-			BPF_ALU32_IMM(BPF_MOV, R3, 0x89abcdef),
-			BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R3, -40),
-			BPF_LDX_MEM(BPF_W, R0, R10, -40),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x01234567 } },
-		.stack_depth = 40,
-	},
-	{
-		"BPF_ATOMIC | BPF_W, BPF_CMPXCHG: Test side effects",
-		.u.insns_int = {
-			BPF_ST_MEM(BPF_W, R10, -40, 0x01234567),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x01234567),
-			BPF_ALU32_IMM(BPF_MOV, R3, 0x89abcdef),
-			BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R3, -40),
-			BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R3, -40),
-			BPF_ALU32_REG(BPF_MOV, R0, R3),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x89abcdef } },
-		.stack_depth = 40,
-	},
-	/* BPF_ATOMIC | BPF_DW, BPF_CMPXCHG */
-	{
-		"BPF_ATOMIC | BPF_DW, BPF_CMPXCHG: Test successful return",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0123456789abcdefULL),
-			BPF_LD_IMM64(R2, 0xfedcba9876543210ULL),
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_STX_MEM(BPF_DW, R10, R1, -40),
-			BPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -40),
-			BPF_JMP_REG(BPF_JNE, R0, R1, 1),
-			BPF_ALU64_REG(BPF_SUB, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 40,
-	},
-	{
-		"BPF_ATOMIC | BPF_DW, BPF_CMPXCHG: Test successful store",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0123456789abcdefULL),
-			BPF_LD_IMM64(R2, 0xfedcba9876543210ULL),
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_STX_MEM(BPF_DW, R10, R0, -40),
-			BPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -40),
-			BPF_LDX_MEM(BPF_DW, R0, R10, -40),
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_REG(BPF_SUB, R0, R2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 40,
-	},
-	{
-		"BPF_ATOMIC | BPF_DW, BPF_CMPXCHG: Test failure return",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0123456789abcdefULL),
-			BPF_LD_IMM64(R2, 0xfedcba9876543210ULL),
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_ALU64_IMM(BPF_ADD, R0, 1),
-			BPF_STX_MEM(BPF_DW, R10, R1, -40),
-			BPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -40),
-			BPF_JMP_REG(BPF_JNE, R0, R1, 1),
-			BPF_ALU64_REG(BPF_SUB, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 40,
-	},
-	{
-		"BPF_ATOMIC | BPF_DW, BPF_CMPXCHG: Test failure store",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0123456789abcdefULL),
-			BPF_LD_IMM64(R2, 0xfedcba9876543210ULL),
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_ALU64_IMM(BPF_ADD, R0, 1),
-			BPF_STX_MEM(BPF_DW, R10, R1, -40),
-			BPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -40),
-			BPF_LDX_MEM(BPF_DW, R0, R10, -40),
-			BPF_JMP_REG(BPF_JNE, R0, R1, 1),
-			BPF_ALU64_REG(BPF_SUB, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 40,
-	},
-	{
-		"BPF_ATOMIC | BPF_DW, BPF_CMPXCHG: Test side effects",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0123456789abcdefULL),
-			BPF_LD_IMM64(R2, 0xfedcba9876543210ULL),
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_STX_MEM(BPF_DW, R10, R1, -40),
-			BPF_ATOMIC_OP(BPF_DW, BPF_CMPXCHG, R10, R2, -40),
-			BPF_LD_IMM64(R0, 0xfedcba9876543210ULL),
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_REG(BPF_SUB, R0, R2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 40,
-	},
-	/* BPF_JMP32 | BPF_JEQ | BPF_K */
-	{
-		"JMP32_JEQ_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 123),
-			BPF_JMP32_IMM(BPF_JEQ, R0, 321, 1),
-			BPF_JMP32_IMM(BPF_JEQ, R0, 123, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 123 } }
-	},
-	{
-		"JMP32_JEQ_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 12345678),
-			BPF_JMP32_IMM(BPF_JEQ, R0, 12345678 & 0xffff, 1),
-			BPF_JMP32_IMM(BPF_JEQ, R0, 12345678, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 12345678 } }
-	},
-	{
-		"JMP32_JEQ_K: negative immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123),
-			BPF_JMP32_IMM(BPF_JEQ, R0,  123, 1),
-			BPF_JMP32_IMM(BPF_JEQ, R0, -123, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123 } }
-	},
-	/* BPF_JMP32 | BPF_JEQ | BPF_X */
-	{
-		"JMP32_JEQ_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1234),
-			BPF_ALU32_IMM(BPF_MOV, R1, 4321),
-			BPF_JMP32_REG(BPF_JEQ, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 1234),
-			BPF_JMP32_REG(BPF_JEQ, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1234 } }
-	},
-	/* BPF_JMP32 | BPF_JNE | BPF_K */
-	{
-		"JMP32_JNE_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 123),
-			BPF_JMP32_IMM(BPF_JNE, R0, 123, 1),
-			BPF_JMP32_IMM(BPF_JNE, R0, 321, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 123 } }
-	},
-	{
-		"JMP32_JNE_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 12345678),
-			BPF_JMP32_IMM(BPF_JNE, R0, 12345678, 1),
-			BPF_JMP32_IMM(BPF_JNE, R0, 12345678 & 0xffff, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 12345678 } }
-	},
-	{
-		"JMP32_JNE_K: negative immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123),
-			BPF_JMP32_IMM(BPF_JNE, R0, -123, 1),
-			BPF_JMP32_IMM(BPF_JNE, R0,  123, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123 } }
-	},
-	/* BPF_JMP32 | BPF_JNE | BPF_X */
-	{
-		"JMP32_JNE_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1234),
-			BPF_ALU32_IMM(BPF_MOV, R1, 1234),
-			BPF_JMP32_REG(BPF_JNE, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 4321),
-			BPF_JMP32_REG(BPF_JNE, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1234 } }
-	},
-	/* BPF_JMP32 | BPF_JSET | BPF_K */
-	{
-		"JMP32_JSET_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_JMP32_IMM(BPF_JSET, R0, 2, 1),
-			BPF_JMP32_IMM(BPF_JSET, R0, 3, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } }
-	},
-	{
-		"JMP32_JSET_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x40000000),
-			BPF_JMP32_IMM(BPF_JSET, R0, 0x3fffffff, 1),
-			BPF_JMP32_IMM(BPF_JSET, R0, 0x60000000, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x40000000 } }
-	},
-	{
-		"JMP32_JSET_K: negative immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123),
-			BPF_JMP32_IMM(BPF_JSET, R0, -1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123 } }
-	},
-	/* BPF_JMP32 | BPF_JSET | BPF_X */
-	{
-		"JMP32_JSET_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 8),
-			BPF_ALU32_IMM(BPF_MOV, R1, 7),
-			BPF_JMP32_REG(BPF_JSET, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 8 | 2),
-			BPF_JMP32_REG(BPF_JNE, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 8 } }
-	},
-	/* BPF_JMP32 | BPF_JGT | BPF_K */
-	{
-		"JMP32_JGT_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 123),
-			BPF_JMP32_IMM(BPF_JGT, R0, 123, 1),
-			BPF_JMP32_IMM(BPF_JGT, R0, 122, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 123 } }
-	},
-	{
-		"JMP32_JGT_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
-			BPF_JMP32_IMM(BPF_JGT, R0, 0xffffffff, 1),
-			BPF_JMP32_IMM(BPF_JGT, R0, 0xfffffffd, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } }
-	},
-	/* BPF_JMP32 | BPF_JGT | BPF_X */
-	{
-		"JMP32_JGT_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
-			BPF_JMP32_REG(BPF_JGT, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xfffffffd),
-			BPF_JMP32_REG(BPF_JGT, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } }
-	},
-	/* BPF_JMP32 | BPF_JGE | BPF_K */
-	{
-		"JMP32_JGE_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 123),
-			BPF_JMP32_IMM(BPF_JGE, R0, 124, 1),
-			BPF_JMP32_IMM(BPF_JGE, R0, 123, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 123 } }
-	},
-	{
-		"JMP32_JGE_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
-			BPF_JMP32_IMM(BPF_JGE, R0, 0xffffffff, 1),
-			BPF_JMP32_IMM(BPF_JGE, R0, 0xfffffffe, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } }
-	},
-	/* BPF_JMP32 | BPF_JGE | BPF_X */
-	{
-		"JMP32_JGE_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
-			BPF_JMP32_REG(BPF_JGE, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xfffffffe),
-			BPF_JMP32_REG(BPF_JGE, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } }
-	},
-	/* BPF_JMP32 | BPF_JLT | BPF_K */
-	{
-		"JMP32_JLT_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 123),
-			BPF_JMP32_IMM(BPF_JLT, R0, 123, 1),
-			BPF_JMP32_IMM(BPF_JLT, R0, 124, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 123 } }
-	},
-	{
-		"JMP32_JLT_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
-			BPF_JMP32_IMM(BPF_JLT, R0, 0xfffffffd, 1),
-			BPF_JMP32_IMM(BPF_JLT, R0, 0xffffffff, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } }
-	},
-	/* BPF_JMP32 | BPF_JLT | BPF_X */
-	{
-		"JMP32_JLT_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xfffffffd),
-			BPF_JMP32_REG(BPF_JLT, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xffffffff),
-			BPF_JMP32_REG(BPF_JLT, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } }
-	},
-	/* BPF_JMP32 | BPF_JLE | BPF_K */
-	{
-		"JMP32_JLE_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 123),
-			BPF_JMP32_IMM(BPF_JLE, R0, 122, 1),
-			BPF_JMP32_IMM(BPF_JLE, R0, 123, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 123 } }
-	},
-	{
-		"JMP32_JLE_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
-			BPF_JMP32_IMM(BPF_JLE, R0, 0xfffffffd, 1),
-			BPF_JMP32_IMM(BPF_JLE, R0, 0xfffffffe, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } }
-	},
-	/* BPF_JMP32 | BPF_JLE | BPF_X */
-	{
-		"JMP32_JLE_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0xfffffffe),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xfffffffd),
-			BPF_JMP32_REG(BPF_JLE, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xfffffffe),
-			BPF_JMP32_REG(BPF_JLE, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xfffffffe } }
-	},
-	/* BPF_JMP32 | BPF_JSGT | BPF_K */
-	{
-		"JMP32_JSGT_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123),
-			BPF_JMP32_IMM(BPF_JSGT, R0, -123, 1),
-			BPF_JMP32_IMM(BPF_JSGT, R0, -124, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123 } }
-	},
-	{
-		"JMP32_JSGT_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -12345678),
-			BPF_JMP32_IMM(BPF_JSGT, R0, -12345678, 1),
-			BPF_JMP32_IMM(BPF_JSGT, R0, -12345679, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -12345678 } }
-	},
-	/* BPF_JMP32 | BPF_JSGT | BPF_X */
-	{
-		"JMP32_JSGT_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -12345678),
-			BPF_ALU32_IMM(BPF_MOV, R1, -12345678),
-			BPF_JMP32_REG(BPF_JSGT, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, -12345679),
-			BPF_JMP32_REG(BPF_JSGT, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -12345678 } }
-	},
-	/* BPF_JMP32 | BPF_JSGE | BPF_K */
-	{
-		"JMP32_JSGE_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123),
-			BPF_JMP32_IMM(BPF_JSGE, R0, -122, 1),
-			BPF_JMP32_IMM(BPF_JSGE, R0, -123, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123 } }
-	},
-	{
-		"JMP32_JSGE_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -12345678),
-			BPF_JMP32_IMM(BPF_JSGE, R0, -12345677, 1),
-			BPF_JMP32_IMM(BPF_JSGE, R0, -12345678, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -12345678 } }
-	},
-	/* BPF_JMP32 | BPF_JSGE | BPF_X */
-	{
-		"JMP32_JSGE_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -12345678),
-			BPF_ALU32_IMM(BPF_MOV, R1, -12345677),
-			BPF_JMP32_REG(BPF_JSGE, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, -12345678),
-			BPF_JMP32_REG(BPF_JSGE, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -12345678 } }
-	},
-	/* BPF_JMP32 | BPF_JSLT | BPF_K */
-	{
-		"JMP32_JSLT_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123),
-			BPF_JMP32_IMM(BPF_JSLT, R0, -123, 1),
-			BPF_JMP32_IMM(BPF_JSLT, R0, -122, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123 } }
-	},
-	{
-		"JMP32_JSLT_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -12345678),
-			BPF_JMP32_IMM(BPF_JSLT, R0, -12345678, 1),
-			BPF_JMP32_IMM(BPF_JSLT, R0, -12345677, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -12345678 } }
-	},
-	/* BPF_JMP32 | BPF_JSLT | BPF_X */
-	{
-		"JMP32_JSLT_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -12345678),
-			BPF_ALU32_IMM(BPF_MOV, R1, -12345678),
-			BPF_JMP32_REG(BPF_JSLT, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, -12345677),
-			BPF_JMP32_REG(BPF_JSLT, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -12345678 } }
-	},
-	/* BPF_JMP32 | BPF_JSLE | BPF_K */
-	{
-		"JMP32_JSLE_K: Small immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -123),
-			BPF_JMP32_IMM(BPF_JSLE, R0, -124, 1),
-			BPF_JMP32_IMM(BPF_JSLE, R0, -123, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -123 } }
-	},
-	{
-		"JMP32_JSLE_K: Large immediate",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -12345678),
-			BPF_JMP32_IMM(BPF_JSLE, R0, -12345679, 1),
-			BPF_JMP32_IMM(BPF_JSLE, R0, -12345678, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -12345678 } }
-	},
-	/* BPF_JMP32 | BPF_JSLE | BPF_K */
-	{
-		"JMP32_JSLE_X",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, -12345678),
-			BPF_ALU32_IMM(BPF_MOV, R1, -12345679),
-			BPF_JMP32_REG(BPF_JSLE, R0, R1, 2),
-			BPF_ALU32_IMM(BPF_MOV, R1, -12345678),
-			BPF_JMP32_REG(BPF_JSLE, R0, R1, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, -12345678 } }
-	},
-	/* BPF_JMP | BPF_EXIT */
-	{
-		"JMP_EXIT",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x4711),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0x4712),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0x4711 } },
-	},
-	/* BPF_JMP | BPF_JA */
-	{
-		"JMP_JA: Unconditional jump: if (true) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_JMP_IMM(BPF_JA, 0, 0, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP32 | BPF_JA */
-	{
-		"JMP32_JA: Unconditional jump: if (true) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_JMP32_IMM(BPF_JA, 0, 1, 0),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSLT | BPF_K */
-	{
-		"JMP_JSLT_K: Signed jump: if (-2 < -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 0xfffffffffffffffeLL),
-			BPF_JMP_IMM(BPF_JSLT, R1, -1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSLT_K: Signed jump: if (-1 < -1) return 0",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_LD_IMM64(R1, 0xffffffffffffffffLL),
-			BPF_JMP_IMM(BPF_JSLT, R1, -1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSGT | BPF_K */
-	{
-		"JMP_JSGT_K: Signed jump: if (-1 > -2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 0xffffffffffffffffLL),
-			BPF_JMP_IMM(BPF_JSGT, R1, -2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSGT_K: Signed jump: if (-1 > -1) return 0",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_LD_IMM64(R1, 0xffffffffffffffffLL),
-			BPF_JMP_IMM(BPF_JSGT, R1, -1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSLE | BPF_K */
-	{
-		"JMP_JSLE_K: Signed jump: if (-2 <= -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 0xfffffffffffffffeLL),
-			BPF_JMP_IMM(BPF_JSLE, R1, -1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSLE_K: Signed jump: if (-1 <= -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 0xffffffffffffffffLL),
-			BPF_JMP_IMM(BPF_JSLE, R1, -1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSLE_K: Signed jump: value walk 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JSLE, R1, 0, 6),
-			BPF_ALU64_IMM(BPF_SUB, R1, 1),
-			BPF_JMP_IMM(BPF_JSLE, R1, 0, 4),
-			BPF_ALU64_IMM(BPF_SUB, R1, 1),
-			BPF_JMP_IMM(BPF_JSLE, R1, 0, 2),
-			BPF_ALU64_IMM(BPF_SUB, R1, 1),
-			BPF_JMP_IMM(BPF_JSLE, R1, 0, 1),
-			BPF_EXIT_INSN(),		/* bad exit */
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),	/* good exit */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSLE_K: Signed jump: value walk 2",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JSLE, R1, 0, 4),
-			BPF_ALU64_IMM(BPF_SUB, R1, 2),
-			BPF_JMP_IMM(BPF_JSLE, R1, 0, 2),
-			BPF_ALU64_IMM(BPF_SUB, R1, 2),
-			BPF_JMP_IMM(BPF_JSLE, R1, 0, 1),
-			BPF_EXIT_INSN(),		/* bad exit */
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),	/* good exit */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSGE | BPF_K */
-	{
-		"JMP_JSGE_K: Signed jump: if (-1 >= -2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 0xffffffffffffffffLL),
-			BPF_JMP_IMM(BPF_JSGE, R1, -2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSGE_K: Signed jump: if (-1 >= -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 0xffffffffffffffffLL),
-			BPF_JMP_IMM(BPF_JSGE, R1, -1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSGE_K: Signed jump: value walk 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -3),
-			BPF_JMP_IMM(BPF_JSGE, R1, 0, 6),
-			BPF_ALU64_IMM(BPF_ADD, R1, 1),
-			BPF_JMP_IMM(BPF_JSGE, R1, 0, 4),
-			BPF_ALU64_IMM(BPF_ADD, R1, 1),
-			BPF_JMP_IMM(BPF_JSGE, R1, 0, 2),
-			BPF_ALU64_IMM(BPF_ADD, R1, 1),
-			BPF_JMP_IMM(BPF_JSGE, R1, 0, 1),
-			BPF_EXIT_INSN(),		/* bad exit */
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),	/* good exit */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSGE_K: Signed jump: value walk 2",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -3),
-			BPF_JMP_IMM(BPF_JSGE, R1, 0, 4),
-			BPF_ALU64_IMM(BPF_ADD, R1, 2),
-			BPF_JMP_IMM(BPF_JSGE, R1, 0, 2),
-			BPF_ALU64_IMM(BPF_ADD, R1, 2),
-			BPF_JMP_IMM(BPF_JSGE, R1, 0, 1),
-			BPF_EXIT_INSN(),		/* bad exit */
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),	/* good exit */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JGT | BPF_K */
-	{
-		"JMP_JGT_K: if (3 > 2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JGT, R1, 2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JGT_K: Unsigned jump: if (-1 > 1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -1),
-			BPF_JMP_IMM(BPF_JGT, R1, 1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JLT | BPF_K */
-	{
-		"JMP_JLT_K: if (2 < 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 2),
-			BPF_JMP_IMM(BPF_JLT, R1, 3, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JGT_K: Unsigned jump: if (1 < -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 1),
-			BPF_JMP_IMM(BPF_JLT, R1, -1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JGE | BPF_K */
-	{
-		"JMP_JGE_K: if (3 >= 2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JGE, R1, 2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JLE | BPF_K */
-	{
-		"JMP_JLE_K: if (2 <= 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 2),
-			BPF_JMP_IMM(BPF_JLE, R1, 3, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JGT | BPF_K jump backwards */
-	{
-		"JMP_JGT_K: if (3 > 2) return 1 (jump backwards)",
-		.u.insns_int = {
-			BPF_JMP_IMM(BPF_JA, 0, 0, 2), /* goto start */
-			BPF_ALU32_IMM(BPF_MOV, R0, 1), /* out: */
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0), /* start: */
-			BPF_LD_IMM64(R1, 3), /* note: this takes 2 insns */
-			BPF_JMP_IMM(BPF_JGT, R1, 2, -6), /* goto out */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JGE_K: if (3 >= 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JGE, R1, 3, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JLT | BPF_K jump backwards */
-	{
-		"JMP_JGT_K: if (2 < 3) return 1 (jump backwards)",
-		.u.insns_int = {
-			BPF_JMP_IMM(BPF_JA, 0, 0, 2), /* goto start */
-			BPF_ALU32_IMM(BPF_MOV, R0, 1), /* out: */
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0), /* start: */
-			BPF_LD_IMM64(R1, 2), /* note: this takes 2 insns */
-			BPF_JMP_IMM(BPF_JLT, R1, 3, -6), /* goto out */
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JLE_K: if (3 <= 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JLE, R1, 3, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JNE | BPF_K */
-	{
-		"JMP_JNE_K: if (3 != 2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JNE, R1, 2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JEQ | BPF_K */
-	{
-		"JMP_JEQ_K: if (3 == 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JEQ, R1, 3, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSET | BPF_K */
-	{
-		"JMP_JSET_K: if (0x3 & 0x2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JSET, R1, 2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSET_K: if (0x3 & 0xffffffff) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_JMP_IMM(BPF_JSET, R1, 0xffffffff, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSGT | BPF_X */
-	{
-		"JMP_JSGT_X: Signed jump: if (-1 > -2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, -2),
-			BPF_JMP_REG(BPF_JSGT, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSGT_X: Signed jump: if (-1 > -1) return 0",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, -1),
-			BPF_JMP_REG(BPF_JSGT, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSLT | BPF_X */
-	{
-		"JMP_JSLT_X: Signed jump: if (-2 < -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, -2),
-			BPF_JMP_REG(BPF_JSLT, R2, R1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSLT_X: Signed jump: if (-1 < -1) return 0",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, -1),
-			BPF_JMP_REG(BPF_JSLT, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSGE | BPF_X */
-	{
-		"JMP_JSGE_X: Signed jump: if (-1 >= -2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, -2),
-			BPF_JMP_REG(BPF_JSGE, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSGE_X: Signed jump: if (-1 >= -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, -1),
-			BPF_JMP_REG(BPF_JSGE, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSLE | BPF_X */
-	{
-		"JMP_JSLE_X: Signed jump: if (-2 <= -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, -2),
-			BPF_JMP_REG(BPF_JSLE, R2, R1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSLE_X: Signed jump: if (-1 <= -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, -1),
-			BPF_JMP_REG(BPF_JSLE, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JGT | BPF_X */
-	{
-		"JMP_JGT_X: if (3 > 2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JGT, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JGT_X: Unsigned jump: if (-1 > 1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, 1),
-			BPF_JMP_REG(BPF_JGT, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JLT | BPF_X */
-	{
-		"JMP_JLT_X: if (2 < 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JLT, R2, R1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JLT_X: Unsigned jump: if (1 < -1) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, -1),
-			BPF_LD_IMM64(R2, 1),
-			BPF_JMP_REG(BPF_JLT, R2, R1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JGE | BPF_X */
-	{
-		"JMP_JGE_X: if (3 >= 2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JGE, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JGE_X: if (3 >= 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 3),
-			BPF_JMP_REG(BPF_JGE, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JLE | BPF_X */
-	{
-		"JMP_JLE_X: if (2 <= 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JLE, R2, R1, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JLE_X: if (3 <= 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 3),
-			BPF_JMP_REG(BPF_JLE, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		/* Mainly testing JIT + imm64 here. */
-		"JMP_JGE_X: ldimm64 test 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JGE, R1, R2, 2),
-			BPF_LD_IMM64(R0, 0xffffffffffffffffULL),
-			BPF_LD_IMM64(R0, 0xeeeeeeeeeeeeeeeeULL),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xeeeeeeeeU } },
-	},
-	{
-		"JMP_JGE_X: ldimm64 test 2",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JGE, R1, R2, 0),
-			BPF_LD_IMM64(R0, 0xffffffffffffffffULL),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffffU } },
-	},
-	{
-		"JMP_JGE_X: ldimm64 test 3",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JGE, R1, R2, 4),
-			BPF_LD_IMM64(R0, 0xffffffffffffffffULL),
-			BPF_LD_IMM64(R0, 0xeeeeeeeeeeeeeeeeULL),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JLE_X: ldimm64 test 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JLE, R2, R1, 2),
-			BPF_LD_IMM64(R0, 0xffffffffffffffffULL),
-			BPF_LD_IMM64(R0, 0xeeeeeeeeeeeeeeeeULL),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xeeeeeeeeU } },
-	},
-	{
-		"JMP_JLE_X: ldimm64 test 2",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JLE, R2, R1, 0),
-			BPF_LD_IMM64(R0, 0xffffffffffffffffULL),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0xffffffffU } },
-	},
-	{
-		"JMP_JLE_X: ldimm64 test 3",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JLE, R2, R1, 4),
-			BPF_LD_IMM64(R0, 0xffffffffffffffffULL),
-			BPF_LD_IMM64(R0, 0xeeeeeeeeeeeeeeeeULL),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JNE | BPF_X */
-	{
-		"JMP_JNE_X: if (3 != 2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JNE, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JEQ | BPF_X */
-	{
-		"JMP_JEQ_X: if (3 == 3) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 3),
-			BPF_JMP_REG(BPF_JEQ, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	/* BPF_JMP | BPF_JSET | BPF_X */
-	{
-		"JMP_JSET_X: if (0x3 & 0x2) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 2),
-			BPF_JMP_REG(BPF_JSET, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSET_X: if (0x3 & 0xffffffff) return 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R0, 0),
-			BPF_LD_IMM64(R1, 3),
-			BPF_LD_IMM64(R2, 0xffffffff),
-			BPF_JMP_REG(BPF_JSET, R1, R2, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JA: Jump, gap, jump, ...",
-		{ },
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0xababcbac } },
-		.fill_helper = bpf_fill_ja,
-	},
-	{	/* Mainly checking JIT here. */
-		"BPF_MAXINSNS: Maximum possible literals",
-		{ },
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0xffffffff } },
-		.fill_helper = bpf_fill_maxinsns1,
-	},
-	{	/* Mainly checking JIT here. */
-		"BPF_MAXINSNS: Single literal",
-		{ },
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0xfefefefe } },
-		.fill_helper = bpf_fill_maxinsns2,
-	},
-	{	/* Mainly checking JIT here. */
-		"BPF_MAXINSNS: Run/add until end",
-		{ },
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0x947bf368 } },
-		.fill_helper = bpf_fill_maxinsns3,
-	},
-	{
-		"BPF_MAXINSNS: Too many instructions",
-		{ },
-		CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
-		{ },
-		{ },
-		.fill_helper = bpf_fill_maxinsns4,
-		.expected_errcode = -EINVAL,
-	},
-	{	/* Mainly checking JIT here. */
-		"BPF_MAXINSNS: Very long jump",
-		{ },
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0xabababab } },
-		.fill_helper = bpf_fill_maxinsns5,
-	},
-	{	/* Mainly checking JIT here. */
-		"BPF_MAXINSNS: Ctx heavy transformations",
-		{ },
-		CLASSIC,
-		{ },
-		{
-			{  1, SKB_VLAN_PRESENT },
-			{ 10, SKB_VLAN_PRESENT }
-		},
-		.fill_helper = bpf_fill_maxinsns6,
-	},
-	{	/* Mainly checking JIT here. */
-		"BPF_MAXINSNS: Call heavy transformations",
-		{ },
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 1, 0 }, { 10, 0 } },
-		.fill_helper = bpf_fill_maxinsns7,
-	},
-	{	/* Mainly checking JIT here. */
-		"BPF_MAXINSNS: Jump heavy test",
-		{ },
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0xffffffff } },
-		.fill_helper = bpf_fill_maxinsns8,
-	},
-	{	/* Mainly checking JIT here. */
-		"BPF_MAXINSNS: Very long jump backwards",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0xcbababab } },
-		.fill_helper = bpf_fill_maxinsns9,
-	},
-	{	/* Mainly checking JIT here. */
-		"BPF_MAXINSNS: Edge hopping nuthouse",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0xabababac } },
-		.fill_helper = bpf_fill_maxinsns10,
-	},
-	{
-		"BPF_MAXINSNS: Jump, gap, jump, ...",
-		{ },
-		CLASSIC | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0xababcbac } },
-		.fill_helper = bpf_fill_maxinsns11,
-	},
-	{
-		"BPF_MAXINSNS: jump over MSH",
-		{ },
-		CLASSIC | FLAG_EXPECTED_FAIL,
-		{ 0xfa, 0xfb, 0xfc, 0xfd, },
-		{ { 4, 0xabababab } },
-		.fill_helper = bpf_fill_maxinsns12,
-		.expected_errcode = -EINVAL,
-	},
-	{
-		"BPF_MAXINSNS: exec all MSH",
-		{ },
-		CLASSIC,
-		{ 0xfa, 0xfb, 0xfc, 0xfd, },
-		{ { 4, 0xababab83 } },
-		.fill_helper = bpf_fill_maxinsns13,
-	},
-	{
-		"BPF_MAXINSNS: ld_abs+get_processor_id",
-		{ },
-		CLASSIC,
-		{ },
-		{ { 1, 0xbee } },
-		.fill_helper = bpf_fill_ld_abs_get_processor_id,
-	},
-	/*
-	 * LD_IND / LD_ABS on fragmented SKBs
-	 */
-	{
-		"LD_IND byte frag",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x40),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, 0x0),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ },
-		{ {0x40, 0x42} },
-		.frag_data = {
-			0x42, 0x00, 0x00, 0x00,
-			0x43, 0x44, 0x00, 0x00,
-			0x21, 0x07, 0x19, 0x83,
-		},
-	},
-	{
-		"LD_IND halfword frag",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x40),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_H, 0x4),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ },
-		{ {0x40, 0x4344} },
-		.frag_data = {
-			0x42, 0x00, 0x00, 0x00,
-			0x43, 0x44, 0x00, 0x00,
-			0x21, 0x07, 0x19, 0x83,
-		},
-	},
-	{
-		"LD_IND word frag",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x40),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, 0x8),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ },
-		{ {0x40, 0x21071983} },
-		.frag_data = {
-			0x42, 0x00, 0x00, 0x00,
-			0x43, 0x44, 0x00, 0x00,
-			0x21, 0x07, 0x19, 0x83,
-		},
-	},
-	{
-		"LD_IND halfword mixed head/frag",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x40),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_H, -0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ [0x3e] = 0x25, [0x3f] = 0x05, },
-		{ {0x40, 0x0519} },
-		.frag_data = { 0x19, 0x82 },
-	},
-	{
-		"LD_IND word mixed head/frag",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x40),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, -0x2),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ [0x3e] = 0x25, [0x3f] = 0x05, },
-		{ {0x40, 0x25051982} },
-		.frag_data = { 0x19, 0x82 },
-	},
-	{
-		"LD_ABS byte frag",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, 0x40),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ },
-		{ {0x40, 0x42} },
-		.frag_data = {
-			0x42, 0x00, 0x00, 0x00,
-			0x43, 0x44, 0x00, 0x00,
-			0x21, 0x07, 0x19, 0x83,
-		},
-	},
-	{
-		"LD_ABS halfword frag",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_H, 0x44),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ },
-		{ {0x40, 0x4344} },
-		.frag_data = {
-			0x42, 0x00, 0x00, 0x00,
-			0x43, 0x44, 0x00, 0x00,
-			0x21, 0x07, 0x19, 0x83,
-		},
-	},
-	{
-		"LD_ABS word frag",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x48),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ },
-		{ {0x40, 0x21071983} },
-		.frag_data = {
-			0x42, 0x00, 0x00, 0x00,
-			0x43, 0x44, 0x00, 0x00,
-			0x21, 0x07, 0x19, 0x83,
-		},
-	},
-	{
-		"LD_ABS halfword mixed head/frag",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_H, 0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ [0x3e] = 0x25, [0x3f] = 0x05, },
-		{ {0x40, 0x0519} },
-		.frag_data = { 0x19, 0x82 },
-	},
-	{
-		"LD_ABS word mixed head/frag",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x3e),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_SKB_FRAG,
-		{ [0x3e] = 0x25, [0x3f] = 0x05, },
-		{ {0x40, 0x25051982} },
-		.frag_data = { 0x19, 0x82 },
-	},
-	/*
-	 * LD_IND / LD_ABS on non fragmented SKBs
-	 */
-	{
-		/*
-		 * this tests that the JIT/interpreter correctly resets X
-		 * before using it in an LD_IND instruction.
-		 */
-		"LD_IND byte default X",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x1] = 0x42 },
-		{ {0x40, 0x42 } },
-	},
-	{
-		"LD_IND byte positive offset",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3e),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x82 } },
-	},
-	{
-		"LD_IND byte negative offset",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3e),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, -0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x05 } },
-	},
-	{
-		"LD_IND byte positive offset, all ff",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3e),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0xff, [0x3d] = 0xff,  [0x3e] = 0xff, [0x3f] = 0xff },
-		{ {0x40, 0xff } },
-	},
-	{
-		"LD_IND byte positive offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3e),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 }, },
-	},
-	{
-		"LD_IND byte negative offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3e),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, -0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 } },
-	},
-	{
-		"LD_IND byte negative offset, multiple calls",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3b),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, SKF_LL_OFF + 1),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, SKF_LL_OFF + 2),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, SKF_LL_OFF + 3),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_B, SKF_LL_OFF + 4),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x82 }, },
-	},
-	{
-		"LD_IND halfword positive offset",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x20),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_H, 0x2),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-		},
-		{ {0x40, 0xdd88 } },
-	},
-	{
-		"LD_IND halfword negative offset",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x20),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_H, -0x2),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-		},
-		{ {0x40, 0xbb66 } },
-	},
-	{
-		"LD_IND halfword unaligned",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x20),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_H, -0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-		},
-		{ {0x40, 0x66cc } },
-	},
-	{
-		"LD_IND halfword positive offset, all ff",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3d),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_H, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0xff, [0x3d] = 0xff,  [0x3e] = 0xff, [0x3f] = 0xff },
-		{ {0x40, 0xffff } },
-	},
-	{
-		"LD_IND halfword positive offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3e),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_H, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 }, },
-	},
-	{
-		"LD_IND halfword negative offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3e),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_H, -0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 } },
-	},
-	{
-		"LD_IND word positive offset",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x20),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, 0x4),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0xee99ffaa } },
-	},
-	{
-		"LD_IND word negative offset",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x20),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, -0x4),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0xaa55bb66 } },
-	},
-	{
-		"LD_IND word unaligned (addr & 3 == 2)",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x20),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, -0x2),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0xbb66cc77 } },
-	},
-	{
-		"LD_IND word unaligned (addr & 3 == 1)",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x20),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, -0x3),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0x55bb66cc } },
-	},
-	{
-		"LD_IND word unaligned (addr & 3 == 3)",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x20),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, -0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0x66cc77dd } },
-	},
-	{
-		"LD_IND word positive offset, all ff",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3b),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0xff, [0x3d] = 0xff,  [0x3e] = 0xff, [0x3f] = 0xff },
-		{ {0x40, 0xffffffff } },
-	},
-	{
-		"LD_IND word positive offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3e),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 }, },
-	},
-	{
-		"LD_IND word negative offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LDX | BPF_IMM, 0x3e),
-			BPF_STMT(BPF_LD | BPF_IND | BPF_W, -0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 } },
-	},
-	{
-		"LD_ABS byte",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, 0x20),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0xcc } },
-	},
-	{
-		"LD_ABS byte positive offset, all ff",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, 0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0xff, [0x3d] = 0xff,  [0x3e] = 0xff, [0x3f] = 0xff },
-		{ {0x40, 0xff } },
-	},
-	{
-		"LD_ABS byte positive offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, 0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 }, },
-	},
-	{
-		"LD_ABS byte negative offset, out of bounds load",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, -1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_EXPECTED_FAIL,
-		.expected_errcode = -EINVAL,
-	},
-	{
-		"LD_ABS byte negative offset, in bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, SKF_LL_OFF + 0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x82 }, },
-	},
-	{
-		"LD_ABS byte negative offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, SKF_LL_OFF + 0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 }, },
-	},
-	{
-		"LD_ABS byte negative offset, multiple calls",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, SKF_LL_OFF + 0x3c),
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, SKF_LL_OFF + 0x3d),
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, SKF_LL_OFF + 0x3e),
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_B, SKF_LL_OFF + 0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x82 }, },
-	},
-	{
-		"LD_ABS halfword",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_H, 0x22),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0xdd88 } },
-	},
-	{
-		"LD_ABS halfword unaligned",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_H, 0x25),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0x99ff } },
-	},
-	{
-		"LD_ABS halfword positive offset, all ff",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_H, 0x3e),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0xff, [0x3d] = 0xff,  [0x3e] = 0xff, [0x3f] = 0xff },
-		{ {0x40, 0xffff } },
-	},
-	{
-		"LD_ABS halfword positive offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_H, 0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 }, },
-	},
-	{
-		"LD_ABS halfword negative offset, out of bounds load",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_H, -1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_EXPECTED_FAIL,
-		.expected_errcode = -EINVAL,
-	},
-	{
-		"LD_ABS halfword negative offset, in bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_H, SKF_LL_OFF + 0x3e),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x1982 }, },
-	},
-	{
-		"LD_ABS halfword negative offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_H, SKF_LL_OFF + 0x3e),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 }, },
-	},
-	{
-		"LD_ABS word",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x1c),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0xaa55bb66 } },
-	},
-	{
-		"LD_ABS word unaligned (addr & 3 == 2)",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x22),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0xdd88ee99 } },
-	},
-	{
-		"LD_ABS word unaligned (addr & 3 == 1)",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x21),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0x77dd88ee } },
-	},
-	{
-		"LD_ABS word unaligned (addr & 3 == 3)",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x23),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{
-			[0x1c] = 0xaa, [0x1d] = 0x55,
-			[0x1e] = 0xbb, [0x1f] = 0x66,
-			[0x20] = 0xcc, [0x21] = 0x77,
-			[0x22] = 0xdd, [0x23] = 0x88,
-			[0x24] = 0xee, [0x25] = 0x99,
-			[0x26] = 0xff, [0x27] = 0xaa,
-		},
-		{ {0x40, 0x88ee99ff } },
-	},
-	{
-		"LD_ABS word positive offset, all ff",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x3c),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0xff, [0x3d] = 0xff,  [0x3e] = 0xff, [0x3f] = 0xff },
-		{ {0x40, 0xffffffff } },
-	},
-	{
-		"LD_ABS word positive offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, 0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 }, },
-	},
-	{
-		"LD_ABS word negative offset, out of bounds load",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, -1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_EXPECTED_FAIL,
-		.expected_errcode = -EINVAL,
-	},
-	{
-		"LD_ABS word negative offset, in bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, SKF_LL_OFF + 0x3c),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x25051982 }, },
-	},
-	{
-		"LD_ABS word negative offset, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_ABS | BPF_W, SKF_LL_OFF + 0x3c),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x3f, 0 }, },
-	},
-	{
-		"LDX_MSH standalone, preserved A",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffeebbaa),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3c),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0xffeebbaa }, },
-	},
-	{
-		"LDX_MSH standalone, preserved A 2",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0x175e9d63),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3c),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3d),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3e),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3f),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x175e9d63 }, },
-	},
-	{
-		"LDX_MSH standalone, test result 1",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffeebbaa),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3c),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x14 }, },
-	},
-	{
-		"LDX_MSH standalone, test result 2",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffeebbaa),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x3e),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x24 }, },
-	},
-	{
-		"LDX_MSH standalone, negative offset",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffeebbaa),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, -1),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0 }, },
-	},
-	{
-		"LDX_MSH standalone, negative offset 2",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffeebbaa),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, SKF_LL_OFF + 0x3e),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0x24 }, },
-	},
-	{
-		"LDX_MSH standalone, out of bounds",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffeebbaa),
-			BPF_STMT(BPF_LDX | BPF_B | BPF_MSH, 0x40),
-			BPF_STMT(BPF_MISC | BPF_TXA, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC,
-		{ [0x3c] = 0x25, [0x3d] = 0x05,  [0x3e] = 0x19, [0x3f] = 0x82 },
-		{ {0x40, 0 }, },
-	},
-	/*
-	 * verify that the interpreter or JIT correctly sets A and X
-	 * to 0.
-	 */
-	{
-		"ADD default X",
-		.u.insns = {
-			/*
-			 * A = 0x42
-			 * A = A + X
-			 * ret A
-			 */
-			BPF_STMT(BPF_LD | BPF_IMM, 0x42),
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x42 } },
-	},
-	{
-		"ADD default A",
-		.u.insns = {
-			/*
-			 * A = A + 0x42
-			 * ret A
-			 */
-			BPF_STMT(BPF_ALU | BPF_ADD | BPF_K, 0x42),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x42 } },
-	},
-	{
-		"SUB default X",
-		.u.insns = {
-			/*
-			 * A = 0x66
-			 * A = A - X
-			 * ret A
-			 */
-			BPF_STMT(BPF_LD | BPF_IMM, 0x66),
-			BPF_STMT(BPF_ALU | BPF_SUB | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x66 } },
-	},
-	{
-		"SUB default A",
-		.u.insns = {
-			/*
-			 * A = A - -0x66
-			 * ret A
-			 */
-			BPF_STMT(BPF_ALU | BPF_SUB | BPF_K, -0x66),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x66 } },
-	},
-	{
-		"MUL default X",
-		.u.insns = {
-			/*
-			 * A = 0x42
-			 * A = A * X
-			 * ret A
-			 */
-			BPF_STMT(BPF_LD | BPF_IMM, 0x42),
-			BPF_STMT(BPF_ALU | BPF_MUL | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x0 } },
-	},
-	{
-		"MUL default A",
-		.u.insns = {
-			/*
-			 * A = A * 0x66
-			 * ret A
-			 */
-			BPF_STMT(BPF_ALU | BPF_MUL | BPF_K, 0x66),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x0 } },
-	},
-	{
-		"DIV default X",
-		.u.insns = {
-			/*
-			 * A = 0x42
-			 * A = A / X ; this halt the filter execution if X is 0
-			 * ret 0x42
-			 */
-			BPF_STMT(BPF_LD | BPF_IMM, 0x42),
-			BPF_STMT(BPF_ALU | BPF_DIV | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_K, 0x42),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x0 } },
-	},
-	{
-		"DIV default A",
-		.u.insns = {
-			/*
-			 * A = A / 1
-			 * ret A
-			 */
-			BPF_STMT(BPF_ALU | BPF_DIV | BPF_K, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x0 } },
-	},
-	{
-		"MOD default X",
-		.u.insns = {
-			/*
-			 * A = 0x42
-			 * A = A mod X ; this halt the filter execution if X is 0
-			 * ret 0x42
-			 */
-			BPF_STMT(BPF_LD | BPF_IMM, 0x42),
-			BPF_STMT(BPF_ALU | BPF_MOD | BPF_X, 0),
-			BPF_STMT(BPF_RET | BPF_K, 0x42),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x0 } },
-	},
-	{
-		"MOD default A",
-		.u.insns = {
-			/*
-			 * A = A mod 1
-			 * ret A
-			 */
-			BPF_STMT(BPF_ALU | BPF_MOD | BPF_K, 0x1),
-			BPF_STMT(BPF_RET | BPF_A, 0x0),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x0 } },
-	},
-	{
-		"JMP EQ default A",
-		.u.insns = {
-			/*
-			 * cmp A, 0x0, 0, 1
-			 * ret 0x42
-			 * ret 0x66
-			 */
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0x0, 0, 1),
-			BPF_STMT(BPF_RET | BPF_K, 0x42),
-			BPF_STMT(BPF_RET | BPF_K, 0x66),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x42 } },
-	},
-	{
-		"JMP EQ default X",
-		.u.insns = {
-			/*
-			 * A = 0x0
-			 * cmp A, X, 0, 1
-			 * ret 0x42
-			 * ret 0x66
-			 */
-			BPF_STMT(BPF_LD | BPF_IMM, 0x0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_X, 0x0, 0, 1),
-			BPF_STMT(BPF_RET | BPF_K, 0x42),
-			BPF_STMT(BPF_RET | BPF_K, 0x66),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ {0x1, 0x42 } },
-	},
-	/* Checking interpreter vs JIT wrt signed extended imms. */
-	{
-		"JNE signed compare, test 1",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xfefbbc12),
-			BPF_ALU32_IMM(BPF_MOV, R3, 0xffff0000),
-			BPF_MOV64_REG(R2, R1),
-			BPF_ALU64_REG(BPF_AND, R2, R3),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JNE, R2, -17104896, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JNE signed compare, test 2",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xfefbbc12),
-			BPF_ALU32_IMM(BPF_MOV, R3, 0xffff0000),
-			BPF_MOV64_REG(R2, R1),
-			BPF_ALU64_REG(BPF_AND, R2, R3),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JNE, R2, 0xfefb0000, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JNE signed compare, test 3",
-		.u.insns_int = {
-			BPF_ALU32_IMM(BPF_MOV, R1, 0xfefbbc12),
-			BPF_ALU32_IMM(BPF_MOV, R3, 0xffff0000),
-			BPF_ALU32_IMM(BPF_MOV, R4, 0xfefb0000),
-			BPF_MOV64_REG(R2, R1),
-			BPF_ALU64_REG(BPF_AND, R2, R3),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JNE, R2, R4, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"JNE signed compare, test 4",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, -17104896),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JNE, R1, -17104896, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"JNE signed compare, test 5",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0xfefb0000),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JNE, R1, 0xfefb0000, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JNE signed compare, test 6",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x7efb0000),
-			BPF_ALU32_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JNE, R1, 0x7efb0000, 1),
-			BPF_ALU32_IMM(BPF_MOV, R0, 2),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 2 } },
-	},
-	{
-		"JNE signed compare, test 7",
-		.u.insns = {
-			BPF_STMT(BPF_LD | BPF_IMM, 0xffff0000),
-			BPF_STMT(BPF_MISC | BPF_TAX, 0),
-			BPF_STMT(BPF_LD | BPF_IMM, 0xfefbbc12),
-			BPF_STMT(BPF_ALU | BPF_AND | BPF_X, 0),
-			BPF_JUMP(BPF_JMP | BPF_JEQ | BPF_K, 0xfefb0000, 1, 0),
-			BPF_STMT(BPF_RET | BPF_K, 1),
-			BPF_STMT(BPF_RET | BPF_K, 2),
-		},
-		CLASSIC | FLAG_NO_DATA,
-		{},
-		{ { 0, 2 } },
-	},
-	/* BPF_LDX_MEM with operand aliasing */
-	{
-		"LDX_MEM_B: operand register aliasing",
-		.u.insns_int = {
-			BPF_ST_MEM(BPF_B, R10, -8, 123),
-			BPF_MOV64_REG(R0, R10),
-			BPF_LDX_MEM(BPF_B, R0, R0, -8),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 123 } },
-		.stack_depth = 8,
-	},
-	{
-		"LDX_MEM_H: operand register aliasing",
-		.u.insns_int = {
-			BPF_ST_MEM(BPF_H, R10, -8, 12345),
-			BPF_MOV64_REG(R0, R10),
-			BPF_LDX_MEM(BPF_H, R0, R0, -8),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 12345 } },
-		.stack_depth = 8,
-	},
-	{
-		"LDX_MEM_W: operand register aliasing",
-		.u.insns_int = {
-			BPF_ST_MEM(BPF_W, R10, -8, 123456789),
-			BPF_MOV64_REG(R0, R10),
-			BPF_LDX_MEM(BPF_W, R0, R0, -8),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 123456789 } },
-		.stack_depth = 8,
-	},
-	{
-		"LDX_MEM_DW: operand register aliasing",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x123456789abcdefULL),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-			BPF_MOV64_REG(R0, R10),
-			BPF_LDX_MEM(BPF_DW, R0, R0, -8),
-			BPF_ALU64_REG(BPF_SUB, R0, R1),
-			BPF_MOV64_REG(R1, R0),
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),
-			BPF_ALU64_REG(BPF_OR, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	/*
-	 * Register (non-)clobbering tests for the case where a JIT implements
-	 * complex ALU or ATOMIC operations via function calls. If so, the
-	 * function call must be transparent to the eBPF registers. The JIT
-	 * must therefore save and restore relevant registers across the call.
-	 * The following tests check that the eBPF registers retain their
-	 * values after such an operation. Mainly intended for complex ALU
-	 * and atomic operation, but we run it for all. You never know...
-	 *
-	 * Note that each operations should be tested twice with different
-	 * destinations, to check preservation for all registers.
-	 */
-#define BPF_TEST_CLOBBER_ALU(alu, op, dst, src)			\
-	{							\
-		#alu "_" #op " to " #dst ": no clobbering",	\
-		.u.insns_int = {				\
-			BPF_ALU64_IMM(BPF_MOV, R0, R0),		\
-			BPF_ALU64_IMM(BPF_MOV, R1, R1),		\
-			BPF_ALU64_IMM(BPF_MOV, R2, R2),		\
-			BPF_ALU64_IMM(BPF_MOV, R3, R3),		\
-			BPF_ALU64_IMM(BPF_MOV, R4, R4),		\
-			BPF_ALU64_IMM(BPF_MOV, R5, R5),		\
-			BPF_ALU64_IMM(BPF_MOV, R6, R6),		\
-			BPF_ALU64_IMM(BPF_MOV, R7, R7),		\
-			BPF_ALU64_IMM(BPF_MOV, R8, R8),		\
-			BPF_ALU64_IMM(BPF_MOV, R9, R9),		\
-			BPF_##alu(BPF_ ##op, dst, src),		\
-			BPF_ALU32_IMM(BPF_MOV, dst, dst),	\
-			BPF_JMP_IMM(BPF_JNE, R0, R0, 10),	\
-			BPF_JMP_IMM(BPF_JNE, R1, R1, 9),	\
-			BPF_JMP_IMM(BPF_JNE, R2, R2, 8),	\
-			BPF_JMP_IMM(BPF_JNE, R3, R3, 7),	\
-			BPF_JMP_IMM(BPF_JNE, R4, R4, 6),	\
-			BPF_JMP_IMM(BPF_JNE, R5, R5, 5),	\
-			BPF_JMP_IMM(BPF_JNE, R6, R6, 4),	\
-			BPF_JMP_IMM(BPF_JNE, R7, R7, 3),	\
-			BPF_JMP_IMM(BPF_JNE, R8, R8, 2),	\
-			BPF_JMP_IMM(BPF_JNE, R9, R9, 1),	\
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),		\
-			BPF_EXIT_INSN(),			\
-		},						\
-		INTERNAL,					\
-		{ },						\
-		{ { 0, 1 } }					\
-	}
-	/* ALU64 operations, register clobbering */
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, AND, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, AND, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, OR, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, OR, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, XOR, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, XOR, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, LSH, R8, 12),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, LSH, R9, 12),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, RSH, R8, 12),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, RSH, R9, 12),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, ARSH, R8, 12),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, ARSH, R9, 12),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, ADD, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, ADD, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, SUB, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, SUB, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, MUL, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, MUL, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, DIV, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, DIV, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, MOD, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU64_IMM, MOD, R9, 123456789),
-	/* ALU32 immediate operations, register clobbering */
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, AND, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, AND, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, OR, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, OR, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, XOR, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, XOR, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, LSH, R8, 12),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, LSH, R9, 12),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, RSH, R8, 12),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, RSH, R9, 12),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, ARSH, R8, 12),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, ARSH, R9, 12),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, ADD, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, ADD, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, SUB, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, SUB, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, MUL, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, MUL, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, DIV, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, DIV, R9, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, MOD, R8, 123456789),
-	BPF_TEST_CLOBBER_ALU(ALU32_IMM, MOD, R9, 123456789),
-	/* ALU64 register operations, register clobbering */
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, AND, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, AND, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, OR, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, OR, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, XOR, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, XOR, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, LSH, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, LSH, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, RSH, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, RSH, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, ARSH, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, ARSH, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, ADD, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, ADD, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, SUB, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, SUB, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, MUL, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, MUL, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, DIV, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, DIV, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, MOD, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU64_REG, MOD, R9, R1),
-	/* ALU32 register operations, register clobbering */
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, AND, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, AND, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, OR, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, OR, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, XOR, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, XOR, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, LSH, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, LSH, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, RSH, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, RSH, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, ARSH, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, ARSH, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, ADD, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, ADD, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, SUB, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, SUB, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, MUL, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, MUL, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, DIV, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, DIV, R9, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, MOD, R8, R1),
-	BPF_TEST_CLOBBER_ALU(ALU32_REG, MOD, R9, R1),
-#undef BPF_TEST_CLOBBER_ALU
-#define BPF_TEST_CLOBBER_ATOMIC(width, op)			\
-	{							\
-		"Atomic_" #width " " #op ": no clobbering",	\
-		.u.insns_int = {				\
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),		\
-			BPF_ALU64_IMM(BPF_MOV, R1, 1),		\
-			BPF_ALU64_IMM(BPF_MOV, R2, 2),		\
-			BPF_ALU64_IMM(BPF_MOV, R3, 3),		\
-			BPF_ALU64_IMM(BPF_MOV, R4, 4),		\
-			BPF_ALU64_IMM(BPF_MOV, R5, 5),		\
-			BPF_ALU64_IMM(BPF_MOV, R6, 6),		\
-			BPF_ALU64_IMM(BPF_MOV, R7, 7),		\
-			BPF_ALU64_IMM(BPF_MOV, R8, 8),		\
-			BPF_ALU64_IMM(BPF_MOV, R9, 9),		\
-			BPF_ST_MEM(width, R10, -8,		\
-				   (op) == BPF_CMPXCHG ? 0 :	\
-				   (op) & BPF_FETCH ? 1 : 0),	\
-			BPF_ATOMIC_OP(width, op, R10, R1, -8),	\
-			BPF_JMP_IMM(BPF_JNE, R0, 0, 10),	\
-			BPF_JMP_IMM(BPF_JNE, R1, 1, 9),		\
-			BPF_JMP_IMM(BPF_JNE, R2, 2, 8),		\
-			BPF_JMP_IMM(BPF_JNE, R3, 3, 7),		\
-			BPF_JMP_IMM(BPF_JNE, R4, 4, 6),		\
-			BPF_JMP_IMM(BPF_JNE, R5, 5, 5),		\
-			BPF_JMP_IMM(BPF_JNE, R6, 6, 4),		\
-			BPF_JMP_IMM(BPF_JNE, R7, 7, 3),		\
-			BPF_JMP_IMM(BPF_JNE, R8, 8, 2),		\
-			BPF_JMP_IMM(BPF_JNE, R9, 9, 1),		\
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),		\
-			BPF_EXIT_INSN(),			\
-		},						\
-		INTERNAL,					\
-		{ },						\
-		{ { 0, 1 } },					\
-		.stack_depth = 8,				\
-	}
-	/* 64-bit atomic operations, register clobbering */
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_ADD),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_AND),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_OR),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_XOR),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_ADD | BPF_FETCH),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_AND | BPF_FETCH),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_OR | BPF_FETCH),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_XOR | BPF_FETCH),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_XCHG),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_DW, BPF_CMPXCHG),
-	/* 32-bit atomic operations, register clobbering */
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_ADD),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_AND),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_OR),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_XOR),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_ADD | BPF_FETCH),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_AND | BPF_FETCH),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_OR | BPF_FETCH),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_XOR | BPF_FETCH),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_XCHG),
-	BPF_TEST_CLOBBER_ATOMIC(BPF_W, BPF_CMPXCHG),
-#undef BPF_TEST_CLOBBER_ATOMIC
-	/* Checking that ALU32 src is not zero extended in place */
-#define BPF_ALU32_SRC_ZEXT(op)					\
-	{							\
-		"ALU32_" #op "_X: src preserved in zext",	\
-		.u.insns_int = {				\
-			BPF_LD_IMM64(R1, 0x0123456789acbdefULL),\
-			BPF_LD_IMM64(R2, 0xfedcba9876543210ULL),\
-			BPF_ALU64_REG(BPF_MOV, R0, R1),		\
-			BPF_ALU32_REG(BPF_##op, R2, R1),	\
-			BPF_ALU64_REG(BPF_SUB, R0, R1),		\
-			BPF_ALU64_REG(BPF_MOV, R1, R0),		\
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),		\
-			BPF_ALU64_REG(BPF_OR, R0, R1),		\
-			BPF_EXIT_INSN(),			\
-		},						\
-		INTERNAL,					\
-		{ },						\
-		{ { 0, 0 } },					\
-	}
-	BPF_ALU32_SRC_ZEXT(MOV),
-	BPF_ALU32_SRC_ZEXT(AND),
-	BPF_ALU32_SRC_ZEXT(OR),
-	BPF_ALU32_SRC_ZEXT(XOR),
-	BPF_ALU32_SRC_ZEXT(ADD),
-	BPF_ALU32_SRC_ZEXT(SUB),
-	BPF_ALU32_SRC_ZEXT(MUL),
-	BPF_ALU32_SRC_ZEXT(DIV),
-	BPF_ALU32_SRC_ZEXT(MOD),
-#undef BPF_ALU32_SRC_ZEXT
-	/* Checking that ATOMIC32 src is not zero extended in place */
-#define BPF_ATOMIC32_SRC_ZEXT(op)					\
-	{								\
-		"ATOMIC_W_" #op ": src preserved in zext",		\
-		.u.insns_int = {					\
-			BPF_LD_IMM64(R0, 0x0123456789acbdefULL),	\
-			BPF_ALU64_REG(BPF_MOV, R1, R0),			\
-			BPF_ST_MEM(BPF_W, R10, -4, 0),			\
-			BPF_ATOMIC_OP(BPF_W, BPF_##op, R10, R1, -4),	\
-			BPF_ALU64_REG(BPF_SUB, R0, R1),			\
-			BPF_ALU64_REG(BPF_MOV, R1, R0),			\
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),			\
-			BPF_ALU64_REG(BPF_OR, R0, R1),			\
-			BPF_EXIT_INSN(),				\
-		},							\
-		INTERNAL,						\
-		{ },							\
-		{ { 0, 0 } },						\
-		.stack_depth = 8,					\
-	}
-	BPF_ATOMIC32_SRC_ZEXT(ADD),
-	BPF_ATOMIC32_SRC_ZEXT(AND),
-	BPF_ATOMIC32_SRC_ZEXT(OR),
-	BPF_ATOMIC32_SRC_ZEXT(XOR),
-#undef BPF_ATOMIC32_SRC_ZEXT
-	/* Checking that CMPXCHG32 src is not zero extended in place */
-	{
-		"ATOMIC_W_CMPXCHG: src preserved in zext",
-		.u.insns_int = {
-			BPF_LD_IMM64(R1, 0x0123456789acbdefULL),
-			BPF_ALU64_REG(BPF_MOV, R2, R1),
-			BPF_ALU64_REG(BPF_MOV, R0, 0),
-			BPF_ST_MEM(BPF_W, R10, -4, 0),
-			BPF_ATOMIC_OP(BPF_W, BPF_CMPXCHG, R10, R1, -4),
-			BPF_ALU64_REG(BPF_SUB, R1, R2),
-			BPF_ALU64_REG(BPF_MOV, R2, R1),
-			BPF_ALU64_IMM(BPF_RSH, R2, 32),
-			BPF_ALU64_REG(BPF_OR, R1, R2),
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL,
-		{ },
-		{ { 0, 0 } },
-		.stack_depth = 8,
-	},
-	/* Checking that JMP32 immediate src is not zero extended in place */
-#define BPF_JMP32_IMM_ZEXT(op)					\
-	{							\
-		"JMP32_" #op "_K: operand preserved in zext",	\
-		.u.insns_int = {				\
-			BPF_LD_IMM64(R0, 0x0123456789acbdefULL),\
-			BPF_ALU64_REG(BPF_MOV, R1, R0),		\
-			BPF_JMP32_IMM(BPF_##op, R0, 1234, 1),	\
-			BPF_JMP_A(0), /* Nop */			\
-			BPF_ALU64_REG(BPF_SUB, R0, R1),		\
-			BPF_ALU64_REG(BPF_MOV, R1, R0),		\
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),		\
-			BPF_ALU64_REG(BPF_OR, R0, R1),		\
-			BPF_EXIT_INSN(),			\
-		},						\
-		INTERNAL,					\
-		{ },						\
-		{ { 0, 0 } },					\
-	}
-	BPF_JMP32_IMM_ZEXT(JEQ),
-	BPF_JMP32_IMM_ZEXT(JNE),
-	BPF_JMP32_IMM_ZEXT(JSET),
-	BPF_JMP32_IMM_ZEXT(JGT),
-	BPF_JMP32_IMM_ZEXT(JGE),
-	BPF_JMP32_IMM_ZEXT(JLT),
-	BPF_JMP32_IMM_ZEXT(JLE),
-	BPF_JMP32_IMM_ZEXT(JSGT),
-	BPF_JMP32_IMM_ZEXT(JSGE),
-	BPF_JMP32_IMM_ZEXT(JSLT),
-	BPF_JMP32_IMM_ZEXT(JSLE),
-#undef BPF_JMP2_IMM_ZEXT
-	/* Checking that JMP32 dst & src are not zero extended in place */
-#define BPF_JMP32_REG_ZEXT(op)					\
-	{							\
-		"JMP32_" #op "_X: operands preserved in zext",	\
-		.u.insns_int = {				\
-			BPF_LD_IMM64(R0, 0x0123456789acbdefULL),\
-			BPF_LD_IMM64(R1, 0xfedcba9876543210ULL),\
-			BPF_ALU64_REG(BPF_MOV, R2, R0),		\
-			BPF_ALU64_REG(BPF_MOV, R3, R1),		\
-			BPF_JMP32_IMM(BPF_##op, R0, R1, 1),	\
-			BPF_JMP_A(0), /* Nop */			\
-			BPF_ALU64_REG(BPF_SUB, R0, R2),		\
-			BPF_ALU64_REG(BPF_SUB, R1, R3),		\
-			BPF_ALU64_REG(BPF_OR, R0, R1),		\
-			BPF_ALU64_REG(BPF_MOV, R1, R0),		\
-			BPF_ALU64_IMM(BPF_RSH, R1, 32),		\
-			BPF_ALU64_REG(BPF_OR, R0, R1),		\
-			BPF_EXIT_INSN(),			\
-		},						\
-		INTERNAL,					\
-		{ },						\
-		{ { 0, 0 } },					\
-	}
-	BPF_JMP32_REG_ZEXT(JEQ),
-	BPF_JMP32_REG_ZEXT(JNE),
-	BPF_JMP32_REG_ZEXT(JSET),
-	BPF_JMP32_REG_ZEXT(JGT),
-	BPF_JMP32_REG_ZEXT(JGE),
-	BPF_JMP32_REG_ZEXT(JLT),
-	BPF_JMP32_REG_ZEXT(JLE),
-	BPF_JMP32_REG_ZEXT(JSGT),
-	BPF_JMP32_REG_ZEXT(JSGE),
-	BPF_JMP32_REG_ZEXT(JSLT),
-	BPF_JMP32_REG_ZEXT(JSLE),
-#undef BPF_JMP2_REG_ZEXT
-	/* ALU64 K register combinations */
-	{
-		"ALU64_MOV_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mov_imm_regs,
-	},
-	{
-		"ALU64_AND_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_and_imm_regs,
-	},
-	{
-		"ALU64_OR_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_or_imm_regs,
-	},
-	{
-		"ALU64_XOR_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_xor_imm_regs,
-	},
-	{
-		"ALU64_LSH_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_lsh_imm_regs,
-	},
-	{
-		"ALU64_RSH_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_rsh_imm_regs,
-	},
-	{
-		"ALU64_ARSH_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_arsh_imm_regs,
-	},
-	{
-		"ALU64_ADD_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_add_imm_regs,
-	},
-	{
-		"ALU64_SUB_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_sub_imm_regs,
-	},
-	{
-		"ALU64_MUL_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mul_imm_regs,
-	},
-	{
-		"ALU64_DIV_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_div_imm_regs,
-	},
-	{
-		"ALU64_MOD_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mod_imm_regs,
-	},
-	{
-		"ALU64_SDIV_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_sdiv_imm_regs,
-	},
-	{
-		"ALU64_SMOD_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_smod_imm_regs,
-	},
-	/* ALU32 K registers */
-	{
-		"ALU32_MOV_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mov_imm_regs,
-	},
-	{
-		"ALU32_AND_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_and_imm_regs,
-	},
-	{
-		"ALU32_OR_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_or_imm_regs,
-	},
-	{
-		"ALU32_XOR_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_xor_imm_regs,
-	},
-	{
-		"ALU32_LSH_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_lsh_imm_regs,
-	},
-	{
-		"ALU32_RSH_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_rsh_imm_regs,
-	},
-	{
-		"ALU32_ARSH_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_arsh_imm_regs,
-	},
-	{
-		"ALU32_ADD_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_add_imm_regs,
-	},
-	{
-		"ALU32_SUB_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_sub_imm_regs,
-	},
-	{
-		"ALU32_MUL_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mul_imm_regs,
-	},
-	{
-		"ALU32_DIV_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_div_imm_regs,
-	},
-	{
-		"ALU32_MOD_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mod_imm_regs,
-	},
-	{
-		"ALU32_SDIV_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_sdiv_imm_regs,
-	},
-	{
-		"ALU32_SMOD_K: registers",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_smod_imm_regs,
-	},
-	/* ALU64 X register combinations */
-	{
-		"ALU64_MOV_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mov_reg_pairs,
-	},
-	{
-		"ALU64_AND_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_and_reg_pairs,
-	},
-	{
-		"ALU64_OR_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_or_reg_pairs,
-	},
-	{
-		"ALU64_XOR_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_xor_reg_pairs,
-	},
-	{
-		"ALU64_LSH_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_lsh_reg_pairs,
-	},
-	{
-		"ALU64_RSH_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_rsh_reg_pairs,
-	},
-	{
-		"ALU64_ARSH_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_arsh_reg_pairs,
-	},
-	{
-		"ALU64_ADD_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_add_reg_pairs,
-	},
-	{
-		"ALU64_SUB_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_sub_reg_pairs,
-	},
-	{
-		"ALU64_MUL_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mul_reg_pairs,
-	},
-	{
-		"ALU64_DIV_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_div_reg_pairs,
-	},
-	{
-		"ALU64_MOD_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mod_reg_pairs,
-	},
-	/* ALU32 X register combinations */
-	{
-		"ALU32_MOV_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mov_reg_pairs,
-	},
-	{
-		"ALU32_AND_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_and_reg_pairs,
-	},
-	{
-		"ALU32_OR_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_or_reg_pairs,
-	},
-	{
-		"ALU32_XOR_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_xor_reg_pairs,
-	},
-	{
-		"ALU32_LSH_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_lsh_reg_pairs,
-	},
-	{
-		"ALU32_RSH_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_rsh_reg_pairs,
-	},
-	{
-		"ALU32_ARSH_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_arsh_reg_pairs,
-	},
-	{
-		"ALU32_ADD_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_add_reg_pairs,
-	},
-	{
-		"ALU32_SUB_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_sub_reg_pairs,
-	},
-	{
-		"ALU32_MUL_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mul_reg_pairs,
-	},
-	{
-		"ALU32_DIV_X: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_div_reg_pairs,
-	},
-	{
-		"ALU32_MOD_X register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mod_reg_pairs,
-	},
-	/* Exhaustive test of ALU64 shift operations */
-	{
-		"ALU64_LSH_K: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_lsh_imm,
-	},
-	{
-		"ALU64_RSH_K: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_rsh_imm,
-	},
-	{
-		"ALU64_ARSH_K: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_arsh_imm,
-	},
-	{
-		"ALU64_LSH_X: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_lsh_reg,
-	},
-	{
-		"ALU64_RSH_X: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_rsh_reg,
-	},
-	{
-		"ALU64_ARSH_X: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_arsh_reg,
-	},
-	/* Exhaustive test of ALU32 shift operations */
-	{
-		"ALU32_LSH_K: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_lsh_imm,
-	},
-	{
-		"ALU32_RSH_K: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_rsh_imm,
-	},
-	{
-		"ALU32_ARSH_K: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_arsh_imm,
-	},
-	{
-		"ALU32_LSH_X: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_lsh_reg,
-	},
-	{
-		"ALU32_RSH_X: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_rsh_reg,
-	},
-	{
-		"ALU32_ARSH_X: all shift values",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_arsh_reg,
-	},
-	/*
-	 * Exhaustive test of ALU64 shift operations when
-	 * source and destination register are the same.
-	 */
-	{
-		"ALU64_LSH_X: all shift values with the same register",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_lsh_same_reg,
-	},
-	{
-		"ALU64_RSH_X: all shift values with the same register",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_rsh_same_reg,
-	},
-	{
-		"ALU64_ARSH_X: all shift values with the same register",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_arsh_same_reg,
-	},
-	/*
-	 * Exhaustive test of ALU32 shift operations when
-	 * source and destination register are the same.
-	 */
-	{
-		"ALU32_LSH_X: all shift values with the same register",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_lsh_same_reg,
-	},
-	{
-		"ALU32_RSH_X: all shift values with the same register",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_rsh_same_reg,
-	},
-	{
-		"ALU32_ARSH_X: all shift values with the same register",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_arsh_same_reg,
-	},
-	/* ALU64 immediate magnitudes */
-	{
-		"ALU64_MOV_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mov_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_AND_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_and_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_OR_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_or_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_XOR_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_xor_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_ADD_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_add_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_SUB_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_sub_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_MUL_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mul_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_DIV_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_div_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_MOD_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mod_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_SDIV_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_sdiv_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_SMOD_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_smod_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* ALU32 immediate magnitudes */
-	{
-		"ALU32_MOV_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mov_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_AND_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_and_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_OR_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_or_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_XOR_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_xor_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_ADD_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_add_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_SUB_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_sub_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_MUL_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mul_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_DIV_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_div_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_MOD_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mod_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_SDIV_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_sdiv_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_SMOD_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_smod_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* ALU64 register magnitudes */
-	{
-		"ALU64_MOV_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mov_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_AND_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_and_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_OR_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_or_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_XOR_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_xor_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_ADD_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_add_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_SUB_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_sub_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_MUL_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mul_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_DIV_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_div_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU64_MOD_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu64_mod_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* ALU32 register magnitudes */
-	{
-		"ALU32_MOV_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mov_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_AND_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_and_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_OR_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_or_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_XOR_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_xor_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_ADD_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_add_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_SUB_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_sub_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_MUL_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mul_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_DIV_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_div_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ALU32_MOD_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_alu32_mod_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* LD_IMM64 immediate magnitudes and byte patterns */
-	{
-		"LD_IMM64: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_ld_imm64_magn,
-	},
-	{
-		"LD_IMM64: checker byte patterns",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_ld_imm64_checker,
-	},
-	{
-		"LD_IMM64: random positive and zero byte patterns",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_ld_imm64_pos_zero,
-	},
-	{
-		"LD_IMM64: random negative and zero byte patterns",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_ld_imm64_neg_zero,
-	},
-	{
-		"LD_IMM64: random positive and negative byte patterns",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_ld_imm64_pos_neg,
-	},
-	/* 64-bit ATOMIC register combinations */
-	{
-		"ATOMIC_DW_ADD: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_add_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_DW_AND: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_and_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_DW_OR: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_or_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_DW_XOR: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_xor_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_DW_ADD_FETCH: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_add_fetch_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_DW_AND_FETCH: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_and_fetch_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_DW_OR_FETCH: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_or_fetch_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_DW_XOR_FETCH: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_xor_fetch_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_DW_XCHG: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_xchg_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_DW_CMPXCHG: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_cmpxchg_reg_pairs,
-		.stack_depth = 8,
-	},
-	/* 32-bit ATOMIC register combinations */
-	{
-		"ATOMIC_W_ADD: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_add_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_W_AND: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_and_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_W_OR: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_or_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_W_XOR: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_xor_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_W_ADD_FETCH: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_add_fetch_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_W_AND_FETCH: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_and_fetch_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_W_OR_FETCH: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_or_fetch_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_W_XOR_FETCH: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_xor_fetch_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_W_XCHG: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_xchg_reg_pairs,
-		.stack_depth = 8,
-	},
-	{
-		"ATOMIC_W_CMPXCHG: register combinations",
-		{ },
-		INTERNAL,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_cmpxchg_reg_pairs,
-		.stack_depth = 8,
-	},
-	/* 64-bit ATOMIC magnitudes */
-	{
-		"ATOMIC_DW_ADD: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_add,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_DW_AND: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_and,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_DW_OR: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_or,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_DW_XOR: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_xor,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_DW_ADD_FETCH: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_add_fetch,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_DW_AND_FETCH: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_and_fetch,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_DW_OR_FETCH: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_or_fetch,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_DW_XOR_FETCH: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_xor_fetch,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_DW_XCHG: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic64_xchg,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_DW_CMPXCHG: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_cmpxchg64,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* 32-bit atomic magnitudes */
-	{
-		"ATOMIC_W_ADD: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_add,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_W_AND: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_and,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_W_OR: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_or,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_W_XOR: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_xor,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_W_ADD_FETCH: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_add_fetch,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_W_AND_FETCH: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_and_fetch,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_W_OR_FETCH: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_or_fetch,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_W_XOR_FETCH: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_xor_fetch,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_W_XCHG: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_atomic32_xchg,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"ATOMIC_W_CMPXCHG: all operand magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_cmpxchg32,
-		.stack_depth = 8,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* JMP immediate magnitudes */
-	{
-		"JMP_JSET_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jset_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JEQ_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jeq_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JNE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jne_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JGT_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jgt_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JGE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jge_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JLT_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jlt_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JLE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jle_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JSGT_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jsgt_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JSGE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jsge_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JSLT_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jslt_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JSLE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jsle_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* JMP register magnitudes */
-	{
-		"JMP_JSET_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jset_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JEQ_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jeq_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JNE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jne_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JGT_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jgt_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JGE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jge_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JLT_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jlt_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JLE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jle_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JSGT_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jsgt_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JSGE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jsge_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JSLT_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jslt_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP_JSLE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp_jsle_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* JMP32 immediate magnitudes */
-	{
-		"JMP32_JSET_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jset_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JEQ_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jeq_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JNE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jne_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JGT_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jgt_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JGE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jge_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JLT_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jlt_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JLE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jle_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JSGT_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jsgt_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JSGE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jsge_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JSLT_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jslt_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JSLE_K: all immediate value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jsle_imm,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* JMP32 register magnitudes */
-	{
-		"JMP32_JSET_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jset_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JEQ_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jeq_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JNE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jne_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JGT_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jgt_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JGE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jge_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JLT_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jlt_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JLE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jle_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JSGT_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jsgt_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JSGE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jsge_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JSLT_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jslt_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	{
-		"JMP32_JSLE_X: all register value magnitudes",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_jmp32_jsle_reg,
-		.nr_testruns = NR_PATTERN_RUNS,
-	},
-	/* Conditional jumps with constant decision */
-	{
-		"JMP_JSET_K: imm = 0 -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JSET, R1, 0, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"JMP_JLT_K: imm = 0 -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JLT, R1, 0, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"JMP_JGE_K: imm = 0 -> always taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JGE, R1, 0, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JGT_K: imm = 0xffffffff -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JGT, R1, U32_MAX, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"JMP_JLE_K: imm = 0xffffffff -> always taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_IMM(BPF_JLE, R1, U32_MAX, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP32_JSGT_K: imm = 0x7fffffff -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP32_IMM(BPF_JSGT, R1, S32_MAX, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"JMP32_JSGE_K: imm = -0x80000000 -> always taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP32_IMM(BPF_JSGE, R1, S32_MIN, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP32_JSLT_K: imm = -0x80000000 -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP32_IMM(BPF_JSLT, R1, S32_MIN, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"JMP32_JSLE_K: imm = 0x7fffffff -> always taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP32_IMM(BPF_JSLE, R1, S32_MAX, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JEQ_X: dst = src -> always taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JEQ, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JGE_X: dst = src -> always taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JGE, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JLE_X: dst = src -> always taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JLE, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSGE_X: dst = src -> always taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JSGE, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JSLE_X: dst = src -> always taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JSLE, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-	},
-	{
-		"JMP_JNE_X: dst = src -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JNE, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"JMP_JGT_X: dst = src -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JGT, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"JMP_JLT_X: dst = src -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JLT, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"JMP_JSGT_X: dst = src -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JSGT, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"JMP_JSLT_X: dst = src -> never taken",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 1),
-			BPF_JMP_REG(BPF_JSLT, R1, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 0 } },
-	},
-	/* Short relative jumps */
-	{
-		"Short relative jump: offset=0",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_JMP_IMM(BPF_JEQ, R0, 0, 0),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, -1),
-		},
-		INTERNAL | FLAG_NO_DATA | FLAG_VERIFIER_ZEXT,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"Short relative jump: offset=1",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_JMP_IMM(BPF_JEQ, R0, 0, 1),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, -1),
-		},
-		INTERNAL | FLAG_NO_DATA | FLAG_VERIFIER_ZEXT,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"Short relative jump: offset=2",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_JMP_IMM(BPF_JEQ, R0, 0, 2),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, -1),
-		},
-		INTERNAL | FLAG_NO_DATA | FLAG_VERIFIER_ZEXT,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"Short relative jump: offset=3",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_JMP_IMM(BPF_JEQ, R0, 0, 3),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, -1),
-		},
-		INTERNAL | FLAG_NO_DATA | FLAG_VERIFIER_ZEXT,
-		{ },
-		{ { 0, 0 } },
-	},
-	{
-		"Short relative jump: offset=4",
-		.u.insns_int = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_JMP_IMM(BPF_JEQ, R0, 0, 4),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_ALU32_IMM(BPF_ADD, R0, 1),
-			BPF_EXIT_INSN(),
-			BPF_ALU32_IMM(BPF_MOV, R0, -1),
-		},
-		INTERNAL | FLAG_NO_DATA | FLAG_VERIFIER_ZEXT,
-		{ },
-		{ { 0, 0 } },
-	},
-	/* Conditional branch conversions */
-	{
-		"Long conditional jump: taken at runtime (32 bits)",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_max_jmp_taken_32,
-	},
-	{
-		"Long conditional jump: not taken at runtime (32 bits)",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 2 } },
-		.fill_helper = bpf_fill_max_jmp_not_taken_32,
-	},
-	{
-		"Long conditional jump: always taken, known at JIT time (32 bits)",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_max_jmp_always_taken_32,
-	},
-	{
-		"Long conditional jump: never taken, known at JIT time (32 bits)",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 2 } },
-		.fill_helper = bpf_fill_max_jmp_never_taken_32,
-	},
-	{
-		"Long conditional jump: taken at runtime",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_max_jmp_taken,
-	},
-	{
-		"Long conditional jump: not taken at runtime",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 2 } },
-		.fill_helper = bpf_fill_max_jmp_not_taken,
-	},
-	{
-		"Long conditional jump: always taken, known at JIT time",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 1 } },
-		.fill_helper = bpf_fill_max_jmp_always_taken,
-	},
-	{
-		"Long conditional jump: never taken, known at JIT time",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, 2 } },
-		.fill_helper = bpf_fill_max_jmp_never_taken,
-	},
-	/* Staggered jump sequences, immediate */
-	{
-		"Staggered jumps: JMP_JA",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_ja,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JEQ_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jeq_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JNE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jne_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSET_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jset_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JGT_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jgt_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JGE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jge_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JLT_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jlt_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JLE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jle_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSGT_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsgt_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSGE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsge_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSLT_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jslt_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSLE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsle_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	/* Staggered jump sequences, register */
-	{
-		"Staggered jumps: JMP_JEQ_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jeq_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JNE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jne_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSET_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jset_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JGT_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jgt_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JGE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jge_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JLT_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jlt_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JLE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jle_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSGT_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsgt_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSGE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsge_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSLT_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jslt_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP_JSLE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsle_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	/* Staggered jump sequences, JMP32 immediate */
-	{
-		"Staggered jumps: JMP32_JEQ_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jeq32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JNE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jne32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSET_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jset32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JGT_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jgt32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JGE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jge32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JLT_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jlt32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JLE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jle32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSGT_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsgt32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSGE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsge32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSLT_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jslt32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSLE_K",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsle32_imm,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	/* Staggered jump sequences, JMP32 register */
-	{
-		"Staggered jumps: JMP32_JEQ_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jeq32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JNE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jne32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSET_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jset32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JGT_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jgt32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JGE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jge32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JLT_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jlt32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JLE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jle32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSGT_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsgt32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSGE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsge32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSLT_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jslt32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-	{
-		"Staggered jumps: JMP32_JSLE_X",
-		{ },
-		INTERNAL | FLAG_NO_DATA,
-		{ },
-		{ { 0, MAX_STAGGERED_JMP_SIZE + 1 } },
-		.fill_helper = bpf_fill_staggered_jsle32_reg,
-		.nr_testruns = NR_STAGGERED_JMP_RUNS,
-	},
-};
-
-static struct net_device dev;
-
-static struct sk_buff *populate_skb(char *buf, int size)
-{
-	struct sk_buff *skb;
-
-	if (size >= MAX_DATA)
-		return NULL;
-
-	skb = alloc_skb(MAX_DATA, GFP_KERNEL);
-	if (!skb)
-		return NULL;
-
-	__skb_put_data(skb, buf, size);
-
-	/* Initialize a fake skb with test pattern. */
-	skb_reset_mac_header(skb);
-	skb->protocol = htons(ETH_P_IP);
-	skb->pkt_type = SKB_TYPE;
-	skb->mark = SKB_MARK;
-	skb->hash = SKB_HASH;
-	skb->queue_mapping = SKB_QUEUE_MAP;
-	skb->vlan_tci = SKB_VLAN_TCI;
-	skb->vlan_proto = htons(ETH_P_IP);
-	dev_net_set(&dev, &init_net);
-	skb->dev = &dev;
-	skb->dev->ifindex = SKB_DEV_IFINDEX;
-	skb->dev->type = SKB_DEV_TYPE;
-	skb_set_network_header(skb, min(size, ETH_HLEN));
-
-	return skb;
-}
-
-static void *generate_test_data(struct bpf_test *test, int sub)
-{
-	struct sk_buff *skb;
-	struct page *page;
-
-	if (test->aux & FLAG_NO_DATA)
-		return NULL;
-
-	if (test->aux & FLAG_LARGE_MEM)
-		return kmalloc(test->test[sub].data_size, GFP_KERNEL);
-
-	/* Test case expects an skb, so populate one. Various
-	 * subtests generate skbs of different sizes based on
-	 * the same data.
-	 */
-	skb = populate_skb(test->data, test->test[sub].data_size);
-	if (!skb)
-		return NULL;
-
-	if (test->aux & FLAG_SKB_FRAG) {
-		/*
-		 * when the test requires a fragmented skb, add a
-		 * single fragment to the skb, filled with
-		 * test->frag_data.
-		 */
-		page = alloc_page(GFP_KERNEL);
-		if (!page)
-			goto err_kfree_skb;
-
-		memcpy(page_address(page), test->frag_data, MAX_DATA);
-		skb_add_rx_frag(skb, 0, page, 0, MAX_DATA, MAX_DATA);
-	}
-
-	return skb;
-err_kfree_skb:
-	kfree_skb(skb);
-	return NULL;
-}
-
-static void release_test_data(const struct bpf_test *test, void *data)
-{
-	if (test->aux & FLAG_NO_DATA)
-		return;
-
-	if (test->aux & FLAG_LARGE_MEM)
-		kfree(data);
-	else
-		kfree_skb(data);
-}
-
-static int filter_length(int which)
-{
-	struct sock_filter *fp;
-	int len;
-
-	if (tests[which].fill_helper)
-		return tests[which].u.ptr.len;
-
-	fp = tests[which].u.insns;
-	for (len = MAX_INSNS - 1; len > 0; --len)
-		if (fp[len].code != 0 || fp[len].k != 0)
-			break;
-
-	return len + 1;
-}
-
-static void *filter_pointer(int which)
-{
-	if (tests[which].fill_helper)
-		return tests[which].u.ptr.insns;
-	else
-		return tests[which].u.insns;
-}
-
-static struct bpf_prog *generate_filter(int which, int *err)
-{
-	__u8 test_type = tests[which].aux & TEST_TYPE_MASK;
-	unsigned int flen = filter_length(which);
-	void *fptr = filter_pointer(which);
-	struct sock_fprog_kern fprog;
-	struct bpf_prog *fp;
-
-	switch (test_type) {
-	case CLASSIC:
-		fprog.filter = fptr;
-		fprog.len = flen;
-
-		*err = bpf_prog_create(&fp, &fprog);
-		if (tests[which].aux & FLAG_EXPECTED_FAIL) {
-			if (*err == tests[which].expected_errcode) {
-				pr_cont("PASS\n");
-				/* Verifier rejected filter as expected. */
-				*err = 0;
-				return NULL;
-			} else {
-				pr_cont("UNEXPECTED_PASS\n");
-				/* Verifier didn't reject the test that's
-				 * bad enough, just return!
-				 */
-				*err = -EINVAL;
-				return NULL;
-			}
-		}
-		if (*err) {
-			pr_cont("FAIL to prog_create err=%d len=%d\n",
-				*err, fprog.len);
-			return NULL;
-		}
-		break;
-
-	case INTERNAL:
-		fp = bpf_prog_alloc(bpf_prog_size(flen), 0);
-		if (fp == NULL) {
-			pr_cont("UNEXPECTED_FAIL no memory left\n");
-			*err = -ENOMEM;
-			return NULL;
-		}
-
-		fp->len = flen;
-		/* Type doesn't really matter here as long as it's not unspec. */
-		fp->type = BPF_PROG_TYPE_SOCKET_FILTER;
-		memcpy(fp->insnsi, fptr, fp->len * sizeof(struct bpf_insn));
-		fp->aux->stack_depth = tests[which].stack_depth;
-		fp->aux->verifier_zext = !!(tests[which].aux &
-					    FLAG_VERIFIER_ZEXT);
-
-		/* We cannot error here as we don't need type compatibility
-		 * checks.
-		 */
-		fp = bpf_prog_select_runtime(fp, err);
-		if (*err) {
-			pr_cont("FAIL to select_runtime err=%d\n", *err);
-			return NULL;
-		}
-		break;
-	}
-
-	*err = 0;
-	return fp;
-}
-
-static void release_filter(struct bpf_prog *fp, int which)
-{
-	__u8 test_type = tests[which].aux & TEST_TYPE_MASK;
-
-	switch (test_type) {
-	case CLASSIC:
-		bpf_prog_destroy(fp);
-		break;
-	case INTERNAL:
-		bpf_prog_free(fp);
-		break;
-	}
-}
-
-static int __run_one(const struct bpf_prog *fp, const void *data,
-		     int runs, u64 *duration)
-{
-	u64 start, finish;
-	int ret = 0, i;
-
-	migrate_disable();
-	start = ktime_get_ns();
-
-	for (i = 0; i < runs; i++)
-		ret = bpf_prog_run(fp, data);
-
-	finish = ktime_get_ns();
-	migrate_enable();
-
-	*duration = finish - start;
-	do_div(*duration, runs);
-
-	return ret;
-}
-
-static int run_one(const struct bpf_prog *fp, struct bpf_test *test)
-{
-	int err_cnt = 0, i, runs = MAX_TESTRUNS;
-
-	if (test->nr_testruns)
-		runs = min(test->nr_testruns, MAX_TESTRUNS);
-
-	for (i = 0; i < MAX_SUBTESTS; i++) {
-		void *data;
-		u64 duration;
-		u32 ret;
-
-		/*
-		 * NOTE: Several sub-tests may be present, in which case
-		 * a zero {data_size, result} tuple indicates the end of
-		 * the sub-test array. The first test is always run,
-		 * even if both data_size and result happen to be zero.
-		 */
-		if (i > 0 &&
-		    test->test[i].data_size == 0 &&
-		    test->test[i].result == 0)
-			break;
-
-		data = generate_test_data(test, i);
-		if (!data && !(test->aux & FLAG_NO_DATA)) {
-			pr_cont("data generation failed ");
-			err_cnt++;
-			break;
-		}
-		ret = __run_one(fp, data, runs, &duration);
-		release_test_data(test, data);
-
-		if (ret == test->test[i].result) {
-			pr_cont("%lld ", duration);
-		} else {
-			s32 res = test->test[i].result;
-
-			pr_cont("ret %d != %d (%#x != %#x)",
-				ret, res, ret, res);
-			err_cnt++;
-		}
-	}
-
-	return err_cnt;
-}
-
-static char test_name[64];
-module_param_string(test_name, test_name, sizeof(test_name), 0);
-
-static int test_id = -1;
-module_param(test_id, int, 0);
-
-static int test_range[2] = { 0, INT_MAX };
-module_param_array(test_range, int, NULL, 0);
-
-static bool exclude_test(int test_id)
-{
-	return test_id < test_range[0] || test_id > test_range[1];
-}
-
-static __init struct sk_buff *build_test_skb(void)
-{
-	u32 headroom = NET_SKB_PAD + NET_IP_ALIGN + ETH_HLEN;
-	struct sk_buff *skb[2];
-	struct page *page[2];
-	int i, data_size = 8;
-
-	for (i = 0; i < 2; i++) {
-		page[i] = alloc_page(GFP_KERNEL);
-		if (!page[i]) {
-			if (i == 0)
-				goto err_page0;
-			else
-				goto err_page1;
-		}
-
-		/* this will set skb[i]->head_frag */
-		skb[i] = dev_alloc_skb(headroom + data_size);
-		if (!skb[i]) {
-			if (i == 0)
-				goto err_skb0;
-			else
-				goto err_skb1;
-		}
-
-		skb_reserve(skb[i], headroom);
-		skb_put(skb[i], data_size);
-		skb[i]->protocol = htons(ETH_P_IP);
-		skb_reset_network_header(skb[i]);
-		skb_set_mac_header(skb[i], -ETH_HLEN);
-
-		skb_add_rx_frag(skb[i], 0, page[i], 0, 64, 64);
-		// skb_headlen(skb[i]): 8, skb[i]->head_frag = 1
-	}
-
-	/* setup shinfo */
-	skb_shinfo(skb[0])->gso_size = 1448;
-	skb_shinfo(skb[0])->gso_type = SKB_GSO_TCPV4;
-	skb_shinfo(skb[0])->gso_type |= SKB_GSO_DODGY;
-	skb_shinfo(skb[0])->gso_segs = 0;
-	skb_shinfo(skb[0])->frag_list = skb[1];
-	skb_shinfo(skb[0])->hwtstamps.hwtstamp = 1000;
-
-	/* adjust skb[0]'s len */
-	skb[0]->len += skb[1]->len;
-	skb[0]->data_len += skb[1]->data_len;
-	skb[0]->truesize += skb[1]->truesize;
-
-	return skb[0];
-
-err_skb1:
-	__free_page(page[1]);
-err_page1:
-	kfree_skb(skb[0]);
-err_skb0:
-	__free_page(page[0]);
-err_page0:
-	return NULL;
-}
-
-static __init struct sk_buff *build_test_skb_linear_no_head_frag(void)
-{
-	unsigned int alloc_size = 2000;
-	unsigned int headroom = 102, doffset = 72, data_size = 1308;
-	struct sk_buff *skb[2];
-	int i;
-
-	/* skbs linked in a frag_list, both with linear data, with head_frag=0
-	 * (data allocated by kmalloc), both have tcp data of 1308 bytes
-	 * (total payload is 2616 bytes).
-	 * Data offset is 72 bytes (40 ipv6 hdr, 32 tcp hdr). Some headroom.
-	 */
-	for (i = 0; i < 2; i++) {
-		skb[i] = alloc_skb(alloc_size, GFP_KERNEL);
-		if (!skb[i]) {
-			if (i == 0)
-				goto err_skb0;
-			else
-				goto err_skb1;
-		}
-
-		skb[i]->protocol = htons(ETH_P_IPV6);
-		skb_reserve(skb[i], headroom);
-		skb_put(skb[i], doffset + data_size);
-		skb_reset_network_header(skb[i]);
-		if (i == 0)
-			skb_reset_mac_header(skb[i]);
-		else
-			skb_set_mac_header(skb[i], -ETH_HLEN);
-		__skb_pull(skb[i], doffset);
-	}
-
-	/* setup shinfo.
-	 * mimic bpf_skb_proto_4_to_6, which resets gso_segs and assigns a
-	 * reduced gso_size.
-	 */
-	skb_shinfo(skb[0])->gso_size = 1288;
-	skb_shinfo(skb[0])->gso_type = SKB_GSO_TCPV6 | SKB_GSO_DODGY;
-	skb_shinfo(skb[0])->gso_segs = 0;
-	skb_shinfo(skb[0])->frag_list = skb[1];
-
-	/* adjust skb[0]'s len */
-	skb[0]->len += skb[1]->len;
-	skb[0]->data_len += skb[1]->len;
-	skb[0]->truesize += skb[1]->truesize;
-
-	return skb[0];
-
-err_skb1:
-	kfree_skb(skb[0]);
-err_skb0:
-	return NULL;
-}
-
-struct skb_segment_test {
-	const char *descr;
-	struct sk_buff *(*build_skb)(void);
-	netdev_features_t features;
-};
-
-static struct skb_segment_test skb_segment_tests[] __initconst = {
-	{
-		.descr = "gso_with_rx_frags",
-		.build_skb = build_test_skb,
-		.features = NETIF_F_SG | NETIF_F_GSO_PARTIAL | NETIF_F_IP_CSUM |
-			    NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM
-	},
-	{
-		.descr = "gso_linear_no_head_frag",
-		.build_skb = build_test_skb_linear_no_head_frag,
-		.features = NETIF_F_SG | NETIF_F_FRAGLIST |
-			    NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_GSO |
-			    NETIF_F_GRO | NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM |
-			    NETIF_F_HW_VLAN_STAG_TX
-	}
-};
-
-static __init int test_skb_segment_single(const struct skb_segment_test *test)
-{
-	struct sk_buff *skb, *segs;
-	int ret = -1;
-
-	skb = test->build_skb();
-	if (!skb) {
-		pr_info("%s: failed to build_test_skb", __func__);
-		goto done;
-	}
-
-	segs = skb_segment(skb, test->features);
-	if (!IS_ERR(segs)) {
-		kfree_skb_list(segs);
-		ret = 0;
-	}
-	kfree_skb(skb);
-done:
-	return ret;
-}
-
-static __init int test_skb_segment(void)
-{
-	int i, err_cnt = 0, pass_cnt = 0;
-
-	for (i = 0; i < ARRAY_SIZE(skb_segment_tests); i++) {
-		const struct skb_segment_test *test = &skb_segment_tests[i];
-
-		cond_resched();
-		if (exclude_test(i))
-			continue;
-
-		pr_info("#%d %s ", i, test->descr);
-
-		if (test_skb_segment_single(test)) {
-			pr_cont("FAIL\n");
-			err_cnt++;
-		} else {
-			pr_cont("PASS\n");
-			pass_cnt++;
-		}
-	}
-
-	pr_info("%s: Summary: %d PASSED, %d FAILED\n", __func__,
-		pass_cnt, err_cnt);
-	return err_cnt ? -EINVAL : 0;
-}
-
-static __init int test_bpf(void)
-{
-	int i, err_cnt = 0, pass_cnt = 0;
-	int jit_cnt = 0, run_cnt = 0;
-
-	for (i = 0; i < ARRAY_SIZE(tests); i++) {
-		struct bpf_prog *fp;
-		int err;
-
-		cond_resched();
-		if (exclude_test(i))
-			continue;
-
-		pr_info("#%d %s ", i, tests[i].descr);
-
-		if (tests[i].fill_helper &&
-		    tests[i].fill_helper(&tests[i]) < 0) {
-			pr_cont("FAIL to prog_fill\n");
-			continue;
-		}
-
-		fp = generate_filter(i, &err);
-
-		if (tests[i].fill_helper) {
-			kfree(tests[i].u.ptr.insns);
-			tests[i].u.ptr.insns = NULL;
-		}
-
-		if (fp == NULL) {
-			if (err == 0) {
-				pass_cnt++;
-				continue;
-			}
-			err_cnt++;
-			continue;
-		}
-
-		pr_cont("jited:%u ", fp->jited);
-
-		run_cnt++;
-		if (fp->jited)
-			jit_cnt++;
-
-		err = run_one(fp, &tests[i]);
-		release_filter(fp, i);
-
-		if (err) {
-			pr_cont("FAIL (%d times)\n", err);
-			err_cnt++;
-		} else {
-			pr_cont("PASS\n");
-			pass_cnt++;
-		}
-	}
-
-	pr_info("Summary: %d PASSED, %d FAILED, [%d/%d JIT'ed]\n",
-		pass_cnt, err_cnt, jit_cnt, run_cnt);
-
-	return err_cnt ? -EINVAL : 0;
-}
-
-struct tail_call_test {
-	const char *descr;
-	struct bpf_insn insns[MAX_INSNS];
-	int flags;
-	int result;
-	int stack_depth;
-	bool has_tail_call;
-};
-
-/* Flags that can be passed to tail call test cases */
-#define FLAG_NEED_STATE		BIT(0)
-#define FLAG_RESULT_IN_STATE	BIT(1)
-
-/*
- * Magic marker used in test snippets for tail calls below.
- * BPF_LD/MOV to R2 and R2 with this immediate value is replaced
- * with the proper values by the test runner.
- */
-#define TAIL_CALL_MARKER 0x7a11ca11
-
-/* Special offset to indicate a NULL call target */
-#define TAIL_CALL_NULL 0x7fff
-
-/* Special offset to indicate an out-of-range index */
-#define TAIL_CALL_INVALID 0x7ffe
-
-#define TAIL_CALL(offset)			       \
-	BPF_LD_IMM64(R2, TAIL_CALL_MARKER),	       \
-	BPF_RAW_INSN(BPF_ALU | BPF_MOV | BPF_K, R3, 0, \
-		     offset, TAIL_CALL_MARKER),	       \
-	BPF_JMP_IMM(BPF_TAIL_CALL, 0, 0, 0)
-
-/*
- * A test function to be called from a BPF program, clobbering a lot of
- * CPU registers in the process. A JITed BPF program calling this function
- * must save and restore any caller-saved registers it uses for internal
- * state, for example the current tail call count.
- */
-BPF_CALL_1(bpf_test_func, u64, arg)
-{
-	char buf[64];
-	long a = 0;
-	long b = 1;
-	long c = 2;
-	long d = 3;
-	long e = 4;
-	long f = 5;
-	long g = 6;
-	long h = 7;
-
-	return snprintf(buf, sizeof(buf),
-			"%ld %lu %lx %ld %lu %lx %ld %lu %x",
-			a, b, c, d, e, f, g, h, (int)arg);
-}
-#define BPF_FUNC_test_func __BPF_FUNC_MAX_ID
-
-/*
- * Tail call tests. Each test case may call any other test in the table,
- * including itself, specified as a relative index offset from the calling
- * test. The index TAIL_CALL_NULL can be used to specify a NULL target
- * function to test the JIT error path. Similarly, the index TAIL_CALL_INVALID
- * results in a target index that is out of range.
- */
-static struct tail_call_test tail_call_tests[] = {
-	{
-		"Tail call leaf",
-		.insns = {
-			BPF_ALU64_REG(BPF_MOV, R0, R1),
-			BPF_ALU64_IMM(BPF_ADD, R0, 1),
-			BPF_EXIT_INSN(),
-		},
-		.result = 1,
-	},
-	{
-		"Tail call 2",
-		.insns = {
-			BPF_ALU64_IMM(BPF_ADD, R1, 2),
-			TAIL_CALL(-1),
-			BPF_ALU64_IMM(BPF_MOV, R0, -1),
-			BPF_EXIT_INSN(),
-		},
-		.result = 3,
-		.has_tail_call = true,
-	},
-	{
-		"Tail call 3",
-		.insns = {
-			BPF_ALU64_IMM(BPF_ADD, R1, 3),
-			TAIL_CALL(-1),
-			BPF_ALU64_IMM(BPF_MOV, R0, -1),
-			BPF_EXIT_INSN(),
-		},
-		.result = 6,
-		.has_tail_call = true,
-	},
-	{
-		"Tail call 4",
-		.insns = {
-			BPF_ALU64_IMM(BPF_ADD, R1, 4),
-			TAIL_CALL(-1),
-			BPF_ALU64_IMM(BPF_MOV, R0, -1),
-			BPF_EXIT_INSN(),
-		},
-		.result = 10,
-		.has_tail_call = true,
-	},
-	{
-		"Tail call load/store leaf",
-		.insns = {
-			BPF_ALU64_IMM(BPF_MOV, R1, 1),
-			BPF_ALU64_IMM(BPF_MOV, R2, 2),
-			BPF_ALU64_REG(BPF_MOV, R3, BPF_REG_FP),
-			BPF_STX_MEM(BPF_DW, R3, R1, -8),
-			BPF_STX_MEM(BPF_DW, R3, R2, -16),
-			BPF_LDX_MEM(BPF_DW, R0, BPF_REG_FP, -8),
-			BPF_JMP_REG(BPF_JNE, R0, R1, 3),
-			BPF_LDX_MEM(BPF_DW, R0, BPF_REG_FP, -16),
-			BPF_JMP_REG(BPF_JNE, R0, R2, 1),
-			BPF_ALU64_IMM(BPF_MOV, R0, 0),
-			BPF_EXIT_INSN(),
-		},
-		.result = 0,
-		.stack_depth = 32,
-	},
-	{
-		"Tail call load/store",
-		.insns = {
-			BPF_ALU64_IMM(BPF_MOV, R0, 3),
-			BPF_STX_MEM(BPF_DW, BPF_REG_FP, R0, -8),
-			TAIL_CALL(-1),
-			BPF_ALU64_IMM(BPF_MOV, R0, -1),
-			BPF_EXIT_INSN(),
-		},
-		.result = 0,
-		.stack_depth = 16,
-		.has_tail_call = true,
-	},
-	{
-		"Tail call error path, max count reached",
-		.insns = {
-			BPF_LDX_MEM(BPF_W, R2, R1, 0),
-			BPF_ALU64_IMM(BPF_ADD, R2, 1),
-			BPF_STX_MEM(BPF_W, R1, R2, 0),
-			TAIL_CALL(0),
-			BPF_EXIT_INSN(),
-		},
-		.flags = FLAG_NEED_STATE | FLAG_RESULT_IN_STATE,
-		.result = (MAX_TAIL_CALL_CNT + 1) * MAX_TESTRUNS,
-		.has_tail_call = true,
-	},
-	{
-		"Tail call count preserved across function calls",
-		.insns = {
-			BPF_LDX_MEM(BPF_W, R2, R1, 0),
-			BPF_ALU64_IMM(BPF_ADD, R2, 1),
-			BPF_STX_MEM(BPF_W, R1, R2, 0),
-			BPF_STX_MEM(BPF_DW, R10, R1, -8),
-			BPF_CALL_REL(BPF_FUNC_get_numa_node_id),
-			BPF_CALL_REL(BPF_FUNC_ktime_get_ns),
-			BPF_CALL_REL(BPF_FUNC_ktime_get_boot_ns),
-			BPF_CALL_REL(BPF_FUNC_ktime_get_coarse_ns),
-			BPF_CALL_REL(BPF_FUNC_jiffies64),
-			BPF_CALL_REL(BPF_FUNC_test_func),
-			BPF_LDX_MEM(BPF_DW, R1, R10, -8),
-			BPF_ALU32_REG(BPF_MOV, R0, R1),
-			TAIL_CALL(0),
-			BPF_EXIT_INSN(),
-		},
-		.stack_depth = 8,
-		.flags = FLAG_NEED_STATE | FLAG_RESULT_IN_STATE,
-		.result = (MAX_TAIL_CALL_CNT + 1) * MAX_TESTRUNS,
-		.has_tail_call = true,
-	},
-	{
-		"Tail call error path, NULL target",
-		.insns = {
-			BPF_LDX_MEM(BPF_W, R2, R1, 0),
-			BPF_ALU64_IMM(BPF_ADD, R2, 1),
-			BPF_STX_MEM(BPF_W, R1, R2, 0),
-			TAIL_CALL(TAIL_CALL_NULL),
-			BPF_EXIT_INSN(),
-		},
-		.flags = FLAG_NEED_STATE | FLAG_RESULT_IN_STATE,
-		.result = MAX_TESTRUNS,
-		.has_tail_call = true,
-	},
-	{
-		"Tail call error path, index out of range",
-		.insns = {
-			BPF_LDX_MEM(BPF_W, R2, R1, 0),
-			BPF_ALU64_IMM(BPF_ADD, R2, 1),
-			BPF_STX_MEM(BPF_W, R1, R2, 0),
-			TAIL_CALL(TAIL_CALL_INVALID),
-			BPF_EXIT_INSN(),
-		},
-		.flags = FLAG_NEED_STATE | FLAG_RESULT_IN_STATE,
-		.result = MAX_TESTRUNS,
-		.has_tail_call = true,
-	},
-};
-
-static void __init destroy_tail_call_tests(struct bpf_array *progs)
-{
-	int i;
-
-	for (i = 0; i < ARRAY_SIZE(tail_call_tests); i++)
-		if (progs->ptrs[i])
-			bpf_prog_free(progs->ptrs[i]);
-	kfree(progs);
-}
-
-static __init int prepare_tail_call_tests(struct bpf_array **pprogs)
-{
-	int ntests = ARRAY_SIZE(tail_call_tests);
-	struct bpf_array *progs;
-	int which, err;
-
-	/* Allocate the table of programs to be used for tail calls */
-	progs = kzalloc_flex(*progs, ptrs, ntests + 1);
-	if (!progs)
-		goto out_nomem;
-
-	/* Create all eBPF programs and populate the table */
-	for (which = 0; which < ntests; which++) {
-		struct tail_call_test *test = &tail_call_tests[which];
-		struct bpf_prog *fp;
-		int len, i;
-
-		/* Compute the number of program instructions */
-		for (len = 0; len < MAX_INSNS; len++) {
-			struct bpf_insn *insn = &test->insns[len];
-
-			if (len < MAX_INSNS - 1 &&
-			    insn->code == (BPF_LD | BPF_DW | BPF_IMM))
-				len++;
-			if (insn->code == 0)
-				break;
-		}
-
-		/* Allocate and initialize the program */
-		fp = bpf_prog_alloc(bpf_prog_size(len), 0);
-		if (!fp)
-			goto out_nomem;
-
-		fp->len = len;
-		fp->type = BPF_PROG_TYPE_SOCKET_FILTER;
-		fp->aux->stack_depth = test->stack_depth;
-		fp->aux->tail_call_reachable = test->has_tail_call;
-		memcpy(fp->insnsi, test->insns, len * sizeof(struct bpf_insn));
-
-		/* Relocate runtime tail call offsets and addresses */
-		for (i = 0; i < len; i++) {
-			struct bpf_insn *insn = &fp->insnsi[i];
-			long addr = 0;
-
-			switch (insn->code) {
-			case BPF_LD | BPF_DW | BPF_IMM:
-				if (insn->imm != TAIL_CALL_MARKER)
-					break;
-				insn[0].imm = (u32)(long)progs;
-				insn[1].imm = ((u64)(long)progs) >> 32;
-				break;
-
-			case BPF_ALU | BPF_MOV | BPF_K:
-				if (insn->imm != TAIL_CALL_MARKER)
-					break;
-				if (insn->off == TAIL_CALL_NULL)
-					insn->imm = ntests;
-				else if (insn->off == TAIL_CALL_INVALID)
-					insn->imm = ntests + 1;
-				else
-					insn->imm = which + insn->off;
-				insn->off = 0;
-				break;
-
-			case BPF_JMP | BPF_CALL:
-				if (insn->src_reg != BPF_PSEUDO_CALL)
-					break;
-				switch (insn->imm) {
-				case BPF_FUNC_get_numa_node_id:
-					addr = (long)&numa_node_id;
-					break;
-				case BPF_FUNC_ktime_get_ns:
-					addr = (long)&ktime_get_ns;
-					break;
-				case BPF_FUNC_ktime_get_boot_ns:
-					addr = (long)&ktime_get_boot_fast_ns;
-					break;
-				case BPF_FUNC_ktime_get_coarse_ns:
-					addr = (long)&ktime_get_coarse_ns;
-					break;
-				case BPF_FUNC_jiffies64:
-					addr = (long)&get_jiffies_64;
-					break;
-				case BPF_FUNC_test_func:
-					addr = (long)&bpf_test_func;
-					break;
-				default:
-					err = -EFAULT;
-					goto out_err;
-				}
-				*insn = BPF_EMIT_CALL(addr);
-				if ((long)__bpf_call_base + insn->imm != addr)
-					*insn = BPF_JMP_A(0); /* Skip: NOP */
-				break;
-			}
-		}
-
-		fp = bpf_prog_select_runtime(fp, &err);
-		if (err)
-			goto out_err;
-
-		progs->ptrs[which] = fp;
-	}
-
-	/* The last entry contains a NULL program pointer */
-	progs->map.max_entries = ntests + 1;
-	*pprogs = progs;
-	return 0;
-
-out_nomem:
-	err = -ENOMEM;
-
-out_err:
-	if (progs)
-		destroy_tail_call_tests(progs);
-	return err;
-}
-
-static __init int test_tail_calls(struct bpf_array *progs)
-{
-	int i, err_cnt = 0, pass_cnt = 0;
-	int jit_cnt = 0, run_cnt = 0;
-
-	for (i = 0; i < ARRAY_SIZE(tail_call_tests); i++) {
-		struct tail_call_test *test = &tail_call_tests[i];
-		struct bpf_prog *fp = progs->ptrs[i];
-		int *data = NULL;
-		int state = 0;
-		u64 duration;
-		int ret;
-
-		cond_resched();
-		if (exclude_test(i))
-			continue;
-
-		pr_info("#%d %s ", i, test->descr);
-		if (!fp) {
-			err_cnt++;
-			continue;
-		}
-		pr_cont("jited:%u ", fp->jited);
-
-		run_cnt++;
-		if (fp->jited)
-			jit_cnt++;
-
-		if (test->flags & FLAG_NEED_STATE)
-			data = &state;
-		ret = __run_one(fp, data, MAX_TESTRUNS, &duration);
-		if (test->flags & FLAG_RESULT_IN_STATE)
-			ret = state;
-		if (ret == test->result) {
-			pr_cont("%lld PASS", duration);
-			pass_cnt++;
-		} else {
-			pr_cont("ret %d != %d FAIL", ret, test->result);
-			err_cnt++;
-		}
-	}
-
-	pr_info("%s: Summary: %d PASSED, %d FAILED, [%d/%d JIT'ed]\n",
-		__func__, pass_cnt, err_cnt, jit_cnt, run_cnt);
-
-	return err_cnt ? -EINVAL : 0;
-}
-
-static char test_suite[32];
-module_param_string(test_suite, test_suite, sizeof(test_suite), 0);
-
-static __init int find_test_index(const char *test_name)
-{
-	int i;
-
-	if (!strcmp(test_suite, "test_bpf")) {
-		for (i = 0; i < ARRAY_SIZE(tests); i++) {
-			if (!strcmp(tests[i].descr, test_name))
-				return i;
-		}
-	}
-
-	if (!strcmp(test_suite, "test_tail_calls")) {
-		for (i = 0; i < ARRAY_SIZE(tail_call_tests); i++) {
-			if (!strcmp(tail_call_tests[i].descr, test_name))
-				return i;
-		}
-	}
-
-	if (!strcmp(test_suite, "test_skb_segment")) {
-		for (i = 0; i < ARRAY_SIZE(skb_segment_tests); i++) {
-			if (!strcmp(skb_segment_tests[i].descr, test_name))
-				return i;
-		}
-	}
-
-	return -1;
-}
-
-static __init int prepare_test_range(void)
-{
-	int valid_range;
-
-	if (!strcmp(test_suite, "test_bpf"))
-		valid_range = ARRAY_SIZE(tests);
-	else if (!strcmp(test_suite, "test_tail_calls"))
-		valid_range = ARRAY_SIZE(tail_call_tests);
-	else if (!strcmp(test_suite, "test_skb_segment"))
-		valid_range = ARRAY_SIZE(skb_segment_tests);
-	else
-		return 0;
-
-	if (test_id >= 0) {
-		/*
-		 * if a test_id was specified, use test_range to
-		 * cover only that test.
-		 */
-		if (test_id >= valid_range) {
-			pr_err("test_bpf: invalid test_id specified for '%s' suite.\n",
-			       test_suite);
-			return -EINVAL;
-		}
-
-		test_range[0] = test_id;
-		test_range[1] = test_id;
-	} else if (*test_name) {
-		/*
-		 * if a test_name was specified, find it and setup
-		 * test_range to cover only that test.
-		 */
-		int idx = find_test_index(test_name);
-
-		if (idx < 0) {
-			pr_err("test_bpf: no test named '%s' found for '%s' suite.\n",
-			       test_name, test_suite);
-			return -EINVAL;
-		}
-		test_range[0] = idx;
-		test_range[1] = idx;
-	} else if (test_range[0] != 0 || test_range[1] != INT_MAX) {
-		/*
-		 * check that the supplied test_range is valid.
-		 */
-		if (test_range[0] < 0 || test_range[1] >= valid_range) {
-			pr_err("test_bpf: test_range is out of bound for '%s' suite.\n",
-			       test_suite);
-			return -EINVAL;
-		}
-
-		if (test_range[1] < test_range[0]) {
-			pr_err("test_bpf: test_range is ending before it starts.\n");
-			return -EINVAL;
-		}
-	}
-
-	return 0;
-}
-
-static int __init test_bpf_init(void)
-{
-	struct bpf_array *progs = NULL;
-	int ret;
-
-	if (strlen(test_suite) &&
-	    strcmp(test_suite, "test_bpf") &&
-	    strcmp(test_suite, "test_tail_calls") &&
-	    strcmp(test_suite, "test_skb_segment")) {
-		pr_err("test_bpf: invalid test_suite '%s' specified.\n", test_suite);
-		return -EINVAL;
-	}
-
-	/*
-	 * if test_suite is not specified, but test_id, test_name or test_range
-	 * is specified, set 'test_bpf' as the default test suite.
-	 */
-	if (!strlen(test_suite) &&
-	    (test_id != -1 || strlen(test_name) ||
-	    (test_range[0] != 0 || test_range[1] != INT_MAX))) {
-		pr_info("test_bpf: set 'test_bpf' as the default test_suite.\n");
-		strscpy(test_suite, "test_bpf", sizeof(test_suite));
-	}
-
-	ret = prepare_test_range();
-	if (ret < 0)
-		return ret;
-
-	if (!strlen(test_suite) || !strcmp(test_suite, "test_bpf")) {
-		ret = test_bpf();
-		if (ret)
-			return ret;
-	}
-
-	if (!strlen(test_suite) || !strcmp(test_suite, "test_tail_calls")) {
-		ret = prepare_tail_call_tests(&progs);
-		if (ret)
-			return ret;
-		ret = test_tail_calls(progs);
-		destroy_tail_call_tests(progs);
-		if (ret)
-			return ret;
-	}
-
-	if (!strlen(test_suite) || !strcmp(test_suite, "test_skb_segment"))
-		return test_skb_segment();
-
-	return 0;
-}
-
-static void __exit test_bpf_exit(void)
-{
-}
-
-module_init(test_bpf_init);
-module_exit(test_bpf_exit);
-
-MODULE_DESCRIPTION("Testsuite for BPF interpreter and BPF JIT compiler");
-MODULE_LICENSE("GPL");
diff --git a/tools/bpf/bpftool/feature.c b/tools/bpf/bpftool/feature.c
index 0f6070a0c8e71..846a58e562034 100644
--- a/tools/bpf/bpftool/feature.c
+++ b/tools/bpf/bpftool/feature.c
@@ -394,9 +394,6 @@ static void probe_kernel_image_config(const char *define_prefix)
 		/* xt_bpf module for passing BPF programs to netfilter  */
 		{ "CONFIG_NETFILTER_XT_MATCH_BPF", },
 
-		/* test_bpf module for BPF tests */
-		{ "CONFIG_TEST_BPF", },
-
 		/* Misc configs useful in BPF C programs */
 		/* jiffies <-> sec conversion for bpf_jiffies64() helper */
 		{ "CONFIG_HZ", true, }
diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 80d8bbbc3084a..1e4af62e8312e 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -38,8 +38,7 @@ TEST_FILES = xsk_prereqs.sh $(wildcard progs/btf_dump_test_case_*.c)	\
 	     bpftool_btf_dump_unsorted.expected
 
 # Order correspond to 'make run_tests' order
-TEST_PROGS := test_kmod.sh \
-	test_bpftool_build.sh \
+TEST_PROGS := test_bpftool_build.sh \
 	test_doc_build.sh \
 	test_xsk.sh \
 	test_xdp_features.sh
diff --git a/tools/testing/selftests/bpf/config b/tools/testing/selftests/bpf/config
index 2b883b388f90c..1f41283ae2f0f 100644
--- a/tools/testing/selftests/bpf/config
+++ b/tools/testing/selftests/bpf/config
@@ -123,7 +123,6 @@ CONFIG_SAMPLE_LIVEPATCH=m
 CONFIG_SECURITY=y
 CONFIG_SECURITYFS=y
 CONFIG_SYN_COOKIES=y
-CONFIG_TEST_BPF=m
 CONFIG_TMPFS=y
 CONFIG_TMPFS_XATTR=y
 CONFIG_UDMABUF=y
diff --git a/tools/testing/selftests/bpf/prog_tests/jit_insns.c b/tools/testing/selftests/bpf/prog_tests/jit_insns.c
new file mode 100644
index 0000000000000..dabf8a4abdfe2
--- /dev/null
+++ b/tools/testing/selftests/bpf/prog_tests/jit_insns.c
@@ -0,0 +1,2433 @@
+// SPDX-License-Identifier: GPL-2.0
+/* Copyright (c) 2026 Isovalent */
+
+#include <endian.h>
+#include <stdint.h>
+#include <test_progs.h>
+#include <bpf/btf.h>
+#include <linux/filter.h>
+
+#include "sysctl_helpers.h"
+#include "jit_insns_arena.skel.h"
+
+#define NR_CASES	512
+#define CTX_SPILL	-16	/* stack slot holding the ctx pointer */
+#define MEM_SLOT	-8	/* stack slot for the atomic operations */
+
+struct sweep_ctx {
+	__u64 in[NR_CASES][2];
+	__u64 out[NR_CASES][3];
+};
+
+#define IN_OFF(k, j)	(offsetof(struct sweep_ctx, in) + ((k) * 2 + (j)) * 8)
+#define OUT_OFF(k, j)	(offsetof(struct sweep_ctx, out) + ((k) * 3 + (j)) * 8)
+
+/* The cases of one program: operands in, results out, expected results */
+struct batch {
+	struct bpf_insn *insns;
+	int cnt, cap;
+	struct sweep_ctx ctx;
+	__u64 exp[NR_CASES][3];
+	__u8 nr_out[NR_CASES];
+	int nr;
+	char desc[80];
+};
+
+static char log[1 << 16];
+
+#define EMIT(b, insn)	((b)->insns[(b)->cnt++] = (insn))
+
+static void emit_ld_imm64(struct batch *b, int reg, __u64 imm)
+{
+	EMIT(b, BPF_RAW_INSN(BPF_LD | BPF_DW | BPF_IMM, reg, 0, 0, (__u32)imm));
+	EMIT(b, BPF_RAW_INSN(0, 0, 0, 0, imm >> 32));
+}
+
+static void batch_reset(struct batch *b)
+{
+	b->cnt = 0;
+	b->nr = 0;
+	/* The ctx pointer lives on the stack, every register is an operand */
+	EMIT(b, BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_1, CTX_SPILL));
+}
+
+static bool batch_init(struct batch *b)
+{
+	b->cap = NR_CASES * 24 + 8;
+	b->insns = malloc(b->cap * sizeof(*b->insns));
+	if (!ASSERT_OK_PTR(b->insns, "insns"))
+		return false;
+	batch_reset(b);
+	return true;
+}
+
+static void batch_fini(struct batch *b)
+{
+	free(b->insns);
+}
+
+static int load_prog(struct bpf_insn *insns, int cnt, const char *desc)
+{
+	LIBBPF_OPTS(bpf_prog_load_opts, lopts,
+		.prog_flags = BPF_F_SLEEPABLE,
+		.log_buf = log,
+		.log_size = sizeof(log),
+	);
+	int fd;
+
+	fd = bpf_prog_load(BPF_PROG_TYPE_SYSCALL, NULL, "GPL", insns, cnt, &lopts);
+	if (!ASSERT_GE(fd, 0, desc))
+		fprintf(stderr, "%s", log);
+	return fd;
+}
+
+/* Run the batch, check the results, start a new one */
+static void batch_flush(struct batch *b)
+{
+	LIBBPF_OPTS(bpf_test_run_opts, opts,
+		.ctx_in = &b->ctx,
+		.ctx_size_in = sizeof(b->ctx),
+	);
+	char buf[160];
+	int fd, k, j;
+
+	if (!b->nr)
+		return;
+	EMIT(b, BPF_MOV64_IMM(BPF_REG_0, 0));
+	EMIT(b, BPF_EXIT_INSN());
+	snprintf(buf, sizeof(buf), "%s: load %d cases", b->desc, b->nr);
+	fd = load_prog(b->insns, b->cnt, buf);
+	if (fd >= 0 && ASSERT_OK(bpf_prog_test_run_opts(fd, &opts), b->desc)) {
+		for (k = 0; k < b->nr; k++) {
+			for (j = 0; j < b->nr_out[k]; j++) {
+				if (b->ctx.out[k][j] == b->exp[k][j])
+					continue;
+				snprintf(buf, sizeof(buf), "%s: in0=0x%llx in1=0x%llx out%d",
+					 b->desc, b->ctx.in[k][0], b->ctx.in[k][1], j);
+				ASSERT_EQ(b->ctx.out[k][j], b->exp[k][j], buf);
+			}
+		}
+	}
+	if (fd >= 0)
+		close(fd);
+	batch_reset(b);
+}
+
+/* Add a case: record the operands and load the ctx pointer into rc */
+static int batch_case(struct batch *b, int rc, __u64 in0, __u64 in1)
+{
+	int k;
+
+	if (b->nr == NR_CASES)
+		batch_flush(b);
+	k = b->nr++;
+	b->ctx.in[k][0] = in0;
+	b->ctx.in[k][1] = in1;
+	b->nr_out[k] = 0;
+	EMIT(b, BPF_LDX_MEM(BPF_DW, rc, BPF_REG_10, CTX_SPILL));
+	return k;
+}
+
+static void batch_expect(struct batch *b, int k, int j, __u64 val)
+{
+	b->exp[k][j] = val;
+	if (b->nr_out[k] <= j)
+		b->nr_out[k] = j + 1;
+}
+
+#define LD_IN(b, k, j, rc, reg)		EMIT(b, BPF_LDX_MEM(BPF_DW, reg, rc, IN_OFF(k, j)))
+#define ST_OUT(b, k, j, rc, reg)	EMIT(b, BPF_STX_MEM(BPF_DW, rc, reg, OUT_OFF(k, j)))
+
+/* A register that is neither of the two operand registers nor r0 */
+static int scratch_reg(int r1, int r2)
+{
+	int r;
+
+	for (r = BPF_REG_1; r <= BPF_REG_9; r++)
+		if (r != r1 && r != r2)
+			return r;
+	return BPF_REG_9;
+}
+
+static const char *alu_name(int op)
+{
+	switch (BPF_OP(op)) {
+	case BPF_MOV: return "mov";
+	case BPF_NEG: return "neg";
+	case BPF_AND: return "and";
+	case BPF_OR: return "or";
+	case BPF_XOR: return "xor";
+	case BPF_LSH: return "lsh";
+	case BPF_RSH: return "rsh";
+	case BPF_ARSH: return "arsh";
+	case BPF_ADD: return "add";
+	case BPF_SUB: return "sub";
+	case BPF_MUL: return "mul";
+	case BPF_DIV: return "div";
+	case BPF_MOD: return "mod";
+	case BPF_OP(BPF_XCHG): return "xchg";
+	case BPF_OP(BPF_CMPXCHG): return "cmpxchg";
+	default: return "?";
+	}
+}
+
+static const char *jmp_name(int op)
+{
+	switch (op) {
+	case BPF_JSET: return "jset";
+	case BPF_JEQ: return "jeq";
+	case BPF_JNE: return "jne";
+	case BPF_JGT: return "jgt";
+	case BPF_JGE: return "jge";
+	case BPF_JLT: return "jlt";
+	case BPF_JLE: return "jle";
+	case BPF_JSGT: return "jsgt";
+	case BPF_JSGE: return "jsge";
+	case BPF_JSLT: return "jslt";
+	case BPF_JSLE: return "jsle";
+	default: return "?";
+	}
+}
+
+/* ALU result computation, false when the operands are not valid */
+enum { F_ALU32 = 1, F_SIGNED = 2 };
+
+static bool alu_result(__u64 *res, __u64 v1, __u64 v2, __u8 op, __u32 flags)
+{
+	bool is_signed = flags & F_SIGNED;
+
+	/* Narrow operands for ALU32 */
+	if (flags & F_ALU32) {
+		if (is_signed) {
+			v1 = (__u64)(__s32)v1;
+			v2 = (__u64)(__s32)v2;
+		} else {
+			v1 = (__u32)v1;
+			v2 = (__u32)v2;
+		}
+	}
+
+	*res = 0;
+	switch (op) {
+	case BPF_MOV:
+		*res = v2;
+		break;
+	case BPF_NEG:
+		*res = -v1;
+		break;
+	case BPF_AND:
+		*res = v1 & v2;
+		break;
+	case BPF_OR:
+		*res = v1 | v2;
+		break;
+	case BPF_XOR:
+		*res = v1 ^ v2;
+		break;
+	case BPF_LSH:
+		*res = v1 << v2;
+		break;
+	case BPF_RSH:
+		*res = v1 >> v2;
+		break;
+	case BPF_ARSH:
+		*res = v1 >> v2;
+		if (v2 > 0 && v1 > INT64_MAX)
+			*res |= ~0ULL << (64 - v2);
+		break;
+	case BPF_ADD:
+		*res = v1 + v2;
+		break;
+	case BPF_SUB:
+		*res = v1 - v2;
+		break;
+	case BPF_MUL:
+		*res = v1 * v2;
+		break;
+	case BPF_DIV:
+		if (v2 == 0)
+			return false;
+		if (!is_signed) {
+			*res = v1 / v2;
+		} else {
+			if ((__s64)v2 == -1) /* Handled by the verifier */
+				return false;
+			*res = (__u64)((__s64)v1 / (__s64)v2);
+		}
+		break;
+	case BPF_MOD:
+		if (v2 == 0)
+			return false;
+		if (!is_signed) {
+			*res = v1 % v2;
+		} else {
+			if ((__s64)v2 == -1)
+				return false;
+			*res = (__u64)((__s64)v1 % (__s64)v2);
+		}
+		break;
+	}
+	return true;
+}
+
+/*
+ * Operand pattern generator for the power-of-two magnitude tests: all
+ * combinations of magnitudes and signs with a block of contiguous values
+ * around each magnitude, with every dstep'th magnitude of the destination,
+ * and a larger block for the same magnitude of both operands. The first
+ * pattern is where the immediates take every encoding a JIT has, the
+ * second where the sign and overflow boundaries of both operands meet.
+ */
+static __s64 value(int msb, int delta, int sign)
+{
+	return sign * (1LL << msb) + delta;
+}
+
+#define PATTERN_BLOCK1 1
+#define PATTERN_BLOCK2 3
+
+typedef void (*emit_fn)(struct batch *b, void *arg, __s64 dst, __s64 src);
+
+static void fill_pattern(struct batch *b, void *arg, int dbits, int sbits,
+			 int block1, int dstep, int block2, emit_fn emit)
+{
+	static const int sgn[][2] = { { 1, 1 }, { 1, -1 }, { -1, 1 }, { -1, -1 } };
+	int di, si, bt, db, sb, k;
+
+	for (di = 0; di < dbits - 1; di += dstep)
+		for (si = 0; si < sbits - 1; si++)
+			for (k = 0; k < ARRAY_SIZE(sgn); k++)
+				for (db = -(block1 / 2); db < (block1 + 1) / 2; db++)
+					for (sb = -(block1 / 2); sb < (block1 + 1) / 2; sb++)
+						emit(b, arg, value(di, db, sgn[k][0]),
+						     value(si, sb, sgn[k][1]));
+
+	for (bt = 0; bt < (dbits > sbits ? dbits : sbits) - 1; bt++)
+		for (k = 0; k < ARRAY_SIZE(sgn); k++)
+			for (db = -(block2 / 2); db < (block2 + 1) / 2; db++)
+				for (sb = -(block2 / 2); sb < (block2 + 1) / 2; sb++)
+					emit(b, arg, value(bt % dbits, db, sgn[k][0]),
+					     value(bt % sbits, sb, sgn[k][1]));
+	batch_flush(b);
+}
+
+/* ALU operations with an immediate and with a register for all magnitudes */
+static const int alu_ops[] = {
+	BPF_MOV, BPF_AND, BPF_OR, BPF_XOR, BPF_ADD, BPF_SUB, BPF_MUL, BPF_DIV, BPF_MOD,
+};
+
+struct alu_arg {
+	int op;
+	__u32 flags;
+};
+
+static void emit_alu_imm(struct batch *b, void *arg, __s64 dst, __s64 imm)
+{
+	struct alu_arg *a = arg;
+	bool alu32 = a->flags & F_ALU32;
+	__u64 res;
+	int k;
+
+	if (!alu_result(&res, dst, (__s32)imm, a->op, a->flags))
+		return;
+	k = batch_case(b, BPF_REG_3, dst, 0);
+	LD_IN(b, k, 0, BPF_REG_3, BPF_REG_1);
+	EMIT(b, BPF_RAW_INSN((alu32 ? BPF_ALU : BPF_ALU64) | BPF_OP(a->op) | BPF_K,
+			     BPF_REG_1, 0, a->flags & F_SIGNED ? 1 : 0, imm));
+	ST_OUT(b, k, 0, BPF_REG_3, BPF_REG_1);
+	batch_expect(b, k, 0, alu32 ? (__u32)res : res);
+}
+
+static void emit_alu_reg(struct batch *b, void *arg, __s64 dst, __s64 src)
+{
+	struct alu_arg *a = arg;
+	bool alu32 = a->flags & F_ALU32;
+	__u64 res;
+	int k;
+
+	if (!alu_result(&res, dst, src, a->op, a->flags))
+		return;
+	k = batch_case(b, BPF_REG_3, dst, src);
+	LD_IN(b, k, 0, BPF_REG_3, BPF_REG_1);
+	LD_IN(b, k, 1, BPF_REG_3, BPF_REG_2);
+	EMIT(b, BPF_RAW_INSN((alu32 ? BPF_ALU : BPF_ALU64) | BPF_OP(a->op) | BPF_X,
+			     BPF_REG_1, BPF_REG_2, a->flags & F_SIGNED ? 1 : 0, 0));
+	ST_OUT(b, k, 0, BPF_REG_3, BPF_REG_1);
+	batch_expect(b, k, 0, alu32 ? (__u32)res : res);
+}
+
+static void test_alu_magnitudes(bool reg)
+{
+	struct batch b;
+	int o, f;
+
+	if (!batch_init(&b))
+		return;
+	for (f = 0; f < 2; f++) {
+		for (o = 0; o < ARRAY_SIZE(alu_ops); o++) {
+			struct alu_arg a = { alu_ops[o], f ? F_ALU32 : 0 };
+
+			snprintf(b.desc, sizeof(b.desc), "alu%d_%s_%c magnitudes",
+				 f ? 32 : 64, alu_name(a.op), reg ? 'x' : 'k');
+			if (reg)
+				fill_pattern(&b, &a, 64, 64, 0, 1, PATTERN_BLOCK2, emit_alu_reg);
+			else
+				fill_pattern(&b, &a, 64, 32, PATTERN_BLOCK1, 1, 5, emit_alu_imm);
+		}
+		for (o = 0; o < 2; o++) {
+			struct alu_arg a = { o ? BPF_MOD : BPF_DIV, F_SIGNED | (f ? F_ALU32 : 0) };
+
+			snprintf(b.desc, sizeof(b.desc), "alu%d_s%s_%c magnitudes",
+				 f ? 32 : 64, alu_name(a.op), reg ? 'x' : 'k');
+			if (reg)
+				fill_pattern(&b, &a, 64, 64, 0, 1, PATTERN_BLOCK2, emit_alu_reg);
+			else
+				fill_pattern(&b, &a, 64, 32, PATTERN_BLOCK1, 1, 5, emit_alu_imm);
+		}
+	}
+	batch_fini(&b);
+}
+
+static void test_alu_imm(void)
+{
+	test_alu_magnitudes(false);
+}
+
+static void test_alu_reg(void)
+{
+	test_alu_magnitudes(true);
+}
+
+/* ALU operations with an immediate for every destination register */
+static const int alu_reg_ops[] = {
+	BPF_MOV, BPF_AND, BPF_OR, BPF_XOR, BPF_LSH, BPF_RSH, BPF_ARSH,
+	BPF_ADD, BPF_SUB, BPF_MUL, BPF_DIV, BPF_MOD,
+};
+
+static void alu_imm_regs(struct batch *b, int op, __u32 flags)
+{
+	bool alu32 = flags & F_ALU32;
+	__u32 imm = 0x01234567U;
+	__u64 dst, res;
+	int rd, rc, k;
+
+	if (flags & F_SIGNED)
+		dst = alu32 ? (__u64)-76543210LL : (__u64)-7654321076543210LL;
+	else
+		dst = alu32 ? 0x76543210ULL : 0x7edcba9876543210ULL;
+	if (op == BPF_LSH || op == BPF_RSH || op == BPF_ARSH)
+		imm &= 31;
+	if (op == BPF_NEG)
+		imm = 0;
+	alu_result(&res, dst, imm, op, flags);
+	if (alu32)
+		res = (__u32)res;
+
+	snprintf(b->desc, sizeof(b->desc), "alu%d_%s%s_k registers", alu32 ? 32 : 64,
+		 flags & F_SIGNED ? "s" : "", alu_name(op));
+	for (rd = BPF_REG_0; rd <= BPF_REG_9; rd++) {
+		rc = scratch_reg(rd, rd);
+		k = batch_case(b, rc, dst, 0);
+		LD_IN(b, k, 0, rc, rd);
+		EMIT(b, BPF_RAW_INSN((alu32 ? BPF_ALU : BPF_ALU64) | BPF_OP(op) | BPF_K,
+				     rd, 0, flags & F_SIGNED ? 1 : 0, imm));
+		ST_OUT(b, k, 0, rc, rd);
+		batch_expect(b, k, 0, res);
+	}
+	batch_flush(b);
+}
+
+static void test_alu_imm_regs(void)
+{
+	struct batch b;
+	int o, f;
+
+	if (!batch_init(&b))
+		return;
+	for (f = 0; f < 2; f++) {
+		for (o = 0; o < ARRAY_SIZE(alu_reg_ops); o++)
+			alu_imm_regs(&b, alu_reg_ops[o], f ? F_ALU32 : 0);
+		alu_imm_regs(&b, BPF_NEG, f ? F_ALU32 : 0);
+		alu_imm_regs(&b, BPF_DIV, F_SIGNED | (f ? F_ALU32 : 0));
+		alu_imm_regs(&b, BPF_MOD, F_SIGNED | (f ? F_ALU32 : 0));
+	}
+	batch_fini(&b);
+}
+
+/*
+ * Division and modulo by constants for every width, signedness and
+ * destination register with a set of divisors and dividends around the
+ * multiple boundaries and the extremes of each range. This covers a JIT
+ * replacing the division with a multiplication by a magic number in all
+ * of its forms: magic numbers needing the extra add step, zero shifts,
+ * both signed corrections, and the divisors like 1, -1 and the ones
+ * above 2^63 that are still emitted as a real division. The dividends
+ * of the 32-bit operations carry garbage in the upper 32 bits.
+ */
+static const __s32 unsigned_divisors[] = {
+	2, 3, 7, 10, 25, 641, 1000, 4096, 65536, 1000000007, 0x7fffffff,
+	-2, -10, -0x7fffffff - 1, -1, 1,
+};
+
+static const __s32 signed_divisors[] = {
+	2, 3, 7, 25, 1000, 0x40000000, 0x7fffffff,
+	-2, -3, -5, -7, -1000, -0x7fffffff, -0x7fffffff - 1, 1, -1,
+};
+
+static int dividends(__u32 flags, __s32 imm, __u64 *n)
+{
+	bool alu32 = flags & F_ALU32, is_signed = flags & F_SIGNED;
+	__u64 d = is_signed ? (imm < 0 ? -(__s64)imm : imm) :
+		  alu32 ? (__u32)imm : (__u64)(__s64)imm;
+	int cnt = 0, i;
+
+	n[cnt++] = 0;
+	n[cnt++] = d - 1;
+	n[cnt++] = d + 1;
+	n[cnt++] = 3 * d + 2;
+	if (!alu32) {
+		n[cnt++] = (d << 40) - 1;
+		n[cnt++] = (d << 40) + 1;
+		n[cnt++] = (1ULL << 63) - 1;
+		n[cnt++] = 1ULL << 63;
+		n[cnt++] = ~0ULL;
+		n[cnt++] = 0xdaeb8ebd244a330cULL;
+	} else {
+		n[cnt++] = (d << 16) - 1;
+		n[cnt++] = (d << 16) + 1;
+		n[cnt++] = (1ULL << 31) - 1;
+		n[cnt++] = 1ULL << 31;
+		n[cnt++] = ~0U;
+		n[cnt++] = 0x8c1e86f1;
+	}
+	if (is_signed) {
+		n[cnt++] = -1;
+		n[cnt++] = -d - 1;
+		n[cnt++] = -3 * d - 2;
+		n[cnt++] = alu32 ? -(1ULL << 31) + 1 : -(1ULL << 63) + 1;
+	}
+	if (alu32)
+		for (i = 0; i < cnt; i++)
+			n[i] = (__u32)n[i] | ((0xa5a50000ULL + i) << 32);
+	return cnt;
+}
+
+static __u64 div_result(int op, __u32 flags, __s32 imm, __u64 n)
+{
+	__u64 res;
+
+	/* LLONG_MIN / -1 == LLONG_MIN, LLONG_MIN % -1 == 0, same for INT_MIN */
+	if ((flags & F_SIGNED) && imm == -1)
+		res = op == BPF_MOD ? 0 : -n;
+	else
+		alu_result(&res, n, (__s32)imm, op, flags);
+	return flags & F_ALU32 ? (__u32)res : res;
+}
+
+static void div_const(struct batch *b, int op, __u32 flags)
+{
+	bool alu32 = flags & F_ALU32, is_signed = flags & F_SIGNED;
+	const __s32 *divs = is_signed ? signed_divisors : unsigned_divisors;
+	int cnt = is_signed ? ARRAY_SIZE(signed_divisors) : ARRAY_SIZE(unsigned_divisors);
+	int code = (alu32 ? BPF_ALU : BPF_ALU64) | BPF_OP(op) | BPF_K;
+	int i, j, nr, rd, rc, k;
+	__u64 n[16];
+
+	snprintf(b->desc, sizeof(b->desc), "alu%d_%s%s_k constants", alu32 ? 32 : 64,
+		 is_signed ? "s" : "", alu_name(op));
+	for (i = 0; i < cnt; i++) {
+		nr = dividends(flags, divs[i], n);
+		for (rd = BPF_REG_0; rd <= BPF_REG_9; rd++) {
+			rc = scratch_reg(rd, rd);
+			for (j = 0; j < nr; j++) {
+				k = batch_case(b, rc, n[j], divs[i]);
+				LD_IN(b, k, 0, rc, rd);
+				EMIT(b, BPF_RAW_INSN(code, rd, 0, is_signed, divs[i]));
+				ST_OUT(b, k, 0, rc, rd);
+				batch_expect(b, k, 0, div_result(op, flags, divs[i], n[j]));
+			}
+		}
+	}
+	batch_flush(b);
+}
+
+static void test_div_const(void)
+{
+	struct batch b;
+	int f;
+
+	if (!batch_init(&b))
+		return;
+	for (f = 0; f < 2; f++) {
+		div_const(&b, BPF_DIV, f ? F_ALU32 : 0);
+		div_const(&b, BPF_MOD, f ? F_ALU32 : 0);
+		div_const(&b, BPF_DIV, F_SIGNED | (f ? F_ALU32 : 0));
+		div_const(&b, BPF_MOD, F_SIGNED | (f ? F_ALU32 : 0));
+	}
+	batch_fini(&b);
+}
+
+/* ALU operations for all combinations of operand registers */
+static void alu_reg_pairs(struct batch *b, int op, __u32 flags)
+{
+	bool alu32 = flags & F_ALU32;
+	__u64 dst, src, res, same;
+	int rd, rs, rc, k;
+
+	if (flags & F_SIGNED)
+		dst = alu32 ? (__u64)-76543210LL : (__u64)-7654321076543210LL;
+	else
+		dst = alu32 ? 0x76543210ULL : 0x7edcba9876543210ULL;
+	src = alu32 ? 0x01234567ULL : 0x0123456789abcdefULL;
+	if (op == BPF_LSH || op == BPF_RSH || op == BPF_ARSH)
+		src &= 31;
+	alu_result(&res, dst, src, op, flags);
+	alu_result(&same, src, src, op, flags);
+	if (alu32) {
+		res = (__u32)res;
+		same = (__u32)same;
+	}
+
+	snprintf(b->desc, sizeof(b->desc), "alu%d_%s%s_x register pairs", alu32 ? 32 : 64,
+		 flags & F_SIGNED ? "s" : "", alu_name(op));
+	for (rd = BPF_REG_0; rd <= BPF_REG_9; rd++) {
+		for (rs = BPF_REG_0; rs <= BPF_REG_9; rs++) {
+			rc = scratch_reg(rd, rs);
+			k = batch_case(b, rc, rd == rs ? src : dst, src);
+			LD_IN(b, k, 0, rc, rd);
+			if (rs != rd)
+				LD_IN(b, k, 1, rc, rs);
+			EMIT(b, BPF_RAW_INSN((alu32 ? BPF_ALU : BPF_ALU64) | BPF_OP(op) | BPF_X,
+					     rd, rs, flags & F_SIGNED ? 1 : 0, 0));
+			ST_OUT(b, k, 0, rc, rd);
+			batch_expect(b, k, 0, rd == rs ? same : res);
+		}
+	}
+	batch_flush(b);
+}
+
+static void test_alu_reg_pairs(void)
+{
+	struct batch b;
+	int o, f;
+
+	if (!batch_init(&b))
+		return;
+	for (f = 0; f < 2; f++) {
+		for (o = 0; o < ARRAY_SIZE(alu_reg_ops); o++)
+			alu_reg_pairs(&b, alu_reg_ops[o], f ? F_ALU32 : 0);
+		alu_reg_pairs(&b, BPF_DIV, F_SIGNED | (f ? F_ALU32 : 0));
+		alu_reg_pairs(&b, BPF_MOD, F_SIGNED | (f ? F_ALU32 : 0));
+	}
+	batch_fini(&b);
+}
+
+/* Shifts for all shift counts, by immediate, by register and by the shifted register */
+static void test_shifts(void)
+{
+	static const __s64 vals[] = {
+		0x0123456789abcdefLL, /* dword > 0, word < 0 */
+		0xfedcba9876543210LL, /* dword < 0, word > 0 */
+		0xfedcba0198765432LL, /* dword < 0, word < 0 */
+		0x0123458967abcdefLL, /* dword > 0, word > 0 */
+	};
+	static const int ops[] = { BPF_LSH, BPF_RSH, BPF_ARSH };
+	struct batch b;
+	int o, f, v, imm, k;
+
+	if (!batch_init(&b))
+		return;
+	for (f = 0; f < 2; f++) {
+		int bits = f ? 32 : 64;
+
+		for (o = 0; o < ARRAY_SIZE(ops); o++) {
+			int op = ops[o];
+
+			snprintf(b.desc, sizeof(b.desc), "alu%d_%s all shift counts", bits,
+				 alu_name(op));
+			for (v = 0; v < ARRAY_SIZE(vals); v++) {
+				for (imm = 0; imm < bits; imm++) {
+					__u64 reg = vals[v], res;
+
+					if (f)
+						reg = op == BPF_ARSH ? (__u64)(__s32)reg :
+						      (__u32)reg;
+					alu_result(&res, reg, imm, op, 0);
+					if (f)
+						res = (__u32)res;
+
+					k = batch_case(&b, BPF_REG_3, vals[v], imm);
+					LD_IN(&b, k, 0, BPF_REG_3, BPF_REG_1);
+					if (f)
+						EMIT(&b, BPF_ALU32_IMM(op, BPF_REG_1, imm));
+					else
+						EMIT(&b, BPF_ALU64_IMM(op, BPF_REG_1, imm));
+					ST_OUT(&b, k, 0, BPF_REG_3, BPF_REG_1);
+					batch_expect(&b, k, 0, res);
+
+					k = batch_case(&b, BPF_REG_3, vals[v], imm);
+					LD_IN(&b, k, 0, BPF_REG_3, BPF_REG_1);
+					LD_IN(&b, k, 1, BPF_REG_3, BPF_REG_2);
+					if (f)
+						EMIT(&b, BPF_ALU32_REG(op, BPF_REG_1, BPF_REG_2));
+					else
+						EMIT(&b, BPF_ALU64_REG(op, BPF_REG_1, BPF_REG_2));
+					ST_OUT(&b, k, 0, BPF_REG_3, BPF_REG_1);
+					batch_expect(&b, k, 0, res);
+				}
+			}
+			/* The count in the shifted register */
+			for (imm = 0; imm < bits; imm++) {
+				__u64 res;
+
+				alu_result(&res, imm, imm, op, 0);
+				k = batch_case(&b, BPF_REG_3, imm, 0);
+				LD_IN(&b, k, 0, BPF_REG_3, BPF_REG_1);
+				if (f)
+					EMIT(&b, BPF_ALU32_REG(op, BPF_REG_1, BPF_REG_1));
+				else
+					EMIT(&b, BPF_ALU64_REG(op, BPF_REG_1, BPF_REG_1));
+				ST_OUT(&b, k, 0, BPF_REG_3, BPF_REG_1);
+				batch_expect(&b, k, 0, f ? (__u32)res : res);
+			}
+			batch_flush(&b);
+		}
+	}
+	batch_fini(&b);
+}
+
+/* Atomic operations on the stack for all magnitudes of memory and source operand */
+static const int atomic_ops[] = {
+	BPF_ADD, BPF_AND, BPF_OR, BPF_XOR,
+	BPF_ADD | BPF_FETCH, BPF_AND | BPF_FETCH, BPF_OR | BPF_FETCH, BPF_XOR | BPF_FETCH,
+	BPF_XCHG,
+};
+
+struct atomic_arg {
+	int op;
+	int size;
+};
+
+static void emit_atomic(struct batch *b, void *arg, __s64 dst, __s64 src)
+{
+	struct atomic_arg *a = arg;
+	bool w = a->size == BPF_W;
+	__u64 keep = 0x0123456789abcdefULL, res, fetch;
+	int k;
+
+	if (a->op == BPF_XCHG)
+		res = src;
+	else
+		alu_result(&res, w ? (__u32)dst : dst, w ? (__u32)src : src, BPF_OP(a->op), 0);
+	/* The source register gets the old value with fetch, keeps its own without */
+	fetch = a->op & BPF_FETCH ? (w ? (__u32)dst : dst) : src;
+
+	k = batch_case(b, BPF_REG_3, dst, src);
+	LD_IN(b, k, 0, BPF_REG_3, BPF_REG_1);
+	EMIT(b, BPF_STX_MEM(a->size, BPF_REG_10, BPF_REG_1, MEM_SLOT));
+	LD_IN(b, k, 1, BPF_REG_3, BPF_REG_2);
+	emit_ld_imm64(b, BPF_REG_0, keep);
+	EMIT(b, BPF_ATOMIC_OP(a->size, a->op, BPF_REG_10, BPF_REG_2, MEM_SLOT));
+	EMIT(b, BPF_LDX_MEM(a->size, BPF_REG_1, BPF_REG_10, MEM_SLOT));
+	ST_OUT(b, k, 0, BPF_REG_3, BPF_REG_1);
+	ST_OUT(b, k, 1, BPF_REG_3, BPF_REG_2);
+	ST_OUT(b, k, 2, BPF_REG_3, BPF_REG_0);
+	batch_expect(b, k, 0, w ? (__u32)res : res);
+	batch_expect(b, k, 1, fetch);
+	batch_expect(b, k, 2, keep);
+}
+
+static void emit_cmpxchg(struct batch *b, void *arg, __s64 dst, __s64 src)
+{
+	int size = *(int *)arg;
+	bool w = size == BPF_W;
+	__u64 old = w ? (__u32)dst : dst;
+	int k;
+
+	k = batch_case(b, BPF_REG_3, dst, src);
+	LD_IN(b, k, 0, BPF_REG_3, BPF_REG_1);
+	EMIT(b, BPF_STX_MEM(size, BPF_REG_10, BPF_REG_1, MEM_SLOT));
+	LD_IN(b, k, 1, BPF_REG_3, BPF_REG_2);
+	/* Mismatch: the memory keeps its value, r0 gets it */
+	EMIT(b, BPF_MOV64_REG(BPF_REG_0, BPF_REG_1));
+	EMIT(b, BPF_ALU64_IMM(BPF_XOR, BPF_REG_0, -1));
+	EMIT(b, BPF_ATOMIC_OP(size, BPF_CMPXCHG, BPF_REG_10, BPF_REG_2, MEM_SLOT));
+	ST_OUT(b, k, 0, BPF_REG_3, BPF_REG_0);
+	/* Match: the memory gets the source, r0 the old value */
+	EMIT(b, BPF_ATOMIC_OP(size, BPF_CMPXCHG, BPF_REG_10, BPF_REG_2, MEM_SLOT));
+	EMIT(b, BPF_LDX_MEM(size, BPF_REG_1, BPF_REG_10, MEM_SLOT));
+	ST_OUT(b, k, 1, BPF_REG_3, BPF_REG_1);
+	ST_OUT(b, k, 2, BPF_REG_3, BPF_REG_0);
+	batch_expect(b, k, 0, old);
+	batch_expect(b, k, 1, w ? (__u32)src : src);
+	batch_expect(b, k, 2, old);
+}
+
+static void test_atomics(void)
+{
+	static const int sizes[] = { BPF_DW, BPF_W };
+	struct batch b;
+	int o, s;
+
+	if (!batch_init(&b))
+		return;
+	for (s = 0; s < ARRAY_SIZE(sizes); s++) {
+		int size = sizes[s];
+
+		for (o = 0; o < ARRAY_SIZE(atomic_ops); o++) {
+			struct atomic_arg a = { atomic_ops[o], size };
+
+			snprintf(b.desc, sizeof(b.desc), "atomic%d_%s%s magnitudes",
+				 size == BPF_DW ? 64 : 32, alu_name(a.op),
+				 a.op == BPF_XCHG ? "" : a.op & BPF_FETCH ? "_fetch" : "");
+			fill_pattern(&b, &a, 64, 64, 0, 1, PATTERN_BLOCK2, emit_atomic);
+		}
+		snprintf(b.desc, sizeof(b.desc), "atomic%d_cmpxchg magnitudes",
+			 size == BPF_DW ? 64 : 32);
+		fill_pattern(&b, &size, 64, 64, 0, 1, PATTERN_BLOCK2, emit_cmpxchg);
+	}
+	batch_fini(&b);
+}
+
+/* Atomic operations for all combinations of pointer and source register */
+static void atomic_reg_pairs(struct batch *b, int size, int op)
+{
+	bool w = size == BPF_W;
+	__u64 mem, upd;
+	int rd, rs, rc, k, n;
+
+	if (w) {
+		mem = 0x01234567U;
+		upd = 0x76543210U;
+	} else {
+		mem = 0x0123456789abcdefULL;
+		upd = 0xfedcba9876543210ULL;
+	}
+
+	snprintf(b->desc, sizeof(b->desc), "atomic%d_%s%s register pairs", w ? 32 : 64,
+		 alu_name(op), op == BPF_XCHG || op == BPF_CMPXCHG ? "" :
+		 op & BPF_FETCH ? "_fetch" : "");
+	for (rd = BPF_REG_0; rd <= BPF_REG_9; rd++) {
+		for (rs = BPF_REG_0; rs <= BPF_REG_9; rs++) {
+			__u64 regs[10], old = mem, new, src, cmp;
+
+			/* The source would be the pointer, r0 the compare value */
+			if (rs == rd || (op == BPF_CMPXCHG && rd == BPF_REG_0))
+				continue;
+			rc = scratch_reg(rd, rs);
+			k = batch_case(b, rc, mem, upd);
+			/* Memory from in0, r0 inverted, source from in1, pointer */
+			LD_IN(b, k, 0, rc, rs);
+			EMIT(b, BPF_STX_MEM(size, BPF_REG_10, rs, MEM_SLOT));
+			LD_IN(b, k, 0, rc, BPF_REG_0);
+			EMIT(b, BPF_ALU64_IMM(BPF_XOR, BPF_REG_0, -1));
+			LD_IN(b, k, 1, rc, rs);
+			EMIT(b, BPF_MOV64_REG(rd, BPF_REG_10));
+			EMIT(b, BPF_ATOMIC_OP(size, op, rd, rs, MEM_SLOT));
+			/* r0 holds the pointer when it is the destination */
+			n = 0;
+			if (rd != BPF_REG_0)
+				ST_OUT(b, k, n++, rc, BPF_REG_0);
+			ST_OUT(b, k, n++, rc, rs);
+			EMIT(b, BPF_LDX_MEM(size, rs, BPF_REG_10, MEM_SLOT));
+			ST_OUT(b, k, n, rc, rs);
+
+			/* Model with the register aliasing of r0 */
+			regs[BPF_REG_0] = ~mem;
+			regs[rs] = upd;
+			src = w ? (__u32)regs[rs] : regs[rs];
+			if (op == BPF_XCHG) {
+				new = src;
+				regs[rs] = old;
+			} else if (op == BPF_CMPXCHG) {
+				cmp = w ? (__u32)regs[BPF_REG_0] : regs[BPF_REG_0];
+				new = cmp == old ? src : old;
+				regs[BPF_REG_0] = old;
+			} else {
+				alu_result(&new, old, src, BPF_OP(op), 0);
+				if (w)
+					new = (__u32)new;
+				if (op & BPF_FETCH)
+					regs[rs] = old;
+			}
+			n = 0;
+			if (rd != BPF_REG_0)
+				batch_expect(b, k, n++, regs[BPF_REG_0]);
+			batch_expect(b, k, n++, regs[rs]);
+			batch_expect(b, k, n, new);
+		}
+	}
+	batch_flush(b);
+}
+
+static void test_atomic_reg_pairs(void)
+{
+	static const int sizes[] = { BPF_DW, BPF_W };
+	struct batch b;
+	int o, s;
+
+	if (!batch_init(&b))
+		return;
+	for (s = 0; s < ARRAY_SIZE(sizes); s++) {
+		for (o = 0; o < ARRAY_SIZE(atomic_ops); o++)
+			atomic_reg_pairs(&b, sizes[s], atomic_ops[o]);
+		atomic_reg_pairs(&b, sizes[s], BPF_CMPXCHG);
+	}
+	batch_fini(&b);
+}
+
+/* A maximal chain of atomic adds on one stack slot */
+static void test_xadd_chain(void)
+{
+	static const int sizes[] = { BPF_DW, BPF_W };
+	LIBBPF_OPTS(bpf_test_run_opts, opts);
+	struct bpf_insn *insns;
+	int len = BPF_MAXINSNS, s, i, fd;
+
+	insns = malloc(len * sizeof(*insns));
+	if (!ASSERT_OK_PTR(insns, "insns"))
+		return;
+	for (s = 0; s < ARRAY_SIZE(sizes); s++) {
+		insns[0] = BPF_MOV32_IMM(BPF_REG_0, 1);
+		insns[1] = BPF_ST_MEM(sizes[s], BPF_REG_10, -40, 42);
+		for (i = 2; i < len - 2; i++)
+			insns[i] = BPF_STX_XADD(sizes[s], BPF_REG_10, BPF_REG_0, -40);
+		insns[len - 2] = BPF_LDX_MEM(sizes[s], BPF_REG_0, BPF_REG_10, -40);
+		insns[len - 1] = BPF_EXIT_INSN();
+
+		fd = load_prog(insns, len, "xadd chain");
+		if (fd < 0)
+			break;
+		if (ASSERT_OK(bpf_prog_test_run_opts(fd, &opts), "xadd chain run"))
+			ASSERT_EQ(opts.retval, 42 + len - 4, "xadd chain result");
+		close(fd);
+	}
+	free(insns);
+}
+
+/* 64-bit immediate loads for all magnitudes and byte patterns */
+static void ld_imm64_case(struct batch *b, __u64 imm)
+{
+	int k = batch_case(b, BPF_REG_3, imm, 0);
+
+	emit_ld_imm64(b, BPF_REG_1, imm);
+	ST_OUT(b, k, 0, BPF_REG_3, BPF_REG_1);
+	batch_expect(b, k, 0, imm);
+}
+
+static void test_ld_imm64(void)
+{
+	static const struct {
+		__u8 base1, mask1, base2, mask2;
+	} bytes[] = {
+		{ 0, 0xff, 0xff, 0xff },	/* checker */
+		{ 1, 0x81, 0x80, 0x80 },	/* positive and negative */
+		{ 1, 0x81, 0, 0xff },		/* positive and zero */
+		{ 0x80, 0x80, 0, 0xff },	/* negative and zero */
+	};
+	int block = 64, bit, adj, sign, p, pattern, index;
+	struct batch b;
+
+	if (!batch_init(&b))
+		return;
+	snprintf(b.desc, sizeof(b.desc), "ld_imm64 magnitudes");
+	for (bit = 0; bit <= 62; bit++)
+		for (adj = -block / 2; adj < block / 2; adj++)
+			for (sign = -1; sign <= 1; sign += 2)
+				ld_imm64_case(&b, sign * ((1LL << bit) + adj));
+	batch_flush(&b);
+
+	for (p = 0; p < ARRAY_SIZE(bytes); p++) {
+		__u32 rand = 1;
+
+		snprintf(b.desc, sizeof(b.desc), "ld_imm64 byte pattern %d", p);
+		for (pattern = 0; pattern < 256; pattern++) {
+			__u64 imm = 0;
+
+			for (index = 0; index < 8; index++) {
+				int byte;
+
+				if (pattern & (1 << index))
+					byte = (bytes[p].base1 & bytes[p].mask1) |
+					       (rand & ~bytes[p].mask1);
+				else
+					byte = (bytes[p].base2 & bytes[p].mask2) |
+					       (rand & ~bytes[p].mask2);
+				imm = (imm << 8) | (__u8)byte;
+			}
+			rand = rand * 1664525 + 1013904223;
+			ld_imm64_case(&b, imm);
+		}
+		batch_flush(&b);
+	}
+	batch_fini(&b);
+}
+
+/* Conditional jumps with an immediate and with a register for all magnitudes */
+static const int jmp_ops[] = {
+	BPF_JSET, BPF_JEQ, BPF_JNE, BPF_JGT, BPF_JGE, BPF_JLT, BPF_JLE,
+	BPF_JSGT, BPF_JSGE, BPF_JSLT, BPF_JSLE,
+};
+
+static bool jmp_match(__s64 v1, __s64 v2, __u8 op)
+{
+	switch (op) {
+	case BPF_JSET:
+		return !!(v1 & v2);
+	case BPF_JEQ:
+		return v1 == v2;
+	case BPF_JNE:
+		return v1 != v2;
+	case BPF_JGT:
+		return (__u64)v1 > (__u64)v2;
+	case BPF_JGE:
+		return (__u64)v1 >= (__u64)v2;
+	case BPF_JLT:
+		return (__u64)v1 < (__u64)v2;
+	case BPF_JLE:
+		return (__u64)v1 <= (__u64)v2;
+	case BPF_JSGT:
+		return v1 > v2;
+	case BPF_JSGE:
+		return v1 >= v2;
+	case BPF_JSLT:
+		return v1 < v2;
+	case BPF_JSLE:
+		return v1 <= v2;
+	}
+	return false;
+}
+
+struct jmp_arg {
+	int op;
+	bool is32;
+	bool reg;
+};
+
+static void emit_jmp(struct batch *b, void *arg, __s64 dst, __s64 src)
+{
+	struct jmp_arg *a = arg;
+	bool match;
+	int k;
+
+	if (a->is32)
+		match = jmp_match((__s32)dst, (__s32)src, a->op);
+	else
+		match = jmp_match(dst, a->reg ? src : (__s32)src, a->op);
+
+	k = batch_case(b, BPF_REG_3, dst, src);
+	LD_IN(b, k, 0, BPF_REG_3, BPF_REG_1);
+	if (a->reg)
+		LD_IN(b, k, 1, BPF_REG_3, BPF_REG_2);
+	EMIT(b, BPF_MOV64_IMM(BPF_REG_4, 1));
+	if (a->reg && a->is32)
+		EMIT(b, BPF_JMP32_REG(a->op, BPF_REG_1, BPF_REG_2, 1));
+	else if (a->reg)
+		EMIT(b, BPF_JMP_REG(a->op, BPF_REG_1, BPF_REG_2, 1));
+	else if (a->is32)
+		EMIT(b, BPF_JMP32_IMM(a->op, BPF_REG_1, src, 1));
+	else
+		EMIT(b, BPF_JMP_IMM(a->op, BPF_REG_1, src, 1));
+	EMIT(b, BPF_MOV64_IMM(BPF_REG_4, 0));
+	ST_OUT(b, k, 0, BPF_REG_3, BPF_REG_4);
+	batch_expect(b, k, 0, match);
+}
+
+static void test_jmp_magnitudes(bool reg)
+{
+	struct batch b;
+	int o, f;
+
+	if (!batch_init(&b))
+		return;
+	for (f = 0; f < 2; f++) {
+		for (o = 0; o < ARRAY_SIZE(jmp_ops); o++) {
+			struct jmp_arg a = { jmp_ops[o], f, reg };
+
+			snprintf(b.desc, sizeof(b.desc), "jmp%s_%s_%c magnitudes", f ? "32" : "",
+				 jmp_name(a.op), reg ? 'x' : 'k');
+			if (reg)
+				fill_pattern(&b, &a, 64, 64, 0, 1, PATTERN_BLOCK2, emit_jmp);
+			else
+				fill_pattern(&b, &a, 64, 32, PATTERN_BLOCK1, 8, PATTERN_BLOCK2,
+					     emit_jmp);
+		}
+	}
+	batch_fini(&b);
+}
+
+static void test_jmp_imm(void)
+{
+	test_jmp_magnitudes(false);
+}
+
+static void test_jmp_reg(void)
+{
+	test_jmp_magnitudes(true);
+}
+
+/* A conditional jump on two registers, with the operands swapped for n == 1 */
+static void jmp_reg_pair(struct batch *b, bool is32, int op, int rd, int rs, int n)
+{
+	const __u64 a = 0x7edcba9876543210ULL, c = 0x0123456789abcdefULL;
+	__u64 v1 = n ? c : a, v2 = n ? a : c;
+	int rc, rt, k;
+	bool match;
+
+	/* Two scratch registers besides the operands */
+	rc = scratch_reg(rd, rs);
+	for (rt = BPF_REG_1; rt < BPF_REG_9; rt++)
+		if (rt != rd && rt != rs && rt != rc)
+			break;
+	if (rd == rs)
+		v2 = v1;
+	match = is32 ? jmp_match((__s32)v1, (__s32)v2, op) : jmp_match(v1, v2, op);
+
+	k = batch_case(b, rc, v1, v2);
+	LD_IN(b, k, 0, rc, rd);
+	if (rs != rd)
+		LD_IN(b, k, 1, rc, rs);
+	EMIT(b, BPF_MOV64_IMM(rt, 1));
+	if (is32)
+		EMIT(b, BPF_JMP32_REG(op, rd, rs, 1));
+	else
+		EMIT(b, BPF_JMP_REG(op, rd, rs, 1));
+	EMIT(b, BPF_MOV64_IMM(rt, 0));
+	ST_OUT(b, k, 0, rc, rt);
+	batch_expect(b, k, 0, match);
+}
+
+/* Conditional jumps for all combinations of operand registers, taken and not */
+static void test_jmp_reg_pairs(void)
+{
+	struct batch b;
+	int o, f, rd, rs, n;
+
+	if (!batch_init(&b))
+		return;
+	for (f = 0; f < 2; f++) {
+		for (o = 0; o < ARRAY_SIZE(jmp_ops); o++) {
+			snprintf(b.desc, sizeof(b.desc), "jmp%s_%s_x register pairs",
+				 f ? "32" : "", jmp_name(jmp_ops[o]));
+			for (rd = BPF_REG_0; rd <= BPF_REG_9; rd++)
+				for (rs = BPF_REG_0; rs <= BPF_REG_9; rs++)
+					for (n = 0; n < 2; n++)
+						jmp_reg_pair(&b, f, jmp_ops[o], rd, rs, n);
+			batch_flush(&b);
+		}
+	}
+	batch_fini(&b);
+}
+
+/* The offset of a jump instruction, which the 32-bit unconditional jump keeps in imm */
+static void set_jmp_off(struct bpf_insn *insn, bool ja32, int off)
+{
+	if (ja32)
+		insn->imm = off;
+	else
+		insn->off = off;
+}
+
+static struct bpf_insn jmp_insn(bool ja32)
+{
+	return ja32 ? BPF_RAW_INSN(BPF_JMP32 | BPF_JA, 0, 0, 0, 0) : BPF_JMP_IMM(BPF_JA, 0, 0, 0);
+}
+
+/*
+ * Taken jumps over regions of doubling length, forward or backward, up to
+ * the maximal offset of the jump: 16 bits, or 2^17 for the 32-bit
+ * unconditional jump. The not taken path of a conditional jump and the
+ * guard of an unconditional one lead to an exit with the region number, so
+ * the verifier sees every instruction reachable and a jump landing anywhere
+ * else than on its target fails the run.
+ */
+static void staggered_jumps(const struct bpf_insn *jmp, __s64 r1, __s64 r2, bool backward,
+			    const char *desc)
+{
+	bool ja32 = BPF_CLASS(jmp->code) == BPF_JMP32 && BPF_OP(jmp->code) == BPF_JA;
+	bool ja = BPF_OP(jmp->code) == BPF_JA;
+	struct { __u64 r1, r2; } ctx = { r1, r2 };
+	LIBBPF_OPTS(bpf_test_run_opts, opts,
+		.ctx_in = &ctx,
+		.ctx_size_in = sizeof(ctx),
+	);
+	int max = ja32 ? 1 << 17 : INT16_MAX;
+	int len = 128 + 2 * max, i = 0, n = 0, gap, fd;
+	struct bpf_insn *insns;
+
+	insns = malloc(len * sizeof(*insns));
+	if (!ASSERT_OK_PTR(insns, "insns"))
+		return;
+	insns[i++] = BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_1, 8);
+	insns[i++] = BPF_LDX_MEM(BPF_DW, BPF_REG_1, BPF_REG_1, 0);
+	insns[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_0, 0);
+	for (gap = backward ? 4 : 2; gap <= max; gap = gap < max / 2 ? gap * 2 : max) {
+		int k, a, t, x, g, j;
+
+		if (backward) {
+			/*
+			 * Over the region to its guard and jump, which comes back
+			 * to the start of the region, from where it leads on to
+			 * the next one.
+			 */
+			a = i++;
+			t = i;
+			for (k = 0; k < gap - 3; k++)
+				insns[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_3, 0);
+			x = i++;
+			g = i;
+			if (ja)
+				insns[i++] = BPF_JMP_IMM(BPF_JEQ, BPF_REG_2, 0, 1);
+			j = i;
+			insns[i] = *jmp;
+			set_jmp_off(&insns[i++], ja32, t - (j + 1));
+			insns[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_0, ++n);
+			insns[i++] = BPF_EXIT_INSN();
+			insns[a] = jmp_insn(ja32);
+			set_jmp_off(&insns[a], ja32, g - (a + 1));
+			insns[x] = jmp_insn(ja32);
+			set_jmp_off(&insns[x], ja32, i - (x + 1));
+		} else {
+			/* An unconditional jump needs a way into its region */
+			if (ja)
+				insns[i++] = BPF_JMP_IMM(BPF_JEQ, BPF_REG_2, 0, 1);
+			insns[i] = *jmp;
+			set_jmp_off(&insns[i++], ja32, gap);
+			insns[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_0, ++n);
+			for (k = 0; k < gap - 2; k++)
+				insns[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_3, 0);
+			insns[i++] = BPF_EXIT_INSN();
+		}
+		if (gap == max)
+			break;
+	}
+	insns[i++] = BPF_EXIT_INSN();
+	if (!ASSERT_LE(i, len, "insn count"))
+		goto out;
+
+	fd = load_prog(insns, i, desc);
+	if (fd >= 0) {
+		if (ASSERT_OK(bpf_prog_test_run_opts(fd, &opts), desc))
+			ASSERT_EQ(opts.retval, 0, desc);
+		close(fd);
+	}
+out:
+	free(insns);
+}
+
+static void test_staggered_jumps(void)
+{
+	/* A representative set, with operands which make the jump taken */
+	static const struct {
+		const char *desc;
+		struct bpf_insn jmp;
+		__s64 r1, r2;
+	} kinds[] = {
+		{ "staggered ja",
+		  BPF_JMP_IMM(BPF_JA, 0, 0, 0), 0, 1 },
+		{ "staggered gotol",
+		  BPF_RAW_INSN(BPF_JMP32 | BPF_JA, 0, 0, 0, 0), 0, 1 },
+		{ "staggered jmp_jeq_k",
+		  BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 1234, 0), 1234, 0 },
+		{ "staggered jmp_jne_x",
+		  BPF_JMP_REG(BPF_JNE, BPF_REG_1, BPF_REG_2, 0), 4321, 1234 },
+		{ "staggered jmp_jset_k",
+		  BPF_JMP_IMM(BPF_JSET, BPF_REG_1, 0x82, 0), 0x86, 0 },
+		{ "staggered jmp_jsgt_x",
+		  BPF_JMP_REG(BPF_JSGT, BPF_REG_1, BPF_REG_2, 0), -1, -2 },
+		{ "staggered jmp32_jlt_k",
+		  BPF_JMP32_IMM(BPF_JLT, BPF_REG_1, 0x80000000, 0), 1234, 0 },
+		{ "staggered jmp32_jsge_x",
+		  BPF_JMP32_REG(BPF_JSGE, BPF_REG_1, BPF_REG_2, 0), -2, -2 },
+	};
+	char desc[64];
+	int i, d;
+
+	for (i = 0; i < ARRAY_SIZE(kinds); i++) {
+		for (d = 0; d < 2; d++) {
+			snprintf(desc, sizeof(desc), "%s %s", kinds[i].desc,
+				 d ? "backward" : "forward");
+			staggered_jumps(&kinds[i].jmp, kinds[i].r1, kinds[i].r2, d, desc);
+		}
+	}
+}
+
+/*
+ * The pattern sweeps: one program per pattern and register choice, run
+ * once per input with the operands in the ctx and the result handed back
+ * through it.
+ */
+struct pat_ctx {
+	__u64 in0;
+	__u64 in1;
+	__u64 res;
+};
+
+#define IN0	offsetof(struct pat_ctx, in0)
+#define IN1	offsetof(struct pat_ctx, in1)
+#define RES	offsetof(struct pat_ctx, res)
+
+/* r6 holds the ctx */
+static const int pat_regs[] = {
+	BPF_REG_0, BPF_REG_1, BPF_REG_2, BPF_REG_3, BPF_REG_4,
+	BPF_REG_5, BPF_REG_7, BPF_REG_8, BPF_REG_9,
+};
+
+/* The second register of a pattern: the same one, the next and a far one */
+#define NR_PAIRS 3
+static const int pair_off[NR_PAIRS] = { 0, 1, 5 };
+
+static int pair_reg(int i, int k)
+{
+	return pat_regs[(i + pair_off[k]) % ARRAY_SIZE(pat_regs)];
+}
+
+static const __u64 inputs[] = {
+	0, 0x1122334455667788ULL, 0xfedcba9876543210ULL, 0x80, 0xffffffffffffff7fULL,
+};
+
+struct prog {
+	struct bpf_insn insns[16];
+	int cnt;
+};
+
+static void prog_start(struct prog *p)
+{
+	p->cnt = 0;
+	EMIT(p, BPF_MOV64_REG(BPF_REG_6, BPF_REG_1));
+}
+
+/* Hand the result in reg back and return */
+static void prog_end(struct prog *p, int reg)
+{
+	EMIT(p, BPF_STX_MEM(BPF_DW, BPF_REG_6, reg, RES));
+	EMIT(p, BPF_MOV64_IMM(BPF_REG_0, 0));
+	EMIT(p, BPF_EXIT_INSN());
+}
+
+static int prog_load(struct prog *p, const char *desc)
+{
+	LIBBPF_OPTS(bpf_prog_load_opts, lopts,
+		.prog_flags = BPF_F_SLEEPABLE,
+		.log_buf = log,
+		.log_size = sizeof(log),
+	);
+	int fd;
+
+	fd = bpf_prog_load(BPF_PROG_TYPE_SYSCALL, NULL, "GPL", p->insns, p->cnt, &lopts);
+	if (!ASSERT_GE(fd, 0, desc))
+		fprintf(stderr, "%s", log);
+	return fd;
+}
+
+static void prog_run(int fd, __u64 in0, __u64 in1, __u64 expected, const char *desc)
+{
+	struct pat_ctx ctx = { .in0 = in0, .in1 = in1 };
+	LIBBPF_OPTS(bpf_test_run_opts, opts,
+		.ctx_in = &ctx,
+		.ctx_size_in = sizeof(ctx),
+	);
+	char buf[128];
+
+	snprintf(buf, sizeof(buf), "%s in0=0x%llx in1=0x%llx", desc, in0, in1);
+	if (ASSERT_OK(bpf_prog_test_run_opts(fd, &opts), buf))
+		ASSERT_EQ(ctx.res, expected, buf);
+}
+
+static int size_bits(int size)
+{
+	switch (size) {
+	case BPF_B:
+		return 8;
+	case BPF_H:
+		return 16;
+	case BPF_W:
+		return 32;
+	default:
+		return 64;
+	}
+}
+
+/* The first size bytes of v in memory, as a load of that size reads them */
+static __u64 head_bytes(__u64 v, int size)
+{
+	int bits = size_bits(size);
+
+	if (bits == 64)
+		return v;
+#if __BYTE_ORDER == __BIG_ENDIAN
+	return v >> (64 - bits);
+#else
+	return v & ((1ULL << bits) - 1);
+#endif
+}
+
+/* v with its first size bytes in memory replaced by those of w */
+static __u64 head_merge(__u64 v, __u64 w, int size)
+{
+	int bits = size_bits(size);
+	__u64 mask;
+
+	if (bits == 64)
+		return w;
+	mask = (1ULL << bits) - 1;
+#if __BYTE_ORDER == __BIG_ENDIAN
+	return (v & ~(mask << (64 - bits))) | ((w & mask) << (64 - bits));
+#else
+	return (v & ~mask) | (w & mask);
+#endif
+}
+
+static void test_ldst_zero_off(void)
+{
+	static const int sizes[] = { BPF_B, BPF_H, BPF_W, BPF_DW };
+	static const int aops[] = {
+		BPF_ADD, BPF_ADD | BPF_FETCH, BPF_OR, BPF_XCHG, BPF_CMPXCHG,
+	};
+	static const __s32 imms[] = { 0x5a, -1 };
+	struct prog p;
+	char desc[64];
+	int b, k, s, j, fd;
+
+	for (b = 0; b < ARRAY_SIZE(pat_regs); b++) {
+		int rb = pat_regs[b];
+
+		for (s = 0; s < ARRAY_SIZE(sizes); s++) {
+			int size = sizes[s];
+
+			for (k = 0; k < NR_PAIRS; k++) {
+				int rd = pair_reg(b, k);
+
+				/* Load with a zero offset, also into the base */
+				prog_start(&p);
+				EMIT(&p, BPF_MOV64_REG(rb, BPF_REG_6));
+				EMIT(&p, BPF_LDX_MEM(size, rd, rb, 0));
+				prog_end(&p, rd);
+				snprintf(desc, sizeof(desc), "ldx size=%d base=r%d dst=r%d",
+					 size, rb, rd);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				for (j = 0; j < ARRAY_SIZE(inputs); j++)
+					prog_run(fd, inputs[j], 0,
+						 head_bytes(inputs[j], size), desc);
+				close(fd);
+
+				/* Sign extending load with a zero offset from the stack */
+				if (size != BPF_DW) {
+					prog_start(&p);
+					EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));
+					EMIT(&p, BPF_STX_MEM(BPF_DW, BPF_REG_10, rd, -8));
+					EMIT(&p, BPF_MOV64_REG(rb, BPF_REG_10));
+					EMIT(&p, BPF_ALU64_IMM(BPF_ADD, rb, -8));
+					EMIT(&p, BPF_RAW_INSN(BPF_LDX | BPF_MEMSX | size,
+							      rd, rb, 0, 0));
+					prog_end(&p, rd);
+					snprintf(desc, sizeof(desc),
+						 "ldsx size=%d base=r%d dst=r%d", size, rb, rd);
+					fd = prog_load(&p, desc);
+					if (fd < 0)
+						return;
+					for (j = 0; j < ARRAY_SIZE(inputs); j++) {
+						__s64 v = head_bytes(inputs[j], size);
+
+						v = size == BPF_B ? (__s8)v :
+						    size == BPF_H ? (__s16)v : (__s32)v;
+						prog_run(fd, inputs[j], 0, v, desc);
+					}
+					close(fd);
+				}
+
+				if (rd == rb)
+					continue;
+				/* Store with a zero offset over in0 */
+				prog_start(&p);
+				EMIT(&p, BPF_MOV64_REG(rb, BPF_REG_6));
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN1));
+				EMIT(&p, BPF_STX_MEM(size, rb, rd, 0));
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));
+				prog_end(&p, rd);
+				snprintf(desc, sizeof(desc), "stx size=%d base=r%d src=r%d",
+					 size, rb, rd);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				for (j = 0; j < ARRAY_SIZE(inputs); j++) {
+					__u64 in1 = inputs[(j + 1) % ARRAY_SIZE(inputs)];
+
+					prog_run(fd, inputs[j], in1,
+						 head_merge(inputs[j], in1, size), desc);
+				}
+				close(fd);
+			}
+
+			/* Store an immediate with a zero offset into a zeroed stack slot */
+			for (k = 0; k < ARRAY_SIZE(imms); k++) {
+				int rd = pair_reg(b, 1);
+
+				prog_start(&p);
+				EMIT(&p, BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0));
+				EMIT(&p, BPF_MOV64_REG(rb, BPF_REG_10));
+				EMIT(&p, BPF_ALU64_IMM(BPF_ADD, rb, -8));
+				EMIT(&p, BPF_ST_MEM(size, rb, 0, imms[k]));
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_10, -8));
+				prog_end(&p, rd);
+				snprintf(desc, sizeof(desc), "st size=%d base=r%d imm=%d",
+					 size, rb, imms[k]);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				prog_run(fd, 0, 0,
+					 head_merge(0, (__u64)(__s64)imms[k], size), desc);
+				close(fd);
+			}
+
+			/* Atomics with a zero offset on a stack slot holding in0 */
+			for (k = 0; k < ARRAY_SIZE(aops); k++) {
+				int rd = pair_reg(b, 1), op = aops[k];
+
+				if (size == BPF_B || size == BPF_H)
+					break;
+				/* cmpxchg compares with r0 */
+				if (op == BPF_CMPXCHG && (rb == BPF_REG_0 || rd == BPF_REG_0))
+					continue;
+				prog_start(&p);
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));
+				EMIT(&p, BPF_STX_MEM(BPF_DW, BPF_REG_10, rd, -8));
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN1));
+				EMIT(&p, BPF_MOV64_REG(rb, BPF_REG_10));
+				EMIT(&p, BPF_ALU64_IMM(BPF_ADD, rb, -8));
+				if (op == BPF_CMPXCHG)
+					EMIT(&p, BPF_LDX_MEM(size, BPF_REG_0, BPF_REG_10, -8));
+				EMIT(&p, BPF_ATOMIC_OP(size, op, rb, rd, 0));
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_10, -8));
+				prog_end(&p, rd);
+				snprintf(desc, sizeof(desc), "atomic 0x%x size=%d base=r%d src=r%d",
+					 op, size, rb, rd);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				for (j = 0; j < ARRAY_SIZE(inputs); j++) {
+					__u64 in1 = inputs[(j + 1) % ARRAY_SIZE(inputs)];
+					__u64 v = head_bytes(inputs[j], size);
+					/* The source is the low half, whichever the byte order */
+					__u64 w = size == BPF_W ? (__u32)in1 : in1;
+					__u64 r = BPF_OP(op) == BPF_ADD ? v + w :
+						  BPF_OP(op) == BPF_OR ? v | w : w;
+
+					prog_run(fd, inputs[j], in1,
+						 head_merge(inputs[j], r, size), desc);
+				}
+				close(fd);
+			}
+		}
+	}
+}
+
+/*
+ * Loads, stores and stores of an immediate with the offsets around the
+ * limits of the short displacement forms, negative, large and unaligned
+ * ones, with every register as base. The memory is an array map value with
+ * the base register pointing at its middle, the loads hand their results
+ * back through a second value and the stores are checked against a copy
+ * kept here. The unaligned offsets are left out where the verifier insists
+ * on aligned accesses.
+ */
+#define MEM_SIZE	65536
+#define MEM_BASE	(MEM_SIZE / 2)
+#define MEM_KEY		0
+#define RES_KEY		1
+#define SLOT_KEY	-4	/* stack slots: map key, results and base pointer */
+#define SLOT_RES	-16
+#define SLOT_BASE	-24
+#define STORE_VAL	0x8899aabbccddeeffULL
+
+struct off_prog {
+	struct bpf_insn insns[128];
+	int cnt;
+};
+
+/* The map holding the memory and the results, a copy of the memory and a buffer */
+struct off_mem {
+	int map_fd;
+	__u8 *mem, *exp, *res;
+};
+
+enum { K_LDX, K_LDSX, K_STX, K_ST };
+
+/* The offsets for an access of size, aligned unless unaligned ones are ok */
+static int offsets_for(int size, bool unaligned, int *off)
+{
+	int n = size_bits(size) / 8, cnt = 0;
+
+	off[cnt++] = n;
+	off[cnt++] = 128 - n;
+	off[cnt++] = 128;
+	off[cnt++] = 256 - n;
+	off[cnt++] = 256;
+	off[cnt++] = 4096;
+	off[cnt++] = MEM_BASE - n;
+	off[cnt++] = -n;
+	off[cnt++] = -128;
+	off[cnt++] = -128 - n;
+	off[cnt++] = -256;
+	off[cnt++] = -4096;
+	off[cnt++] = -MEM_BASE;
+	if (n > 1 && unaligned) {
+		off[cnt++] = 13;
+		off[cnt++] = 127;
+		off[cnt++] = -13;
+		off[cnt++] = -129;
+	}
+	return cnt;
+}
+
+/* The bytes a store of size writes from the register value v */
+static void store_bytes(__u8 *dst, __u64 v, int size)
+{
+	int n = size_bits(size) / 8;
+
+#if __BYTE_ORDER == __BIG_ENDIAN
+	memcpy(dst, (__u8 *)&v + 8 - n, n);
+#else
+	memcpy(dst, &v, n);
+#endif
+}
+
+/* The value a load of size reads from the bytes at src */
+static __u64 load_bytes(const __u8 *src, int size)
+{
+	__u64 v = 0;
+
+	memcpy(&v, src, size_bits(size) / 8);
+	return head_bytes(v, size);
+}
+
+/* A register that is neither of the two given ones */
+static int other_reg(int r1, int r2)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(pat_regs); i++)
+		if (pat_regs[i] != r1 && pat_regs[i] != r2)
+			return pat_regs[i];
+	return BPF_REG_9;
+}
+
+/* Look up the value of key into r0, exit with 1 when the lookup fails */
+static void off_prog_lookup(struct off_prog *p, int map_fd, int key)
+{
+	EMIT(p, BPF_ST_MEM(BPF_W, BPF_REG_10, SLOT_KEY, key));
+	EMIT(p, BPF_RAW_INSN(BPF_LD | BPF_DW | BPF_IMM, BPF_REG_1, BPF_PSEUDO_MAP_FD, 0, map_fd));
+	EMIT(p, BPF_RAW_INSN(0, 0, 0, 0, 0));
+	EMIT(p, BPF_MOV64_REG(BPF_REG_2, BPF_REG_10));
+	EMIT(p, BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, SLOT_KEY));
+	EMIT(p, BPF_EMIT_CALL(BPF_FUNC_map_lookup_elem));
+	EMIT(p, BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 2));
+	EMIT(p, BPF_MOV64_IMM(BPF_REG_0, 1));
+	EMIT(p, BPF_EXIT_INSN());
+}
+
+/* rb points at the middle of the memory, the results value is spilled */
+static void off_prog_start(struct off_prog *p, int map_fd, int rb)
+{
+	p->cnt = 0;
+	off_prog_lookup(p, map_fd, RES_KEY);
+	EMIT(p, BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_0, SLOT_RES));
+	off_prog_lookup(p, map_fd, MEM_KEY);
+	EMIT(p, BPF_ALU64_IMM(BPF_ADD, BPF_REG_0, MEM_BASE));
+	EMIT(p, BPF_STX_MEM(BPF_DW, BPF_REG_10, BPF_REG_0, SLOT_BASE));
+	if (rb != BPF_REG_0)
+		EMIT(p, BPF_MOV64_REG(rb, BPF_REG_0));
+}
+
+static int off_prog_load(struct off_prog *p, const char *desc, bool quiet)
+{
+	LIBBPF_OPTS(bpf_prog_load_opts, lopts,
+		.prog_flags = BPF_F_SLEEPABLE,
+		.log_buf = log,
+		.log_size = sizeof(log),
+	);
+	int fd;
+
+	EMIT(p, BPF_MOV64_IMM(BPF_REG_0, 0));
+	EMIT(p, BPF_EXIT_INSN());
+	fd = bpf_prog_load(BPF_PROG_TYPE_SYSCALL, NULL, "GPL", p->insns, p->cnt, &lopts);
+	if (quiet)
+		return fd;
+	if (!ASSERT_GE(fd, 0, desc))
+		fprintf(stderr, "%s", log);
+	return fd;
+}
+
+static int off_prog_run(int fd, const char *desc)
+{
+	LIBBPF_OPTS(bpf_test_run_opts, opts);
+	int err;
+
+	err = bpf_prog_test_run_opts(fd, &opts);
+	close(fd);
+	if (!ASSERT_OK(err, desc) || !ASSERT_EQ(opts.retval, 0, desc))
+		return -1;
+	return 0;
+}
+
+/* Whether the verifier accepts a halfword load from an odd offset */
+static bool unaligned_ok(int map_fd)
+{
+	struct off_prog p;
+	int fd;
+
+	off_prog_start(&p, map_fd, BPF_REG_1);
+	EMIT(&p, BPF_LDX_MEM(BPF_H, BPF_REG_0, BPF_REG_1, 1));
+	fd = off_prog_load(&p, "unaligned probe", true);
+	if (fd < 0)
+		return false;
+	close(fd);
+	return true;
+}
+
+/* One program loading from all the offsets of size through rb into rd */
+static void load_offsets(struct off_mem *m, int kind, int size, int rb, int rd,
+			 const int *off, int nr)
+{
+	__u32 mem_key = MEM_KEY, res_key = RES_KEY;
+	int rs = other_reg(rb, rd), fd, i;
+	__u64 *res = (__u64 *)m->res;
+	int map_fd = m->map_fd;
+	struct off_prog p;
+	char desc[64];
+
+	off_prog_start(&p, map_fd, rb);
+	for (i = 0; i < nr; i++) {
+		if (rd == rb)
+			EMIT(&p, BPF_LDX_MEM(BPF_DW, rb, BPF_REG_10, SLOT_BASE));
+		if (kind == K_LDX)
+			EMIT(&p, BPF_LDX_MEM(size, rd, rb, off[i]));
+		else
+			EMIT(&p, BPF_RAW_INSN(BPF_LDX | BPF_MEMSX | size, rd, rb, off[i], 0));
+		EMIT(&p, BPF_LDX_MEM(BPF_DW, rs, BPF_REG_10, SLOT_RES));
+		EMIT(&p, BPF_STX_MEM(BPF_DW, rs, rd, i * 8));
+	}
+	snprintf(desc, sizeof(desc), "%s size=%d base=r%d dst=r%d",
+		 kind == K_LDX ? "ldx" : "ldsx", size, rb, rd);
+	if (!ASSERT_OK(bpf_map_update_elem(map_fd, &mem_key, m->mem, 0), desc))
+		return;
+	fd = off_prog_load(&p, desc, false);
+	if (fd < 0)
+		return;
+	if (off_prog_run(fd, desc) || !ASSERT_OK(bpf_map_lookup_elem(map_fd, &res_key, res), desc))
+		return;
+	for (i = 0; i < nr; i++) {
+		__u64 v = load_bytes(m->mem + MEM_BASE + off[i], size);
+
+		if (kind == K_LDSX)
+			v = size == BPF_B ? (__s8)v : size == BPF_H ? (__s16)v : (__s32)v;
+		if (res[i] != v) {
+			snprintf(desc, sizeof(desc), "%s size=%d base=r%d dst=r%d off=%d",
+				 kind == K_LDX ? "ldx" : "ldsx", size, rb, rd, off[i]);
+			ASSERT_EQ(res[i], v, desc);
+		}
+	}
+}
+
+/* One program storing rd, or the immediate imm when rd < 0, at all the offsets */
+static void store_offsets(struct off_mem *m, int size, int rb, int rd, __s32 imm,
+			  const int *off, int nr)
+{
+	__u64 val = rd >= 0 ? STORE_VAL : (__u64)(__s64)imm;
+	__u8 *mem = m->mem, *exp = m->exp, *res = m->res;
+	__u32 mem_key = MEM_KEY;
+	int map_fd = m->map_fd;
+	char desc[64], buf[96];
+	struct off_prog p;
+	int fd, i;
+
+	off_prog_start(&p, map_fd, rb);
+	if (rd >= 0) {
+		EMIT(&p, BPF_RAW_INSN(BPF_LD | BPF_DW | BPF_IMM, rd, 0, 0, (__u32)STORE_VAL));
+		EMIT(&p, BPF_RAW_INSN(0, 0, 0, 0, STORE_VAL >> 32));
+	}
+	memcpy(exp, mem, MEM_SIZE);
+	for (i = 0; i < nr; i++) {
+		if (rd >= 0)
+			EMIT(&p, BPF_STX_MEM(size, rb, rd, off[i]));
+		else
+			EMIT(&p, BPF_ST_MEM(size, rb, off[i], imm));
+		store_bytes(exp + MEM_BASE + off[i], val, size);
+	}
+	if (rd >= 0)
+		snprintf(desc, sizeof(desc), "stx size=%d base=r%d src=r%d", size, rb, rd);
+	else
+		snprintf(desc, sizeof(desc), "st size=%d base=r%d imm=%d", size, rb, imm);
+	if (!ASSERT_OK(bpf_map_update_elem(map_fd, &mem_key, mem, 0), desc))
+		return;
+	fd = off_prog_load(&p, desc, false);
+	if (fd < 0)
+		return;
+	if (off_prog_run(fd, desc) || !ASSERT_OK(bpf_map_lookup_elem(map_fd, &mem_key, res), desc))
+		return;
+	for (i = 0; i < MEM_SIZE && res[i] == exp[i]; i++)
+		;
+	if (i < MEM_SIZE) {
+		snprintf(buf, sizeof(buf), "%s: byte at offset %d", desc, i - MEM_BASE);
+		ASSERT_EQ(res[i], exp[i], buf);
+	}
+}
+
+static void test_ldst_offsets(void)
+{
+	static const int sizes[] = { BPF_B, BPF_H, BPF_W, BPF_DW };
+	static const __s32 imms[] = { -1, 0x7fffffff, -0x7fffffff - 1 };
+	int b, k, s, i, nr, off[32];
+	struct off_mem m = {};
+	bool unaligned;
+
+	m.map_fd = bpf_map_create(BPF_MAP_TYPE_ARRAY, "ldst_mem", sizeof(__u32), MEM_SIZE, 2, NULL);
+	if (!ASSERT_GE(m.map_fd, 0, "ldst_mem map"))
+		return;
+	m.mem = malloc(MEM_SIZE);
+	m.exp = malloc(MEM_SIZE);
+	m.res = malloc(MEM_SIZE);
+	if (!ASSERT_OK_PTR(m.mem, "mem") || !ASSERT_OK_PTR(m.exp, "exp") ||
+	    !ASSERT_OK_PTR(m.res, "res"))
+		goto out;
+	for (i = 0; i < MEM_SIZE; i++)
+		m.mem[i] = (i * 7 + 3) ^ (i >> 8);
+	unaligned = unaligned_ok(m.map_fd);
+
+	for (b = 0; b < ARRAY_SIZE(pat_regs); b++) {
+		for (s = 0; s < ARRAY_SIZE(sizes); s++) {
+			int rb = pat_regs[b], size = sizes[s];
+
+			nr = offsets_for(size, unaligned, off);
+			/* Loads and sign extending loads, also into the base */
+			for (k = 0; k < NR_PAIRS; k++) {
+				int rd = pair_reg(b, k);
+
+				load_offsets(&m, K_LDX, size, rb, rd, off, nr);
+				if (size != BPF_DW)
+					load_offsets(&m, K_LDSX, size, rb, rd, off, nr);
+			}
+			/* Stores of a register and of an immediate */
+			for (k = 1; k < NR_PAIRS; k++)
+				store_offsets(&m, size, rb, pair_reg(b, k), 0, off, nr);
+			for (k = 0; k < ARRAY_SIZE(imms); k++)
+				store_offsets(&m, size, rb, -1, imms[k], off, nr);
+		}
+	}
+out:
+	free(m.mem);
+	free(m.exp);
+	free(m.res);
+	close(m.map_fd);
+}
+
+static void test_movsx(void)
+{
+	static const struct {
+		bool is64;
+		int off;
+	} ops[] = {
+		{ true, 8 }, { true, 16 }, { true, 32 }, { false, 8 }, { false, 16 },
+	};
+	struct prog p;
+	char desc[64];
+	int s, k, o, j, fd;
+
+	for (s = 0; s < ARRAY_SIZE(pat_regs); s++) {
+		int rs = pat_regs[s];
+
+		for (k = 0; k < NR_PAIRS; k++) {
+			int rd = pair_reg(s, k);
+
+			for (o = 0; o < ARRAY_SIZE(ops); o++) {
+				prog_start(&p);
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rs, BPF_REG_6, IN0));
+				if (ops[o].is64)
+					EMIT(&p, BPF_MOVSX64_REG(rd, rs, ops[o].off));
+				else
+					EMIT(&p, BPF_MOVSX32_REG(rd, rs, ops[o].off));
+				prog_end(&p, rd);
+				snprintf(desc, sizeof(desc), "movsx%d off=%d dst=r%d src=r%d",
+					 ops[o].is64 ? 64 : 32, ops[o].off, rd, rs);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				for (j = 0; j < ARRAY_SIZE(inputs); j++) {
+					__s64 v = inputs[j];
+
+					if (ops[o].off == 8)
+						v = (__s8)v;
+					else if (ops[o].off == 16)
+						v = (__s16)v;
+					else
+						v = (__s32)v;
+					prog_run(fd, inputs[j], 0,
+						 ops[o].is64 ? (__u64)v : (__u32)v, desc);
+				}
+				close(fd);
+			}
+		}
+	}
+}
+
+/* Branch on dst and imm, with 1 in res when taken and 0 otherwise */
+static void jmp_prog(struct prog *p, bool is64, int op, int d, __s32 imm)
+{
+	int rd = pat_regs[d], rt = pair_reg(d, 1);
+
+	prog_start(p);
+	EMIT(p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));
+	EMIT(p, BPF_MOV64_IMM(rt, 1));
+	if (is64)
+		EMIT(p, BPF_JMP_IMM(op, rd, imm, 1));
+	else
+		EMIT(p, BPF_JMP32_IMM(op, rd, imm, 1));
+	EMIT(p, BPF_MOV64_IMM(rt, 0));
+	prog_end(p, rt);
+}
+
+static void test_jset_imm(void)
+{
+	static const __s32 masks[] = {
+		0x1, 0x40, 0x80, 0xff, 0x100, 0x7fff, 0x7fffffff, -1, -0x7fffffff - 1,
+	};
+	struct prog p;
+	char desc[64];
+	int d, m, j, fd;
+	bool is64;
+
+	for (d = 0; d < ARRAY_SIZE(pat_regs); d++) {
+		int rd = pat_regs[d];
+
+		for (is64 = false; ; is64 = true) {
+			for (m = 0; m < ARRAY_SIZE(masks); m++) {
+				jmp_prog(&p, is64, BPF_JSET, d, masks[m]);
+				snprintf(desc, sizeof(desc), "jset%d dst=r%d mask=0x%x",
+					 is64 ? 64 : 32, rd, masks[m]);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				for (j = 0; j < ARRAY_SIZE(inputs); j++) {
+					__u64 v = inputs[j];
+					bool taken;
+
+					if (is64)
+						taken = v & (__u64)(__s64)masks[m];
+					else
+						taken = (__u32)v & (__u32)masks[m];
+					prog_run(fd, v, 0, taken, desc);
+				}
+				close(fd);
+			}
+			if (is64)
+				break;
+		}
+	}
+}
+
+static bool cmp_taken(int op, bool is64, __u64 v, __u64 c)
+{
+	__s64 sv = is64 ? (__s64)v : (__s32)v, sc = is64 ? (__s64)c : (__s32)c;
+
+	switch (op) {
+	case BPF_JEQ:
+		return v == c;
+	case BPF_JNE:
+		return v != c;
+	case BPF_JGT:
+		return v > c;
+	case BPF_JGE:
+		return v >= c;
+	case BPF_JLT:
+		return v < c;
+	case BPF_JLE:
+		return v <= c;
+	case BPF_JSGT:
+		return sv > sc;
+	case BPF_JSGE:
+		return sv >= sc;
+	case BPF_JSLT:
+		return sv < sc;
+	default:
+		return sv <= sc;
+	}
+}
+
+static void test_cmp_imm(void)
+{
+	static const __s32 imms[] = {
+		1, -1, 0x7f, 0x80, -0x80, -0x81, 0x1000, 0x7fffffff,
+	};
+	static const int ops[] = {
+		BPF_JEQ, BPF_JNE, BPF_JGT, BPF_JGE, BPF_JLT, BPF_JLE,
+		BPF_JSGT, BPF_JSGE, BPF_JSLT, BPF_JSLE,
+	};
+	struct prog p;
+	char desc[64];
+	int d, o, m, j, fd;
+	bool is64;
+
+	for (d = 0; d < ARRAY_SIZE(pat_regs); d++) {
+		int rd = pat_regs[d];
+
+		for (is64 = false; ; is64 = true) {
+			for (o = 0; o < ARRAY_SIZE(ops); o++) {
+				for (m = 0; m < ARRAY_SIZE(imms); m++) {
+					jmp_prog(&p, is64, ops[o], d, imms[m]);
+					snprintf(desc, sizeof(desc), "jmp%d op=0x%x dst=r%d imm=%d",
+						 is64 ? 64 : 32, ops[o], rd, imms[m]);
+					fd = prog_load(&p, desc);
+					if (fd < 0)
+						return;
+					for (j = 0; j < ARRAY_SIZE(inputs); j++) {
+						__u64 v = is64 ? inputs[j] : (__u32)inputs[j];
+						__u64 c = is64 ? (__u64)(__s64)imms[m] :
+							  (__u32)imms[m];
+						__u64 taken = cmp_taken(ops[o], is64, v, c);
+
+						prog_run(fd, inputs[j], 0, taken, desc);
+					}
+					close(fd);
+				}
+			}
+			if (is64)
+				break;
+		}
+	}
+}
+
+static __u64 alu_model(int op, __u64 v, __u64 c)
+{
+	switch (op) {
+	case BPF_ADD:
+		return v + c;
+	case BPF_SUB:
+		return v - c;
+	case BPF_AND:
+		return v & c;
+	case BPF_OR:
+		return v | c;
+	case BPF_XOR:
+		return v ^ c;
+	default:
+		return v * c;
+	}
+}
+
+static void test_alu_consts(void)
+{
+	static const struct {
+		int op;
+		__s32 imm;
+	} ops[] = {
+		{ BPF_ADD, 1 }, { BPF_ADD, -1 }, { BPF_SUB, 1 }, { BPF_SUB, -1 },
+		{ BPF_ADD, 128 }, { BPF_SUB, 128 }, { BPF_ADD, -128 },
+		{ BPF_AND, 0xff }, { BPF_AND, 0xffff }, { BPF_AND, 0x7f },
+		{ BPF_AND, 0x3ff }, { BPF_AND, 0x7fffffff },
+		{ BPF_OR, 0xff }, { BPF_XOR, -1 }, { BPF_XOR, 0x80 },
+		{ BPF_MUL, 2 }, { BPF_MUL, 3 }, { BPF_MUL, 4 }, { BPF_MUL, 5 },
+		{ BPF_MUL, 7 }, { BPF_MUL, 8 }, { BPF_MUL, 9 }, { BPF_MUL, 16 },
+		{ BPF_MUL, 0x40000000 }, { BPF_MUL, -3 }, { BPF_MUL, -0x7fffffff - 1 },
+		{ BPF_MUL, 0 }, { BPF_MUL, 1 }, { BPF_MUL, -1 },
+	};
+	struct prog p;
+	char desc[64];
+	int d, o, j, fd;
+	bool is64;
+
+	for (d = 0; d < ARRAY_SIZE(pat_regs); d++) {
+		int rd = pat_regs[d];
+
+		for (is64 = false; ; is64 = true) {
+			for (o = 0; o < ARRAY_SIZE(ops); o++) {
+				prog_start(&p);
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));
+				if (is64)
+					EMIT(&p, BPF_ALU64_IMM(ops[o].op, rd, ops[o].imm));
+				else
+					EMIT(&p, BPF_ALU32_IMM(ops[o].op, rd, ops[o].imm));
+				prog_end(&p, rd);
+				snprintf(desc, sizeof(desc), "alu%d op=0x%x dst=r%d imm=%d",
+					 is64 ? 64 : 32, ops[o].op, rd, ops[o].imm);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				for (j = 0; j < ARRAY_SIZE(inputs); j++) {
+					__u64 v = is64 ? inputs[j] : (__u32)inputs[j];
+					__u64 c = is64 ? (__u64)(__s64)ops[o].imm :
+						  (__u32)ops[o].imm;
+					__u64 r = alu_model(ops[o].op, v, c);
+
+					prog_run(fd, inputs[j], 0, is64 ? r : (__u32)r, desc);
+				}
+				close(fd);
+			}
+			if (is64)
+				break;
+		}
+	}
+}
+
+static void test_bswap(void)
+{
+	static const int widths[] = { 16, 32, 64 };
+	struct prog p;
+	char desc[64];
+	int d, w, o, j, fd;
+
+	for (d = 0; d < ARRAY_SIZE(pat_regs); d++) {
+		int rd = pat_regs[d];
+
+		for (w = 0; w < ARRAY_SIZE(widths); w++) {
+			int bits = widths[w];
+
+			/* To big endian, to little endian, and the unconditional swap */
+			for (o = 0; o < 3; o++) {
+				prog_start(&p);
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));
+				if (o == 0)
+					EMIT(&p, BPF_ENDIAN(BPF_TO_BE, rd, bits));
+				else if (o == 1)
+					EMIT(&p, BPF_ENDIAN(BPF_TO_LE, rd, bits));
+				else
+					EMIT(&p, BPF_RAW_INSN(BPF_ALU64 | BPF_END | BPF_TO_LE,
+							      rd, 0, 0, bits));
+				prog_end(&p, rd);
+				snprintf(desc, sizeof(desc), "%s%d dst=r%d",
+					 o == 0 ? "be" : o == 1 ? "le" : "bswap", bits, rd);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				for (j = 0; j < ARRAY_SIZE(inputs); j++) {
+					__u64 v = inputs[j], r;
+
+					if (bits == 16)
+						r = o == 0 ? htobe16(v) : o == 1 ? htole16(v) :
+						    __builtin_bswap16(v);
+					else if (bits == 32)
+						r = o == 0 ? htobe32(v) : o == 1 ? htole32(v) :
+						    __builtin_bswap32(v);
+					else
+						r = o == 0 ? htobe64(v) : o == 1 ? htole64(v) :
+						    __builtin_bswap64(v);
+					prog_run(fd, v, 0, r, desc);
+				}
+				close(fd);
+			}
+		}
+	}
+}
+
+static void test_probe_mem(void)
+{
+	int kfunc_id, type_id, b, k, j, fd;
+	struct btf *btf;
+	struct prog p;
+	char desc[64];
+
+	btf = btf__load_vmlinux_btf();
+	if (!ASSERT_OK_PTR(btf, "vmlinux btf"))
+		return;
+	kfunc_id = btf__find_by_name_kind(btf, "bpf_rdonly_cast", BTF_KIND_FUNC);
+	type_id = btf__find_by_name_kind(btf, "timespec64", BTF_KIND_STRUCT);
+	btf__free(btf);
+	if (!ASSERT_GT(kfunc_id, 0, "bpf_rdonly_cast id") ||
+	    !ASSERT_GT(type_id, 0, "timespec64 id"))
+		return;
+
+	/* The kernel copy of the ctx through an untrusted pointer in every register */
+	for (b = 0; b < ARRAY_SIZE(pat_regs); b++) {
+		int rb = pat_regs[b];
+
+		for (k = 0; k < NR_PAIRS; k++) {
+			int rd = pair_reg(b, k);
+
+			prog_start(&p);
+			EMIT(&p, BPF_MOV64_REG(BPF_REG_1, BPF_REG_6));
+			EMIT(&p, BPF_MOV32_IMM(BPF_REG_2, type_id));
+			EMIT(&p, BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, BPF_PSEUDO_KFUNC_CALL,
+					      0, kfunc_id));
+			if (rb != BPF_REG_0)
+				EMIT(&p, BPF_MOV64_REG(rb, BPF_REG_0));
+			EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, rb, 0));
+			prog_end(&p, rd);
+			snprintf(desc, sizeof(desc), "probe_mem base=r%d dst=r%d", rb, rd);
+			fd = prog_load(&p, desc);
+			if (fd < 0)
+				return;
+			for (j = 0; j < ARRAY_SIZE(inputs); j++)
+				prog_run(fd, inputs[j], 0, inputs[j], desc);
+			close(fd);
+		}
+	}
+
+	/* NULL and a user address are not touched and read as zero */
+	for (j = 0; j < 2; j++) {
+		__u64 addr = j ? 0x00007ffffffff000ULL : 0;
+
+		prog_start(&p);
+		EMIT(&p, BPF_RAW_INSN(BPF_LD | BPF_DW | BPF_IMM, BPF_REG_1, 0, 0, (__u32)addr));
+		EMIT(&p, BPF_RAW_INSN(0, 0, 0, 0, addr >> 32));
+		EMIT(&p, BPF_MOV32_IMM(BPF_REG_2, type_id));
+		EMIT(&p, BPF_RAW_INSN(BPF_JMP | BPF_CALL, 0, BPF_PSEUDO_KFUNC_CALL,
+				      0, kfunc_id));
+		EMIT(&p, BPF_LDX_MEM(BPF_DW, BPF_REG_3, BPF_REG_0, 0));
+		prog_end(&p, BPF_REG_3);
+		snprintf(desc, sizeof(desc), "probe_mem addr=0x%llx", addr);
+		fd = prog_load(&p, desc);
+		if (fd < 0)
+			return;
+		prog_run(fd, 0, 0, 0, desc);
+		close(fd);
+	}
+}
+
+/* Whether the JIT supports load-acquire and store-release */
+static bool acq_rel_ok(void)
+{
+	LIBBPF_OPTS(bpf_prog_load_opts, lopts, .prog_flags = BPF_F_SLEEPABLE);
+	struct prog p;
+	int fd;
+
+	prog_start(&p);
+	EMIT(&p, BPF_ST_MEM(BPF_DW, BPF_REG_10, -8, 0));
+	EMIT(&p, BPF_ATOMIC_OP(BPF_DW, BPF_LOAD_ACQ, BPF_REG_0, BPF_REG_10, -8));
+	prog_end(&p, BPF_REG_0);
+	fd = bpf_prog_load(BPF_PROG_TYPE_SYSCALL, NULL, "GPL", p.insns, p.cnt, &lopts);
+	if (fd < 0)
+		return false;
+	close(fd);
+	return true;
+}
+
+/*
+ * Load-acquire and store-release of every size with every register as
+ * base, on a stack slot holding in0: the loads zero extend like the plain
+ * loads and the stores replace the first bytes of the slot like the plain
+ * stores.
+ */
+static void test_acq_rel(void)
+{
+	static const int sizes[] = { BPF_B, BPF_H, BPF_W, BPF_DW };
+	struct prog p;
+	char desc[64];
+	int b, k, s, j, fd;
+
+	if (!acq_rel_ok()) {
+		test__skip();
+		return;
+	}
+	for (b = 0; b < ARRAY_SIZE(pat_regs); b++) {
+		int rb = pat_regs[b];
+
+		for (s = 0; s < ARRAY_SIZE(sizes); s++) {
+			int size = sizes[s];
+
+			for (k = 0; k < NR_PAIRS; k++) {
+				int rd = pair_reg(b, k);
+
+				/* Load-acquire from the slot, also into the base */
+				prog_start(&p);
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));
+				EMIT(&p, BPF_STX_MEM(BPF_DW, BPF_REG_10, rd, -8));
+				EMIT(&p, BPF_MOV64_REG(rb, BPF_REG_10));
+				EMIT(&p, BPF_ALU64_IMM(BPF_ADD, rb, -8));
+				EMIT(&p, BPF_ATOMIC_OP(size, BPF_LOAD_ACQ, rd, rb, 0));
+				prog_end(&p, rd);
+				snprintf(desc, sizeof(desc), "load_acq size=%d base=r%d dst=r%d",
+					 size, rb, rd);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				for (j = 0; j < ARRAY_SIZE(inputs); j++)
+					prog_run(fd, inputs[j], 0,
+						 head_bytes(inputs[j], size), desc);
+				close(fd);
+
+				if (rd == rb)
+					continue;
+				/* Store-release of in1 over the slot holding in0 */
+				prog_start(&p);
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN0));
+				EMIT(&p, BPF_STX_MEM(BPF_DW, BPF_REG_10, rd, -8));
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_6, IN1));
+				EMIT(&p, BPF_MOV64_REG(rb, BPF_REG_10));
+				EMIT(&p, BPF_ALU64_IMM(BPF_ADD, rb, -8));
+				EMIT(&p, BPF_ATOMIC_OP(size, BPF_STORE_REL, rb, rd, 0));
+				EMIT(&p, BPF_LDX_MEM(BPF_DW, rd, BPF_REG_10, -8));
+				prog_end(&p, rd);
+				snprintf(desc, sizeof(desc), "store_rel size=%d base=r%d src=r%d",
+					 size, rb, rd);
+				fd = prog_load(&p, desc);
+				if (fd < 0)
+					return;
+				for (j = 0; j < ARRAY_SIZE(inputs); j++) {
+					__u64 in1 = inputs[(j + 1) % ARRAY_SIZE(inputs)];
+
+					prog_run(fd, inputs[j], in1,
+						 head_merge(inputs[j], in1, size), desc);
+				}
+				close(fd);
+			}
+		}
+	}
+}
+
+/*
+ * A jump with the maximal offset over instructions which expand to several
+ * native ones, so that the native offset outgrows the field of a short
+ * branch and takes the JITs through their branch conversion. The region
+ * must not grow in the verifier, or the jump could not reach over it any
+ * more: the divisions are by constants, as a division by a register gets
+ * a zero check in front, and the region sticks to one width, as a 32-bit
+ * result read by a 64-bit instruction gets a zero extension on the JITs
+ * which need one. The region is the not taken path and ends with a result
+ * different from the taken one, so a jump landing inside it fails the run.
+ */
+static void max_jmp(bool alu32, bool taken)
+{
+	static const int ops[] = {
+		BPF_LSH, BPF_RSH, BPF_ARSH, BPF_ADD, BPF_SUB, BPF_MUL, BPF_DIV, BPF_MOD,
+	};
+	struct { __u64 r0, r2; } ctx = { taken, 0x0123456789abcdefULL };
+	LIBBPF_OPTS(bpf_test_run_opts, opts,
+		.ctx_in = &ctx,
+		.ctx_size_in = sizeof(ctx),
+	);
+	int len = INT16_MAX + 5, i = 0, fd;
+	struct bpf_insn *insns;
+	char desc[64];
+
+	snprintf(desc, sizeof(desc), "max jump alu%d %s", alu32 ? 32 : 64,
+		 taken ? "taken" : "not taken");
+	insns = malloc(len * sizeof(*insns));
+	if (!ASSERT_OK_PTR(insns, "insns"))
+		return;
+	insns[i++] = BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_1, 8);
+	insns[i++] = BPF_LDX_MEM(BPF_DW, BPF_REG_0, BPF_REG_1, 0);
+	insns[i++] = BPF_MOV64_REG(BPF_REG_3, BPF_REG_2);
+	insns[i++] = BPF_JMP_IMM(BPF_JEQ, BPF_REG_0, 1, INT16_MAX);
+	while (i < len - 2) {
+		int op = ops[(i >> 1) % ARRAY_SIZE(ops)];
+
+		if (op == BPF_DIV || op == BPF_MOD)
+			insns[i++] = alu32 ? BPF_ALU32_IMM(op, BPF_REG_3, 7) :
+					     BPF_ALU64_IMM(op, BPF_REG_3, 7);
+		else
+			insns[i++] = alu32 ? BPF_ALU32_REG(op, BPF_REG_3, BPF_REG_2) :
+					     BPF_ALU64_REG(op, BPF_REG_3, BPF_REG_2);
+	}
+	insns[i++] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_0, 2);
+	insns[i++] = BPF_EXIT_INSN();
+	ASSERT_EQ(i, len, "insn count");
+
+	fd = load_prog(insns, i, desc);
+	if (fd >= 0) {
+		if (ASSERT_OK(bpf_prog_test_run_opts(fd, &opts), desc))
+			ASSERT_EQ(opts.retval, taken ? 1 : 2, desc);
+		close(fd);
+	}
+	free(insns);
+}
+
+static void test_max_jmp(void)
+{
+	max_jmp(false, true);
+	max_jmp(false, false);
+	max_jmp(true, true);
+	max_jmp(true, false);
+}
+
+void test_jit_insns(void)
+{
+	RUN_TESTS(jit_insns_arena);
+	if (test__start_subtest("alu_imm"))
+		test_alu_imm();
+	if (test__start_subtest("alu_reg"))
+		test_alu_reg();
+	if (test__start_subtest("alu_imm_regs"))
+		test_alu_imm_regs();
+	if (test__start_subtest("div_const"))
+		test_div_const();
+	if (test__start_subtest("alu_reg_pairs"))
+		test_alu_reg_pairs();
+	if (test__start_subtest("shifts"))
+		test_shifts();
+	if (test__start_subtest("atomics"))
+		test_atomics();
+	if (test__start_subtest("atomic_reg_pairs"))
+		test_atomic_reg_pairs();
+	if (test__start_subtest("xadd_chain"))
+		test_xadd_chain();
+	if (test__start_subtest("ld_imm64"))
+		test_ld_imm64();
+	if (test__start_subtest("jmp_imm"))
+		test_jmp_imm();
+	if (test__start_subtest("jmp_reg"))
+		test_jmp_reg();
+	if (test__start_subtest("jmp_reg_pairs"))
+		test_jmp_reg_pairs();
+	if (test__start_subtest("staggered_jumps"))
+		test_staggered_jumps();
+	if (test__start_subtest("max_jmp"))
+		test_max_jmp();
+	if (test__start_subtest("ldst_zero_off"))
+		test_ldst_zero_off();
+	if (test__start_subtest("ldst_offsets"))
+		test_ldst_offsets();
+	if (test__start_subtest("acq_rel"))
+		test_acq_rel();
+	if (test__start_subtest("movsx"))
+		test_movsx();
+	if (test__start_subtest("jset_imm"))
+		test_jset_imm();
+	if (test__start_subtest("cmp_imm"))
+		test_cmp_imm();
+	if (test__start_subtest("alu_consts"))
+		test_alu_consts();
+	if (test__start_subtest("bswap"))
+		test_bswap();
+	if (test__start_subtest("probe_mem"))
+		test_probe_mem();
+}
+
+/* The families with an immediate once more with the constants blinded */
+void serial_test_jit_insns_blinded(void)
+{
+	const char *harden = "/proc/sys/net/core/bpf_jit_harden";
+	char old[16] = {};
+
+	if (!is_jit_enabled()) {
+		test__skip();
+		return;
+	}
+	if (sysctl_set_or_fail(harden, old, "2"))
+		return;
+	if (test__start_subtest("alu_imm"))
+		test_alu_imm();
+	if (test__start_subtest("alu_imm_regs"))
+		test_alu_imm_regs();
+	if (test__start_subtest("div_const"))
+		test_div_const();
+	if (test__start_subtest("shifts"))
+		test_shifts();
+	if (test__start_subtest("xadd_chain"))
+		test_xadd_chain();
+	if (test__start_subtest("ld_imm64"))
+		test_ld_imm64();
+	if (test__start_subtest("jmp_imm"))
+		test_jmp_imm();
+	if (test__start_subtest("ldst_zero_off"))
+		test_ldst_zero_off();
+	if (test__start_subtest("ldst_offsets"))
+		test_ldst_offsets();
+	if (test__start_subtest("jset_imm"))
+		test_jset_imm();
+	if (test__start_subtest("cmp_imm"))
+		test_cmp_imm();
+	if (test__start_subtest("alu_consts"))
+		test_alu_consts();
+	sysctl_set_or_fail(harden, NULL, old);
+}
diff --git a/tools/testing/selftests/bpf/progs/jit_insns_arena.c b/tools/testing/selftests/bpf/progs/jit_insns_arena.c
new file mode 100644
index 0000000000000..b396d5aefb5a6
--- /dev/null
+++ b/tools/testing/selftests/bpf/progs/jit_insns_arena.c
@@ -0,0 +1,113 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * The arena accesses of jit_insns in their own object, so that a kernel
+ * without arena support fails only these programs.
+ */
+#define BPF_NO_KFUNC_PROTOTYPES
+#include <vmlinux.h>
+#include <bpf/bpf_helpers.h>
+#include "bpf_misc.h"
+#include "bpf_experimental.h"
+#include "bpf_arena_common.h"
+
+struct {
+	__uint(type, BPF_MAP_TYPE_ARENA);
+	__uint(map_flags, BPF_F_MMAPABLE);
+	__uint(max_entries, 1);
+} arena SEC(".maps");
+
+/*
+ * The first bytes in memory of the test value and its sum with the slot
+ * after the u32 store depend on the byte order.
+ */
+#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
+#define VAL_B0	0x88
+#define VAL_H0	0x7788
+#define VAL_W0	0x55667788
+#define VAL_SUM	0x22446688556689bc
+#else
+#define VAL_B0	0x11
+#define VAL_H0	0x1122
+#define VAL_W0	0x11223344
+#define VAL_SUM	0x11224578aaccef10
+#endif
+
+#if defined(__BPF_FEATURE_ADDR_SPACE_CAST)
+SEC("syscall")
+__description("arena access with zero offset")
+__success __retval(0)
+int arena_zero_off(void *ctx)
+{
+	void __arena *page;
+	__u64 res;
+
+	page = bpf_arena_alloc_pages(&arena, NULL, 1, NUMA_NO_NODE, 0);
+	if (!page)
+		return 1;
+	res = (__u32)(__u64)page;
+	/* Accesses through two base registers */
+	asm volatile ("					\
+	r7 = %[res];					\
+	r7 = addr_space_cast(r7, 0x0, 0x1);		\
+	r1 = r7;					\
+	r8 = 0x1122334455667788 ll;			\
+	*(u64 *)(r7 + 0) = r8;				\
+	r9 = *(u64 *)(r7 + 0);				\
+	r9 ^= r8;					\
+	*(u64 *)(r1 + 0) = r8;				\
+	r2 = *(u64 *)(r1 + 0);				\
+	r2 ^= r8;					\
+	r9 |= r2;					\
+	r3 = *(u8 *)(r1 + 0);				\
+	r3 ^= %[b0];					\
+	r9 |= r3;					\
+	r4 = *(u16 *)(r1 + 0);				\
+	r4 ^= %[h0];					\
+	r9 |= r4;					\
+	r5 = *(u32 *)(r1 + 0);				\
+	r5 ^= %[w0];					\
+	r9 |= r5;					\
+	*(u32 *)(r1 + 0) = 0x1234;			\
+	lock *(u64 *)(r7 + 0) += r8;			\
+	r2 = *(u64 *)(r1 + 0);				\
+	r8 = %[sum] ll;					\
+	r2 ^= r8;					\
+	r9 |= r2;					\
+	%[res] = r9;					\
+"	: [res]"+r"(res)
+	: __imm_const(b0, VAL_B0), __imm_const(h0, VAL_H0),
+	  __imm_const(w0, VAL_W0), __imm_const(sum, VAL_SUM)
+	: "r1", "r2", "r3", "r4", "r5", "r7", "r8", "r9");
+	return res != 0;
+}
+
+SEC("syscall")
+__description("cast to a user address")
+__success __retval(0)
+int cast_to_user(void *ctx)
+{
+	void __arena *page;
+	__u64 res;
+
+	page = bpf_arena_alloc_pages(&arena, NULL, 1, NUMA_NO_NODE, 0);
+	if (!page)
+		return 1;
+	/* The user address comes back from the kernel one, NULL stays NULL */
+	asm volatile ("					\
+	r7 = %[page];					\
+	r1 = addr_space_cast(r7, 0x0, 0x1);		\
+	r1 = addr_space_cast(r1, 0x1, 0x0);		\
+	r9 = r1;					\
+	r9 ^= r7;					\
+	r2 = 0;						\
+	r2 = addr_space_cast(r2, 0x1, 0x0);		\
+	r9 |= r2;					\
+	%[res] = r9;					\
+"	: [res]"=r"(res)
+	: [page]"r"(page)
+	: "r1", "r2", "r7", "r9");
+	return res != 0;
+}
+#endif
+
+char _license[] SEC("license") = "GPL";
diff --git a/tools/testing/selftests/bpf/test_kmod.sh b/tools/testing/selftests/bpf/test_kmod.sh
deleted file mode 100755
index 50dca53ac536a..0000000000000
--- a/tools/testing/selftests/bpf/test_kmod.sh
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-2.0
-
-# Usage:
-# ./test_kmod.sh [module_param]...
-# Ex.: ./test_kmod.sh test_range=1,3
-# All the parameters are passed to the kernel module.
-
-# Kselftest framework requirement - SKIP code is 4.
-ksft_skip=4
-
-msg="skip all tests:"
-if [ "$(id -u)" != "0" ]; then
-	echo $msg please run this as root >&2
-	exit $ksft_skip
-fi
-
-if [ "$building_out_of_srctree" ]; then
-	# We are in linux-build/kselftest/bpf
-	OUTPUT=../../
-else
-	# We are in linux/tools/testing/selftests/bpf
-	OUTPUT=../../../../
-fi
-
-test_run()
-{
-	sysctl -w net.core.bpf_jit_enable=$1 2>&1 > /dev/null
-	sysctl -w net.core.bpf_jit_harden=$2 2>&1 > /dev/null
-
-	echo "[ JIT enabled:$1 hardened:$2 ]"
-	shift 2
-	dmesg -C
-	if [ -f ${OUTPUT}/lib/test_bpf.ko ]; then
-		insmod ${OUTPUT}/lib/test_bpf.ko "$@" 2> /dev/null
-		if [ $? -ne 0 ]; then
-			rc=1
-		fi
-	else
-		# Use modprobe dry run to check for missing test_bpf module
-		if ! /sbin/modprobe -q -n test_bpf "$@"; then
-			echo "test_bpf: [SKIP]"
-		elif /sbin/modprobe -q test_bpf "$@"; then
-			echo "test_bpf: ok"
-		else
-			echo "test_bpf: [FAIL]"
-			rc=1
-		fi
-	fi
-	rmmod  test_bpf 2> /dev/null
-	dmesg | grep FAIL
-}
-
-test_save()
-{
-	JE=`sysctl -n net.core.bpf_jit_enable`
-	JH=`sysctl -n net.core.bpf_jit_harden`
-}
-
-test_restore()
-{
-	sysctl -w net.core.bpf_jit_enable=$JE 2>&1 > /dev/null
-	sysctl -w net.core.bpf_jit_harden=$JH 2>&1 > /dev/null
-}
-
-rc=0
-test_save
-test_run 0 0 "$@"
-test_run 1 0 "$@"
-test_run 1 1 "$@"
-test_run 1 2 "$@"
-test_restore
-exit $rc
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index 590b33e16d9fb..0ffce8efc6d0b 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -104,7 +104,6 @@ TEST_PROGS := \
 	stress_reuseport_listen.sh \
 	tcp_ecmp_failover.sh \
 	tcp_fastopen_backup_key.sh \
-	test_bpf.sh \
 	test_bridge_backup_port.sh \
 	test_bridge_neigh_suppress.sh \
 	test_ingress_egress_chaining.sh \
diff --git a/tools/testing/selftests/net/config b/tools/testing/selftests/net/config
index 737e7e6327b37..6223b00516fe9 100644
--- a/tools/testing/selftests/net/config
+++ b/tools/testing/selftests/net/config
@@ -127,7 +127,6 @@ CONFIG_TAP=m
 CONFIG_TCP_CONG_DCTCP=y
 CONFIG_TCP_MD5SIG=y
 CONFIG_TEST_BLACKHOLE_DEV=m
-CONFIG_TEST_BPF=m
 CONFIG_TLS=m
 CONFIG_TRACEPOINTS=y
 CONFIG_TUN=y
diff --git a/tools/testing/selftests/net/test_bpf.sh b/tools/testing/selftests/net/test_bpf.sh
deleted file mode 100755
index 65677909c574d..0000000000000
--- a/tools/testing/selftests/net/test_bpf.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-2.0
-# Runs bpf test using test_bpf kernel module
-
-if /sbin/modprobe -q test_bpf ; then
-	/sbin/modprobe -q -r test_bpf;
-	echo "test_bpf: ok";
-else
-	echo "test_bpf: [FAIL]";
-	exit 1;
-fi

23/3 2026/10/13 22:53 llm kmsan-evaluator
1m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 291699
							output: 324
							thoughts: 4003
						

Thoughts:
**Analysis of the BPF JIT Optimization Patch Series: KASAN vs. KMSAN Considerations**

Alright, let's break down this patch series. My initial impression is that this is about cleaning up and optimizing the BPF JIT compiler for x86-64, specifically related to the removal of the in-kernel test module and improvements to code generation. I need to figure out if this necessitates a dedicated KMSAN fuzzing session. The key question is whether this patch introduces or exposes uninitialized memory risks that would *only* be caught by KMSAN.

First, I see the main changes are:

1.  Documentation updates and MAINTAINERS file modifications.
2.  Removal of `lib/test_bpf.c` and related config options and exports. This is a significant change, as it removes the in-kernel test module.
3.  The associated removal of `test_bpf.c` from various defconfigs.
4.  Updates to `kernel/bpf/core.c` including the removal of symbols related to `test_bpf.c`.
5.  Replacement of the removed test module with a user-space selftest suite in `tools/testing/selftests/bpf/`. This includes new test files in `prog_tests` and `progs`.
6.  The core of the patch, however, lies within `arch/x86/net/bpf_jit_comp.c`. This is where all the JIT optimizations are taking place.

Now, let's dive into the `arch/x86/net/bpf_jit_comp.c` changes. I need to carefully scrutinize these, as they are the most likely area for potential uninitialized memory issues. We're seeing changes to how x86 machine code is generated from eBPF instructions. It appears to focus on optimizing instruction selection, such as:

*   Parameter type changes in `emit_add_rsp` and `emit_sub_rsp`.
*   Helper functions for emitting instructions like `emit_mov_reg`, `emit_ldx`, `emit_alu_imm`, etc.
*   Implementation of "Hacker's Delight" division-by-constant optimizations (excellent!).
*   Zero-displacement optimizations in ModR/M and SIB encodings.
*   LEA (Load Effective Address) usage for multiplications by 3, 5, and 9.
*   8-bit optimization for `BPF_JSET`.
*   Immediate adjustment (`cmp_imm`, `< 1` to `<= 0`).
*   Arena bounds check optimization using `lea` and shift.
*   `emit_kasan_check`.

My primary concern is whether these changes could lead to uninitialized memory being read or leaked to user space. KMSAN's job is to catch precisely this. The critical rule is, *“THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN, LOCKDEP, OR OTHER STANDARD BUG DETECTORS.”* KMSAN is expensive, so it should only be used if there is a *risk* that it is the only detector for the bug.

From my review of the code changes, there is nothing that sends newly allocated or uninitialized kernel data to user space via the usual mechanisms. There is no evidence of `copy_to_user`, `put_user`, netlink attributes, ioctl output, socket options, or new BPF buffers that could leak uninitialized values. The JIT code translates already-verified BPF instructions into machine instructions. It's an instruction selection optimization.

Crucially, the JIT-compiled code's potential issues would be functional correctness (detected by existing BPF tests), control flow/arithmetic bugs (resulting in crashes, which would be detected by standard kernel checkers and KASAN), or memory access violations (caught by KASAN). KMSAN is not relevant here as the patch series is purely about *instruction generation* and not about the *memory* managed by the kernel. The goal of these JIT optimizations is for more efficient code, not to change how memory is initialized.

Therefore, because this patch series does not introduce any risk of uninitialized memory usage or info-leaks and the potential risks are already covered by KASAN and the usual memory checks, there is no need for a dedicated KMSAN fuzzing session. Standard KASAN fuzzing is sufficient.



24/3 2026/10/13 22:54 tool set-results
0m Args:
{
  "KMSANReasoning": "The patch series makes two main categories of changes:\n1. It deletes the legacy in-kernel BPF test module (`lib/test_bpf.c`) and associated symbols/config options, replacing them with user-space BPF selftests (`tools/testing/selftests/bpf/prog_tests/jit_insns.c`).\n2. It optimizes code generation in the x86-64 BPF JIT compiler (`arch/x86/net/bpf_jit_comp.c`), including strength reduction of 64-bit constant division and modulo operations into multiplications by magic numbers, zero-displacement ModR/M and SIB optimizations, peephole optimizations for ALU operations and comparisons, and helper refactoring for stack depth adjustments.\n\nThese modifications do not introduce or touch any kernel structures copied to user space, netlink skb attributes, ioctls, or socket options. No kernel memory allocations or initialization paths are altered in ways that could cause uninitialized heap/stack memory to be read or leaked. Potential bugs in BPF JIT emission would consist of incorrect native machine code generation, register clobbering, invalid jumps, or out-of-bounds memory accesses—issues that are caught by hardware traps, standard bug detectors, or KASAN. Therefore, there is no risk of uninitialized memory use or info-leak that would necessitate a dedicated KMSAN fuzzing session.",
  "NeedsKMSAN": false
}

Results:
{
  "KMSANReasoning": "The patch series makes two main categories of changes:\n1. It deletes the legacy in-kernel BPF test module (`lib/test_bpf.c`) and associated symbols/config options, replacing them with user-space BPF selftests (`tools/testing/selftests/bpf/prog_tests/jit_insns.c`).\n2. It optimizes code generation in the x86-64 BPF JIT compiler (`arch/x86/net/bpf_jit_comp.c`), including strength reduction of 64-bit constant division and modulo operations into multiplications by magic numbers, zero-displacement ModR/M and SIB optimizations, peephole optimizations for ALU operations and comparisons, and helper refactoring for stack depth adjustments.\n\nThese modifications do not introduce or touch any kernel structures copied to user space, netlink skb attributes, ioctls, or socket options. No kernel memory allocations or initialization paths are altered in ways that could cause uninitialized heap/stack memory to be read or leaked. Potential bugs in BPF JIT emission would consist of incorrect native machine code generation, register clobbering, invalid jumps, or out-of-bounds memory accesses—issues that are caught by hardware traps, standard bug detectors, or KASAN. Therefore, there is no risk of uninitialized memory use or info-leak that would necessitate a dedicated KMSAN fuzzing session.",
  "NeedsKMSAN": false
}

LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)