[PATCH bpf-next 2/6] bpf, x86-32: Always zero extend for LDX with B/W/H

2023-09-12 Thread Puranjay Mohan
The JITs should not depend on the verifier for zero extending the upper 32 bits of the destination register when loading a byte, half-word, or word. A following patch will make the verifier stop patching zext instructions after LDX. Signed-off-by: Puranjay Mohan --- arch/x86/net/bpf_jit_comp32

[PATCH bpf-next 1/6] bpf, riscv32: Always zero extend for LDX with B/W/H

2023-09-12 Thread Puranjay Mohan
The JITs should not depend on the verifier for zero extending the upper 32 bits of the destination register when loading a byte, half-word, or word. A following patch will make the verifier stop patching zext instructions after LDX. Signed-off-by: Puranjay Mohan --- arch/riscv/net

[PATCH bpf-next 0/6] bpf: verifier: stop emitting zext for LDX

2023-09-12 Thread Puranjay Mohan
p me test this. Especially, the powerpc32 JTI where amount of code change is more. [1] https://lore.kernel.org/all/CANk7y0j2f-gPgZwd+YfTL71-6wfvky+f=kbc_ccqss0ehay...@mail.gmail.com/ Puranjay Mohan (6): bpf, riscv32: Always zero extend for LDX with B/W/H bpf, x86-32: Always zero extend for LDX wit

[PATCH bpf-next 3/6] bpf, parisc32: Always zero extend for LDX with B/W/H

2023-09-12 Thread Puranjay Mohan
The JITs should not depend on the verifier for zero extending the upper 32 bits of the destination register when loading a byte, half-word, or word. A following patch will make the verifier stop patching zext instructions after LDX. Signed-off-by: Puranjay Mohan --- arch/parisc/net

[PATCH bpf-next 4/6] bpf, powerpc32: Always zero extend for LDX

2023-09-12 Thread Puranjay Mohan
The JITs should not depend on the verifier for zero extending the upper 32 bits of the destination register when loading a byte, half-word, or word. A following patch will make the verifier stop patching zext instructions after LDX. Signed-off-by: Puranjay Mohan --- arch/powerpc/net

[PATCH bpf-next 6/6] bpf, verifier: always mark destination of LDX as 64-bit

2023-09-12 Thread Puranjay Mohan
zero extend the destination. Now the verifier can safely mark LDX destination as 64-bit and stop emitting zero-extension instructions for it. Signed-off-by: Puranjay Mohan --- kernel/bpf/verifier.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/bpf/verifier.c b/kernel

[PATCH bpf-next 5/6] bpf, arm32: Always zero extend for LDX with B/H/W

2023-09-12 Thread Puranjay Mohan
The JITs should not depend on the verifier for zero extending the upper 32 bits of the destination register when loading a byte, half-word, or word. A following patch will make the verifier stop patching zext instructions after LDX. Signed-off-by: Puranjay Mohan --- arch/arm/net/bpf_jit_32.c

Re: [PATCH bpf-next 5/6] bpf, arm32: Always zero extend for LDX with B/H/W

2023-09-12 Thread Puranjay Mohan
On Wed, Sep 13, 2023 at 1:04 AM Russell King (Oracle) wrote: > > On Tue, Sep 12, 2023 at 10:46:53PM +, Puranjay Mohan wrote: > > The JITs should not depend on the verifier for zero extending the upper > > 32 bits of the destination register when loading a byte, half

Re: [PATCH 00/13] mm: jit/text allocator

2023-06-03 Thread Puranjay Mohan
y be different :) > > > > What I mean is that jit_alloc_arch_params() tries to aggregate common > > parameters, but they aren't actually common (e.g. the actual start+end range > > for allocation). > > > > > Can you give more detail on what parameters you

Re: [PATCH v2 02/12] mm: introduce execmem_text_alloc() and jit_text_alloc()

2023-06-26 Thread Puranjay Mohan
On Mon, Jun 26, 2023 at 8:13 AM Song Liu wrote: > > On Sun, Jun 25, 2023 at 11:07 AM Kent Overstreet > wrote: > > > > On Sun, Jun 25, 2023 at 08:42:57PM +0300, Mike Rapoport wrote: > > > On Sun, Jun 25, 2023 at 09:59:34AM -0700, Andy Lutomirski wrote: > > > > > > > > > > > > On Sun, Jun 25, 2023,

[PATCH bpf] powerpc/bpf: enforce full ordering for ATOMIC operations with BPF_FETCH

2024-05-07 Thread Puranjay Mohan
) Observation SB+atomic_add+fetch Never 0 9 [1] https://www.kernel.org/doc/Documentation/memory-barriers.txt [2] https://www.kernel.org/doc/Documentation/atomic_t.txt Fixes: 65112709115f ("powerpc/bpf/64: add support for BPF_ATOMIC bitwise operations") Signed-off-by: Puranjay Mohan --- arch/p

Re: [PATCH bpf] powerpc/bpf: enforce full ordering for ATOMIC operations with BPF_FETCH

2024-05-08 Thread Puranjay Mohan
Michael Ellerman writes: > Puranjay Mohan writes: >> The Linux Kernel Memory Model [1][2] requires RMW operations that have a >> return value to be fully ordered. >> >> BPF atomic operations with BPF_FETCH (including BPF_XCHG and >> BPF_CMPXCHG) return a value

[PATCH bpf v2] powerpc/bpf: enforce full ordering for ATOMIC operations with BPF_FETCH

2024-05-08 Thread Puranjay Mohan
) Observation SB+atomic_add+fetch Never 0 9 [1] https://www.kernel.org/doc/Documentation/memory-barriers.txt [2] https://www.kernel.org/doc/Documentation/atomic_t.txt Fixes: 65112709115f ("powerpc/bpf/64: add support for BPF_ATOMIC bitwise operations") Signed-off-by: Puranjay Mohan --- Changes i

[PATCH bpf v3] powerpc/bpf: enforce full ordering for ATOMIC operations with BPF_FETCH

2024-05-13 Thread Puranjay Mohan
) Observation SB+atomic_add+fetch Never 0 9 [1] https://www.kernel.org/doc/Documentation/memory-barriers.txt [2] https://www.kernel.org/doc/Documentation/atomic_t.txt Fixes: 65112709115f ("powerpc/bpf/64: add support for BPF_ATOMIC bitwise operations") Signed-off-by: Puranjay Mohan Acked-

Re: [PATCH bpf v3] powerpc/bpf: enforce full ordering for ATOMIC operations with BPF_FETCH

2024-05-13 Thread Puranjay Mohan
Naveen N Rao writes: > On Mon, May 13, 2024 at 10:02:48AM GMT, Puranjay Mohan wrote: >> The Linux Kernel Memory Model [1][2] requires RMW operations that have a >> return value to be fully ordered. >> >> BPF atomic operations with BPF_FETCH (including BPF_XCHG and >

[PATCH bpf-next 1/1] powerpc64/bpf: Add jit support for load_acquire and store_release

2025-07-17 Thread Puranjay Mohan
lease to pkt pointer:OK #556/26 verifier_store_release/store-release to flow_keys pointer:OK #556/27 verifier_store_release/store-release to sock pointer:OK #556 verifier_store_release:OK Summary: 3/55 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Puranjay Mohan --- arch/powerpc/include/asm/

[PATCH RESEND bpf-next 1/1] powerpc64/bpf: Add jit support for load_acquire and store_release

2025-07-17 Thread Puranjay Mohan
lease to pkt pointer:OK #556/26 verifier_store_release/store-release to flow_keys pointer:OK #556/27 verifier_store_release/store-release to sock pointer:OK #556 verifier_store_release:OK Summary: 3/55 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Puranjay Mohan --- arch/powerpc/include/asm/