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.19-523-g89b4bd6


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  89b4bd6b6028852065b65b9d6cf4e1ea74a10634 (commit)
       via  111cc714894d71fdc31c04e56b1bcd41b2680269 (commit)
      from  ccc39911132db27b385b4dd196cf2bb82f2d03c2 (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=89b4bd6b6028852065b65b9d6cf4e1ea74a10634

commit 89b4bd6b6028852065b65b9d6cf4e1ea74a10634
Author: Richard Henderson <rth@redhat.com>
Date:   Fri May 23 16:23:32 2014 -0400

    aarch64: Consolidate NPTL/non versions of vfork
    
    At the same time, incorporate the 0 -> 0x80000000 mapping
    of the pid expected by raise.c.

diff --git a/ChangeLog b/ChangeLog
index 2b30915..8d40c8f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2014-06-03  Richard Henderson  <rth@redhat.com>
 
+	* sysdeps/unix/sysv/linux/aarch64/pt-vfork.c: New file.
+	* sysdeps/unix/sysv/linux/aarch64/nptl/pt-vfork.S: Remove file.
+	* sysdeps/unix/sysv/linux/aarch64/vfork.S (__vfork): Incorporate
+	SAVE_PID and RESTORE_PID blocks from pt-vfork.S.  Map 0 to INT_MIN
+	in the SAVE_PID block.
+	(__libc_vfork): New alias.
+
 	* sysdeps/unix/sysv/linux/aarch64/clone.S (__clone): Save args for
 	child in registers, not on the stack.  Remove RESET_PID conditionals.
 	* sysdeps/unix/sysv/linux/aarch64/nptl/clone.S: Remove file.
diff --git a/sysdeps/unix/sysv/linux/aarch64/nptl/pt-vfork.S b/sysdeps/unix/sysv/linux/aarch64/nptl/pt-vfork.S
deleted file mode 100644
index 2108347..0000000
--- a/sysdeps/unix/sysv/linux/aarch64/nptl/pt-vfork.S
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 2009-2014 Free Software Foundation, Inc.
-
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <tcb-offsets.h>
-
-/* Save the PID value.  */
-#define SAVE_PID							\
-	mrs	x2, tpidr_el0;						\
-	sub	x2, x2, #PTHREAD_SIZEOF;				\
-	ldr	w3, [x2, #PTHREAD_PID_OFFSET];				\
-	neg	w0, w3;							\
-	str	w0, [x2, #PTHREAD_PID_OFFSET]
-
-/* Restore the old PID value in the parent.  */
-#define RESTORE_PID                                                     \
-	cbz	x0, 1f;							\
-	str	w3, [x2, #PTHREAD_PID_OFFSET];				\
-1:
-
-#include "../vfork.S"
diff --git a/sysdeps/unix/sysv/linux/aarch64/pt-vfork.c b/sysdeps/unix/sysv/linux/aarch64/pt-vfork.c
new file mode 100644
index 0000000..5dd23bf
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/pt-vfork.c
@@ -0,0 +1,54 @@
+/* vfork ABI-compatibility entry points for libpthread.
+   Copyright (C) 2014 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <shlib-compat.h>
+
+/* libpthread used to have its own vfork implementation that differed
+   from libc's only in having a pointless micro-optimization.  There
+   is no longer any use to having a separate copy in libpthread, but
+   the historical ABI requires it.  For static linking, there is no
+   need to provide anything here--the libc version will be linked in.
+   For shared library ABI compatibility, there must be __vfork and
+   vfork symbols in libpthread.so.  */
+
+#if HAVE_IFUNC
+# include <nptl/pt-vfork.c>
+#elif (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) \
+       || SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20))
+
+/* Thankfully, on AArch64 we can rely on the compiler generating
+   a tail call here.  */
+
+extern void __libc_vfork (void);
+
+void
+vfork_compat (void)
+{
+  __libc_vfork ();
+}
+
+# if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20)
+compat_symbol (libpthread, vfork_compat, vfork, GLIBC_2_0);
+# endif
+
+# if SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20)
+strong_alias (vfork_compat, vfork_compat2)
+compat_symbol (libpthread, vfork_compat2, __vfork, GLIBC_2_1_2);
+# endif
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/aarch64/vfork.S b/sysdeps/unix/sysv/linux/aarch64/vfork.S
index d9f2c70..316cb65 100644
--- a/sysdeps/unix/sysv/linux/aarch64/vfork.S
+++ b/sysdeps/unix/sysv/linux/aarch64/vfork.S
@@ -28,22 +28,33 @@
 
 ENTRY (__vfork)
 
-#ifdef SAVE_PID
-	SAVE_PID
-#endif
+	/* Save the TCB-cached PID away in w3, and then negate the TCB
+           field.  But if it's zero, set it to 0x80000000 instead.  See
+           raise.c for the logic that relies on this value.  */
+	mrs	x2, tpidr_el0
+	sub	x2, x2, #PTHREAD_SIZEOF
+	ldr	w3, [x2, #PTHREAD_PID_OFFSET]
+	mov	w1, #0x80000000
+	negs	w0, w3
+	csel	w0, w1, w0, eq
+	str	w0, [x2, #PTHREAD_PID_OFFSET]
+
 	mov	x0, #0x4111	/* CLONE_VM | CLONE_VFORK | SIGCHLD */
 	mov	x1, sp
 	DO_CALL (clone, 2)
-#ifdef RESTORE_PID
-	RESTORE_PID
-#endif
+
+	/* Restore the original value of the TCB cache of the PID, if we're
+	   the parent.  But in the child (syscall return value equals zero),
+	   leave things as they are.  */
+	cbz	x0, 1f
+	str	w3, [x2, #PTHREAD_PID_OFFSET]
+1:
 	cmn	x0, #4095
-	b.cs    1f
+	b.cs    .Lsyscall_error
 	RET
-1:
-	b	SYSCALL_ERROR
 
 PSEUDO_END (__vfork)
 libc_hidden_def (__vfork)
 
 weak_alias (__vfork, vfork)
+strong_alias (__vfork, __libc_vfork)

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=111cc714894d71fdc31c04e56b1bcd41b2680269

commit 111cc714894d71fdc31c04e56b1bcd41b2680269
Author: Richard Henderson <rth@redhat.com>
Date:   Fri May 23 15:44:23 2014 -0400

    aarch64: Consolidate NPTL/non versions of clone
    
    At the same time, rely on non-clobbered registers across syscall
    so that we eliminate the stack frame that we previously ignored
    in the unwind info.

diff --git a/ChangeLog b/ChangeLog
index d00c7d4..2b30915 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-06-03  Richard Henderson  <rth@redhat.com>
+
+	* sysdeps/unix/sysv/linux/aarch64/clone.S (__clone): Save args for
+	child in registers, not on the stack.  Remove RESET_PID conditionals.
+	* sysdeps/unix/sysv/linux/aarch64/nptl/clone.S: Remove file.
+
 2014-06-03  Marcus Shawcroft  <marcus.shawcroft@arm.com>
 
 	* sysdeps/aarch64/libm-test-ulps: Regenerate.
diff --git a/sysdeps/unix/sysv/linux/aarch64/clone.S b/sysdeps/unix/sysv/linux/aarch64/clone.S
index f2964f4..a2b5a2b 100644
--- a/sysdeps/unix/sysv/linux/aarch64/clone.S
+++ b/sysdeps/unix/sysv/linux/aarch64/clone.S
@@ -39,47 +39,42 @@
  */
         .text
 ENTRY(__clone)
+	/* Save args for the child.  */
+	mov	x10, x0
+	mov	x11, x2
+	mov	x12, x3
+
 	/* Sanity check args.  */
-	cbz	x0, 1f
-	cbz	x1, 1f
-	/* Insert the args onto the new stack.  */
-	stp	x0, x3, [x1, #-16]!	/* Fn, arg.  */
+	mov	x0, #-EINVAL
+	cbz	x10, .Lsyscall_error
+	cbz	x1, .Lsyscall_error
 
 	/* Do the system call.  */
+	/* X0:flags, x1:newsp, x2:parenttidptr, x3:newtls, x4:childtid.  */
 	mov	x0, x2                  /* flags  */
-
 	/* New sp is already in x1.  */
 	mov	x2, x4			/* ptid  */
 	mov	x3, x5			/* tls  */
 	mov	x4, x6			/* ctid  */
-
-#ifdef RESET_PID
-	/* We rely on the kernel preserving the argument regsiters across a
-	   each system call so that we can inspect the flags against after
-	   the clone call.  */
-	mov	x5, x0
-#endif
-
 	mov	x8, #SYS_ify(clone)
-	/* X0:flags, x1:newsp, x2:parenttidptr, x3:newtls, x4:childtid.  */
 	svc	0x0
-	cfi_endproc
+
 	cmp	x0, #0
-	beq	2f
-	blt	3f
+	beq	thread_start
+	blt	.Lsyscall_error
 	RET
-1:	mov	x0, #-EINVAL
-3:
-	b	syscall_error
+PSEUDO_END (__clone)
 
-2:
+	.align 4
+	.type thread_start, %function
+thread_start:
 	cfi_startproc
 	cfi_undefined (x30)
 	mov	x29, 0
-#ifdef RESET_PID
-	tbnz	x5, #CLONE_THREAD_BIT, 3f
+
+	tbnz	x11, #CLONE_THREAD_BIT, 3f
 	mov	x0, #-1
-	tbnz	x5, #CLONE_VM_BIT, 2f
+	tbnz	x11, #CLONE_VM_BIT, 2f
 	mov	x8, #SYS_ify(getpid)
 	svc	0x0
 2:
@@ -87,18 +82,15 @@ ENTRY(__clone)
 	sub	x1, x1, #PTHREAD_SIZEOF
 	str	w0, [x1, #PTHREAD_PID_OFFSET]
 	str	w0, [x1, #PTHREAD_TID_OFFSET]
-
 3:
-#endif
-	/* Pick the function arg and call address from the stack and
-	   execute.  */
-	ldp	x1, x0, [sp], #16
-	blr	x1
+
+	/* Pick the function arg and execute.  */
+	mov	x0, x12
+	blr	x10
 
 	/* We are done, pass the return value through x0.  */
 	b	HIDDEN_JUMPTARGET(_exit)
 	cfi_endproc
-	cfi_startproc
-PSEUDO_END (__clone)
+	.size thread_start, .-thread_start
 
 weak_alias (__clone, clone)
diff --git a/sysdeps/unix/sysv/linux/aarch64/nptl/clone.S b/sysdeps/unix/sysv/linux/aarch64/nptl/clone.S
deleted file mode 100644
index 281be3b..0000000
--- a/sysdeps/unix/sysv/linux/aarch64/nptl/clone.S
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Copyright (C) 2009-2014 Free Software Foundation, Inc.
-
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public License as
-   published by the Free Software Foundation; either version 2.1 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#define RESET_PID
-#include <tcb-offsets.h>
-#include "../clone.S"

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

Summary of changes:
 ChangeLog                                          |   13 +++++
 sysdeps/unix/sysv/linux/aarch64/clone.S            |   56 ++++++++-----------
 sysdeps/unix/sysv/linux/aarch64/nptl/clone.S       |   21 -------
 sysdeps/unix/sysv/linux/aarch64/nptl/pt-vfork.S    |   35 ------------
 .../linux/{alpha/pt-vfork.S => aarch64/pt-vfork.c} |   31 +++++++----
 sysdeps/unix/sysv/linux/aarch64/vfork.S            |   29 +++++++---
 6 files changed, 78 insertions(+), 107 deletions(-)
 delete mode 100644 sysdeps/unix/sysv/linux/aarch64/nptl/clone.S
 delete mode 100644 sysdeps/unix/sysv/linux/aarch64/nptl/pt-vfork.S
 copy sysdeps/unix/sysv/linux/{alpha/pt-vfork.S => aarch64/pt-vfork.c} (67%)


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]