From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,FROM_EXCESS_BASE64, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6153C43387 for ; Wed, 16 Jan 2019 19:06:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 882AC20873 for ; Wed, 16 Jan 2019 19:06:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bYCBm5kV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730083AbfAPTGV (ORCPT ); Wed, 16 Jan 2019 14:06:21 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:42713 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729330AbfAPTGV (ORCPT ); Wed, 16 Jan 2019 14:06:21 -0500 Received: by mail-qt1-f196.google.com with SMTP id d19so8442962qtq.9 for ; Wed, 16 Jan 2019 11:06:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=a/Ix4UL7RxF8iUSMDzSxOWvlf6qtFBVXJ4pGbPq2pZ4=; b=bYCBm5kV+MGvyGLsnVN7aUnNJQE+slK3ARrsAPRPUw3MOXf8jkW/4WqpMV+TmbO1Hv xCdwsizgBA2cnchks5UIbl/vlm7xf/cn00fUfapMfMHctV0PUDWrPWjuPeyXh4M6nyKB /xyaiqgN0UHlLVmzH6qp0SspbuddtT4RlTui8KsHsrrT50A28mrOZPjCFXHRA3MB9eAk ZWxQHywYIEMkt2pXek8E+VuUB+RYnF4fZMUxkp1mvYQ0so4ak//u0hewMWpZ5kau8sb5 CxEAe79Gka6YLXxI0RCRLMZwVy+4vKp36vUs897Q4to0KjJg6KDazYFtAQ5+jHJJExNH daBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=a/Ix4UL7RxF8iUSMDzSxOWvlf6qtFBVXJ4pGbPq2pZ4=; b=Q28mEnTR1GAtY+wxWpnCP1eURSP1x+aFm0kQAeCn4bX83uSJUq85u0R5Mk/lGSJn2l RzhWlwicIPLkb12Aaln9z3yLqe/f9+Vbf4zbgMaB8VqV4O8l+U2x087yUfwJaUZ03HWW dCCWlnN+0GRmzFRwBThO9ccxm2Tgj4xcOrb7VJZuVK/a64MTTiwP1o/YD+3XqIIRsfz0 wR8+UPFzZlKVhrTFF59pjQMAzg2tMD0Y5wEEnikB5yXiWxSmO5f0u++ObuidVsn0b66p 22r62ggtOpf9SMFKj7zxDSFJBaPr4yHXaW66hXqTVlzGckuJgKPOioIOJglYTVOjoaV2 dXwA== X-Gm-Message-State: AJcUukdJbFBgQm9E9sAWUgGpdyaxEuDHwqOCtdAcHi1IG4CcFCDL5lDj KfqsvYiaH4IPDaaLiXskW8JtcPqc5nqtoUuebkY= X-Google-Smtp-Source: ALg8bN5z0tBYVTKMJysBSwpBWMmP7MQr1PtBejmSHgMPp/ym3DIvUNupPRYUUcpwxw/HdAweSTgBGlw/5O5JM7MBmsY= X-Received: by 2002:ac8:8e1:: with SMTP id y30mr8425185qth.3.1547665580042; Wed, 16 Jan 2019 11:06:20 -0800 (PST) MIME-Version: 1.0 References: <20190115083518.10149-1-bjorn.topel@gmail.com> <20190115083518.10149-4-bjorn.topel@gmail.com> <912c38fc-e75d-a7f5-30bc-592e7498e958@iogearbox.net> In-Reply-To: <912c38fc-e75d-a7f5-30bc-592e7498e958@iogearbox.net> From: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= Date: Wed, 16 Jan 2019 20:06:08 +0100 Message-ID: Subject: Re: [RFC PATCH 3/3] bpf, riscv: added eBPF JIT for RV64G To: Daniel Borkmann Cc: linux-riscv@lists.infradead.org, Palmer Dabbelt , davidlee@sifive.com, Netdev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Den ons 16 jan. 2019 kl 16:41 skrev Daniel Borkmann : > [...] > > > 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 <=3D st= ack > 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=C3=B6rn > Cheers, > Daniel