linux/arch/riscv
Feng Jiang 5ba15d419f riscv: lib: add strnlen() implementation
Add an optimized strnlen() implementation for RISC-V. This version
includes a generic optimization and a Zbb-powered optimization using
the 'orc.b' instruction, derived from the strlen() implementation.

Benchmark results (QEMU TCG, rv64):
  Length | Original (MB/s) | Optimized (MB/s) | Improvement
  -------|-----------------|------------------|------------
  16 B   | 179             | 309              | +72.6%
  512 B  | 347             | 1562             | +350.1%
  4096 B | 356             | 1878             | +427.5%

Suggested-by: Qingfang Deng <dqfext@gmail.com>
Signed-off-by: Feng Jiang <jiangfeng@kylinos.cn>
Link: https://patch.msgid.link/20260130025018.172925-7-jiangfeng@kylinos.cn
Signed-off-by: Paul Walmsley <pjw@kernel.org>
2026-04-04 18:42:44 -06:00
..
boot RISC-V soc fixes for v7.0-rc1 2026-03-04 21:35:06 +01:00
configs RISC-V updates for v7.0 2026-02-12 19:17:44 -08:00
crypto lib/crypto: riscv/aes: Migrate optimized code into library 2026-01-12 11:39:58 -08:00
errata riscv: fix various typos in comments and code 2026-04-04 18:42:39 -06:00
include riscv: lib: add strnlen() implementation 2026-04-04 18:42:44 -06:00
kernel riscv: vdso_cfi: Add .gitignore for build artifacts 2026-04-04 18:42:44 -06:00
kvm riscv: fix various typos in comments and code 2026-04-04 18:42:39 -06:00
lib riscv: lib: add strnlen() implementation 2026-04-04 18:42:44 -06:00
mm riscv: mm: WARN_ON() for bad addresses in vmemmap_populate() 2026-04-04 18:42:44 -06:00
net Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
purgatory riscv: lib: add strnlen() implementation 2026-04-04 18:42:44 -06:00
tools riscv: Stop considering R_RISCV_NONE as bad relocations 2025-07-16 08:13:55 -07:00
Kbuild
Kconfig riscv: enable HAVE_IOREMAP_PROT 2026-04-04 18:42:44 -06:00
Kconfig.debug
Kconfig.errata riscv: ERRATA_STARFIVE_JH7100: Fix missing dependency on new CONFIG_CACHEMAINT_FOR_DMA 2026-01-15 18:13:04 -07:00
Kconfig.socs Initial Anlogic Platform Support 2025-11-21 21:29:57 +01:00
Kconfig.vendor riscv: Add xmipsexectl as a vendor extension 2025-09-18 20:36:00 -06:00
Makefile riscv: Simplify assignment for UTS_MACHINE 2026-04-04 18:42:40 -06:00
Makefile.postlink