From: Heiko Carstens <hca@linux.ibm.com>
To: Alexander Gordeev <agordeev@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Juergen Christ <jchrist@linux.ibm.com>
Cc: linux-s390@vger.kernel.org
Subject: [PATCH v3 0/9] s390/string: Convert various functions to C
Date: Tue, 9 Jun 2026 12:33:34 +0200 [thread overview]
Message-ID: <20260609103343.107325-1-hca@linux.ibm.com> (raw)
v3:
- Add additional patch which adds -ffreestanding compile option to
string.o [Sashiko [3]]
v2:
Address various Shashiko findings [2]:
- Off by one comparison bug, which leads to slow path for memmove()
- Incorrect ifdef around __memset()
- Incorrect commit description for memmove() conversion
- Missing noinstr for tishift functions
- Missing header guard for tishift header file
v1:
While working on something else I stumbled again across the various mem*()
helper functions, which were implemented in assembler to avoid recursive
calls [1], when using the compiler's builtin functions.
Convert the functions back to C using inline assemblies, which makes them
hopefully a bit more readable and maintainable. Also improve the memmove()
implementation by using the mvcrl instruction for the backward copy case.
Thanks,
Heiko
[1] commit 535c611ddd3e ("s390/string: provide asm lib functions for memcpy and memcmp")
[2] https://sashiko.dev/#/patchset/20260607162937.2927356-1-hca%40linux.ibm.com
[3] https://sashiko.dev/#/patchset/20260608053754.571282-1-hca%40linux.ibm.com
Heiko Carstens (9):
s390/purgatory: Enforce z10 minimum architecture level
s390: Add .noinstr.text to boot and purgatory linker scripts
s390/string: Add -ffreestanding compile option to string.o
s390/string: Convert memmove() to C
s390/string: Convert memset() to C
s390/string: Convert memcpy() to C
s390/string: Convert memset(16|32|64)() to C
s390/memmove: Optimize backward copy case
s390/tishift: Convert __ashlti3(), __ashrti3(), __lshrti3() to C
arch/s390/boot/Makefile | 7 +-
arch/s390/boot/mem.S | 2 -
arch/s390/boot/string.c | 6 +-
arch/s390/boot/vmlinux.lds.S | 1 +
arch/s390/include/asm/asm-prototypes.h | 4 -
arch/s390/lib/Makefile | 6 +-
arch/s390/lib/mem.S | 192 ----------------------
arch/s390/lib/string.c | 210 +++++++++++++++++++++++++
arch/s390/lib/tishift.S | 63 --------
arch/s390/lib/tishift.c | 64 ++++++++
arch/s390/lib/tishift.h | 9 ++
arch/s390/purgatory/Makefile | 9 +-
arch/s390/purgatory/purgatory.lds.S | 1 +
13 files changed, 301 insertions(+), 273 deletions(-)
delete mode 100644 arch/s390/boot/mem.S
delete mode 100644 arch/s390/lib/mem.S
delete mode 100644 arch/s390/lib/tishift.S
create mode 100644 arch/s390/lib/tishift.c
create mode 100644 arch/s390/lib/tishift.h
--
2.53.0
next reply other threads:[~2026-06-09 10:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 10:33 Heiko Carstens [this message]
2026-06-09 10:33 ` [PATCH v3 1/9] s390/purgatory: Enforce z10 minimum architecture level Heiko Carstens
2026-06-09 10:33 ` [PATCH v3 2/9] s390: Add .noinstr.text to boot and purgatory linker scripts Heiko Carstens
2026-06-09 10:33 ` [PATCH v3 3/9] s390/string: Add -ffreestanding compile option to string.o Heiko Carstens
2026-06-09 12:23 ` Juergen Christ
2026-06-09 13:39 ` Heiko Carstens
2026-06-09 10:33 ` [PATCH v3 4/9] s390/string: Convert memmove() to C Heiko Carstens
2026-06-09 10:33 ` [PATCH v3 5/9] s390/string: Convert memset() " Heiko Carstens
2026-06-09 10:33 ` [PATCH v3 6/9] s390/string: Convert memcpy() " Heiko Carstens
2026-06-09 10:33 ` [PATCH v3 7/9] s390/string: Convert memset(16|32|64)() " Heiko Carstens
2026-06-09 10:33 ` [PATCH v3 8/9] s390/memmove: Optimize backward copy case Heiko Carstens
2026-06-09 10:33 ` [PATCH v3 9/9] s390/tishift: Convert __ashlti3(), __ashrti3(), __lshrti3() to C Heiko Carstens
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=20260609103343.107325-1-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=jchrist@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=svens@linux.ibm.com \
/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