[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.

Igor

________________________________
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

Hi,

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
(llvm/lib/Target/BPF/BPFRegisterInfo.cpp):

   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.)

Thanks,

Steven
_______________________________________________
cfe-users mailing list
cfe-users at lists.llvm.org
https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.llvm.org_cgi-2Dbin_mailman_listinfo_cfe-2Dusers&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=LlbfLxvkyuVVPfVvG7EAbQ&m=On5jaYfY7XtHrHbnvpNvCTd5nJsIP5oS73Lyre_M7ds&s=-1jnm3HD6bQO8C8Cu71msJqTKLsQ9uAxEdZiPbABiwo&e=
-------------- 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