Skip to contentSkip to conversation

test: bpf: extend "load 64-bit immediate" testcase

PATCH Applied Xi Wang 4 participants 4 messages May 9, 2015 – May 11, 2015

Subsystems (3)
lore
Share & tools
lore

Xi Wang

author
#0 lore raw

PATCH 1/1 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.

---
 lib/test_bpf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/test_bpf.c +2 -1
index f2c23ffaa6d7..3c41049d72d8 100644
@@ -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,
Signature · 1 line
1.9.1
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Xi Wang

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.

---

looks good. Thanks!

Acked-by on v1 1/1
#2 lore raw
In reply to Xi Wang
Quoted 10 lines · Xi Wang

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.

maintainer Applied
#3 lore raw
In reply to Xi Wang

From: Xi Wang <[email protected]>
Date: Sat, 9 May 2015 04:14:30 -0400

Quoted 10 lines

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.

Applied, thank you.