This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH V2 2/8] bpf: new GCC port


On Tue, Aug 20, 2019 at 11:14:35PM +0200, Jose E. Marchesi wrote:
> The kernel verifier doesn't allow backward jumps.
> 
> This may change at some point.  There is much discussion among the
> kernel hackers in whether it is possible to allow bounded loops in a
> safe way.  In that case, some of the restrictions may be lifted.
> 
> For now, only loops that can be peeled/massaged and then fully unrolled
> are supported.

You can also generate code like

x5:	call x4
	jump x1
x4:	call x2
x2:	call x1
x1:	do things once here
	ret

to do fixed number of iteration loops.  Disgusting?  You decide :-)

(Or is something in that not allowed by the verifier?)


Segher


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]