public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@sous-sol.org>
To: linux-kernel@vger.kernel.org, stable@kernel.org
Cc: Justin Forbes <jmforbes@linuxtx.org>,
	Zwane Mwaikambo <zwane@arm.linux.org.uk>,
	"Theodore Ts'o" <tytso@mit.edu>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Dave Jones <davej@redhat.com>,
	Chuck Wolber <chuckw@quantumlinux.com>,
	Chris Wedgwood <reviews@ml.cw.f00f.org>,
	torvalds@osdl.org, akpm@osdl.org, alan@lxorguk.ukuu.org.uk,
	David Miller <davem@davemloft.net>,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: [PATCH 04/13] SPARC64: Fix missing fold at end of checksums.
Date: Tue, 20 Jun 2006 00:00:04 -0700	[thread overview]
Message-ID: <20060620114657.947738000@sous-sol.org> (raw)
In-Reply-To: 20060620114527.934114000@sous-sol.org

[-- Attachment #1: sparc64-fix-missing-fold-at-end-of-checksums.patch --]
[-- Type: text/plain, Size: 1508 bytes --]

-stable review patch.  If anyone has any objections, please let us know.
------------------

From: David Miller <davem@davemloft.net>

Both csum_partial() and the csum_partial_copy*() family of routines
forget to do a final fold on the computed checksum value on sparc64.
So do the standard Sparc "add + set condition codes, add carry"
sequence, then make sure the high 32-bits of the return value are
clear.

Based upon some excellent detective work and debugging done by
Richard Braun and Samuel Thibault.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---

 arch/sparc64/lib/checksum.S  |    5 +++--
 arch/sparc64/lib/csum_copy.S |    5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

--- linux-2.6.16.21.orig/arch/sparc64/lib/checksum.S
+++ linux-2.6.16.21/arch/sparc64/lib/checksum.S
@@ -165,8 +165,9 @@ csum_partial_end_cruft:
 	sll		%g1, 8, %g1
 	or		%o5, %g1, %o4
 
-1:	add		%o2, %o4, %o2
+1:	addcc		%o2, %o4, %o2
+	addc		%g0, %o2, %o2
 
 csum_partial_finish:
 	retl
-	 mov		%o2, %o0
+	 srl		%o2, 0, %o0
--- linux-2.6.16.21.orig/arch/sparc64/lib/csum_copy.S
+++ linux-2.6.16.21/arch/sparc64/lib/csum_copy.S
@@ -221,11 +221,12 @@ FUNC_NAME:		/* %o0=src, %o1=dst, %o2=len
 	sll		%g1, 8, %g1
 	or		%o5, %g1, %o4
 
-1:	add		%o3, %o4, %o3
+1:	addcc		%o3, %o4, %o3
+	addc		%g0, %o3, %o3
 
 70:
 	retl
-	 mov		%o3, %o0
+	 srl		%o3, 0, %o0
 
 95:	mov		0, GLOBAL_SPARE
 	brlez,pn	%o2, 4f

--

  parent reply	other threads:[~2006-06-20 11:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-20 11:45 [PATCH 00/13] -stable review Chris Wright
2006-06-20  7:00 ` [PATCH 01/13] USB: Whiteheat: fix firmware spurious errors Chris Wright
2006-06-20  7:00 ` [PATCH 02/13] SPARC64: Fix D-cache corruption in mremap Chris Wright
2006-06-20  7:00 ` [PATCH 03/13] SPARC64: Respect gfp_t argument to dma_alloc_coherent() Chris Wright
2006-06-20  7:00 ` Chris Wright [this message]
2006-06-20  7:00 ` [PATCH 05/13] [PATCH] Missed error checking for intents filp in open_namei() Chris Wright
2006-06-20  7:00 ` [PATCH 06/13] tmpfs: time granularity fix for [acm]time going backwards Chris Wright
2006-06-20  7:00 ` [PATCH 07/13] SERIAL: PARPORT_SERIAL should depend on SERIAL_8250_PCI Chris Wright
2006-06-29 17:31   ` Michael Tokarev
2006-06-29 17:37     ` Russell King
2006-06-29 18:12       ` Chris Wright
2006-06-29 18:17         ` Michael Tokarev
2006-06-20  7:00 ` [PATCH 08/13] fs/namei.c: Call to file_permission() under a spinlock in do_lookup_path() Chris Wright
2006-06-20  7:00 ` [PATCH 09/13] JFS: Fix multiple errors in metapage_releasepage Chris Wright
2006-06-20  7:00 ` [PATCH 10/13] scsi_lib.c: properly count the number of pages in scsi_req_map_sg() Chris Wright
2006-06-20  7:00 ` [PATCH 11/13] I2O: Bugfixes to get I2O working again Chris Wright
2006-06-20  7:00 ` [PATCH 12/13] powernow-k8 crash workaround Chris Wright
2006-06-20  7:00 ` [PATCH 13/13] NTFS: Critical bug fix (affects MIPS and possibly others) Chris Wright

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=20060620114657.947738000@sous-sol.org \
    --to=chrisw@sous-sol.org \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=chuckw@quantumlinux.com \
    --cc=davej@redhat.com \
    --cc=davem@davemloft.net \
    --cc=gregkh@suse.de \
    --cc=jmforbes@linuxtx.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@xenotime.net \
    --cc=reviews@ml.cw.f00f.org \
    --cc=stable@kernel.org \
    --cc=torvalds@osdl.org \
    --cc=tytso@mit.edu \
    --cc=zwane@arm.linux.org.uk \
    /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