diff options
author | Ilya Leoshkevich <iii@linux.ibm.com> | 2019-07-16 12:53:53 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-07-16 09:20:08 -0700 |
commit | 3461a0a02141b2612f2916e9250a430de41b0290 (patch) | |
tree | c72dc9dc9aa33589ee869178cfd6ac2fec8258b3 | |
parent | d5e1db990fcce571a4af2434d6fc2b312d94b45e (diff) | |
download | linux-3461a0a02141b2612f2916e9250a430de41b0290.tar.gz linux-3461a0a02141b2612f2916e9250a430de41b0290.tar.bz2 linux-3461a0a02141b2612f2916e9250a430de41b0290.zip |
selftests/bpf: fix "alu with different scalars 1" on s390
BPF_LDX_MEM is used to load the least significant byte of the retrieved
test_val.index, however, on big-endian machines it ends up retrieving
the most significant byte.
Change the test to load the whole int in order to make it
endianness-independent.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
-rw-r--r-- | tools/testing/selftests/bpf/verifier/value_ptr_arith.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/verifier/value_ptr_arith.c b/tools/testing/selftests/bpf/verifier/value_ptr_arith.c index c3de1a2c9dc5..a53d99cebd9f 100644 --- a/tools/testing/selftests/bpf/verifier/value_ptr_arith.c +++ b/tools/testing/selftests/bpf/verifier/value_ptr_arith.c @@ -183,7 +183,7 @@ BPF_EMIT_CALL(BPF_FUNC_map_lookup_elem), BPF_JMP_IMM(BPF_JNE, BPF_REG_0, 0, 1), BPF_EXIT_INSN(), - BPF_LDX_MEM(BPF_B, BPF_REG_1, BPF_REG_0, 0), + BPF_LDX_MEM(BPF_W, BPF_REG_1, BPF_REG_0, 0), BPF_JMP_IMM(BPF_JEQ, BPF_REG_1, 0, 3), BPF_MOV64_IMM(BPF_REG_2, 0), BPF_MOV64_IMM(BPF_REG_3, 0x100000), |