From: "Björn Töpel" <bjorn.topel@gmail.com> To: Daniel Borkmann <daniel@iogearbox.net> Cc: linux-riscv@lists.infradead.org, Palmer Dabbelt <palmer@sifive.com>, davidlee@sifive.com, Netdev <netdev@vger.kernel.org> Subject: Re: [RFC PATCH 3/3] bpf, riscv: added eBPF JIT for RV64G Date: Wed, 16 Jan 2019 20:06:08 +0100 [thread overview] Message-ID: <CAJ+HfNjJ+Yy=+bpvBnAMugCQBjNNvaMBs=gBFfgE7U5dv37MRw@mail.gmail.com> (raw) In-Reply-To: <912c38fc-e75d-a7f5-30bc-592e7498e958@iogearbox.net> Den ons 16 jan. 2019 kl 16:41 skrev Daniel Borkmann <daniel@iogearbox.net>: > [...] > > > For the fixed prologue: how does, say x86, deal with BPF stack usage > > in the tail call case? If the caller doesn't use the bpf stack, but > > the callee does. From a quick glance in the code, the x86 prologue > > still uses aux->stack_depth. If the callee has a different stack usage > > that the caller, and then the callee does a function call, wouldn't > > this mess up the frame? (Yeah, obviously missing something! :-)) > > Basically in this case verifier sets stack size to MAX_BPF_STACK when it > finds a tail call in the prog, meaning the callee will be reusing <= stack > size than the caller and then upon exit unwinds it via leave+ret. > Ugh, so for "dynamic" tail calls this would mean "more expensive functions calls with maximum stack usage per call"? I.e. each tail call consumes MAX_BPF_STACK plus regular pro-/epilogue plus depth tracking. I'd still prefer optimizing to regular functions calls, than tail calls -- or is that naive? What is most common in larger bpf deployments, say, Katran or Cilium? Cheers! Björn > Cheers, > Daniel
WARNING: multiple messages have this Message-ID (diff)
From: "Björn Töpel" <bjorn.topel@gmail.com> To: Daniel Borkmann <daniel@iogearbox.net> Cc: Netdev <netdev@vger.kernel.org>, linux-riscv@lists.infradead.org, Palmer Dabbelt <palmer@sifive.com>, davidlee@sifive.com Subject: Re: [RFC PATCH 3/3] bpf, riscv: added eBPF JIT for RV64G Date: Wed, 16 Jan 2019 20:06:08 +0100 [thread overview] Message-ID: <CAJ+HfNjJ+Yy=+bpvBnAMugCQBjNNvaMBs=gBFfgE7U5dv37MRw@mail.gmail.com> (raw) In-Reply-To: <912c38fc-e75d-a7f5-30bc-592e7498e958@iogearbox.net> Den ons 16 jan. 2019 kl 16:41 skrev Daniel Borkmann <daniel@iogearbox.net>: > [...] > > > For the fixed prologue: how does, say x86, deal with BPF stack usage > > in the tail call case? If the caller doesn't use the bpf stack, but > > the callee does. From a quick glance in the code, the x86 prologue > > still uses aux->stack_depth. If the callee has a different stack usage > > that the caller, and then the callee does a function call, wouldn't > > this mess up the frame? (Yeah, obviously missing something! :-)) > > Basically in this case verifier sets stack size to MAX_BPF_STACK when it > finds a tail call in the prog, meaning the callee will be reusing <= stack > size than the caller and then upon exit unwinds it via leave+ret. > Ugh, so for "dynamic" tail calls this would mean "more expensive functions calls with maximum stack usage per call"? I.e. each tail call consumes MAX_BPF_STACK plus regular pro-/epilogue plus depth tracking. I'd still prefer optimizing to regular functions calls, than tail calls -- or is that naive? What is most common in larger bpf deployments, say, Katran or Cilium? Cheers! Björn > Cheers, > Daniel _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2019-01-16 19:06 UTC|newest] Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-01-15 8:35 [RFC PATCH 0/3] RV64G eBPF JIT Björn Töpel 2019-01-15 8:35 ` Björn Töpel 2019-01-15 8:35 ` Björn Töpel 2019-01-15 8:35 ` [RFC PATCH 1/3] riscv: set HAVE_EFFICIENT_UNALIGNED_ACCESS Björn Töpel 2019-01-15 8:35 ` Björn Töpel 2019-01-15 15:39 ` Christoph Hellwig 2019-01-15 15:39 ` Christoph Hellwig 2019-01-15 16:06 ` Björn Töpel 2019-01-15 16:06 ` Björn Töpel 2019-01-25 20:21 ` Palmer Dabbelt 2019-01-25 20:21 ` Palmer Dabbelt 2019-01-26 1:33 ` Jim Wilson 2019-01-26 1:33 ` Jim Wilson 2019-01-29 2:43 ` Palmer Dabbelt 2019-01-29 2:43 ` Palmer Dabbelt 2019-01-15 8:35 ` [RFC PATCH 2/3] riscv: add build infra for JIT compiler Björn Töpel 2019-01-15 8:35 ` Björn Töpel 2019-01-15 15:43 ` Christoph Hellwig 2019-01-15 15:43 ` Christoph Hellwig 2019-01-15 16:09 ` Björn Töpel 2019-01-15 16:09 ` Björn Töpel 2019-01-15 8:35 ` [RFC PATCH 3/3] bpf, riscv: added eBPF JIT for RV64G Björn Töpel 2019-01-15 8:35 ` Björn Töpel 2019-01-15 8:35 ` Björn Töpel 2019-01-15 23:49 ` Daniel Borkmann 2019-01-15 23:49 ` Daniel Borkmann 2019-01-16 7:23 ` Björn Töpel 2019-01-16 7:23 ` Björn Töpel 2019-01-16 15:41 ` Daniel Borkmann 2019-01-16 15:41 ` Daniel Borkmann 2019-01-16 19:06 ` Björn Töpel [this message] 2019-01-16 19:06 ` Björn Töpel 2019-01-15 15:40 ` [RFC PATCH 0/3] RV64G eBPF JIT Christoph Hellwig 2019-01-15 15:40 ` Christoph Hellwig 2019-01-15 16:03 ` Björn Töpel 2019-01-15 16:03 ` Björn Töpel 2019-01-25 19:02 ` Palmer Dabbelt 2019-01-25 19:02 ` Palmer Dabbelt 2019-01-25 19:54 ` Paul Walmsley 2019-01-25 19:54 ` Paul Walmsley 2019-01-27 12:28 ` Björn Töpel 2019-01-27 12:28 ` Björn Töpel 2019-01-30 2:02 ` Palmer Dabbelt 2019-01-30 2:02 ` Palmer Dabbelt
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to='CAJ+HfNjJ+Yy=+bpvBnAMugCQBjNNvaMBs=gBFfgE7U5dv37MRw@mail.gmail.com' \ --to=bjorn.topel@gmail.com \ --cc=daniel@iogearbox.net \ --cc=davidlee@sifive.com \ --cc=linux-riscv@lists.infradead.org \ --cc=netdev@vger.kernel.org \ --cc=palmer@sifive.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.