Re: [PATCH] arch: powerpc: net: bpf_jit_comp32.c: Fixed 'instead' typo

2023-10-16 Thread Daniel Borkmann
On 10/13/23 7:31 AM, Muhammad Muzammil wrote: Fixed 'instead' typo Signed-off-by: Muhammad Muzammil Michael, I presume you'll pick it up? Thanks, Daniel --- arch/powerpc/net/bpf_jit_comp32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH v6 0/5] powerpc/bpf: use BPF prog pack allocator

2023-10-16 Thread Daniel Borkmann
On 10/12/23 10:03 PM, Hari Bathini wrote: Most BPF programs are small, but they consume a page each. For systems with busy traffic and many BPF programs, this may also add significant pressure on instruction TLB. High iTLB pressure usually slows down the whole system causing visible performance

Re: [bpf-next v1] bpf: drop deprecated bpf_jit_enable == 2

2023-01-03 Thread Daniel Borkmann
and then image/insn is valid. BTW, we can use the "bpftool prog dump" JITed instructions. * clean up the doc * remove bpf_jit_disasm tool * set bpf_jit_enable only 0 or 1. Signed-off-by: Tonghao Zhang Suggested-by: Alexei Starovoitov Cc: Alexei Starovoitov Cc: Daniel Borkmann Cc: Andrii Na

Re: [PATCH 0/5] Atomics support for eBPF on powerpc

2022-05-12 Thread Daniel Borkmann
On 5/12/22 9:45 AM, Hari Bathini wrote: This patchset adds atomic operations to the eBPF instruction set on powerpc. The instructions that are added here can be summarised with this list of kernel operations for ppc64: * atomic[64]_[fetch_]add * atomic[64]_[fetch_]and * atomic[64]_[fetch_]or *

Re: [PATCH 01/13] bpf: Guard against accessing NULL pt_regs in bpf_get_task_stack()

2022-01-07 Thread Daniel Borkmann
. Fixes: fa28dcb82a38f8 ("bpf: Introduce helper bpf_get_task_stack()") Cc: sta...@vger.kernel.org # v5.9+ Signed-off-by: Naveen N. Rao Acked-by: Daniel Borkmann

Re: [PATCH] powerpc/bpf: fix write protecting JIT code

2021-10-25 Thread Daniel Borkmann
On 10/25/21 8:15 AM, Naveen N. Rao wrote: Hari Bathini wrote: Running program with bpf-to-bpf function calls results in data access exception (0x300) with the below call trace:     [c0113f28] bpf_int_jit_compile+0x238/0x750 (unreliable)     [c037d2f8] bpf_check+0x2008/0x2710    

Re: [PATCH v4 0/8] bpf powerpc: Add BPF_PROBE_MEM support in powerpc JIT compiler

2021-10-04 Thread Daniel Borkmann
On 10/4/21 12:49 AM, Michael Ellerman wrote: Daniel Borkmann writes: On 9/29/21 1:18 PM, Hari Bathini wrote: Patch #1 & #2 are simple cleanup patches. Patch #3 refactors JIT compiler code with the aim to simplify adding BPF_PROBE_MEM support. Patch #4 introduces PPC_RAW_BRANCH() macro ins

Re: [PATCH v4 0/8] bpf powerpc: Add BPF_PROBE_MEM support in powerpc JIT compiler

2021-09-30 Thread Daniel Borkmann
On 9/29/21 1:18 PM, Hari Bathini wrote: Patch #1 & #2 are simple cleanup patches. Patch #3 refactors JIT compiler code with the aim to simplify adding BPF_PROBE_MEM support. Patch #4 introduces PPC_RAW_BRANCH() macro instead of open coding branch instruction. Patch #5 & #7 add BPF_PROBE_MEM

Re: [PATCH bpf-next v2] bpf: Change value of MAX_TAIL_CALL_CNT from 32 to 33

2021-09-14 Thread Daniel Borkmann
On 9/11/21 3:56 AM, Tiezhu Yang wrote: In the current code, the actual max tail call count is 33 which is greater than MAX_TAIL_CALL_CNT (defined as 32), the actual limit is not consistent with the meaning of MAX_TAIL_CALL_CNT, there is some confusion and need to spend some time to think about

Re: [PATCH bpf-next] bpf: Change value of MAX_TAIL_CALL_CNT from 32 to 33

2021-09-09 Thread Daniel Borkmann
On 9/9/21 7:50 AM, Andrii Nakryiko wrote: On Wed, Sep 8, 2021 at 8:33 PM Tiezhu Yang wrote: In the current code, the actual max tail call count is 33 which is greater than MAX_TAIL_CALL_CNT (defined as 32), the actual limit is not consistent with the meaning of MAX_TAIL_CALL_CNT, there is

Re: [PATCH v2] lockdown,selinux: avoid bogus SELinux lockdown permission checks

2021-06-04 Thread Daniel Borkmann
On 6/4/21 6:50 AM, Paul Moore wrote: On Thu, Jun 3, 2021 at 2:53 PM Daniel Borkmann wrote: [...] I did run this entire discussion by both of the other BPF co-maintainers (Alexei, Andrii, CC'ed) and together we did further brainstorming on the matter on how we could solve this, but couldn't

Re: [PATCH v2] lockdown,selinux: avoid bogus SELinux lockdown permission checks

2021-06-03 Thread Daniel Borkmann
9] schedule+0x5b/0xc0 [ 730.893522] exit_to_user_mode_prepare+0x11d/0x240 [ 730.894457] syscall_exit_to_user_mode+0x27/0x70 [ 730.895361] entry_SYSCALL_64_after_hwframe+0x44/0xae [...] Fixes: 59438b46471a ("security,lockdown,selinux: implement SELinux lockdown") Reported-by: Ondrej Mosnacek Report

Re: [PATCH v2] lockdown,selinux: avoid bogus SELinux lockdown permission checks

2021-06-02 Thread Daniel Borkmann
On 6/1/21 10:47 PM, Paul Moore wrote: On Mon, May 31, 2021 at 4:24 AM Daniel Borkmann wrote: On 5/29/21 8:48 PM, Paul Moore wrote: [...] Daniel's patch side steps that worry by just doing the lockdown permission check when the BPF program is loaded, but that isn't a great solution

Re: [PATCH v2] lockdown,selinux: avoid bogus SELinux lockdown permission checks

2021-05-31 Thread Daniel Borkmann
On 5/29/21 8:48 PM, Paul Moore wrote: [...] Daniel's patch side steps that worry by just doing the lockdown permission check when the BPF program is loaded, but that isn't a great solution if the policy changes afterward. I was hoping there might be some way to perform the permission check as

Re: [PATCH v2] lockdown,selinux: avoid bogus SELinux lockdown permission checks

2021-05-28 Thread Daniel Borkmann
On 5/28/21 5:47 PM, Paul Moore wrote: On Fri, May 28, 2021 at 3:10 AM Daniel Borkmann wrote: On 5/28/21 3:37 AM, Paul Moore wrote: On Mon, May 17, 2021 at 5:22 AM Ondrej Mosnacek wrote: Commit 59438b46471a ("security,lockdown,selinux: implement SELinux lockdown") added an impl

Re: [PATCH v2] lockdown,selinux: avoid bogus SELinux lockdown permission checks

2021-05-28 Thread Daniel Borkmann
On 5/28/21 3:42 PM, Ondrej Mosnacek wrote: (I'm off work today and plan to reply also to Paul's comments next week, but for now let me at least share a couple quick thoughts on Daniel's patch.) On Fri, May 28, 2021 at 11:56 AM Daniel Borkmann wrote: On 5/28/21 9:09 AM, Daniel Borkmann wrote

Re: [PATCH v2] lockdown,selinux: avoid bogus SELinux lockdown permission checks

2021-05-28 Thread Daniel Borkmann
On 5/28/21 1:47 PM, Jiri Olsa wrote: On Fri, May 28, 2021 at 11:56:02AM +0200, Daniel Borkmann wrote: Ondrej / Paul / Jiri: at least for the BPF tracing case specifically (I haven't looked at the rest but it's also kind of independent), the attached fix should address both reported issues

Re: [PATCH v2] lockdown,selinux: avoid bogus SELinux lockdown permission checks

2021-05-28 Thread Daniel Borkmann
On 5/28/21 9:09 AM, Daniel Borkmann wrote: On 5/28/21 3:37 AM, Paul Moore wrote: On Mon, May 17, 2021 at 5:22 AM Ondrej Mosnacek wrote: Commit 59438b46471a ("security,lockdown,selinux: implement SELinux lockdown") added an implementation of the locked_down LSM hook to SELinux, wi

Re: [PATCH v2] lockdown,selinux: avoid bogus SELinux lockdown permission checks

2021-05-28 Thread Daniel Borkmann
On 5/28/21 3:37 AM, Paul Moore wrote: On Mon, May 17, 2021 at 5:22 AM Ondrej Mosnacek wrote: Commit 59438b46471a ("security,lockdown,selinux: implement SELinux lockdown") added an implementation of the locked_down LSM hook to SELinux, with the aim to restrict which domains are allowed to

Re: [PATCH bpf-next 1/2] bpf: Remove bpf_jit_enable=2 debugging mode

2021-04-15 Thread Daniel Borkmann
On 4/15/21 11:32 AM, Jianlin Lv wrote: For debugging JITs, dumping the JITed image to kernel log is discouraged, "bpftool prog dump jited" is much better way to examine JITed dumps. This patch get rid of the code related to bpf_jit_enable=2 mode and update the proc handler of bpf_jit_enable,

Re: [PATCH] powerpc: net: bpf_jit_comp: Fix misuse of fallthrough

2020-09-29 Thread Daniel Borkmann
On 9/28/20 11:00 AM, zhe...@windriver.com wrote: From: He Zhe The user defined label following "fallthrough" is not considered by GCC and causes build failure. kernel-source/include/linux/compiler_attributes.h:208:41: error: attribute 'fallthrough' not preceding a case label or default label

Re: [PATCH] powerpc/bpf: Enable bpf_probe_read{, str}() on powerpc again

2020-05-28 Thread Daniel Borkmann
On 5/28/20 2:23 PM, Michael Ellerman wrote: Petr Mladek writes: On Thu 2020-05-28 11:03:43, Michael Ellerman wrote: Petr Mladek writes: The commit 0ebeea8ca8a4d1d453a ("bpf: Restrict bpf_probe_read{, str}() only to archs where they work") caused that bpf_probe_read{, str}() functions were

Re: [PATCH v2 1/4] powerpc/64s: implement probe_kernel_read/write without touching AMR

2020-04-07 Thread Daniel Borkmann
Hey Nicholas, On 4/7/20 6:01 AM, Nicholas Piggin wrote: Nicholas Piggin's on April 3, 2020 9:05 pm: Christophe Leroy's on April 3, 2020 8:31 pm: Le 03/04/2020 à 11:35, Nicholas Piggin a écrit : There is no need to allow user accesses when probing kernel addresses. I just discovered the

Re: [PATCH] libbpf: fix readelf output parsing on powerpc with recent binutils

2019-12-02 Thread Daniel Borkmann
On Mon, Dec 02, 2019 at 04:53:26PM +1100, Michael Ellerman wrote: > Aurelien Jarno writes: > > On powerpc with recent versions of binutils, readelf outputs an extra > > field when dumping the symbols of an object file. For example: > > > > 35: 083896 FUNCLOCAL DEFAULT [:

Re: [PATCH] bpf: handle 32-bit zext during constant blinding

2019-08-26 Thread Daniel Borkmann
On 8/21/19 9:23 PM, Naveen N. Rao wrote: Since BPF constant blinding is performed after the verifier pass, the ALU32 instructions inserted for doubleword immediate loads don't have a corresponding zext instruction. This is causing a kernel oops on powerpc and can be reproduced by running

Re: [PATCH 0/2] powerpc/bpf: DIV64 instruction fix

2019-06-13 Thread Daniel Borkmann
On 06/12/2019 08:51 PM, Naveen N. Rao wrote: > The first patch updates DIV64 overflow tests to properly detect error > conditions. The second patch fixes powerpc64 JIT to generate the proper > unsigned division instruction for BPF_ALU64. > > - Naveen > > Naveen N. Rao (2): > bpf: fix div64

Re: [PATCH] powerpc: bpf: Fix generation of load/store DW instructions

2019-03-15 Thread Daniel Borkmann
On 03/15/2019 03:51 PM, Naveen N. Rao wrote: > Yauheni Kaliuta pointed out that PTR_TO_STACK store/load verifier test > was failing on powerpc64 BE, and rightfully indicated that the PPC_LD() > macro is not masking away the last two bits of the offset per the ISA, > resulting in the generation of

Re: [PATCH] bpf: fix overflow of bpf_jit_limit when PAGE_SIZE >= 64K

2018-12-10 Thread Daniel Borkmann
On 12/10/2018 06:27 PM, Michael Roth wrote: > Quoting Daniel Borkmann (2018-12-10 08:26:31) >> On 12/07/2018 04:36 PM, Michael Roth wrote: >>> Quoting Michael Ellerman (2018-12-07 06:31:13) >>>> Michael Roth writes: >>>> >>>>> Commit ed

Re: [PATCH] bpf: fix overflow of bpf_jit_limit when PAGE_SIZE >= 64K

2018-12-10 Thread Daniel Borkmann
sion of min() has gotten too complicated to work here? > > I wasn't sure if it was safe here or not, so I tried looking at other > users and came across: > > mm/vmalloc.c:777:#define VMAP_MIN(x, y) ((x) < (y) ? (x) : (y)) > /* can't use min() */ > &g

Re: [PATCH bpf] bpf: powerpc64: optimize JIT passes for bpf function calls

2018-12-03 Thread Daniel Borkmann
On 12/03/2018 02:26 PM, Sandipan Das wrote: > Hi Daniel, > > On 03/12/18 6:18 PM, Daniel Borkmann wrote: >> >> Thanks for the patch, just to clarify, it's targeted at bpf-next and >> not bpf, correct? > > This patch is targeted at the bpf tree. Ok, thanks for clarifying, applied to bpf!

Re: [PATCH bpf] bpf: powerpc64: optimize JIT passes for bpf function calls

2018-12-03 Thread Daniel Borkmann
Hi Sandipan, On 12/03/2018 01:21 PM, Sandipan Das wrote: > Once the JITed images for each function in a multi-function program > are generated after the first three JIT passes, we only need to fix > the target address for the branch instruction corresponding to each > bpf-to-bpf function call. >

Re: [PATCH net-next 2/6] net/bpf: split VLAN_PRESENT bit handling from VLAN_TCI

2018-11-19 Thread Daniel Borkmann
On 11/10/2018 07:58 PM, Michał Mirosław wrote: > Signed-off-by: Michał Mirosław Why you have empty commit messages for non-trivial changes like this in 4 out of 6 of your patches ... How was it tested on the JITs you were changing? Did you test on both, big and little endian machines? > --- >

Re: [PATCH net-next 0/6] Remove VLAN.CFI overload

2018-11-19 Thread Daniel Borkmann
On 11/10/2018 10:47 PM, David Miller wrote: > From: Michał Mirosław > Date: Sat, 10 Nov 2018 19:58:29 +0100 > >> Fix BPF code/JITs to allow for separate VLAN_PRESENT flag >> storage and finally move the flag to separate storage in skbuff. >> >> This is final step to make CLAN.CFI transparent to

Re: [PATCH 1/4] bpf: account for freed JIT allocations in arch code

2018-11-19 Thread Daniel Borkmann
On 11/17/2018 07:57 PM, Ard Biesheuvel wrote: > Commit ede95a63b5e84 ("bpf: add bpf_jit_limit knob to restrict unpriv > allocations") added a call to bpf_jit_uncharge_modmem() to the routine > bpf_jit_binary_free() which is called from the __weak bpf_jit_free(). > This function is overridden by

Re: [PATCH bpf-next v4 02/10] bpf: powerpc64: pad function address loads with NOPs

2018-05-24 Thread Daniel Borkmann
On 05/24/2018 10:25 AM, Sandipan Das wrote: > On 05/24/2018 01:04 PM, Daniel Borkmann wrote: >> On 05/24/2018 08:56 AM, Sandipan Das wrote: >>> For multi-function programs, loading the address of a callee >>> function to a register requires emitting instructions whos

Re: [PATCH bpf-next v4 02/10] bpf: powerpc64: pad function address loads with NOPs

2018-05-24 Thread Daniel Borkmann
On 05/24/2018 08:56 AM, Sandipan Das wrote: > For multi-function programs, loading the address of a callee > function to a register requires emitting instructions whose > count varies from one to five depending on the nature of the > address. > > Since we come to know of the callee's address only

Re: [PATCH bpf-next v4 00/10] bpf: enhancements for multi-function programs

2018-05-24 Thread Daniel Borkmann
On 05/24/2018 08:56 AM, Sandipan Das wrote: > [1] Support for bpf-to-bpf function calls in the powerpc64 JIT compiler. > > [2] Provide a way for resolving function calls because of the way JITed > images are allocated in powerpc64. > > [3] Fix to get JITed instruction dumps for

Re: [PATCH bpf-next v3 10/10] tools: bpftool: add delimiters to multi-function JITed dumps

2018-05-23 Thread Daniel Borkmann
On 05/23/2018 12:37 PM, Sandipan Das wrote: [...] > Other than that, for powerpc64, there is a problem with the way the > binutils disassembler code (in "opcodes/ppc-dis.c") passes arguments > to the callback fprintf_json(). > > In fprintf_json(), we always expect the va_list elements to resolve

Re: [PATCH bpf-next v3 10/10] tools: bpftool: add delimiters to multi-function JITed dumps

2018-05-23 Thread Daniel Borkmann
On 05/22/2018 09:55 PM, Jakub Kicinski wrote: > On Tue, 22 May 2018 22:46:13 +0530, Sandipan Das wrote: >> +if (info.nr_jited_func_lens && info.jited_func_lens) { >> +struct kernel_sym *sym = NULL; >> +unsigned char *img = buf; >> +

Re: [PATCH bpf v2 6/6] bpf: fix JITed dump for multi-function programs via syscall

2018-05-22 Thread Daniel Borkmann
On 05/21/2018 09:42 PM, Sandipan Das wrote: > On 05/18/2018 09:21 PM, Daniel Borkmann wrote: >> On 05/18/2018 02:50 PM, Sandipan Das wrote: >>> Currently, for multi-function programs, we cannot get the JITed >>> instructions using the bpf system call's BPF_OBJ_GET_INFO

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

2018-05-18 Thread Daniel Borkmann
On 05/18/2018 06:05 PM, Naveen N. Rao wrote: > 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 >>>

Re: [PATCH bpf v2 6/6] bpf: fix JITed dump for multi-function programs via syscall

2018-05-18 Thread Daniel Borkmann
On 05/18/2018 02:50 PM, Sandipan Das wrote: > Currently, for multi-function programs, we cannot get the JITed > instructions using the bpf system call's BPF_OBJ_GET_INFO_BY_FD > command. Because of this, userspace tools such as bpftool fail > to identify a multi-function program as being JITed or

Re: [PATCH bpf v2 3/6] bpf: get kernel symbol addresses via syscall

2018-05-18 Thread Daniel Borkmann
l > instruction in the verifier instead of the offset of > the callee's symbol's address from __bpf_call_base. > > [2] Determining the address of a callee's corresponding > symbol by using the imm field as an index for the > list of kernel symbol addresses now ava

Re: [PATCH bpf v2 1/6] bpf: support 64-bit offsets for bpf function calls

2018-05-18 Thread Daniel Borkmann
On 05/18/2018 02:50 PM, Sandipan Das wrote: > The imm field of a bpf instruction is a signed 32-bit integer. > For JIT bpf-to-bpf function calls, it stores the offset of the > start address of the callee's JITed image from __bpf_call_base. > > For some architectures, such as powerpc64, this

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

2018-05-18 Thread Daniel Borkmann
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 images for the

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

2018-02-27 Thread Daniel Borkmann
onsider? > > Since each subprog does not get a separate id, we cannot fetch > the fd and therefore the tag of a subprog. Instead we can use > the tag of the complete program as shown below. > > "Daniel Borkmann" wrote: >> I think one limitation that would st

Re: [PATCH] bpf, powerpc: fix jit for seccomp_data access

2018-02-20 Thread Daniel Borkmann
On 02/21/2018 01:33 AM, Michael Ellerman wrote: > Mark Lord writes: > >> I am using SECCOMP to filter syscalls on a ppc32 platform, >> and noticed that the JIT compiler was failing on the BPF >> even though the interpreter was working fine. >> >> The issue was that the compiler

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

2018-02-15 Thread Daniel Borkmann
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 fun

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

2018-02-15 Thread Daniel Borkmann
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 some architectures, such as powerpc64, it was found that > this

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

2017-09-01 Thread Daniel Borkmann
On 09/01/2017 08:53 PM, Sandipan Das wrote: Take advantage of stack_depth tracking, originally introduced for x64, in powerpc JIT as well. Round up allocated stack by 16 bytes to make sure it stays aligned for functions called from JITed bpf program. Signed-off-by: Sandipan Das

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

2017-01-13 Thread Daniel Borkmann
<naveen.n@linux.vnet.ibm.com> Acked-by: Daniel Borkmann <dan...@iogearbox.net>

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

2016-09-26 Thread Daniel Borkmann
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 wrote: Tail calls allow JIT'ed eBPF programs to call into other JIT'ed eBPF programs. This can

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

2016-09-23 Thread Daniel Borkmann
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. This can be achieved either by: (1) retaining the stack setup by the first eBPF program and having all subsequent eBPF programs re-using it, or, (2) by unwinding/tearing

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

2016-09-23 Thread Daniel Borkmann
On 09/23/2016 10:35 PM, Naveen N. Rao wrote: In line with similar support for other architectures by Daniel Borkmann. 'MOD Default X' from test_bpf without constant blinding: 84 bytes emitted from JIT compiler (pass:3, flen:7) d58a4688 + : 0: nop 4: nop 8: std r27,-40

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

2016-04-05 Thread Daniel Borkmann
: Alexei Starovoitov <a...@fb.com> Cc: Daniel Borkmann <dan...@iogearbox.net> Cc: "David S. Miller" <da...@davemloft.net> Cc: Ananth N Mavinakayanahalli <ana...@in.ibm.com> Cc: Michael Ellerman <m...@ellerman.id.au> Cc: Paul Mackerras <pau...@samba.

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

2016-04-05 Thread Daniel Borkmann
On 04/05/2016 12:02 PM, Naveen N. Rao wrote: BPF_ALU32 and BPF_ALU64 tests for adding two 32-bit values that results in 32-bit overflow. Cc: Alexei Starovoitov <a...@fb.com> Cc: Daniel Borkmann <dan...@iogearbox.net> Cc: "David S. Miller" <da...@davemloft.net> Cc

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

2016-04-05 Thread Daniel Borkmann
On 04/05/2016 12:02 PM, Naveen N. Rao wrote: Unsigned Jump-if-Greater-Than. Cc: Alexei Starovoitov <a...@fb.com> Cc: Daniel Borkmann <dan...@iogearbox.net> Cc: "David S. Miller" <da...@davemloft.net> Cc: Ananth N Mavinakayanahalli <ana...@in.ibm.com> Cc: Mic

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

2016-04-05 Thread Daniel Borkmann
On 04/05/2016 12:02 PM, Naveen N. Rao wrote: JMP_JSET tests incorrectly used BPF_JNE. Fix the same. Cc: Alexei Starovoitov <a...@fb.com> Cc: Daniel Borkmann <dan...@iogearbox.net> Cc: "David S. Miller" <da...@davemloft.net> Cc: Ananth N Mavinakayanahalli <ana...@i

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

2016-04-01 Thread Daniel Borkmann
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/net/core/bpf_jit_enable or echo 2 > /proc/sys/net/core/bpf_jit_enable ... to see the generated JIT code. This can

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

2016-03-31 Thread Daniel Borkmann
On 03/31/2016 07:46 PM, Alexei Starovoitov wrote: On 3/31/16 4:25 AM, Naveen N. Rao wrote: While at it, fix some typos in the comment. Cc: Alexei Starovoitov Cc: David S. Miller Cc: Ananth N Mavinakayanahalli Cc: Michael Ellerman

Re: [PATCH] net: filter: make JITs zero A for SKF_AD_ALU_XOR_X

2016-01-05 Thread Daniel Borkmann
On 01/05/2016 05:03 PM, Rabin Vincent wrote: On Tue, Jan 05, 2016 at 08:00:45AM -0800, Eric Dumazet wrote: On Tue, 2016-01-05 at 16:23 +0100, Rabin Vincent wrote: The SKF_AD_ALU_XOR_X ancillary is not like the other ancillary data instructions since it XORs A with X while all the others

Re: [PATCH] net: filter: make JITs zero A for SKF_AD_ALU_XOR_X

2016-01-05 Thread Daniel Borkmann
-by: Rabin Vincent <ra...@rab.in> Excellent catch, thanks a lot! The fix looks good to me and should go to -net tree. Acked-by: Daniel Borkmann <dan...@iogearbox.net> If you're interested, feel free to add a small test case for the SKF_AD_ALU_XOR_X issue to lib/test_bpf.c for

Re: [PATCH net-next 0/6] bpf: Enable BPF JIT on ppc32

2015-02-16 Thread Daniel Borkmann
On 02/16/2015 08:13 AM, Denis Kirjanov wrote: ... Well, I don't see significant challenges to enable eBPF on ppc64 in the future. I'll start working on it after I get this merged Cool, awesome! ___ Linuxppc-dev mailing list

Re: [PATCH net-next 0/6] bpf: Enable BPF JIT on ppc32

2015-02-15 Thread Daniel Borkmann
On 02/15/2015 07:06 PM, Denis Kirjanov wrote: This patch series enables BPF JIT on ppc32. There are relatevily few chnages in the code to make it work. All test_bpf tests passed both on 7447a and P2041-based machines. I'm just wondering, next to the feedback that has already been provided,

ppc64 and Documentation/mic/mpssd/mpssd.c issues

2014-12-04 Thread Daniel Borkmann
Hi Caz, I think commit ... commit 8d49751580db804a02caf6a5b7cebe2ff26c0d7e Author: Caz Yokoyama caz.yokoy...@intel.com Date: Thu Sep 5 16:42:39 2013 -0700 Sample Implementation of Intel MIC User Space Daemon. ... actually triggers a build error on my default config ppc64 (I'm using

Re: ppc64 and Documentation/mic/mpssd/mpssd.c issues

2014-12-04 Thread Daniel Borkmann
: Daniel Borkmann [mailto:dbork...@redhat.com] Sent: Thursday, December 04, 2014 5:42 AM To: Yokoyama, Caz Cc: b...@kernel.crashing.org; linuxppc-dev@lists.ozlabs.org Subject: ppc64 and Documentation/mic/mpssd/mpssd.c issues Hi Caz, I think commit ... commit 8d49751580db804a02caf6a5b7cebe2ff26c0d7e

Re: [PATCH v2] PPC: bpf_jit_comp: add SKF_AD_PKTTYPE instruction

2014-11-01 Thread Daniel Borkmann
On 11/01/2014 07:00 PM, David Miller wrote: From: Denis Kirjanov k...@linux-powerpc.org Date: Sat, 1 Nov 2014 21:49:27 +0400 David, you need a feedback from other guys to apply this patch, right? Alexei wanted some output before/after the patch. Michael Ellerman wanted the explanation what a

Re: [PATCH v2] PPC: bpf_jit_comp: add SKF_AD_PKTTYPE instruction

2014-11-01 Thread Daniel Borkmann
On 10/31/2014 07:09 AM, Denis Kirjanov wrote: On 10/30/14, Alexei Starovoitov alexei.starovoi...@gmail.com wrote: On Wed, Oct 29, 2014 at 11:12 PM, Denis Kirjanov k...@linux-powerpc.org wrote: Add BPF extension SKF_AD_PKTTYPE to ppc JIT to load skb-pkt_type field. Before: [ 88.262622]

Re: [PATCH v2 2/2] powerpc: bpf: Fix the broken LD_VLAN_TAG_PRESENT test

2014-06-27 Thread Daniel Borkmann
On 06/27/2014 07:08 AM, Michael Ellerman wrote: On Thu, 2014-06-26 at 10:36 +0200, Daniel Borkmann wrote: On 06/26/2014 10:30 AM, Michael Ellerman wrote: On Wed, 2014-06-25 at 21:34 +0400, Denis Kirjanov wrote: We have to return the boolean here if the tag presents or not, not just ANDing

Re: [PATCH v2 2/2] powerpc: bpf: Fix the broken LD_VLAN_TAG_PRESENT test

2014-06-26 Thread Daniel Borkmann
On 06/26/2014 10:30 AM, Michael Ellerman wrote: On Wed, 2014-06-25 at 21:34 +0400, Denis Kirjanov wrote: We have to return the boolean here if the tag presents or not, not just ANDing the TCI with the mask which results to: [ 709.412097] test_bpf: #18 LD_VLAN_TAG_PRESENT [ 709.412245] ret

Re: [PATCH] ppc: bpf_jit: support MOD operation

2013-09-04 Thread Daniel Borkmann
On 09/03/2013 10:52 PM, Daniel Borkmann wrote: On 09/03/2013 09:58 PM, Vladimir Murzin wrote: [...] Do you have a test case/suite by any chance ? Ben. Hi Ben! Thanks for your feedback. This patch is only compile tested. I have no real hardware, but I'll probably bring up qemu ppc64 till

Re: [PATCH] ppc: bpf_jit: support MOD operation

2013-09-03 Thread Daniel Borkmann
On 09/03/2013 09:58 PM, Vladimir Murzin wrote: On Tue, Sep 03, 2013 at 06:45:50AM +1000, Benjamin Herrenschmidt wrote: On Mon, 2013-09-02 at 19:48 +0200, Vladimir Murzin wrote: Ping On Wed, Aug 28, 2013 at 02:49:52AM +0400, Vladimir Murzin wrote: commit b6069a9570 (filter: add MOD operation)

[PATCH] powerpc: fix ics_rtas_init and start_secondary section mismatch

2013-02-05 Thread Daniel Borkmann
: Benjamin Herrenschmidt b...@kernel.crashing.org Signed-off-by: Daniel Borkmann dbork...@redhat.com --- Note: compile-tested only! arch/powerpc/kernel/smp.c |2 +- arch/powerpc/sysdev/xics/ics-rtas.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc