linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiko Carstens <hca@linux.ibm.com>
To: Vasily Gorbik <gor@linux.ibm.com>
Cc: Ilya Leoshkevich <iii@linux.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	linux-s390@vger.kernel.org
Subject: Re: [PATCH] s390/checksum: Fix csum_partial() without vector facility
Date: Thu, 9 Jul 2026 08:08:18 +0200	[thread overview]
Message-ID: <20260709060818.25563B9c-hca@linux.ibm.com> (raw)
In-Reply-To: <p01.g0de361f35d11.tthup4z@ub.hpns>

On Wed, Jul 08, 2026 at 12:02:14PM +0200, Vasily Gorbik wrote:
> Currently csum_partial() calls csum_copy() with copy=false and dst=NULL.
> On machines without the vector facility, csum_copy() falls back to
> cksm(dst, ...), causing the checksum to be calculated from address zero
> instead of the source buffer.
> 
> The VX implementation already checksums data loaded from src. Make the
> fallback do the same by passing src to cksm().
> 
> Fixes: dcd3e1de9d17 ("s390/checksum: provide csum_partial_copy_nocheck()")
> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
> ---
>  arch/s390/lib/csum-partial.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/s390/lib/csum-partial.c b/arch/s390/lib/csum-partial.c
> index 458abd9bac70..9d74ceff136c 100644
> --- a/arch/s390/lib/csum-partial.c
> +++ b/arch/s390/lib/csum-partial.c
> @@ -23,7 +23,7 @@ static __always_inline __wsum csum_copy(void *dst, const void *src, int len, __w
>  	if (!cpu_has_vx()) {
>  		if (copy)
>  			memcpy(dst, src, len);
> -		return cksm(dst, len, sum);
> +		return cksm(src, len, sum);

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>

But at least that also tells us that this code never worked on pre z13.

  reply	other threads:[~2026-07-09  6:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08 10:02 [PATCH] s390/checksum: Fix csum_partial() without vector facility Vasily Gorbik
2026-07-09  6:08 ` Heiko Carstens [this message]
2026-07-09 10:49 ` Vasily Gorbik

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=20260709060818.25563B9c-hca@linux.ibm.com \
    --to=hca@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=linux-s390@vger.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;
as well as URLs for NNTP newsgroup(s).