[PATCH bpf-next] ARC, bpf: Fix issues reported by the static analyzers

2024-05-24 Thread Shahab Vahedi
From: Shahab Vahedi Also updated couple of comments along the way. One of the issues reported was indeed a bug in the code: memset(ctx, 0, sizeof(ctx)) // original line memset(ctx, 0, sizeof(*ctx)) // fixed line That was a nice catch. Reported-by: kernel test robot Closes

[PATCH 6/7] v2: Fix most of the "Checks" from "checkpatch.pl"

2024-04-30 Thread Shahab Vahedi
From: Shahab Vahedi If they're left untouched, then it was decided like that. The command that was used for checkpatch.pl: $ checkpatch.pl ... --strict --no-signoff \ --ignore AVOID_BUG,SPLIT_STRING,COMMIT_MESSAGE \ --git

[PATCH 7/7] v2: Check "bpf_jit_binary_lock_ro()" return value

2024-04-30 Thread Shahab Vahedi
From: Shahab Vahedi ...after the rebase. --- arch/arc/net/bpf_jit_core.c | 29 - 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/arch/arc/net/bpf_jit_core.c b/arch/arc/net/bpf_jit_core.c index 00c99b339b4a..6f6b4ffccf2c 100644 --- a/arch/arc/net

[PATCH 1/7] v2: Turn "emit" from global into a context var

2024-04-30 Thread Shahab Vahedi
From: Shahab Vahedi Plus an easter egg: Add "static" to do_{normal,extra}_pass() proto-type, so GCC won't complain about missing proto-type before invocation. --- arch/arc/net/bpf_jit.h | 14 +- arch/arc/net/bpf_jit_arcv2.c | 409 ++- ar

[PATCH 3/7] v2: Use memset() in jit_ctx_init()

2024-04-30 Thread Shahab Vahedi
From: Shahab Vahedi --- arch/arc/net/bpf_jit_core.c | 21 + 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/arch/arc/net/bpf_jit_core.c b/arch/arc/net/bpf_jit_core.c index 79ec0bbf1153..9c0fdd514967 100644 --- a/arch/arc/net/bpf_jit_core.c +++ b/arch/arc/net

[PATCH 5/7] v2: Fix typos

2024-04-30 Thread Shahab Vahedi
From: Shahab Vahedi --- arch/arc/net/bpf_jit_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arc/net/bpf_jit_core.c b/arch/arc/net/bpf_jit_core.c index 9c0fdd514967..6692272fa1ac 100644 --- a/arch/arc/net/bpf_jit_core.c +++ b/arch/arc/net/bpf_jit_core.c

[PATCH 2/7] v2: Turn "zext_thyself" from global into a context var

2024-04-30 Thread Shahab Vahedi
From: Shahab Vahedi also: - Update some comments along the way. - Refactor the gen_swap()'s "if/else" to present the logic better - Remove "extern" from the proto-type --- arch/arc/net/bpf_jit.h | 14 +- arch/arc/net/bpf_jit_arcv2.c | 51 ++

[PATCH 4/7] v2: MAINTAINERS: Add "BPF JIT for ARC" entry

2024-04-30 Thread Shahab Vahedi
From: Shahab Vahedi --- MAINTAINERS | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 943921d642ad..b6a946d24f00 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3712,6 +3712,12 @@ S: Maintained F: Documentation/devicetree/bindings/iio/imu/bosch

[off-list] [PATCH 0/7 bpf-next v2] ARC: Add eBPF JIT support

2024-04-30 Thread Shahab Vahedi
From: Shahab Vahedi [off-list] Hi Björn, First and foremost, I apologise that it took me a long time to rework what we have discussed about the first version of "ARC: Add eBPF JIT support" patch. In order to make the second review easier for you, since you already have reviewed P

Re: [PATCH bpf-next v1] ARC: Add eBPF JIT support

2024-04-30 Thread Shahab Vahedi
Shahab Vahedi writes: > > Björn Töpel writes: >> >> Please try to avoid static inline in the C-files. The compiler usually >> knows better. > > I will replace them with "static" then. I have tried [1] this and the test execution time took a p

[PATCH bpf-next v2] ARC: Add eBPF JIT support

2024-04-30 Thread Shahab Vahedi
From: Shahab Vahedi This will add eBPF JIT support to the 32-bit ARCv2 processors. The implementation is qualified by running the BPF tests on a Synopsys HSDK board with "ARC HS38 v2.1c at 500 MHz" as the 4-core CPU. The test_bpf.ko reports 2-10 fold improvements in execution time of

Re: [PATCH bpf-next v1] ARC: Add eBPF JIT support

2024-03-05 Thread Shahab Vahedi
Hi Björn, Thank you very much for your inputs. Please find my remarks below. Björn Töpel writes: > Shahab Vahedi writes: > > What's the easiest way to test test this w/o ARC HW? Is there a qemu > port avaiable? Yes, there is a (downstream) port available on GitHub [1]. If one i

Re: [PATCH bpf-next v1] ARC: Add eBPF JIT support

2024-02-26 Thread Shahab Vahedi
Hello list, I know this is not a small patch, but could someone skim over it? If there's anything that I can do to make the review process easier, please let me know. I already intend to change the "commit message" in the following ways: - Fix a typo: interpretor -> interpreter - Mentioning the

Re: [PATCH bpf-next v1] ARC: Add eBPF JIT support

2024-02-14 Thread Shahab Vahedi
On 2/14/24 03:39, Alexei Starovoitov wrote: > On Tue, Feb 13, 2024 at 5:20 AM Shahab Vahedi wrote: > > Could you share performance numbers interpreter vs JITed ? I see noticeable improvements on every selected test. To list a few: ---8<-- test_bpf: #0

[PATCH bpf-next v1] ARC: Add eBPF JIT support

2024-02-13 Thread Shahab Vahedi
From: Shahab Vahedi This will add eBPF JIT support to the 32-bit ARCv2 processors. The implementation is qualified by running the BPF tests on a Synopsys HSDK board with "ARC HS38 v2.1c at 500 MHz" as the 4-core CPU. Deployment and structure The related codes

Re: [PATCH 13/21] arc: dma-mapping: skip invalidating before bidirectional DMA

2023-04-06 Thread Shahab Vahedi
e arm/arm64/xtensa instead, and use just a >> writeback before the DMA when we do the invalidate afterwards. >> >> Signed-off-by: Arnd Bergmann > > Reviewed-by: Vineet Gupta > > Shahab can you give this a spin on hsdk - run glibc testsuite over ssh > and m

Re: [PATCH net 1/1] net: stmmac: check fwnode for phy device before scanning for phy

2023-04-05 Thread Shahab Vahedi
Cc Vineet Gupta On 4/5/23 12:07, Shahab Vahedi wrote: > On 4/5/23 11:39, Michael Sit Wei Hong wrote: >> Some DT devices already have phy device configured in the DT/ACPI. >> Current implementation scans for a phy unconditionally even though >> there is a phy listed in th

Re: [PATCH net 1/1] net: stmmac: check fwnode for phy device before scanning for phy

2023-04-05 Thread Shahab Vahedi
here is any phy device listed in > fwnode and decide whether to scan for a phy to attach to.y > > Reported-by: Martin Blumenstingl > Fixes: fe2cfbc96803 ("net: stmmac: check if MAC needs to attach to a PHY") > Signed-off-by: Michael Sit Wei Hong > --- Works fine

Re: [PATCH net v5 2/3] net: stmmac: check if MAC needs to attach to a PHY

2023-04-05 Thread Shahab Vahedi
Fixing the CC header. Apologies for the inconvenience. -- Same happens on ARC HSDK [1]: # dmesg | grep stmmaceth stmmaceth f0008000.ethernet: use coherent DMA ops stmmaceth f0008000.ethernet: IRQ eth_wake_irq not found stmmaceth f0008000.ethernet: IRQ eth_lpi not found stmmaceth

Re: [PATCH 13/21] arc: dma-mapping: skip invalidating before bidirectional DMA

2023-04-04 Thread Shahab Vahedi
On 4/2/23 08:52, Vineet Gupta wrote: > CC Shahab > > On 3/27/23 17:43, Arnd Bergmann wrote: >> From: Arnd Bergmann >> >> Some architectures that need to invalidate buffers after bidirectional >> DMA because of speculative prefetching only do a simpler writeback >> before that DMA, while

Re: [Buildroot] [PATCH v4 1/1] package/bpftool: revert bpf_cookie patch to allow building

2023-02-10 Thread Shahab Vahedi
On 2/9/23 21:27, Arnout Vandecappelle wrote: > > On 09/02/2023 13:23, Shahab Vahedi wrote: >> >> On 2/8/23 17:36, Arnout Vandecappelle wrote: >>> >>> It's not clear to me why you did a revert of the cookie feature rather than >>> using those p

Re: [Buildroot] [PATCH v4 1/1] package/bpftool: revert bpf_cookie patch to allow building

2023-02-09 Thread Shahab Vahedi
Hi Arnout, On 2/8/23 17:36, Arnout Vandecappelle wrote: > > It's not clear to me why you did a revert of the cookie feature rather than > using those patches. I think the first two or three should be sufficient to > fix your issue? Ideally, the correct way would be applying that pending series.

[PATCH v3 2/2] ARC: update definitions in elf/elf.h

2022-11-27 Thread Shahab Vahedi
NSUPPORTED: string/tst-strsignal UNSUPPORTED: time/tst-clock_settime UNSUPPORTED: time/tst-settimeofday Summary of test results: 21 FAIL 4184 PASS 69 UNSUPPORTED 16 XFAIL 2 XPASS Signed-off-by: Shahab Vahedi --- ChangeLog: v3: - Fix a collision in glibcelf.py. - Add te

[PATCH v3 1/2] scripts: Add "|" operator support to glibcpp's parsing

2022-11-27 Thread Shahab Vahedi
e "/src/glibc/scripts/glibcelf.py", line 223, in _parse_elf_h raise IOError('parse error in elf.h') OSError: parse error in elf.h [1] ARC: update definitions in elf/elf.h https://sourceware.org/pipermail/libc-alpha/2022-November/143503.html [2] tst-glibcelf, tst-relro-ldso, and t

[PATCH v3 0/2] Update ARC definitions in elf/elf.h

2022-11-27 Thread Shahab Vahedi
and the second one is related to the actual update of definitions in elf.h header. Rationale for the CCs: Florian Weimer -- Changes related to glibcpp and glibcelf Vineet Gupta -- Changes related to elf.h (ARC section) Shahab Vahedi (2): scripts: Add "|" operator support to glibcpp's par

Re: [PATCH] ARC: update definitions in elf/elf.h

2022-11-21 Thread Shahab Vahedi
Hi Vineet, FYI, a second version of the patch is submitted [1]. Regarding what has changed, a changelog is put right after the sign-off line. On 11/19/22 01:34, Vineet Gupta wrote: > On 11/18/22 05:15, Shahab Vahedi wrote: >> The majority of the update is about adding new de

[PATCH v2] ARC: update definitions in elf/elf.h

2022-11-21 Thread Shahab Vahedi
://sourceware.org/pipermail/elfutils-devel/2022q4/005530.html [2] https://sourceware.org/pipermail/elfutils-devel/2022q4/005548.html Signed-off-by: Shahab Vahedi --- Chagelog: v2: - Rename instances of R_ARC_JUMP_SLOT to R_ARC_JMP_SLOT. - Remove an unnecessary extra empty line introduced in elf/elf.h

Re: [PATCH v2 3/5] memblock: allow to specify flags with memblock_add_node()

2021-10-04 Thread Shahab Vahedi
{ > #ifdef CONFIG_HIGHMEM > high_mem_start = base; > high_mem_sz = size; > in_use = 1; > - memblock_add_node(base, size, 1); > + memblock_add_node(base, size, 1, MEMBLOCK_NONE); > memblock_reserve(base, size); >

Re: [PATCH 3/3] memblock: cleanup memblock_free interface

2021-09-23 Thread Shahab Vahedi
y: Linus Torvalds > Signed-off-by: Mike Rapoport arch/arc part: Reviewed-by: Shahab Vahedi Thanks, Shahab ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc

Re: [PATCH] clocksource: arc_timer: eliminate redefined macro error

2021-09-23 Thread Shahab Vahedi
Hi Randy, I have one minor comment. On 9/23/21 5:18 AM, Randy Dunlap wrote: > > --- linux-next-20210917.orig/include/soc/arc/timers.h > +++ linux-next-20210917/include/soc/arc/timers.h > @@ -17,7 +17,7 @@ > #define ARC_REG_TIMER1_CNT 0x100 /* timer 1 count */ > > /* CTRL reg bits */ >

Re: [PATCH] ARC: entry: fix off-by-one error in syscall number validation

2021-04-29 Thread Shahab Vahedi
On 4/23/21 9:52 PM, Vineet Gupta wrote: > diff --git a/arch/arc/kernel/entry.S b/arch/arc/kernel/entry.S > index 1743506081da..aea9b558993d 100644 > --- a/arch/arc/kernel/entry.S > +++ b/arch/arc/kernel/entry.S > @@ -255,7 +255,7 @@ ENTRY(EV_Trap) > ; Normal syscall case > >