[PATCH] arm64: bpf: fix buffer pointer

2015-11-18 Thread Zi Shen Lim
During code review, I noticed we were passing a bad buffer pointer to bpf_load_pointer helper function called by jitted code. Point to the buffer allocated by JIT, so we don't silently corrupt other parts of the stack. Signed-off-by: Zi Shen Lim <zlim@gmail.com> --- arch/arm

[PATCH net-next 1/3] arm64: bpf: implement bpf_tail_call() helper

2016-06-04 Thread Zi Shen Lim
h index aee5637..7c16e54 100644 --- a/arch/arm64/net/bpf_jit.h +++ b/arch/arm64/net/bpf_jit.h @@ -1,7 +1,7 @@ /* * BPF JIT compiler for ARM64 * - * Copyright (C) 2014-2015 Zi Shen Lim <zlim@gmail.com> + * Copyright (C) 2014-2016 Zi Shen Lim <zlim@gmail.com> * * This pro

[PATCH net-next 3/3] arm64: bpf: optimize LD_ABS, LD_IND

2016-06-04 Thread Zi Shen Lim
Remove superfluous stack frame, saving us 3 instructions for every LD_ABS or LD_IND. Signed-off-by: Zi Shen Lim <zlim@gmail.com> --- arch/arm64/net/bpf_jit_comp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 7

[PATCH net-next 2/3] arm64: bpf: optimize JMP_CALL

2016-06-04 Thread Zi Shen Lim
Remove superfluous stack frame, saving us 3 instructions for every JMP_CALL. Signed-off-by: Zi Shen Lim <zlim@gmail.com> --- arch/arm64/net/bpf_jit_comp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 5

[PATCH net-next v2 1/4] bpf: fix missing header inclusion

2016-06-06 Thread Zi Shen Lim
c174dea545 ("ebpf: make internal bpf API independent of CONFIG_BPF_SYSCALL ifdefs") Suggested-by: Daniel Borkmann <dan...@iogearbox.net> Signed-off-by: Zi Shen Lim <zlim@gmail.com> Acked-by: Daniel Borkmann <dan...@iogearbox.net> --- include/linux/bpf.h | 1 + 1 fi

[PATCH net-next v2 4/4] arm64: bpf: optimize LD_ABS, LD_IND

2016-06-06 Thread Zi Shen Lim
Remove superfluous stack frame, saving us 3 instructions for every LD_ABS or LD_IND. Signed-off-by: Zi Shen Lim <zlim@gmail.com> --- arch/arm64/net/bpf_jit_comp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 7

[PATCH net-next v2 3/4] arm64: bpf: optimize JMP_CALL

2016-06-06 Thread Zi Shen Lim
Remove superfluous stack frame, saving us 3 instructions for every JMP_CALL. Signed-off-by: Zi Shen Lim <zlim@gmail.com> --- arch/arm64/net/bpf_jit_comp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 5

[PATCH net-next v2 0/4] arm64 BPF JIT updates

2016-06-06 Thread Zi Shen Lim
to missing header inclusion in linux/bpf.h. (Thanks to suggestion and ack by Daniel Borkmann) Ordered it ahead of bpf_tail_call patch #2 so build error is not triggered. Zi Shen Lim (4): bpf: fix missing header inclusion arm64: bpf: implement bpf_tail_call() helper arm64: bpf

Re: [PATCH net-next 1/3] arm64: bpf: implement bpf_tail_call() helper

2016-06-06 Thread Zi Shen Lim
On Mon, Jun 6, 2016 at 1:11 AM, Daniel Borkmann wrote: > On 06/06/2016 06:56 AM, Z Lim wrote: > [...] >> >> How about the attached patch? Fixes compilation error on build >> !CONFIG_BPF_SYSCALL. >> >> Also, should this patch be sent to net or net-next (along with this >>

[PATCH net-next v2 2/4] arm64: bpf: implement bpf_tail_call() helper

2016-06-07 Thread Zi Shen Lim
h index aee5637..7c16e54 100644 --- a/arch/arm64/net/bpf_jit.h +++ b/arch/arm64/net/bpf_jit.h @@ -1,7 +1,7 @@ /* * BPF JIT compiler for ARM64 * - * Copyright (C) 2014-2015 Zi Shen Lim <zlim@gmail.com> + * Copyright (C) 2014-2016 Zi Shen Lim <zlim@gmail.com> * * This pro

[PATCH net-next v3 2/4] arm64: bpf: implement bpf_tail_call() helper

2016-06-08 Thread Zi Shen Lim
h index aee5637..7c16e54 100644 --- a/arch/arm64/net/bpf_jit.h +++ b/arch/arm64/net/bpf_jit.h @@ -1,7 +1,7 @@ /* * BPF JIT compiler for ARM64 * - * Copyright (C) 2014-2015 Zi Shen Lim <zlim@gmail.com> + * Copyright (C) 2014-2016 Zi Shen Lim <zlim@gmail.com> * * This pro

[PATCH net-next v3 4/4] arm64: bpf: optimize LD_ABS, LD_IND

2016-06-08 Thread Zi Shen Lim
Remove superfluous stack frame, saving us 3 instructions for every LD_ABS or LD_IND. Signed-off-by: Zi Shen Lim <zlim@gmail.com> --- arch/arm64/net/bpf_jit_comp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 7

[PATCH net-next v3 3/4] arm64: bpf: optimize JMP_CALL

2016-06-08 Thread Zi Shen Lim
Remove superfluous stack frame, saving us 3 instructions for every JMP_CALL. Signed-off-by: Zi Shen Lim <zlim@gmail.com> --- arch/arm64/net/bpf_jit_comp.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c index 5

[PATCH net-next v3 0/4] arm64 BPF JIT updates

2016-06-08 Thread Zi Shen Lim
since v1: - Added patch #1 to address build error due to missing header inclusion in linux/bpf.h. (Thanks to suggestion and ack by Daniel Borkmann) Ordered it ahead of bpf_tail_call patch #2 so build error is not triggered. Zi Shen Lim (4): bpf: fix missing header inclusion arm64

[PATCH net-next v3 1/4] bpf: fix missing header inclusion

2016-06-08 Thread Zi Shen Lim
c174dea545 ("ebpf: make internal bpf API independent of CONFIG_BPF_SYSCALL ifdefs") Suggested-by: Daniel Borkmann <dan...@iogearbox.net> Signed-off-by: Zi Shen Lim <zlim@gmail.com> Acked-by: Daniel Borkmann <dan...@iogearbox.net> --- include/linux/bpf.h | 1 + 1 fi

[PATCH] arm64: bpf: jit JMP_JSET_{X,K}

2016-05-13 Thread Zi Shen Lim
: if (0x3 & 0x) return 1 jited:1 89 PASS ... Fixes: e54bcde3d69d ("arm64: eBPF JIT compiler") Signed-off-by: Zi Shen Lim <zlim@gmail.com> --- arch/arm64/net/bpf_jit_comp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64

[PATCH net] selftests/bpf: fix broken build, take 2

2017-03-19 Thread Zi Shen Lim
: Fix selftests build to just build, not run tests"). Reordering the Makefile allows us to remove the 'all' target. Tested on Ubuntu 16.04.2. Signed-off-by: Zi Shen Lim <zlim@gmail.com> --- tools/testing/selftests/bpf/Makefile | 13 ++--- 1 file changed, 6 insertions(

[PATCH v2 net] selftests/bpf: fix broken build, take 2

2017-03-20 Thread Zi Shen Lim
: Fix selftests build to just build, not run tests"). Reordering the Makefile allows us to remove the 'all' target. Tested both: selftests/bpf$ make and selftests$ make TARGETS=bpf on Ubuntu 16.04.2. Signed-off-by: Zi Shen Lim <zlim@gmail.com> --- v1: - Fixed build