From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.redhat.com (Postfix) with ESMTP id B95743EA35 for ; Thu, 5 Dec 2002 05:25:28 -0500 (EST) Received: (from mail@localhost) by int-mx1.corp.redhat.com (8.11.6/8.11.6) id gB5APSn06209 for axp-list@listman.redhat.com; Thu, 5 Dec 2002 05:25:28 -0500 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with SMTP id gB5APSD06205 for ; Thu, 5 Dec 2002 05:25:28 -0500 Received: from jurassic.park.msu.ru (jurassic.park.msu.ru [195.208.223.243]) by mx1.redhat.com (8.11.6/8.11.6) with SMTP id gB5A0HP20145 for ; Thu, 5 Dec 2002 05:00:17 -0500 Received: (from ink@localhost) by jurassic.park.msu.ru (8.11.6/8.11.6) id gB5AP9a06395 for axp-list@redhat.com; Thu, 5 Dec 2002 13:25:09 +0300 Date: Thu, 5 Dec 2002 13:25:09 +0300 From: Ivan Kokshaysky To: axp-list@redhat.com Subject: Re: stxncpy Message-ID: <20021205132509.A6245@jurassic.park.msu.ru> References: <850F2E3B91BCD611A3FC00508B94988A108C5B@erlh908a.med.siemens.de> <20021204101156.A11299@twiddle.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20021204101156.A11299@twiddle.net>; from rth@twiddle.net on Wed, Dec 04, 2002 at 10:11:56AM -0800 X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: axp-list@redhat.com List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: On Wed, Dec 04, 2002 at 10:11:56AM -0800, Richard Henderson wrote: > On Tue, Dec 03, 2002 at 01:50:07PM +0100, Heid Oliver wrote: > > Does anybody know what the patch intended to fix? > > Reading too much data (and oopsing) under certain conditions. There are few uncaught typos. - ev6: missing local label which causes oopses in several places; - ev5: t12 instead of t10 - corruption in ISO readdir, probably other nastiness. Also, minor cleanups: - move the label in $unaligned, this should save a cycle or two; - replace redundant `mskqh' with a nop (it doesn't save any cycles though); - fix comment: t12 _is_ touched. Applies to both 2.4 and 2.5. Ivan. --- all/arch/alpha/lib/stxncpy.S Thu Oct 24 09:11:59 2002 +++ linux/arch/alpha/lib/stxncpy.S Thu Dec 5 12:04:20 2002 @@ -25,7 +25,7 @@ * a0 = unaligned address of the last *word* written * a2 = the number of full words left in COUNT * - * Furthermore, v0, a3-a5, t11, t12, and $at are untouched. + * Furthermore, v0, a3-a5, t11, and $at are untouched. */ #include @@ -269,7 +269,7 @@ $u_final: t1 == the shifted high-order bits from the previous source word */ $u_eoc: and a1, 7, t6 # e1 : - sll t12, t6, t6 # e0 : + sll t10, t6, t6 # e0 : and t6, 0xff, t6 # e0 : bne t6, 1f # .. e1 : @@ -303,18 +303,17 @@ $unaligned: ldq_u t0, 0(a0) # e0 : lda t6, -1 # .. e1 : mskql t6, a0, t6 # e0 : -1: subq a1, t4, a1 # .. e1 : sub dest misalignment from src addr /* If source misalignment is larger than dest misalignment, we need extra startup checks to avoid SEGV. */ - cmplt t4, t5, t12 # e1 : +1: cmplt t4, t5, t12 # e1 : extql t1, a1, t1 # .. e0 : shift src into place lda t2, -1 # e0 : for creating masks later - beq t12, $u_head # e1 : + beq t12, $u_head # .. e1 : - mskqh t2, t5, t2 # e0 : begin src byte validity mask + nop # e0 : cmpbge zero, t1, t8 # .. e1 : is there a zero? extql t2, a1, t2 # e0 : or t8, t10, t5 # .. e1 : test for end-of-count too --- all/arch/alpha/lib/ev6-stxncpy.S Thu Oct 24 09:11:59 2002 +++ linux/arch/alpha/lib/ev6-stxncpy.S Thu Dec 5 11:50:47 2002 @@ -25,7 +25,7 @@ * a0 = unaligned address of the last *word* written * a2 = the number of full words left in COUNT * - * Furthermore, v0, a3-a5, t11, t12, and $at are untouched. + * Furthermore, v0, a3-a5, t11, and $at are untouched. * * Much of the information about 21264 scheduling/coding comes from: * Compiler Writer's Guide for the Alpha 21264 @@ -324,7 +324,7 @@ $u_eoc: extqh t2, a1, t0 # U : extract low bits for last word (stall) or t1, t0, t1 # E : (stall) - cmpbge zero, t1, t8 # E : +1: cmpbge zero, t1, t8 # E : mov t1, t0 # E : $u_eocfin: # end-of-count, final word @@ -350,17 +350,17 @@ $unaligned: mskql t6, a0, t6 # U : nop nop -1: subq a1, t4, a1 # E : sub dest misalignment from src addr + subq a1, t4, a1 # E : sub dest misalignment from src addr /* If source misalignment is larger than dest misalignment, we need extra startup checks to avoid SEGV. */ - cmplt t4, t5, t12 # E : +1: cmplt t4, t5, t12 # E : extql t1, a1, t1 # U : shift src into place lda t2, -1 # E : for creating masks later beq t12, $u_head # U : (stall) - mskqh t2, t5, t2 # U : begin src byte validity mask + nop cmpbge zero, t1, t8 # E : is there a zero? extql t2, a1, t2 # U : or t8, t10, t5 # E : test for end-of-count too