Re: [PATCHv2 bpf-next] selftests/bpf: Fix test_attach_probe for powerpc uprobes

2021-03-08 Thread Naveen N . Rao
powerpc arch plus instruction check stolen from ppc_function_entry > function pointed out and explained by Michael and Naveen. > > Cc: Michael Ellerman > Cc: Naveen N. Rao > Signed-off-by: Jiri Olsa > --- > .../selftests/bpf/prog_tests/attach_probe.c | 40 +

Re: [PATCH bpf-next] selftests/bpf: Fix test_attach_probe for powerpc uprobes

2021-03-05 Thread Naveen N. Rao
On 2021/03/04 04:55PM, Jiri Olsa wrote: > On Thu, Mar 04, 2021 at 11:46:27AM +1100, Michael Ellerman wrote: > > "Naveen N. Rao" writes: > > > On 2021/03/02 11:35AM, Jiri Olsa wrote: > > >> On Mon, Mar 01, 2021 at 02:58:53PM -0800, Yonghong Song wrote: >

Re: [PATCH bpf-next] selftests/bpf: Fix test_attach_probe for powerpc uprobes

2021-03-03 Thread Naveen N. Rao
On 2021/03/02 09:19AM, Yonghong Song wrote: > > > On 3/2/21 3:14 AM, Jiri Olsa wrote: > > On Mon, Mar 01, 2021 at 04:34:24PM -0800, Andrii Nakryiko wrote: > > > On Mon, Mar 1, 2021 at 11:11 AM Jiri Olsa wrote: > > > > > > > > When testing uprobes we the test gets GEP (Global Entry Point) > > >

Re: [PATCH bpf-next] selftests/bpf: Fix test_attach_probe for powerpc uprobes

2021-03-03 Thread Naveen N. Rao
On 2021/03/02 11:35AM, Jiri Olsa wrote: > On Mon, Mar 01, 2021 at 02:58:53PM -0800, Yonghong Song wrote: > > > > > > On 3/1/21 11:04 AM, Jiri Olsa wrote: > > > When testing uprobes we the test gets GEP (Global Entry Point) > > > address from kallsyms, but then the function is called locally > > >

Re: [PATCH] libbpf: Remove arch-specific include path in Makefile

2020-09-02 Thread Naveen N. Rao
Daniel Borkmann wrote: On 9/2/20 10:58 PM, Andrii Nakryiko wrote: On Wed, Sep 2, 2020 at 1:43 AM Naveen N. Rao wrote: Ubuntu mainline builds for ppc64le are failing with the below error (*): CALL/home/kernel/COD/linux/scripts/atomic/check-atomics.sh DESCEND bpf/resolve_btfids

[PATCH] libbpf: Remove arch-specific include path in Makefile

2020-09-02 Thread Naveen N. Rao
build failure. The specific header include path doesn't seem necessary for a libbpf build. Hence, remove the same. (*) https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.9-rc3/ppc64el/log Reported-by: Vaidyanathan Srinivasan Signed-off-by: Naveen N. Rao --- This is a simpler fix that seems to

Re: [PATCH bpf-next] libbpf: relicense bpf_helpers.h and bpf_endian.h

2019-08-19 Thread Naveen N. Rao
-Clause. This patch updates licensing of those two files. Quite late, but FWIW: Acked-by: Naveen N. Rao - Naveen

[PATCH] bpf: optimize constant blinding

2019-06-12 Thread Naveen N. Rao
branches at once. Reported-by: Michael Ellerman Signed-off-by: Naveen N. Rao --- kernel/bpf/core.c | 232 +- 1 file changed, 168 insertions(+), 64 deletions(-) diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 33fb292f2e30..82338b5cd98d 100644 --- a

Re: [PATCH v3 bpf-next 08/19] bpf: insert explicit zero extension insn when hardware doesn't do it implicitly

2019-04-15 Thread Naveen N. Rao
Jiong Wang wrote: On 15 Apr 2019, at 19:21, Naveen N. Rao wrote: Jiong Wang wrote: It will be great if you could test the latest set on PowerPC to see if there is any regression for example for those under test_progs and test_verifier. With test_bpf, I am seeing a few failures with this

Re: [PATCH v3 bpf-next 08/19] bpf: insert explicit zero extension insn when hardware doesn't do it implicitly

2019-04-15 Thread Naveen N. Rao
Jiong Wang wrote: It will be great if you could test the latest set on PowerPC to see if there is any regression for example for those under test_progs and test_verifier. With test_bpf, I am seeing a few failures with this patchset. And it will be even greater if you also use latest llvm sn

Re: [PATCH v3 bpf-next 08/19] bpf: insert explicit zero extension insn when hardware doesn't do it implicitly

2019-04-15 Thread Naveen N. Rao
Naveen N. Rao wrote: It is then for all back-ends to decide how to use such information to eliminate unnecessary zero extension code-gen during JIT compilation. One approach is: 1. Verifier insert explicit zero extension for those instructions that need zero extension. 2. All JIT back

Re: [PATCH v3 bpf-next 08/19] bpf: insert explicit zero extension insn when hardware doesn't do it implicitly

2019-04-15 Thread Naveen N. Rao
Hi Jiong, Jiong Wang wrote: After previous patches, verifier has marked those instructions that really need zero extension on dst_reg. Thanks for implementing this -- this is very helpful on architectures without sub-register instructions, especially in comparison with legacy BPF, since the

Re: [PATCH bpf v2 2/6] bpf: powerpc64: add JIT support for multi-function programs

2018-05-18 Thread Naveen N. Rao
Daniel Borkmann wrote: On 05/18/2018 02:50 PM, Sandipan Das wrote: This adds support for bpf-to-bpf function calls in the powerpc64 JIT compiler. The JIT compiler converts the bpf call instructions to native branch instructions. After a round of the usual passes, the start addresses of the JITed

Re: [RFC][PATCH bpf] tools: bpftool: Fix tags for bpf-to-bpf calls

2018-05-03 Thread Naveen N. Rao
Alexei Starovoitov wrote: On 3/1/18 12:51 AM, Naveen N. Rao wrote: Daniel Borkmann wrote: Worst case if there's nothing better, potentially what one could do in bpf_prog_get_info_by_fd() is to dump an array of full addresses and have the imm part as the index pointing to one of them,

Re: [RFC][PATCH bpf] tools: bpftool: Fix tags for bpf-to-bpf calls

2018-03-01 Thread Naveen N. Rao
Daniel Borkmann wrote: On 02/27/2018 01:13 PM, Sandipan Das wrote: With this patch, it will look like this: 0: (85) call pc+2#bpf_prog_8f85936f29a7790a+3 (Note the +2 is the insn->off already.) 1: (b7) r0 = 1 2: (95) exit 3: (b7) r0 = 2 4: (95) exit where 8f85936f29a7790a is

Re: [RFC][PATCH bpf v2 1/2] bpf: allow 64-bit offsets for bpf function calls

2018-02-20 Thread Naveen N. Rao
Michael Ellerman wrote: "Naveen N. Rao" writes: Daniel Borkmann wrote: On 02/15/2018 05:25 PM, Daniel Borkmann wrote: On 02/13/2018 05:05 AM, Sandipan Das wrote: The imm field of a bpf_insn is a signed 32-bit integer. For JIT-ed bpf-to-bpf function calls, it stores the o

Re: [RFC][PATCH bpf v2 1/2] bpf: allow 64-bit offsets for bpf function calls

2018-02-16 Thread Naveen N. Rao
Daniel Borkmann wrote: On 02/15/2018 05:25 PM, Daniel Borkmann wrote: On 02/13/2018 05:05 AM, Sandipan Das wrote: The imm field of a bpf_insn is a signed 32-bit integer. For JIT-ed bpf-to-bpf function calls, it stores the offset from __bpf_call_base to the start of the callee function. For som

Re: [RFC][PATCH bpf 1/2] bpf: allow 64-bit offsets for bpf function calls

2018-02-09 Thread Naveen N. Rao
Naveen N. Rao wrote: Alexei Starovoitov wrote: On 2/8/18 4:03 AM, Sandipan Das wrote: The imm field of a bpf_insn is a signed 32-bit integer. For JIT-ed bpf-to-bpf function calls, it stores the offset from __bpf_call_base to the start of the callee function. For some architectures, such as

Re: [RFC][PATCH bpf 1/2] bpf: allow 64-bit offsets for bpf function calls

2018-02-08 Thread Naveen N. Rao
Alexei Starovoitov wrote: On 2/8/18 4:03 AM, Sandipan Das wrote: The imm field of a bpf_insn is a signed 32-bit integer. For JIT-ed bpf-to-bpf function calls, it stores the offset from __bpf_call_base to the start of the callee function. For some architectures, such as powerpc64, it was found t

Re: [PATCH bpf-next 01/13] bpf: xor of a/x in cbpf can be done

2018-01-28 Thread Naveen N. Rao
in 32 bit alu Daniel Borkmann wrote: Very minor optimization; saves 1 byte per program in x86_64 JIT in cBPF prologue. ... but increases program size by 4 bytes on ppc64 :( In general, this is an area I've been wanting to spend some time on. Powerpc doesn't have 32-bit sub-registers, so we n

Re: [PATCH bpf-next 08/13] bpf, ppc64: remove obsolete exception handling from div/mod

2018-01-28 Thread Naveen N. Rao
Daniel Borkmann wrote: Since we've changed div/mod exception handling for src_reg in eBPF verifier itself, remove the leftovers from ppc64 JIT. Signed-off-by: Daniel Borkmann Cc: Naveen N. Rao --- arch/powerpc/net/bpf_jit_comp64.c | 8 1 file changed, 8 deletions(-) Probabl

Re: [RFC PATCH] bpf: Add helpers to read useful task_struct members

2017-11-07 Thread Naveen N. Rao
Alexei Starovoitov wrote: On 11/7/17 12:55 AM, Naveen N. Rao wrote: I thought such struct shouldn't change layout. If it is we need to fix include/linux/compiler-clang.h to do that anon struct as well. We considered that, but it looked to be very dependent on the version of gcc used to

Re: [RFC PATCH] bpf: Add helpers to read useful task_struct members

2017-11-06 Thread Naveen N. Rao
Alexei Starovoitov wrote: On 11/5/17 2:31 AM, Naveen N. Rao wrote: Hi Alexei, Alexei Starovoitov wrote: On 11/3/17 3:58 PM, Sandipan Das wrote: For added security, the layout of some structures can be randomized by enabling CONFIG_GCC_PLUGIN_RANDSTRUCT. One such structure is task_struct. To

Re: [RFC PATCH] bpf: Add helpers to read useful task_struct members

2017-11-04 Thread Naveen N. Rao
Hi Alexei, Alexei Starovoitov wrote: On 11/3/17 3:58 PM, Sandipan Das wrote: For added security, the layout of some structures can be randomized by enabling CONFIG_GCC_PLUGIN_RANDSTRUCT. One such structure is task_struct. To build BPF programs, we use Clang which does not support this feature.

Re: [PATCH 1/1] bpf: take advantage of stack_depth tracking in powerpc JIT

2017-09-01 Thread Naveen N. Rao
f-by: Sandipan Das > --- LGTM, thanks! Reviewed-by: Naveen N. Rao Michael, Seeing as this is powerpc specific, can you please take this through your tree? Thanks, Naveen > arch/powerpc/net/bpf_jit64.h | 7 --- > arch/powerpc/net/bpf_jit_comp64.c | 16 ++-- > 2 file

Re: [PATCH 3/3] powerpc: bpf: implement in-register swap for 64-bit endian operations

2017-01-24 Thread 'Naveen N. Rao'
On 2017/01/24 04:13PM, David Laight wrote: > From: 'Naveen N. Rao' > > Sent: 23 January 2017 19:22 > > On 2017/01/15 09:00AM, Benjamin Herrenschmidt wrote: > > > On Fri, 2017-01-13 at 23:22 +0530, 'Naveen N. Rao' wrote: > > > > > That

Re: [PATCH 3/3] powerpc: bpf: implement in-register swap for 64-bit endian operations

2017-01-23 Thread 'Naveen N. Rao'
On 2017/01/15 09:00AM, Benjamin Herrenschmidt wrote: > On Fri, 2017-01-13 at 23:22 +0530, 'Naveen N. Rao' wrote: > > > That rather depends on whether the processor has a store to load forwarder > > > that will satisfy the read from the store buffer. > > > I

Re: [PATCH 1/3] powerpc: bpf: remove redundant check for non-null image

2017-01-23 Thread Naveen N. Rao
Hi David, On 2017/01/16 01:38PM, David Miller wrote: > > I'm assuming these patches will go via the powerpc tree. > > If you want them to go into net-next, I kindly ask that you always > explicitly say so, and furthermore always submit a patch series with > a proper "[PATCH 0/N] ..." header post

Re: [PATCH 3/3] powerpc: bpf: implement in-register swap for 64-bit endian operations

2017-01-13 Thread 'Naveen N. Rao'
On 2017/01/13 05:17PM, David Laight wrote: > From: Naveen N. Rao > > Sent: 13 January 2017 17:10 > > Generate instructions to perform the endian conversion using registers, > > rather than generating two memory accesses. > > > > The "way easier and faster

[PATCH 1/3] powerpc: bpf: remove redundant check for non-null image

2017-01-13 Thread Naveen N. Rao
From: Daniel Borkmann We have a check earlier to ensure we don't proceed if image is NULL. As such, the redundant check can be removed. Signed-off-by: Daniel Borkmann [Added similar changes for classic BPF JIT] Signed-off-by: Naveen N. Rao --- arch/powerpc/net/bpf_jit_comp.c

[PATCH 3/3] powerpc: bpf: implement in-register swap for 64-bit endian operations

2017-01-13 Thread Naveen N. Rao
Generate instructions to perform the endian conversion using registers, rather than generating two memory accesses. The "way easier and faster" comment was obviously for the author, not the processor. Signed-off-by: Naveen N. Rao --- arch/powerpc/net/bpf_jit_com

[PATCH 2/3] powerpc: bpf: flush the entire JIT buffer

2017-01-13 Thread Naveen N. Rao
h the entire allocated buffer rather than just the part containing the actual program. We already flush the buffer from start to the end of the BPF program. Extend this to include the illegal instructions after the BPF program. Signed-off-by: Naveen N. Rao --- arch/powerpc/net/bpf_jit_comp64.

Re: [PATCH 2/3] bpf powerpc: implement support for tail calls

2016-09-26 Thread Naveen N. Rao
On 2016/09/26 11:00AM, Daniel Borkmann wrote: > On 09/26/2016 10:56 AM, Naveen N. Rao wrote: > > On 2016/09/24 03:30AM, Alexei Starovoitov wrote: > > > On Sat, Sep 24, 2016 at 12:33:54AM +0200, Daniel Borkmann wrote: > > > > On 09/23/2016 10:35 PM, Naveen N. Rao wro

Re: [PATCH 2/3] bpf powerpc: implement support for tail calls

2016-09-26 Thread Naveen N. Rao
On 2016/09/24 03:30AM, Alexei Starovoitov wrote: > On Sat, Sep 24, 2016 at 12:33:54AM +0200, Daniel Borkmann wrote: > > On 09/23/2016 10:35 PM, Naveen N. Rao wrote: > > >Tail calls allow JIT'ed eBPF programs to call into other JIT'ed eBPF > > >programs. Th

[PATCH 1/2] bpf samples: fix compiler errors with sockex2 and sockex3

2016-09-23 Thread Naveen N. Rao
These samples fail to compile as 'struct flow_keys' conflicts with definition in net/flow_dissector.h. Fix the same by renaming the structure used in the sample. Signed-off-by: Naveen N. Rao --- samples/bpf/sockex2_kern.c | 10 +- samples/bpf/sockex3_kern.c | 8 s

[PATCH 2/2] bpf samples: update tracex5 sample to use __seccomp_filter

2016-09-23 Thread Naveen N. Rao
seccomp_phase1() does not exist anymore. Instead, update sample to use __seccomp_filter(). While at it, set max locked memory to unlimited. Signed-off-by: Naveen N. Rao --- I am not completely sure if __seccomp_filter is the right place to hook in. This works for me though. Please review

[PATCH 3/3] bpf powerpc: add support for bpf constant blinding

2016-09-23 Thread Naveen N. Rao
2,r2,39131 6c: xoris r2,r2,48399 70: rotlwi r2,r2,0 74: mr r8,r2 78: rotlwi r8,r8,0 7c: ld r27,-40(r1) 80: ld r28,-32(r1) 84: mr r3,r8 88: blr Signed-off-by: Naveen N. Rao --- arch/powerpc/net/bpf_jit64.h | 9 + arch/p

[PATCH 2/3] bpf powerpc: implement support for tail calls

2016-09-23 Thread Naveen N. Rao
t don't do tail calls themselves, the first two instructions are NOPs. Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/ppc-opcode.h | 2 + arch/powerpc/net/bpf_jit.h| 2 + arch/powerpc/net/bpf_jit64.h | 1 + arch/powerpc/net/bpf_ji

[PATCH 1/3] bpf powerpc: introduce accessors for using the tmp local stack space

2016-09-23 Thread Naveen N. Rao
While at it, ensure that the location of the local save area is consistent whether or not we setup our own stackframe. This property is utilised in the next patch that adds support for tail calls. Signed-off-by: Naveen N. Rao --- arch/powerpc/net/bpf_jit64.h | 16 +--- arch/powerpc/net

[PATCHv2 6/7] ppc: bpf/jit: Isolate classic BPF JIT specifics into a separate header

2016-06-22 Thread Naveen N. Rao
vid S. Miller" Cc: Ananth N Mavinakayanahalli Cc: Thadeu Lima de Souza Cascardo Acked-by: Alexei Starovoitov Signed-off-by: Naveen N. Rao --- arch/powerpc/net/bpf_jit.h | 121 +- arch/powerpc/net/bpf_jit32.h| 139

[PATCHv2 3/7] ppc: bpf/jit: Optimize 64-bit Immediate loads

2016-06-22 Thread Naveen N. Rao
Cc: "David S. Miller" Cc: Ananth N Mavinakayanahalli Cc: Thadeu Lima de Souza Cascardo Acked-by: Alexei Starovoitov Signed-off-by: Naveen N. Rao --- arch/powerpc/net/bpf_jit.h | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/net/b

[PATCHv2 0/7] eBPF JIT for PPC64

2016-06-22 Thread Naveen N. Rao
4 [2] http://thread.gmane.org/gmane.linux.ports.ppc.embedded/96514 Naveen N. Rao (7): ppc bpf/jit: Disable classic BPF JIT on ppc64le ppc: bpf/jit: Fix/enhance 32-bit Load Immediate implementation ppc: bpf/jit: Optimize 64-bit Immediate loads ppc: bpf/jit: Introduce rotate immediate in

[PATCHv2 5/7] ppc: bpf/jit: A few cleanups

2016-06-22 Thread Naveen N. Rao
ahalli Cc: Thadeu Lima de Souza Cascardo Acked-by: Alexei Starovoitov Signed-off-by: Naveen N. Rao --- arch/powerpc/net/bpf_jit.h | 13 +++-- arch/powerpc/net/bpf_jit_comp.c | 8 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/net/bpf_jit.h b/arch/p

[PATCHv2 4/7] ppc: bpf/jit: Introduce rotate immediate instructions

2016-06-22 Thread Naveen N. Rao
s Kirjanov Cc: Michael Ellerman Cc: Paul Mackerras Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "David S. Miller" Cc: Ananth N Mavinakayanahalli Cc: Thadeu Lima de Souza Cascardo Acked-by: Alexei Starovoitov Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/ppc-op

[PATCHv2 7/7] ppc: ebpf/jit: Implement JIT compiler for extended BPF

2016-06-22 Thread Naveen N. Rao
"David S. Miller" Cc: Ananth N Mavinakayanahalli Cc: Thadeu Lima de Souza Cascardo Acked-by: Alexei Starovoitov Signed-off-by: Naveen N. Rao --- arch/powerpc/Kconfig | 3 +- arch/powerpc/include/asm/asm-compat.h | 2 + arch/powerpc/include/asm/ppc-opcode.h | 2

[PATCHv2 1/7] ppc bpf/jit: Disable classic BPF JIT on ppc64le

2016-06-22 Thread Naveen N. Rao
: Alexei Starovoitov Cc: Daniel Borkmann Cc: "David S. Miller" Cc: Ananth N Mavinakayanahalli Cc: Thadeu Lima de Souza Cascardo Reported-by: Thadeu Lima de Souza Cascardo Signed-off-by: Naveen N. Rao --- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[PATCHv2 2/7] ppc: bpf/jit: Fix/enhance 32-bit Load Immediate implementation

2016-06-22 Thread Naveen N. Rao
Cc: Thadeu Lima de Souza Cascardo Acked-by: Alexei Starovoitov Signed-off-by: Naveen N. Rao --- arch/powerpc/net/bpf_jit.h | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/net/bpf_jit.h b/arch/powerpc/net/bpf_jit.h index 889fd19..a9882db 100644

Re: [PATCH] ppc: Fix BPF JIT for ABIv2

2016-06-22 Thread Naveen N. Rao
On 2016/06/22 12:42PM, Naveen N Rao wrote: > On 2016/06/21 11:47AM, Thadeu Lima de Souza Cascardo wrote: > > On Tue, Jun 21, 2016 at 09:15:48PM +1000, Michael Ellerman wrote: > > > On Tue, 2016-06-21 at 14:28 +0530, Naveen N. Rao wrote: > > > > On 2016/06/20 03:56PM,

Re: [PATCH 6/6] ppc: ebpf/jit: Implement JIT compiler for extended BPF

2016-06-22 Thread Naveen N. Rao
On 2016/06/22 08:37PM, Michael Ellerman wrote: > On Tue, 2016-06-07 at 19:02 +0530, Naveen N. Rao wrote: > > > PPC64 eBPF JIT compiler. > > > > Enable with: > > echo 1 > /proc/sys/net/core/bpf_jit_enable > > or > > echo 2 > /proc/sys/net/core/bpf_

Re: [PATCH] ppc: Fix BPF JIT for ABIv2

2016-06-22 Thread Naveen N. Rao
On 2016/06/21 11:47AM, Thadeu Lima de Souza Cascardo wrote: > On Tue, Jun 21, 2016 at 09:15:48PM +1000, Michael Ellerman wrote: > > On Tue, 2016-06-21 at 14:28 +0530, Naveen N. Rao wrote: > > > On 2016/06/20 03:56PM, Thadeu Lima de Souza Cascardo wrote: > > > > On S

Re: [6/6] ppc: ebpf/jit: Implement JIT compiler for extended BPF

2016-06-22 Thread Naveen N. Rao
On 2016/06/21 09:04PM, Michael Ellerman wrote: > On Tue, 2016-06-21 at 12:28 +0530, Naveen N. Rao wrote: > > On 2016/06/21 09:38AM, Michael Ellerman wrote: > > > On Sun, 2016-06-19 at 23:06 +0530, Naveen N. Rao wrote: > > > > > > > > #inc

Re: [PATCH] ppc: Fix BPF JIT for ABIv2

2016-06-21 Thread Naveen N. Rao
On 2016/06/20 03:56PM, Thadeu Lima de Souza Cascardo wrote: > On Sun, Jun 19, 2016 at 11:19:14PM +0530, Naveen N. Rao wrote: > > On 2016/06/17 10:00AM, Thadeu Lima de Souza Cascardo wrote: > > > > > > Hi, Michael and Naveen. > > > > > > I noticed i

Re: [6/6] ppc: ebpf/jit: Implement JIT compiler for extended BPF

2016-06-21 Thread Naveen N. Rao
On 2016/06/21 09:38AM, Michael Ellerman wrote: > On Sun, 2016-06-19 at 23:06 +0530, Naveen N. Rao wrote: > > On 2016/06/17 10:53PM, Michael Ellerman wrote: > > > On Tue, 2016-07-06 at 13:32:23 UTC, "Naveen N. Rao" wrote: > > > > diff --git a/arch/powe

Re: [PATCH] ppc: Fix BPF JIT for ABIv2

2016-06-19 Thread Naveen N. Rao
On 2016/06/17 10:00AM, Thadeu Lima de Souza Cascardo wrote: > On Fri, Jun 17, 2016 at 10:53:21PM +1000, Michael Ellerman wrote: > > On Tue, 2016-07-06 at 13:32:23 UTC, "Naveen N. Rao" wrote: > > > diff --git a/arch/powerpc/net/bpf_jit_comp64.c > > > b/arch/p

Re: [6/6] ppc: ebpf/jit: Implement JIT compiler for extended BPF

2016-06-19 Thread Naveen N. Rao
On 2016/06/17 10:53PM, Michael Ellerman wrote: > On Tue, 2016-07-06 at 13:32:23 UTC, "Naveen N. Rao" wrote: > > diff --git a/arch/powerpc/net/bpf_jit_comp64.c > > b/arch/powerpc/net/bpf_jit_comp64.c > > new file mode 100644 > > index 000..954ff53 > &g

Re: [PATCH 0/6] eBPF JIT for PPC64

2016-06-12 Thread Naveen N. Rao
On 2016/06/10 10:47PM, David Miller wrote: > From: "Naveen N. Rao" > Date: Tue, 7 Jun 2016 19:02:17 +0530 > > > Please note that patch [2] is a pre-requisite for this patchset, and is > > not yet upstream. > ... > > [1] http://thread.gmane.org

Re: [PATCH 6/6] ppc: ebpf/jit: Implement JIT compiler for extended BPF

2016-06-08 Thread Naveen N. Rao
On 2016/06/08 10:19PM, Nilay Vaish wrote: > Naveen, can you point out where in the patch you update the variable: > idx, a member of codegen_contex structure? Somehow I am unable to > figure it out. I can only see that we set it to 0 in the > bpf_int_jit_compile function. Since all your test cas

Re: [PATCH 6/6] ppc: ebpf/jit: Implement JIT compiler for extended BPF

2016-06-08 Thread Naveen N. Rao
On 2016/06/07 03:56PM, Alexei Starovoitov wrote: > On Tue, Jun 07, 2016 at 07:02:23PM +0530, Naveen N. Rao wrote: > > PPC64 eBPF JIT compiler. > > > > Enable with: > > echo 1 > /proc/sys/net/core/bpf_jit_enable > > or > > echo 2 > /proc/sys/ne

[PATCH 3/6] ppc: bpf/jit: Introduce rotate immediate instructions

2016-06-07 Thread Naveen N. Rao
s Kirjanov Cc: Michael Ellerman Cc: Paul Mackerras Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "David S. Miller" Cc: Ananth N Mavinakayanahalli Signed-off-by: Naveen N. Rao --- arch/powerpc/include/asm/ppc-opcode.h | 2 ++ arch/powerpc/net/bpf_jit.h| 20 +

[PATCH 4/6] ppc: bpf/jit: A few cleanups

2016-06-07 Thread Naveen N. Rao
li Signed-off-by: Naveen N. Rao --- arch/powerpc/net/bpf_jit.h | 13 +++-- arch/powerpc/net/bpf_jit_comp.c | 8 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/net/bpf_jit.h b/arch/powerpc/net/bpf_jit.h index 95d0e38..9041d3f 100644 --- a/arch/p

[PATCH 0/6] eBPF JIT for PPC64

2016-06-07 Thread Naveen N. Rao
t for BPF constant blinding Please note that patch [2] is a pre-requisite for this patchset, and is not yet upstream. - Naveen [1] http://thread.gmane.org/gmane.linux.kernel/2188694 [2] http://thread.gmane.org/gmane.linux.ports.ppc.embedded/96514 Naveen N. Rao (6): ppc: bpf/jit: Fix/enhance 3

[PATCH 1/6] ppc: bpf/jit: Fix/enhance 32-bit Load Immediate implementation

2016-06-07 Thread Naveen N. Rao
Signed-off-by: Naveen N. Rao --- arch/powerpc/net/bpf_jit.h | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/net/bpf_jit.h b/arch/powerpc/net/bpf_jit.h index 889fd19..a9882db 100644 --- a/arch/powerpc/net/bpf_jit.h +++ b/arch/powerpc/net/bpf_jit.h

[PATCH 5/6] ppc: bpf/jit: Isolate classic BPF JIT specifics into a separate header

2016-06-07 Thread Naveen N. Rao
vid S. Miller" Cc: Ananth N Mavinakayanahalli Signed-off-by: Naveen N. Rao --- arch/powerpc/net/bpf_jit.h | 121 +- arch/powerpc/net/bpf_jit32.h| 139 arch/powerpc/net/bpf_jit_asm.S | 2 +- arch/powerpc/net/bpf_

[PATCH 6/6] ppc: ebpf/jit: Implement JIT compiler for extended BPF

2016-06-07 Thread Naveen N. Rao
"David S. Miller" Cc: Ananth N Mavinakayanahalli Signed-off-by: Naveen N. Rao --- arch/powerpc/Kconfig | 3 +- arch/powerpc/include/asm/asm-compat.h | 2 + arch/powerpc/include/asm/ppc-opcode.h | 20 +- arch/powerpc/net/Makefile | 4 + arch/powerpc

[PATCH 2/6] ppc: bpf/jit: Optimize 64-bit Immediate loads

2016-06-07 Thread Naveen N. Rao
Cc: "David S. Miller" Cc: Ananth N Mavinakayanahalli Signed-off-by: Naveen N. Rao --- arch/powerpc/net/bpf_jit.h | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/net/bpf_jit.h b/arch/powerpc/net/bpf_jit.h index a9882db..4c1e055 10

Re: [net-next PATCH V4 1/5] samples/bpf: add back functionality to redefine LLC command

2016-04-28 Thread Naveen N. Rao
On 2016/04/28 04:40PM, Jesper Dangaard Brouer wrote: > On Thu, 28 Apr 2016 18:51:33 +0530 > "Naveen N. Rao" wrote: > > > > Add this features back. Note that it is possible to redefine the LLC > > > on the make command like: > > > > &g

Re: [net-next PATCH V4 3/5] samples/bpf: add a README file to get users started

2016-04-28 Thread Naveen N. Rao
. one > need to call make like: > > make samples/bpf/ > > Do notice the "/" slash after the directory name. > > Signed-off-by: Jesper Dangaard Brouer Acked-by: Naveen N. Rao > --- > samples/bpf/README.rst | 64 > +++

Re: [net-next PATCH V4 1/5] samples/bpf: add back functionality to redefine LLC command

2016-04-28 Thread Naveen N. Rao
On 2016/04/28 02:20PM, Jesper Dangaard Brouer wrote: > It is practical to be-able-to redefine the location of the LLVM > command 'llc', because not all distros have a LLVM version with bpf > target support. Thus, it is sometimes required to compile LLVM from > source, and sometimes it is not desir

Re: [net-next PATCH V3 3/5] samples/bpf: add a README file to get users started

2016-04-27 Thread Naveen N. Rao
On 2016/04/27 11:16AM, Jesper Dangaard Brouer wrote: > On Wed, 27 Apr 2016 14:05:22 +0530 > "Naveen N. Rao" wrote: > > > On 2016/04/27 09:30AM, Jesper Dangaard Brouer wrote: > > > Getting started with using examples in samples/bpf/ is not > > > strai

Re: [net-next PATCH V3 2/5] samples/bpf: Makefile verify LLVM compiler avail and bpf target is supported

2016-04-27 Thread Naveen N. Rao
Dangaard Brouer > Acked-by: Alexei Starovoitov > --- > samples/bpf/Makefile | 18 ++ > 1 file changed, 18 insertions(+) Acked-by: Naveen N. Rao > > diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile > index 5bae9536f100..45859c99f573 100644 &

Re: [net-next PATCH V3 3/5] samples/bpf: add a README file to get users started

2016-04-27 Thread Naveen N. Rao
On 2016/04/27 09:30AM, Jesper Dangaard Brouer wrote: > Getting started with using examples in samples/bpf/ is not > straightforward. There are several dependencies, and specific > versions of these dependencies. > > Just compiling the example tool is also slightly obscure, e.g. one > need to call

Re: [net-next PATCH V3 1/5] samples/bpf: add back functionality to redefine LLC command

2016-04-27 Thread Naveen N. Rao
On 2016/04/27 09:30AM, Jesper Dangaard Brouer wrote: > It is practical to be-able-to redefine the location of the LLVM > command 'llc', because not all distros have a LLVM version with bpf > target support. Thus, it is sometimes required to compile LLVM from > source, and sometimes it is not desir

Re: [PATCH net 4/4] lib/test_bpf: Add additional BPF_ADD tests

2016-04-05 Thread Naveen N. Rao
On 2016/04/05 09:28AM, Alexei Starovoitov wrote: > On 4/5/16 3:02 AM, Naveen N. Rao wrote: > >Some of these tests proved useful with the powerpc eBPF JIT port due to > >sign-extended 16-bit immediate loads. Though some of these aspects get > >covered in other tests, it is be

Re: [PATCH net 2/4] lib/test_bpf: Add tests for unsigned BPF_JGT

2016-04-05 Thread Naveen N. Rao
On 2016/04/05 09:20AM, Alexei Starovoitov wrote: > On 4/5/16 3:02 AM, Naveen N. Rao wrote: > >Unsigned Jump-if-Greater-Than. > > > >Cc: Alexei Starovoitov > >Cc: Daniel Borkmann > >Cc: "David S. Miller" > >Cc: Ananth N Mavinakayanahalli > >

[PATCH net 3/4] lib/test_bpf: Add test to check for result of 32-bit add that overflows

2016-04-05 Thread Naveen N. Rao
BPF_ALU32 and BPF_ALU64 tests for adding two 32-bit values that results in 32-bit overflow. Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "David S. Miller" Cc: Ananth N Mavinakayanahalli Cc: Michael Ellerman Cc: Paul Mackerras Signed-off-by: Naveen N. Rao --- lib/test_

[PATCH net 4/4] lib/test_bpf: Add additional BPF_ADD tests

2016-04-05 Thread Naveen N. Rao
: "David S. Miller" Cc: Ananth N Mavinakayanahalli Cc: Michael Ellerman Cc: Paul Mackerras Signed-off-by: Naveen N. Rao --- lib/test_bpf.c | 128 + 1 file changed, 128 insertions(+) diff --git a/lib/test_bpf.c b/lib/test_bpf.c ind

[PATCH net 2/4] lib/test_bpf: Add tests for unsigned BPF_JGT

2016-04-05 Thread Naveen N. Rao
Unsigned Jump-if-Greater-Than. Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "David S. Miller" Cc: Ananth N Mavinakayanahalli Cc: Michael Ellerman Cc: Paul Mackerras Signed-off-by: Naveen N. Rao --- lib/test_bpf.c | 29 + 1 file changed, 29 insertion

[PATCH net 1/4] lib/test_bpf: Fix JMP_JSET tests

2016-04-05 Thread Naveen N. Rao
JMP_JSET tests incorrectly used BPF_JNE. Fix the same. Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: "David S. Miller" Cc: Ananth N Mavinakayanahalli Cc: Michael Ellerman Cc: Paul Mackerras Signed-off-by: Naveen N. Rao --- lib/test_bpf.c | 8 1 file changed, 4 insert

Re: [RFC PATCH 6/6] ppc: ebpf/jit: Implement JIT compiler for extended BPF

2016-04-04 Thread Naveen N. Rao
On 2016/04/01 08:34PM, Daniel Borkmann wrote: > On 04/01/2016 08:10 PM, Alexei Starovoitov wrote: > >On 4/1/16 2:58 AM, Naveen N. Rao wrote: > >>PPC64 eBPF JIT compiler. Works for both ABIv1 and ABIv2. > >> > >>Enable with: > >>echo 1 > /proc/sys/n

[PATCHv2 net 1/3] samples/bpf: Fix build breakage with map_perf_test_user.c

2016-04-04 Thread Naveen N. Rao
: Alexei Starovoitov Cc: Daniel Borkmann Cc: David S. Miller Cc: Ananth N Mavinakayanahalli Cc: Michael Ellerman Acked-by: Alexei Starovoitov Signed-off-by: Naveen N. Rao --- v2: no changes samples/bpf/map_perf_test_user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sam

[PATCHv2 net 2/3] samples/bpf: Use llc in PATH, rather than a hardcoded value

2016-04-04 Thread Naveen N. Rao
While at it, remove the generation of .s files and fix some typos in the related comment. Cc: Alexei Starovoitov Cc: David S. Miller Cc: Daniel Borkmann Cc: Ananth N Mavinakayanahalli Cc: Michael Ellerman Signed-off-by: Naveen N. Rao --- v2: removed generation of .s files samples/bpf

[PATCHv2 net 3/3] samples/bpf: Enable powerpc support

2016-04-04 Thread Naveen N. Rao
vid S. Miller Cc: Ananth N Mavinakayanahalli Cc: Michael Ellerman Signed-off-by: Naveen N. Rao --- v2: updated macros using ({ }) gcc extension as per Alexei samples/bpf/bpf_helpers.h | 26 ++ samples/bpf/spintest_kern.c | 2 +- samples/bpf/tracex2_kern.c

Re: [PATCH 4/4] samples/bpf: Enable powerpc support

2016-04-01 Thread Naveen N. Rao
On 2016/03/31 10:52AM, Alexei Starovoitov wrote: > On 3/31/16 4:25 AM, Naveen N. Rao wrote: > ... > >+ > >+#ifdef __powerpc__ > >+#define BPF_KPROBE_READ_RET_IP(ip, ctx) { (ip) = (ctx)->link; } > >+#define BPF_KRETPROBE_READ_RET_IP(ip, ctx) BPF_KPRO

Re: [PATCH 2/4] samples/bpf: Use llc in PATH, rather than a hardcoded value

2016-04-01 Thread Naveen N. Rao
On 2016/03/31 08:19PM, Daniel Borkmann wrote: > On 03/31/2016 07:46 PM, Alexei Starovoitov wrote: > >On 3/31/16 4:25 AM, Naveen N. Rao wrote: > >> clang $(NOSTDINC_FLAGS) $(LINUXINCLUDE) $(EXTRA_CFLAGS) \ > >> -D__KERNEL__ -D__ASM_SYSREG_H -Wno-unu

Re: [PATCH 3/4] samples/bpf: Simplify building BPF samples

2016-03-31 Thread Naveen N. Rao
On 2016/03/31 10:49AM, Alexei Starovoitov wrote: > On 3/31/16 4:25 AM, Naveen N. Rao wrote: > >Make BPF samples build depend on CONFIG_SAMPLE_BPF. We still don't add a > >Kconfig option since that will add a dependency on llvm for allyesconfig > >builds which may not be d

Re: [PATCH 1/4] samples/bpf: Fix build breakage with map_perf_test_user.c

2016-03-31 Thread Naveen N. Rao
On 2016/03/31 10:43AM, Alexei Starovoitov wrote: > On 3/31/16 4:25 AM, Naveen N. Rao wrote: > >Building BPF samples is failing with the below error: > > > >samples/bpf/map_perf_test_user.c: In function ‘main’: > >samples/bpf/map_perf_test_user.c:134:9: error: variable