Linux Hardening
 help / color / mirror / Atom feed
From: Milan Tripkovic <milant2002@gmail.com>
To: Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>, Kees Cook <kees@kernel.org>
Cc: Alexandre Ghiti <alex@ghiti.fr>,
	Andy Shevchenko <andy@kernel.org>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org,
	Dusan Stojkovic <Dusan.Stojkovic@rt-rk.com>,
	Milan Tripkovic <Milan.Tripkovic@rt-rk.com>
Subject: [PATCH 0/2] riscv: lib: add optimized memchr() and extend KUnit tests
Date: Wed, 20 May 2026 17:55:29 +0200	[thread overview]
Message-ID: <20260520155532.1139471-1-milant2002@gmail.com> (raw)

From: Milan Tripkovic <Milan.Tripkovic@rt-rk.com>

Add an optimized assembly implementation of memchr() for RISC-V.
The implementation uses word-aligned loads and Zbb optimizations where
available, with a fallback for non-Zbb hardware.

The series also includes KUnit tests for functional verification 
and performance benchmarking.

Signed-off-by: Milan Tripkovic <Milan.Tripkovic@rt-rk.com>

Milan Tripkovic (2):
  riscv: lib: add memchr() implementation
  lib/string_kunit: extend benchmarks and unit test to memchr()

 arch/riscv/include/asm/string.h |   3 +-
 arch/riscv/lib/Makefile         |   1 +
 arch/riscv/lib/memchr.S         | 126 ++++++++++++++++++++++++++++++++
 arch/riscv/purgatory/Makefile   |   5 +-
 lib/tests/string_kunit.c        |  53 ++++++++++++++
 5 files changed, 186 insertions(+), 2 deletions(-)
 create mode 100644 arch/riscv/lib/memchr.S

-- 
2.43.0


             reply	other threads:[~2026-05-20 15:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20 15:55 Milan Tripkovic [this message]
2026-05-20 15:55 ` [PATCH 1/2] riscv: lib: add memchr() implementation Milan Tripkovic
2026-05-20 15:55 ` [PATCH 2/2] lib/string_kunit: extend benchmarks and unit test to memchr() Milan Tripkovic

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=20260520155532.1139471-1-milant2002@gmail.com \
    --to=milant2002@gmail.com \
    --cc=Dusan.Stojkovic@rt-rk.com \
    --cc=Milan.Tripkovic@rt-rk.com \
    --cc=alex@ghiti.fr \
    --cc=andy@kernel.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=kees@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    /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