From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4BC7FDDF01 for ; Wed, 18 Mar 2009 10:03:11 +1100 (EST) Subject: Re: Fix for __div64_32 locks when using some 64 bit numbers From: Benjamin Herrenschmidt To: davidastro In-Reply-To: <22567864.post@talk.nabble.com> References: <22567864.post@talk.nabble.com> Content-Type: text/plain Date: Wed, 18 Mar 2009 10:03:04 +1100 Message-Id: <1237330984.25062.164.camel@pasglop> Mime-Version: 1.0 Cc: linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, 2009-03-17 at 14:15 -0700, davidastro wrote: > I found a bug when using the function __div64_32 in assembly in a 32 bit ppc > architecture unit. > > I tried the numbers 55834565048000000 for the dividend and 4294967079 for > the divisor. When passing these two numbers to the function __div64_32, I > had a software lock. I searched for possible patches online and in different > forums but I could not find anything related to the assembly implementation > to this function (I would have to apologize if somebody already found a fix > :-) ). > > Anyway, when analyzing the assembly code, I found out with gdb the problem. > I am not an expert in ppc architecture but I read the documentation and I am > pretty sure I solved the issue (I have been testing for couple of days using > random 64 to 32 number combinations with good results). > > Who or Where should I post the fix to be reviewed. Here is fine :-) Ben.