Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1650669 > unrolled thread

Re: [PATCH] RFC: arm: eBPF JIT compiler

Started byAndrew Lunn <andrew@lunn.ch>
First post2017-05-25 19:10 +0200
Last post2017-05-26 00:20 +0200
Articles 11 — 5 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] RFC: arm: eBPF JIT compiler Andrew Lunn <andrew@lunn.ch> - 2017-05-25 19:10 +0200
    Re: [PATCH] RFC: arm: eBPF JIT compiler Andrew Lunn <andrew@lunn.ch> - 2017-05-25 19:30 +0200
      Re: [PATCH] RFC: arm: eBPF JIT compiler Andrew Lunn <andrew@lunn.ch> - 2017-05-25 20:30 +0200
        Re: [PATCH] RFC: arm: eBPF JIT compiler Shubham Bansal <illusionist.neo@gmail.com> - 2017-05-25 20:40 +0200
          Re: [PATCH] RFC: arm: eBPF JIT compiler Andrew Lunn <andrew@lunn.ch> - 2017-05-25 20:50 +0200
            Re: [PATCH] RFC: arm: eBPF JIT compiler Shubham Bansal <illusionist.neo@gmail.com> - 2017-05-25 21:10 +0200
              Re: [PATCH] RFC: arm: eBPF JIT compiler Florian Fainelli <f.fainelli@gmail.com> - 2017-05-25 21:50 +0200
                Re: [PATCH] RFC: arm: eBPF JIT compiler Shubham Bansal <illusionist.neo@gmail.com> - 2017-05-25 22:10 +0200
                  Re: [PATCH] RFC: arm: eBPF JIT compiler Kees Cook <keescook@chromium.org> - 2017-05-25 23:00 +0200
                  Re: [PATCH] RFC: arm: eBPF JIT compiler Florian Fainelli <f.fainelli@gmail.com> - 2017-05-25 23:20 +0200
                Re: [PATCH] RFC: arm: eBPF JIT compiler Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-05-26 00:20 +0200

#1650669 — Re: [PATCH] RFC: arm: eBPF JIT compiler

FromAndrew Lunn <andrew@lunn.ch>
Date2017-05-25 19:10 +0200
SubjectRe: [PATCH] RFC: arm: eBPF JIT compiler
Message-ID<tL4qT-2vP-35@gated-at.bofh.it>
On Thu, May 25, 2017 at 02:01:36AM +0530, Shubham Bansal wrote:
> Hi Andrew,
> 
> I am attaching the latest patch which should work on ARMv5 , ARMv6 and ARMv7.
> 
> Please test on your machines. Apologies for the last patch. This patch
> should work though.

andrew@shuttle:~/linux$ make -s -j 16
arch/arm/net/bpf_jit_32.c:1755:12: warning: ‘validate_code’ defined but not used [-Wunused-function]
 static int validate_code(struct jit_ctx *ctx)
            ^~~~~~~~~~~~~
arch/arm/net/bpf_jit_32.c:1724:12: warning: ‘build_body’ defined but not used [-Wunused-function]
 static int build_body(struct jit_ctx *ctx)
            ^~~~~~~~~~
arch/arm/net/bpf_jit_32.c:1122:13: warning: ‘build_epilogue’ defined but not used [-Wunused-function]
 static void build_epilogue(struct jit_ctx *ctx)
             ^~~~~~~~~~~~~~
arch/arm/net/bpf_jit_32.c:1049:13: warning: ‘build_prologue’ defined but not used [-Wunused-function]
 static void build_prologue(struct jit_ctx *ctx)
             ^~~~~~~~~~~~~~
arch/arm/net/bpf_jit_32.c:174:13: warning: ‘jit_fill_hole’ defined but not used [-Wunused-function]
 static void jit_fill_hole(void *area, unsigned int size)
             ^~~~~~~~~~~~~

I _think_ this is because CONFIG_CPU_LITTLE_ENDIAN is not set. But it
is a little endian machine/configuration. ARM does not seem to use
CONFIG_CPU_LITTLE_ENDIAN, it just has CPU_BIG_ENDIAN.

	  Andrew

[toc] | [next] | [standalone]


#1650683

FromAndrew Lunn <andrew@lunn.ch>
Date2017-05-25 19:30 +0200
Message-ID<tL4Ke-2DT-15@gated-at.bofh.it>
In reply to#1650669
On Thu, May 25, 2017 at 07:00:51PM +0200, Andrew Lunn wrote:
> On Thu, May 25, 2017 at 02:01:36AM +0530, Shubham Bansal wrote:
> > Hi Andrew,
> > 
> > I am attaching the latest patch which should work on ARMv5 , ARMv6 and ARMv7.
> > 
> > Please test on your machines. Apologies for the last patch. This patch
> > should work though.
> 
> andrew@shuttle:~/linux$ make -s -j 16
> arch/arm/net/bpf_jit_32.c:1755:12: warning: ‘validate_code’ defined but not used [-Wunused-function]
>  static int validate_code(struct jit_ctx *ctx)
>             ^~~~~~~~~~~~~
> arch/arm/net/bpf_jit_32.c:1724:12: warning: ‘build_body’ defined but not used [-Wunused-function]
>  static int build_body(struct jit_ctx *ctx)
>             ^~~~~~~~~~
> arch/arm/net/bpf_jit_32.c:1122:13: warning: ‘build_epilogue’ defined but not used [-Wunused-function]
>  static void build_epilogue(struct jit_ctx *ctx)
>              ^~~~~~~~~~~~~~
> arch/arm/net/bpf_jit_32.c:1049:13: warning: ‘build_prologue’ defined but not used [-Wunused-function]
>  static void build_prologue(struct jit_ctx *ctx)
>              ^~~~~~~~~~~~~~
> arch/arm/net/bpf_jit_32.c:174:13: warning: ‘jit_fill_hole’ defined but not used [-Wunused-function]
>  static void jit_fill_hole(void *area, unsigned int size)
>              ^~~~~~~~~~~~~
> 
> I _think_ this is because CONFIG_CPU_LITTLE_ENDIAN is not set. But it
> is a little endian machine/configuration. ARM does not seem to use
> CONFIG_CPU_LITTLE_ENDIAN, it just has CPU_BIG_ENDIAN.

After removing the #ifdef:

test_bpf: Summary: 314 PASSED, 0 FAILED, [272/306 JIT'ed]

Each test prints:

ARM version : 5
ARM version : 5

So the code needs some cleanup, but seems to basically work.

   Andrew

[toc] | [prev] | [next] | [standalone]


#1650717

FromAndrew Lunn <andrew@lunn.ch>
Date2017-05-25 20:30 +0200
Message-ID<tL5Gi-3fL-7@gated-at.bofh.it>
In reply to#1650683
On Thu, May 25, 2017 at 11:30:36PM +0530, Shubham Bansal wrote:
> Actually I intentionally put that print statement their.

Hi Shubham

Please don't top post.  
> Can you tell me what ifdef you removed ?

#ifdef CONFIG_CPU_LITTLE_ENDIAN

Since i said, ARM does not seem to use it.

      Andrew

[toc] | [prev] | [next] | [standalone]


#1650728

FromShubham Bansal <illusionist.neo@gmail.com>
Date2017-05-25 20:40 +0200
Message-ID<tL5PY-3iT-25@gated-at.bofh.it>
In reply to#1650717
Hi Andrew,

My Apologies.

I will remove the #ifdef CONFIG_CPU_LITTLE_ENDIAN. Do you have the
ARMv6 machine you can test it on?

-Shubham

[toc] | [prev] | [next] | [standalone]


#1650730

FromAndrew Lunn <andrew@lunn.ch>
Date2017-05-25 20:50 +0200
Message-ID<tL5ZE-3mc-5@gated-at.bofh.it>
In reply to#1650728
On Fri, May 26, 2017 at 12:05:23AM +0530, Shubham Bansal wrote:
> Hi Andrew,
> 
> My Apologies.
> 
> I will remove the #ifdef CONFIG_CPU_LITTLE_ENDIAN. Do you have the
> ARMv6 machine you can test it on?

Sorry, i don't have a v6.

Maybe try kzm with qemu-system-qemu?

      Andrew

[toc] | [prev] | [next] | [standalone]


#1650759

FromShubham Bansal <illusionist.neo@gmail.com>
Date2017-05-25 21:10 +0200
Message-ID<tL6j0-3K7-13@gated-at.bofh.it>
In reply to#1650730
Hi Andrew,

On Fri, May 26, 2017 at 12:18 AM, Andrew Lunn <andrew@lunn.ch> wrote:
> On Fri, May 26, 2017 at 12:05:23AM +0530, Shubham Bansal wrote:
>> Hi Andrew,
>>
>> My Apologies.
>>
>> I will remove the #ifdef CONFIG_CPU_LITTLE_ENDIAN. Do you have the
>> ARMv6 machine you can test it on?
>
> Sorry, i don't have a v6.
>
> Maybe try kzm with qemu-system-qemu?

I am afraid I not so familiar with qemu, otherwise I would have tried
to test the code on ARMv5,6,7 myself.
If you can help me with that it would be great, Otherwise I think I
have to wait for someone to test it for ARMv6. Although, I am pretty
sure it would work on that as it worked on ARMv5.

>
>       Andrew

-Shubham

[toc] | [prev] | [next] | [standalone]


#1650778

FromFlorian Fainelli <f.fainelli@gmail.com>
Date2017-05-25 21:50 +0200
Message-ID<tL6VI-3XA-13@gated-at.bofh.it>
In reply to#1650759
On 05/25/2017 12:09 PM, Shubham Bansal wrote:
> Hi Andrew,
> 
> On Fri, May 26, 2017 at 12:18 AM, Andrew Lunn <andrew@lunn.ch> wrote:
>> On Fri, May 26, 2017 at 12:05:23AM +0530, Shubham Bansal wrote:
>>> Hi Andrew,
>>>
>>> My Apologies.
>>>
>>> I will remove the #ifdef CONFIG_CPU_LITTLE_ENDIAN. Do you have the
>>> ARMv6 machine you can test it on?
>>
>> Sorry, i don't have a v6.
>>
>> Maybe try kzm with qemu-system-qemu?
> 
> I am afraid I not so familiar with qemu, otherwise I would have tried
> to test the code on ARMv5,6,7 myself.
> If you can help me with that it would be great, Otherwise I think I
> have to wait for someone to test it for ARMv6. Although, I am pretty
> sure it would work on that as it worked on ARMv5.

Using QEMU is far less complex than the patch you wrote, the tricky
point me be to find an ARMv6 root filesystem, unless you build the
module into the kernel and let it run its tests.
-- 
Florian

[toc] | [prev] | [next] | [standalone]


#1650788

FromShubham Bansal <illusionist.neo@gmail.com>
Date2017-05-25 22:10 +0200
Message-ID<tL7f4-4jo-3@gated-at.bofh.it>
In reply to#1650778
Hi Florian,

It would be great if you could help me with it.

Currently, what I am doing is.

 root@arm$ ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make -j4

Then I am using Busybox to build the root filesystem

root@arm$ qemu-system-arm -M vexpress-a9 -dtb
./linux/arch/arm/boot/dts/vexpress-v2p-ca9.dtb -kernel
./linux/arch/arm/boot/zImage -append "root=/dev/mmcblk0
console=ttyAMA0" -sd ./a9rootfs.ext3 --nographic

Which machine I should use for ARMv6 in QEMU. Which dtb file I should
use for ? All these questions I have. If anybody knows please let me
know.


Best,
Shubham Bansal


On Fri, May 26, 2017 at 1:14 AM, Florian Fainelli <f.fainelli@gmail.com> wrote:
> On 05/25/2017 12:09 PM, Shubham Bansal wrote:
>> Hi Andrew,
>>
>> On Fri, May 26, 2017 at 12:18 AM, Andrew Lunn <andrew@lunn.ch> wrote:
>>> On Fri, May 26, 2017 at 12:05:23AM +0530, Shubham Bansal wrote:
>>>> Hi Andrew,
>>>>
>>>> My Apologies.
>>>>
>>>> I will remove the #ifdef CONFIG_CPU_LITTLE_ENDIAN. Do you have the
>>>> ARMv6 machine you can test it on?
>>>
>>> Sorry, i don't have a v6.
>>>
>>> Maybe try kzm with qemu-system-qemu?
>>
>> I am afraid I not so familiar with qemu, otherwise I would have tried
>> to test the code on ARMv5,6,7 myself.
>> If you can help me with that it would be great, Otherwise I think I
>> have to wait for someone to test it for ARMv6. Although, I am pretty
>> sure it would work on that as it worked on ARMv5.
>
> Using QEMU is far less complex than the patch you wrote, the tricky
> point me be to find an ARMv6 root filesystem, unless you build the
> module into the kernel and let it run its tests.
> --
> Florian

[toc] | [prev] | [next] | [standalone]


#1650819

FromKees Cook <keescook@chromium.org>
Date2017-05-25 23:00 +0200
Message-ID<tL81r-4EH-5@gated-at.bofh.it>
In reply to#1650788
For what it's worth, I did an comparison of the numbers Shubham posted
in another thread for the JIT, comparing the eBPF interpreter with his
new JIT. The post is here:

https://www.spinics.net/lists/netdev/msg436402.html

-Kees

-- 
Kees Cook
Pixel Security

[toc] | [prev] | [next] | [standalone]


#1650824

FromFlorian Fainelli <f.fainelli@gmail.com>
Date2017-05-25 23:20 +0200
Message-ID<tL8kN-51l-5@gated-at.bofh.it>
In reply to#1650788
On 05/25/2017 01:08 PM, Shubham Bansal wrote:
> Hi Florian,
> 
> It would be great if you could help me with it.
> 
> Currently, what I am doing is.
> 
>  root@arm$ ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make -j4
> 
> Then I am using Busybox to build the root filesystem
> 
> root@arm$ qemu-system-arm -M vexpress-a9 -dtb
> ./linux/arch/arm/boot/dts/vexpress-v2p-ca9.dtb -kernel
> ./linux/arch/arm/boot/zImage -append "root=/dev/mmcblk0
> console=ttyAMA0" -sd ./a9rootfs.ext3 --nographic
> 
> Which machine I should use for ARMv6 in QEMU. Which dtb file I should
> use for ? All these questions I have. If anybody knows please let me
> know.

You should use realview-eb-mpcore for instance (ARM11MPCORE is ARMv6).

> 
> 
> Best,
> Shubham Bansal
> 
> 
> On Fri, May 26, 2017 at 1:14 AM, Florian Fainelli <f.fainelli@gmail.com> wrote:
>> On 05/25/2017 12:09 PM, Shubham Bansal wrote:
>>> Hi Andrew,
>>>
>>> On Fri, May 26, 2017 at 12:18 AM, Andrew Lunn <andrew@lunn.ch> wrote:
>>>> On Fri, May 26, 2017 at 12:05:23AM +0530, Shubham Bansal wrote:
>>>>> Hi Andrew,
>>>>>
>>>>> My Apologies.
>>>>>
>>>>> I will remove the #ifdef CONFIG_CPU_LITTLE_ENDIAN. Do you have the
>>>>> ARMv6 machine you can test it on?
>>>>
>>>> Sorry, i don't have a v6.
>>>>
>>>> Maybe try kzm with qemu-system-qemu?
>>>
>>> I am afraid I not so familiar with qemu, otherwise I would have tried
>>> to test the code on ARMv5,6,7 myself.
>>> If you can help me with that it would be great, Otherwise I think I
>>> have to wait for someone to test it for ARMv6. Although, I am pretty
>>> sure it would work on that as it worked on ARMv5.
>>
>> Using QEMU is far less complex than the patch you wrote, the tricky
>> point me be to find an ARMv6 root filesystem, unless you build the
>> module into the kernel and let it run its tests.
>> --
>> Florian


-- 
Florian

[toc] | [prev] | [next] | [standalone]


#1650884

FromRussell King - ARM Linux <linux@armlinux.org.uk>
Date2017-05-26 00:20 +0200
Message-ID<tL9gS-5Hd-29@gated-at.bofh.it>
In reply to#1650778
On Thu, May 25, 2017 at 12:44:19PM -0700, Florian Fainelli wrote:
> Using QEMU is far less complex than the patch you wrote, the tricky
> point me be to find an ARMv6 root filesystem, unless you build the
> module into the kernel and let it run its tests.

I beg to differ - when I tried qemu during the last year, it was
basically completely non-functional for ARM, and I gave up with it.
I think what you get depends on your distro.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web