This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, master, updated. glibc-2.14-243-g9e5c9dc
- From: drepper at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 7 Sep 2011 04:14:37 -0000
- Subject: GNU C Library master sources branch, master, updated. glibc-2.14-243-g9e5c9dc
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 9e5c9dcd57e80cd56c47fd2bf11de8d167176a0e (commit)
via e38ba7ab6a56d53bde4fcff250f6928fb473bc3c (commit)
from fc8bffcccf5821bca179486abef83a7f82526715 (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://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9e5c9dcd57e80cd56c47fd2bf11de8d167176a0e
commit 9e5c9dcd57e80cd56c47fd2bf11de8d167176a0e
Author: Ulrich Drepper <drepper@gmail.com>
Date: Wed Sep 7 00:14:06 2011 -0400
Remove gettimeofday vsyscall use from x86-86 libpthread
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 9d066c6..1f4cfd0 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -2,6 +2,14 @@
* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait): Don't
use gettimeofday vsyscall, just call gettimeofday.
+ * sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
+ Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
+ Simplify __vdso_clock_gettime use.
2011-09-05 David S. Miller <davem@davemloft.net>
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
index 3195db2..018da0c 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2007, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -68,10 +68,6 @@
#endif
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
-
-
.globl __lll_lock_wait_private
.type __lll_lock_wait_private,@function
.hidden __lll_lock_wait_private
@@ -250,10 +246,9 @@ __lll_timedlock_wait:
/* Get current time. */
movq %rsp, %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- /* This is a regular function call, all caller-save registers
- might be clobbered. */
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 8(%rsp), %rax
@@ -402,8 +397,9 @@ __lll_timedwait_tid:
/* Get current time. */
2: movq %rsp, %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 8(%rsp), %rax
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
index 5218a4f..b7b8b34 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002=2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2011=2007, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -50,9 +50,6 @@
orl $FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME, reg
#endif
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
-
.globl __lll_robust_lock_wait
.type __lll_robust_lock_wait,@function
@@ -219,10 +216,9 @@ __lll_robust_timedlock_wait:
/* Get current time. */
movq %rsp, %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- /* This is a regular function call, all caller-save registers
- might be clobbered. */
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 8(%rsp), %rax
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
index 48ea8b9..d11b297 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
@@ -26,9 +26,6 @@
#include <kernel-features.h>
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
-
.text
@@ -453,13 +450,11 @@ __pthread_cond_timedwait:
movq __vdso_clock_gettime@GOTPCREL(%rip), %rax
movq (%rax), %rax
PTR_DEMANGLE (%rax)
- jz 26f
call *%rax
- jmp 27f
-# endif
-26: movl $__NR_clock_gettime, %eax
+# else
+ movl $__NR_clock_gettime, %eax
syscall
-27:
+# endif
# ifndef __ASSUME_POSIX_TIMERS
cmpq $-ENOSYS, %rax
je 19f
@@ -473,8 +468,9 @@ __pthread_cond_timedwait:
# else
leaq 24(%rsp), %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 40(%rsp), %rax
@@ -611,8 +607,9 @@ __pthread_cond_timedwait:
/* clock_gettime not available. */
19: leaq 32(%rsp), %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 40(%rsp), %rax
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
index f5d055c..0e6a6ee 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2005,2007,2009,2010,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -23,10 +23,6 @@
#include <pthread-errnos.h>
#include <kernel-features.h>
-
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
-
.text
.globl pthread_rwlock_timedrdlock
@@ -123,8 +119,9 @@ pthread_rwlock_timedrdlock:
/* Get current time. */
movq %rsp, %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 8(%rsp), %rax
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
index 6ed8b49..16bf920 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
@@ -1,4 +1,5 @@
-/* Copyright (C) 2002, 2003, 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007, 2009, 2010, 2011
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -23,10 +24,6 @@
#include <pthread-errnos.h>
#include <kernel-features.h>
-
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
-
.text
.globl pthread_rwlock_timedwrlock
@@ -120,8 +117,9 @@ pthread_rwlock_timedwrlock:
/* Get current time. */
movq %rsp, %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 8(%rsp), %rax
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e38ba7ab6a56d53bde4fcff250f6928fb473bc3c
commit e38ba7ab6a56d53bde4fcff250f6928fb473bc3c
Author: Ulrich Drepper <drepper@gmail.com>
Date: Wed Sep 7 00:07:08 2011 -0400
Make sure __vdso_clock_gettime always contains a valid pointer
diff --git a/ChangeLog b/ChangeLog
index db4150e..3011a5a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-09-07 Ulrich Drepper <drepper@gmail.com>
+
+ * sysdeps/unix/sysv/linux/x86_64/init-first.c
+ (_libc_vdso_platform_setup): If vDSO is not present store pointer to
+ syscall wrapper around clock_gettime in __vdso_clock_gettime.
+ * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Add entry for
+ clock_gettime.
+
2011-09-06 Ulrich Drepper <drepper@gmail.com>
* sysdeps/unix/sysv/linux/x86_64/clock_gettime.c (INTERNAL_GETTIME):
diff --git a/sysdeps/unix/sysv/linux/x86_64/init-first.c b/sysdeps/unix/sysv/linux/x86_64/init-first.c
index 25cf08b..cb39aca 100644
--- a/sysdeps/unix/sysv/linux/x86_64/init-first.c
+++ b/sysdeps/unix/sysv/linux/x86_64/init-first.c
@@ -17,6 +17,8 @@
02111-1307 USA. */
#ifdef SHARED
+# include <time.h>
+# include <sysdep.h>
# include <dl-vdso.h>
# include <bits/libc-vdso.h>
@@ -27,12 +29,17 @@ strong_alias (__vdso_clock_gettime, __GI___vdso_clock_gettime attribute_hidden)
long int (*__vdso_getcpu) (unsigned *, unsigned *, void *) attribute_hidden;
+extern long int __syscall_clock_gettime (clockid_t, struct timespec *);
+
+
static inline void
_libc_vdso_platform_setup (void)
{
PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
void *p = _dl_vdso_vsym ("clock_gettime", &linux26);
+ if (p == NULL)
+ p = __syscall_clock_gettime;
PTR_MANGLE (p);
__GI___vdso_clock_gettime = p;
diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
index 3e231a0..ccddb84 100644
--- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
@@ -14,6 +14,7 @@ semop - semop i:ipi __semop semop
semtimedop - semtimedop i:ipip semtimedop
semget - semget i:iii __semget semget
semctl - semctl i:iiii __semctl semctl
+syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime
# proper socket implementations:
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 8 +++++++
nptl/ChangeLog | 8 +++++++
nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S | 18 ++++++----------
.../unix/sysv/linux/x86_64/lowlevelrobustlock.S | 12 +++-------
.../sysv/linux/x86_64/pthread_cond_timedwait.S | 21 ++++++++-----------
.../sysv/linux/x86_64/pthread_rwlock_timedrdlock.S | 11 +++------
.../sysv/linux/x86_64/pthread_rwlock_timedwrlock.S | 12 ++++------
sysdeps/unix/sysv/linux/x86_64/init-first.c | 7 ++++++
sysdeps/unix/sysv/linux/x86_64/syscalls.list | 1 +
9 files changed, 53 insertions(+), 45 deletions(-)
hooks/post-receive
--
GNU C Library master sources