diff options
author | Xi Wang <xi.wang@gmail.com> | 2015-05-09 10:14:30 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-05-11 17:02:27 +0200 |
commit | 986ccfdbd90a292e8242c5d2647d8bb8565c38c3 (patch) | |
tree | df0a49c8d5b06eb7c56781228d22599b88a08c6b /lib/test_bpf.c | |
parent | Merge branch 'bonding_netlink_lacp' (diff) | |
download | linux-986ccfdbd90a292e8242c5d2647d8bb8565c38c3.tar.xz linux-986ccfdbd90a292e8242c5d2647d8bb8565c38c3.zip |
test: bpf: extend "load 64-bit immediate" testcase
Extend the testcase to catch a signedness bug in the arm64 JIT:
test_bpf: #58 load 64-bit immediate jited:1 ret -1 != 1 FAIL (1 times)
This is useful to ensure other JITs won't have a similar bug.
Link: https://lkml.org/lkml/2015/5/8/458
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/test_bpf.c')
-rw-r--r-- | lib/test_bpf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/test_bpf.c b/lib/test_bpf.c index f2c23ffaa6d7..3c41049d72d8 100644 --- a/lib/test_bpf.c +++ b/lib/test_bpf.c @@ -1755,7 +1755,8 @@ static struct bpf_test tests[] = { BPF_EXIT_INSN(), BPF_JMP_IMM(BPF_JEQ, R3, 0x1234, 1), BPF_EXIT_INSN(), - BPF_ALU64_IMM(BPF_MOV, R0, 1), + BPF_LD_IMM64(R0, 0x1ffffffffLL), + BPF_ALU64_IMM(BPF_RSH, R0, 32), /* R0 = 1 */ BPF_EXIT_INSN(), }, INTERNAL, |