lkml.org 
[lkml]   [2012]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v8 3/8] seccomp: add system call filtering using BPF
From
On Fri, February 17, 2012 05:09, H. Peter Anvin wrote:
> On 02/16/2012 07:27 PM, Indan Zupancic wrote:
>>
>> A JIT won't be able to merge accesses because it also has to merge other
>> instructions and recognize when 64-bit operations are done with 32-bit
>> instructions. I think that will be too hard for a JIT.
>>
>
> Please Google "peephole optimizer".

I have written one for uni. Like I said, I think it will be too hard
for a BPF JIT because the pattern is too complex. Keep in mind that
there is no 64-bit register where you can load the data to, everything
is done on 32-bit values. So you have to recognize 32-bit code emulating
64-bit ops. I don't think anyone will add all the different patterns of
doing that to the JIT, there are too many.

The current JIT is networking-only and is very simplistic. It is a very
long way to a sophisticated enough JIT that does such complex peephole
optimisations. I'm not saying it's impossible in general, just that the
kernel BPF JIT won't be able to do it. It's a lot easier to just add
64-bit support to BPF instead.

Greetings,

Indan




\
 
 \ /
  Last update: 2012-02-17 05:55    [W:0.207 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site