This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.22-709-g8a71d2e


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  8a71d2e27fd067a85059aefb93c9ce83142b03e9 (commit)
      from  4fb66fac3a7bfe152651610a498c988a75fc316d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8a71d2e27fd067a85059aefb93c9ce83142b03e9

commit 8a71d2e27fd067a85059aefb93c9ce83142b03e9
Author: Steve Ellcey <sellcey@imgtec.com>
Date:   Thu Jan 28 01:52:05 2016 +0000

    Fix MIPS64 memcpy regression.
    
    The MIPS memcpy optimizations at
    <https://sourceware.org/ml/libc-alpha/2015-10/msg00597.html>
    introduced a bug causing many string function tests to fail with
    segfaults for n32 and n64:
    
    FAIL: string/stratcliff
    FAIL: string/test-bcopy
    FAIL: string/test-memccpy
    FAIL: string/test-memcmp
    FAIL: string/test-memcpy
    FAIL: string/test-memmove
    FAIL: string/test-mempcpy
    FAIL: string/test-stpncpy
    FAIL: string/test-strncmp
    FAIL: string/test-strncpy
    
    (Some failures in other directories could also be caused by this bug.)
    
    The problem is that after the check for whether a word of input is
    left that can be copied as a word before moving to byte copies, a load
    can occur in the branch delay slot, resulting in a segfault if we are
    at the end of a page and the following page is unmapped.  I don't see
    how this would have passed the tests as reported in the original patch
    posting (different kernel configurations affecting the code setting up
    unmapped pages, maybe?), since the tests in question don't appear to
    have changed recently.
    
    This patch moves a later instruction into the delay slot, as suggested
    at <https://sourceware.org/ml/libc-alpha/2016-01/msg00584.html>.
    
    Tested for n32 and n64.
    
    2016-01-28  Steve Ellcey  <sellcey@imgtec.com>
                Joseph Myers  <joseph@codesourcery.com>
    
    	* sysdeps/mips/memcpy.S (MEMCPY_NAME) [USE_DOUBLE]: Avoid word
    	load in branch delay slot when less than a word of input left.

diff --git a/ChangeLog b/ChangeLog
index e2108a9..9cb8df3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-01-28  Steve Ellcey  <sellcey@imgtec.com>
+            Joseph Myers  <joseph@codesourcery.com>
+
+	* sysdeps/mips/memcpy.S (MEMCPY_NAME) [USE_DOUBLE]: Avoid word
+	load in branch delay slot when less than a word of input left.
+
 2016-01-27  Andreas Schwab  <schwab@suse.de>
 
 	* sysdeps/ieee754/ldbl-128ibm/s_erfl.c (half): Remove.
diff --git a/sysdeps/mips/memcpy.S b/sysdeps/mips/memcpy.S
index d79e144..9b072d7 100644
--- a/sysdeps/mips/memcpy.S
+++ b/sysdeps/mips/memcpy.S
@@ -565,11 +565,11 @@ L(lastw):
 #ifdef USE_DOUBLE
 	andi    t8,a2,3		/* a2 is the remainder past 4 byte chunks.  */
 	beq	t8,a2,L(lastb)
+	move	a2,t8
 	lw	REG3,0(a1)
 	sw	REG3,0(a0)
 	PTR_ADDIU a0,a0,4
 	PTR_ADDIU a1,a1,4
-	move	a2,t8
 #endif
 
 /* Copy the last 8 (or 16) bytes */

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog             |    6 ++++++
 sysdeps/mips/memcpy.S |    2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]