]> git.baikalelectronics.ru Git - kernel.git/commit
bpf jit: Let the x86 jit handle negative offsets
authorJan Seiffert <kaffeemonster@googlemail.com>
Fri, 30 Mar 2012 05:24:05 +0000 (05:24 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Apr 2012 22:01:41 +0000 (18:01 -0400)
commit1179d8b6e243889660e7a5bc16657fa197449592
tree301294142ae65e4646281329737fa349190d7565
parent5e1d6885ec4b371ad2cca804dcfc474eeceb16b1
bpf jit: Let the x86 jit handle negative offsets

Now the helper function from filter.c for negative offsets is exported,
it can be used it in the jit to handle negative offsets.

First modify the asm load helper functions to handle:
- know positive offsets
- know negative offsets
- any offset

then the compiler can be modified to explicitly use these helper
when appropriate.

This fixes the case of a negative X register and allows to lift
the restriction that bpf programs with negative offsets can't
be jited.

Signed-of-by: Jan Seiffert <kaffeemonster@googlemail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/x86/net/bpf_jit.S
arch/x86/net/bpf_jit_comp.c