[cfe-users] BPF stack limit

Igor Sugak via cfe-users cfe-users at lists.llvm.org
Mon Mar 27 08:48:50 PDT 2017

cc Alex

>From Alex: It's indeed the kernel restriction and it's a good idea to add a flag to make it configurable.


From: cfe-users <cfe-users-bounces at lists.llvm.org> on behalf of Steven Simpson via cfe-users <cfe-users at lists.llvm.org>
Sent: Wednesday, March 22, 2017 9:10 AM
To: cfe-users at lists.llvm.org
Subject: [cfe-users] BPF stack limit


I'm using Clang to compile C to eBPF, not to run in the Linux kernel,
but in ubpf.

I occasionally encounter the error "Looks like the BPF stack limit of
512 bytes is exceeded".  The limit seems to be hard-wired

   if (Offset <= -512) {

(I'm using "clang version 5.0.0 (trunk 294090)" built from SVN source.
Checked it's still there in r298510.)

Is this an intrinsic limit of eBPF, or just one set by the kernel? If
the latter, and since the kernel isn't the only place BPF could run,
could an option be added to override it?  (For the moment, I've just
disabled the check and rebuilt.  Plus there are still some changes to
try with my code which might avoid the limit.)


cfe-users mailing list
cfe-users at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20170327/4b578569/attachment.html>

More information about the cfe-users mailing list