linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] test: bpf: extend "load 64-bit immediate" testcase
@ 2015-05-09  8:14 Xi Wang
  2015-05-09 16:11 ` Alexei Starovoitov
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Xi Wang @ 2015-05-09  8:14 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, linux-kernel, Xi Wang, Alexei Starovoitov, Will Deacon

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>
---
 lib/test_bpf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] test: bpf: extend "load 64-bit immediate" testcase
  2015-05-09  8:14 [PATCH net-next] test: bpf: extend "load 64-bit immediate" testcase Xi Wang
@ 2015-05-09 16:11 ` Alexei Starovoitov
  2015-05-09 21:12 ` Daniel Borkmann
  2015-05-11 15:02 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Alexei Starovoitov @ 2015-05-09 16:11 UTC (permalink / raw)
  To: Xi Wang, netdev; +Cc: David S. Miller, linux-kernel, Will Deacon

On 5/9/15 1:14 AM, Xi Wang wrote:
> 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>
> ---

looks good. Thanks!

Acked-by: Alexei Starovoitov <ast@plumgrid.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] test: bpf: extend "load 64-bit immediate" testcase
  2015-05-09  8:14 [PATCH net-next] test: bpf: extend "load 64-bit immediate" testcase Xi Wang
  2015-05-09 16:11 ` Alexei Starovoitov
@ 2015-05-09 21:12 ` Daniel Borkmann
  2015-05-11 15:02 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Borkmann @ 2015-05-09 21:12 UTC (permalink / raw)
  To: Xi Wang, netdev
  Cc: David S. Miller, linux-kernel, Alexei Starovoitov, Will Deacon

On 05/09/2015 10:14 AM, Xi Wang wrote:
> 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: Daniel Borkmann <daniel@iogearbox.net>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] test: bpf: extend "load 64-bit immediate" testcase
  2015-05-09  8:14 [PATCH net-next] test: bpf: extend "load 64-bit immediate" testcase Xi Wang
  2015-05-09 16:11 ` Alexei Starovoitov
  2015-05-09 21:12 ` Daniel Borkmann
@ 2015-05-11 15:02 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2015-05-11 15:02 UTC (permalink / raw)
  To: xi.wang; +Cc: netdev, linux-kernel, ast, will.deacon

From: Xi Wang <xi.wang@gmail.com>
Date: Sat,  9 May 2015 04:14:30 -0400

> 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>

Applied, thank you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-05-11 15:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-09  8:14 [PATCH net-next] test: bpf: extend "load 64-bit immediate" testcase Xi Wang
2015-05-09 16:11 ` Alexei Starovoitov
2015-05-09 21:12 ` Daniel Borkmann
2015-05-11 15:02 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).