From: Xiao Wang <xiao.w.wang@intel.com>
To: paul.walmsley@sifive.com, palmer@dabbelt.com,
aou@eecs.berkeley.edu, luke.r.nels@gmail.com, xi.wang@gmail.com,
bjorn@kernel.org
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
martin.lau@linux.dev, eddyz87@gmail.com, song@kernel.org,
yonghong.song@linux.dev, john.fastabend@gmail.com,
kpsingh@kernel.org, sdf@google.com, haoluo@google.com,
jolsa@kernel.org, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org, bpf@vger.kernel.org,
pulehui@huawei.com, puranjay@kernel.org, haicheng.li@intel.com,
Xiao Wang <xiao.w.wang@intel.com>
Subject: [PATCH bpf-next v4 0/2] riscv, bpf: Introduce Zba optimization
Date: Fri, 24 May 2024 15:55:41 +0800 [thread overview]
Message-ID: <20240524075543.4050464-1-xiao.w.wang@intel.com> (raw)
The riscv Zba extension provides instructions to accelerate the generation
of addresses that index into arrays of basic data types, bpf JIT generated
insn counts could be reduced by leveraging Zba for address calculation.
The first patch introduces RISCV_ISA_ZBA Kconfig option and uses Zba add.uw
insn to optimize zextw operation.
The second patch uses Zba shift-and-add insns to optimize address
calculation for array of unsigned long data.
Thanks,
Xiao
v4:
* Combine the second patch (previously v1) and the first patch into a series. (Bjorn)
* Rebase the second patch on bpf-next tree.
* Link to v3: https://lore.kernel.org/bpf/20240516090430.493122-1-xiao.w.wang@intel.com/
v3:
* Remove the Kconfig dependencies on TOOLCHAIN_HAS_ZBA and
RISCV_ALTERNATIVE. (Andrew)
* Link to v2: https://lore.kernel.org/bpf/20240511023436.3282285-1-xiao.w.wang@intel.com/
v2:
* Add Zba description in the Kconfig. (Lehui)
* Reword the Kconfig help message to make it clearer. (Conor)
* Link to v1: https://lore.kernel.org/bpf/20240507104528.435980-1-xiao.w.wang@intel.com/
Xiao Wang (2):
riscv, bpf: Optimize zextw insn with Zba extension
riscv, bpf: Introduce shift add helper with Zba optimization
arch/riscv/Kconfig | 12 ++++++++
arch/riscv/net/bpf_jit.h | 51 +++++++++++++++++++++++++++++++++
arch/riscv/net/bpf_jit_comp32.c | 3 +-
arch/riscv/net/bpf_jit_comp64.c | 9 ++----
4 files changed, 67 insertions(+), 8 deletions(-)
base-commit: 5c1672705a1a2389f5ad78e0fea6f08ed32d6f18
--
2.25.1
next reply other threads:[~2024-05-24 7:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-24 7:55 Xiao Wang [this message]
2024-05-24 7:55 ` [PATCH bpf-next v4 1/2] riscv, bpf: Optimize zextw insn with Zba extension Xiao Wang
2024-05-24 7:55 ` [PATCH bpf-next v4 2/2] riscv, bpf: Introduce shift add helper with Zba optimization Xiao Wang
2024-05-29 9:41 ` Björn Töpel
2024-05-30 0:32 ` Wang, Xiao W
2024-05-24 15:10 ` [PATCH bpf-next v4 0/2] riscv, bpf: Introduce " patchwork-bot+netdevbpf
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=20240524075543.4050464-1-xiao.w.wang@intel.com \
--to=xiao.w.wang@intel.com \
--cc=andrii@kernel.org \
--cc=aou@eecs.berkeley.edu \
--cc=ast@kernel.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=haicheng.li@intel.com \
--cc=haoluo@google.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=luke.r.nels@gmail.com \
--cc=martin.lau@linux.dev \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=pulehui@huawei.com \
--cc=puranjay@kernel.org \
--cc=sdf@google.com \
--cc=song@kernel.org \
--cc=xi.wang@gmail.com \
--cc=yonghong.song@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