Discussion:
bpfjit
Alexander Nasonov
2012-11-24 14:22:53 UTC
Permalink
After a successful testing of bpfjit on an emulated MALTA board, I
committed sljit support to evbmips. It's disabled my default but you
can easily enable it. To reproduce my setup, you need to apply the patch
below and build with MKSLJIT=yes.
I followed an instruction on gxemul page to install and run my system
under gxemul emulator. I also added "net.bpf.jit=1" to sysctl.conf
while following an installation instruction.
All sljit and bpfjit userspace tests pass and the system can filter
packets using simple rules.

Alex


Enable bpfjit on MALTA ebvmips board.

Index: sys/arch/evbmips/conf/MALTA
===================================================================
RCS file: /cvsroot/src/sys/arch/evbmips/conf/MALTA,v
retrieving revision 1.69
diff -p -u -u -r1.69 MALTA
--- sys/arch/evbmips/conf/MALTA 17 Oct 2012 14:48:11 -0000 1.69
+++ sys/arch/evbmips/conf/MALTA 24 Nov 2012 14:05:30 -0000
@@ -307,6 +307,9 @@ audio* at clct?
#pseudo-device md # memory disk device
(ramdisk)
pseudo-device vnd # disk-like interface to
files

+options SLJIT
+options BPFJIT
+
# Network pseudo-devices
pseudo-device bpfilter # Berkeley packet filter
pseudo-device ipfilter # IP filter (firewall)
and NAT
Index: sys/arch/evbmips/conf/files.malta
===================================================================
RCS file: /cvsroot/src/sys/arch/evbmips/conf/files.malta,v
retrieving revision 1.18
diff -p -u -u -r1.18 files.malta
--- sys/arch/evbmips/conf/files.malta 9 Jul 2011 16:03:01 -0000
1.18
+++ sys/arch/evbmips/conf/files.malta 24 Nov 2012 14:05:30 -0000
@@ -26,6 +26,12 @@ device cpu
attach cpu at mainbus
file arch/evbmips/evbmips/cpu.c cpu

+#
+# Stack-less Just-In-Time compiler
+#
+
+include "external/bsd/sljit/conf/files.sljit"
+
# Machine-independent I2O drivers.
include "dev/i2o/files.i2o"
Christos Zoulas
2012-11-24 15:38:05 UTC
Permalink
Post by Alexander Nasonov
After a successful testing of bpfjit on an emulated MALTA board, I
committed sljit support to evbmips. It's disabled my default but you
can easily enable it. To reproduce my setup, you need to apply the patch
below and build with MKSLJIT=yes.
I followed an instruction on gxemul page to install and run my system
under gxemul emulator. I also added "net.bpf.jit=1" to sysctl.conf
while following an installation instruction.
All sljit and bpfjit userspace tests pass and the system can filter
packets using simple rules.
Alex
Enable bpfjit on MALTA ebvmips board.
Index: sys/arch/evbmips/conf/MALTA
===================================================================
RCS file: /cvsroot/src/sys/arch/evbmips/conf/MALTA,v
retrieving revision 1.69
diff -p -u -u -r1.69 MALTA
--- sys/arch/evbmips/conf/MALTA 17 Oct 2012 14:48:11 -0000 1.69
+++ sys/arch/evbmips/conf/MALTA 24 Nov 2012 14:05:30 -0000
@@ -307,6 +307,9 @@ audio* at clct?
#pseudo-device md # memory disk device
(ramdisk)
pseudo-device vnd # disk-like interface to
files
+options SLJIT
+options BPFJIT
+
# Network pseudo-devices
pseudo-device bpfilter # Berkeley packet filter
pseudo-device ipfilter # IP filter (firewall)
and NAT
Index: sys/arch/evbmips/conf/files.malta
===================================================================
RCS file: /cvsroot/src/sys/arch/evbmips/conf/files.malta,v
retrieving revision 1.18
diff -p -u -u -r1.18 files.malta
--- sys/arch/evbmips/conf/files.malta 9 Jul 2011 16:03:01 -0000
1.18
+++ sys/arch/evbmips/conf/files.malta 24 Nov 2012 14:05:30 -0000
@@ -26,6 +26,12 @@ device cpu
attach cpu at mainbus
file arch/evbmips/evbmips/cpu.c cpu
+#
+# Stack-less Just-In-Time compiler
+#
+
+include "external/bsd/sljit/conf/files.sljit"
+
# Machine-independent I2O drivers.
include "dev/i2o/files.i2o"
I would commit that with the options commented out.


christos
Alexander Nasonov
2012-11-24 19:58:46 UTC
Permalink
Post by Christos Zoulas
I would commit that with the options commented out.
Sure, I can do it but this will make MATLA special only because I
happened to find an installation instruction. I'd be nice to commit
this for all configs that support bpfjit but I don't have any
expertise in mips world.

If anybody has a list of configs that are still actively used and that
are easy to run in an emulator, I can test them and commit.

Alex
Alexander Nasonov
2014-07-20 10:32:42 UTC
Permalink
Post by Alexander Nasonov
Post by Christos Zoulas
I would commit that with the options commented out.
Sure, I can do it but this will make MATLA special only because I
happened to find an installation instruction. I'd be nice to commit
this for all configs that support bpfjit but I don't have any
expertise in mips world.
If anybody has a list of configs that are still actively used and that
are easy to run in an emulator, I can test them and commit.
I've just committed bpfjit support to all but MIPS1 kernels (with
the options commented out). This will not be functional for a couple
of days, though. I need to work on rump support.

Alex

Matt Thomas
2012-11-24 14:56:45 UTC
Permalink
Post by Alexander Nasonov
After a successful testing of bpfjit on an emulated MALTA board, I
committed sljit support to evbmips. It's disabled my default but you
can easily enable it. To reproduce my setup, you need to apply the patch
below and build with MKSLJIT=yes.
I followed an instruction on gxemul page to install and run my system
under gxemul emulator. I also added "net.bpf.jit=1" to sysctl.conf
while following an installation instruction.
All sljit and bpfjit userspace tests pass and the system can filter
packets using simple rules.
Does it generate MIPS1 or MIPS32 instructions?
Alexander Nasonov
2012-11-26 16:33:01 UTC
Permalink
I think it generates mips32 but it's better to confirm with the author of sljit.
Zoltan, can you please comment on this?
Thanks,
Alex
Post by Matt Thomas
Post by Alexander Nasonov
After a successful testing of bpfjit on an emulated MALTA board, I
committed sljit support to evbmips. It's disabled my default but you
can easily enable it. To reproduce my setup, you need to apply the patch
below and build with MKSLJIT=yes.
I followed an instruction on gxemul page to install and run my system
under gxemul emulator. I also added "net.bpf.jit=1" to sysctl.conf
while following an installation instruction.
All sljit and bpfjit userspace tests pass and the system can filter
packets using simple rules.
Does it generate MIPS1 or MIPS32 instructions?
--
Alex
Zoltán Herczeg
2012-11-26 21:24:10 UTC
Permalink
Hi,=0A=0Athanks for testing the code. The MIPS code generator generates MIP=
S III instruction set by default, but if SLJIT_MIPS_32_64 is defined to 1, =
it also uses some MIPS 32 instructions, such as SEB or CLZ. I couldn't find=
a way to automatically detect MIPS 32 so far, but I would be grateful if s=
omebody could tell me how to do it.=0A=0ARegards,=0AZoltan=0A=0A>Alexander =
Nasonov <***@yandex.ru> =C3=ADrta:=0A>I think it generates mips32 but it'=
s better to confirm with the author of sljit.=0A>Zoltan, can you please com=
ment on this?=0A>Thanks,=0A>Alex=0A>=0A>26.11.12, 20:28, "Matt Thomas" <mat=
***@3am-software.com>":=0A>=0A>=0A> On Nov 24, 2012, at 6:22 AM, Alexander Na=
sonov wrote:=0A>=0A> > After a successful testing of bpfjit on an emulated =
MALTA board, I=0A> > committed sljit support to evbmips. It's disabled my d=
efault but you=0A> > can easily enable it. To reproduce my setup, you need =
to apply the patch=0A> > below and build with MKSLJIT=3Dyes.=0A> > I follow=
ed an instruction on gxemul page to install and run my system=0A> > under g=
xemul emulator. I also added "net.bpf.jit=3D1" to sysctl.conf=0A> > while f=
ollowing an installation instruction.=0A> > All sljit and bpfjit userspace =
tests pass and the system can filter=0A> > packets using simple rules.=0A>=
=0A> Does it generate MIPS1 or MIPS32 instructions?=0A
Loading...