summaryrefslogtreecommitdiff
path: root/lib/test_bpf.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-09-09 10:27:22 -0700
committerDavid S. Miller <davem@davemloft.net>2014-09-09 10:27:22 -0700
commitafddacc3ccd048c49c7f4f0ad0b6a40730c74715 (patch)
treef990840a7b9e6afe48ea73a5fdafe1cdc50f936d /lib/test_bpf.c
parent5b4c314575ea6edd57c547c2123083d88d8ff4e6 (diff)
parentdaedfb22451dd02b35c0549566cbb7cc06bdd53b (diff)
Merge branch 'ebpf'
Alexei Starovoitov says: ==================== load imm64 insn and uapi/linux/bpf.h V9->V10 - no changes, added Daniel's ack Note they're on top of Hannes's patch in the same area [1] V8 thread with 'why' reasoning and end goal [2] Original set [3] of ~28 patches I'm planning to present in 4 stages: I. this 2 patches to fork off llvm upstreaming II. bpf syscall with manpage and map implementation III. bpf program load/unload with verifier testsuite (1st user of instruction macros from bpf.h and 1st user of load imm64 insn) IV. tracing, etc [1] http://patchwork.ozlabs.org/patch/385266/ [2] https://lkml.org/lkml/2014/8/27/628 [3] https://lkml.org/lkml/2014/8/26/859 ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/test_bpf.c')
-rw-r--r--lib/test_bpf.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index 9a67456ba29a..413890815d3e 100644
--- a/lib/test_bpf.c
+++ b/lib/test_bpf.c
@@ -1735,6 +1735,27 @@ static struct bpf_test tests[] = {
{ },
{ { 1, 0 } },
},
+ {
+ "load 64-bit immediate",
+ .u.insns_int = {
+ BPF_LD_IMM64(R1, 0x567800001234L),
+ 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_ALU64_IMM(BPF_MOV, R0, 1),
+ BPF_EXIT_INSN(),
+ },
+ INTERNAL,
+ { },
+ { { 0, 1 } }
+ },
};
static struct net_device dev;