All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>,
	stable@kernel.org, Martin Schwidefsky <schwidefsky@de.ibm.com>
Subject: [patch 1/6] __div64_31 broken for CONFIG_MARCH_G5
Date: Wed, 18 Mar 2009 13:48:30 +0100	[thread overview]
Message-ID: <20090318124844.895336869@de.ibm.com> (raw)
In-Reply-To: 20090318124829.637003183@de.ibm.com

[-- Attachment #1: 001-div64.diff --]
[-- Type: text/plain, Size: 1210 bytes --]

From: Martin Schwidefsky <schwidefsky@de.ibm.com>

The implementation of __div64_31 for G5 machines is broken. The comments
in __div64_31 are correct, only the code does not do what the comments
say. The part "If the remainder has overflown subtract base and increase
the quotient" is only partially realized, the base is subtracted correctly
but the quotient is only increased if the dividend had the last bit set.
Using the correct instruction fixes the problem.

Cc: stable@kernel.org
Reported-by: Frans Pop <elendil@planet.nl>
Tested-by: Frans Pop <elendil@planet.nl>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
---

 arch/s390/lib/div64.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: quilt-2.6/arch/s390/lib/div64.c
===================================================================
--- quilt-2.6.orig/arch/s390/lib/div64.c
+++ quilt-2.6/arch/s390/lib/div64.c
@@ -61,7 +61,7 @@ static uint32_t __div64_31(uint64_t *n, 
 		"	clr	%0,%3\n"
 		"	jl	0f\n"
 		"	slr	%0,%3\n"
-		"	alr	%1,%2\n"
+		"	ahi	%1,1\n"
 		"0:\n"
 		: "+d" (reg2), "+d" (reg3), "=d" (tmp)
 		: "d" (base), "2" (1UL) : "cc" );

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

  reply	other threads:[~2009-03-18 12:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-18 12:48 [patch 0/6] s390 bug fixes for 2.6.29 Martin Schwidefsky
2009-03-18 12:48 ` Martin Schwidefsky [this message]
2009-03-18 12:48 ` [patch 2/6] topology: define SD_MC_INIT to fix performance regression Martin Schwidefsky
2009-03-18 12:48 ` [patch 3/6] ftrace/mcount: fix kernel stack backchain Martin Schwidefsky
2009-03-18 12:48 ` [patch 4/6] Dont check for pfn_valid() in uaccess_pt.c Martin Schwidefsky
2009-03-18 12:48 ` [patch 5/6] make page table walking more robust Martin Schwidefsky
2009-03-18 12:48 ` [patch 6/6] make page table upgrade work again Martin Schwidefsky

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=20090318124844.895336869@de.ibm.com \
    --to=schwidefsky@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=stable@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.