BPF List
 help / color / mirror / Atom feed
From: Hengqi Chen <hengqi.chen@gmail.com>
To: bpf@vger.kernel.org, loongarch@lists.linux.dev
Cc: hengqi.chen@gmail.com
Subject: [PATCH 0/2] Allow mixing bpf2bpf calls with tailcalls on LoongArch
Date: Sun, 12 Feb 2023 11:52:34 +0800	[thread overview]
Message-ID: <20230212035236.1436532-1-hengqi.chen@gmail.com> (raw)

This patchset enables mixing bpf2bpf calls with tailcalls on LoongArch.

The first patch fixes JIT for function calls, like:

  [   29.346981] multi-func JIT bug 105 != 103

This is because we are emiting variable instructions for 64-bit immediate moves.
During the first pass of JIT, the placeholder address is just zero, emiting two
instructions for it. In the extra pass, the function address is in XKVRANGE,
emiting four instructions for it. This change the instruction index in JIT context.
Fix it by using a fixed 4-instruction sequence.

The second patch enables mixing bpf2bpf calls with tailcalls on LoongArch.

Hengqi Chen (2):
  LoongArch: BPF: Treat function address as 64-bit value
  LoongArch: BPF: Support mixing bpf2bpf and tailcalls

 arch/loongarch/net/bpf_jit.c | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

--
2.31.1

             reply	other threads:[~2023-02-12  3:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-12  3:52 Hengqi Chen [this message]
2023-02-12  3:52 ` [PATCH 1/2] LoongArch: BPF: Treat function address as 64-bit value Hengqi Chen
2023-02-13  3:01   ` Tiezhu Yang
2023-02-13  3:18     ` Tiezhu Yang
2023-02-14 15:36     ` Hengqi Chen
2023-02-12  3:52 ` [PATCH 2/2] LoongArch: BPF: Support mixing bpf2bpf and tailcalls Hengqi Chen

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=20230212035236.1436532-1-hengqi.chen@gmail.com \
    --to=hengqi.chen@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    /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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox