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-137-gf449141


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  f4491417cc80b4a01e72e9d218af137765ee5918 (commit)
       via  18173559a23e28055640b152e623d9f0d40ecca8 (commit)
       via  fe7faec3e56a8dd64f78023a2f4a74fc8d42e79f (commit)
      from  2194737e77256a847ed4fca7652e4dcb8d3f9c1e (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=f4491417cc80b4a01e72e9d218af137765ee5918

commit f4491417cc80b4a01e72e9d218af137765ee5918
Author: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
Date:   Tue Aug 25 10:23:47 2015 -0300

    Call direct system calls for socket operations
    
    Explicit system calls for the socket operations were added in Linux kernel
    in commit 86250b9d12ca for powerpc. This patch make use of those instead of
    calling socketcall to save number of cycles on networking syscalls.
    
    2015-08-25  Rajalakshmi Srinivasaraghavan  <raji@linux.vnet.ibm.com>
    
    	* sysdeps/unix/sysv/linux/powerpc/kernel-features.h: Define new macros.
    	* sysdeps/unix/sysv/linux/accept.c: Call direct system call.
    	* sysdeps/unix/sysv/linux/bind.c: Call direct system call.
    	* sysdeps/unix/sysv/linux/connect.c: Call direct system call.
    	* sysdeps/unix/sysv/linux/getpeername.c: Call direct system call.
    	* sysdeps/unix/sysv/linux/getsockname.c: Call direct system call.
    	* sysdeps/unix/sysv/linux/getsockopt.c: Call direct system call.
    	* sysdeps/unix/sysv/linux/listen.c: Call direct system call.
    	* sysdeps/unix/sysv/linux/recv.c: Call direct system call.
    	* sysdeps/unix/sysv/linux/recvfrom.c: Call direct system call.
    	* sysdeps/unix/sysv/linux/recvmsg.c: Call direct system call.
    	* sysdeps/unix/sysv/linux/send.c: Call direct system call.
    	* sysdeps/unix/sysv/linux/sendmsg.c: Call direct system call.
    	* sysdeps/unix/sysv/linux/sendto.c: Call direct system call.
    	* sysdeps/unix/sysv/linux/setsockopt.c: Call direct system call.
    	* sysdeps/unix/sysv/linux/shutdown.c: Call direct system call.
    	* sysdeps/unix/sysv/linux/socket.c: Call direct system call.
    	* sysdeps/unix/sysv/linux/socketpair.c: Call direct system call.

diff --git a/ChangeLog b/ChangeLog
index 6e55d88..5c115bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2015-08-25  Rajalakshmi Srinivasaraghavan  <raji@linux.vnet.ibm.com>
+
+	* sysdeps/unix/sysv/linux/powerpc/kernel-features.h: Define new macros.
+	* sysdeps/unix/sysv/linux/accept.c: Call direct system call.
+	* sysdeps/unix/sysv/linux/bind.c: Call direct system call.
+	* sysdeps/unix/sysv/linux/connect.c: Call direct system call.
+	* sysdeps/unix/sysv/linux/getpeername.c: Call direct system call.
+	* sysdeps/unix/sysv/linux/getsockname.c: Call direct system call.
+	* sysdeps/unix/sysv/linux/getsockopt.c: Call direct system call.
+	* sysdeps/unix/sysv/linux/listen.c: Call direct system call.
+	* sysdeps/unix/sysv/linux/recv.c: Call direct system call.
+	* sysdeps/unix/sysv/linux/recvfrom.c: Call direct system call.
+	* sysdeps/unix/sysv/linux/recvmsg.c: Call direct system call.
+	* sysdeps/unix/sysv/linux/send.c: Call direct system call.
+	* sysdeps/unix/sysv/linux/sendmsg.c: Call direct system call.
+	* sysdeps/unix/sysv/linux/sendto.c: Call direct system call.
+	* sysdeps/unix/sysv/linux/setsockopt.c: Call direct system call.
+	* sysdeps/unix/sysv/linux/shutdown.c: Call direct system call.
+	* sysdeps/unix/sysv/linux/socket.c: Call direct system call.
+	* sysdeps/unix/sysv/linux/socketpair.c: Call direct system call.
+
 2015-08-25  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
 
 	* sysdeps/powerpc/powerpc32/sysdep.h (ABORT_TRANSACTION): Use
diff --git a/sysdeps/unix/sysv/linux/accept.c b/sysdeps/unix/sysv/linux/accept.c
index 72d42a7..8b4fff0 100644
--- a/sysdeps/unix/sysv/linux/accept.c
+++ b/sysdeps/unix/sysv/linux/accept.c
@@ -21,11 +21,17 @@
 
 #include <sysdep-cancel.h>
 #include <socketcall.h>
+#include <sys/syscall.h>
+#include <kernel-features.h>
 
 int
 __libc_accept (int fd, __SOCKADDR_ARG addr, socklen_t *len)
 {
+#ifdef __ASSUME_ACCEPT_SYSCALL
+  return SYSCALL_CANCEL (accept, fd, addr.__sockaddr__, len);
+#else
   return SOCKETCALL_CANCEL (accept, fd, addr.__sockaddr__, len);
+#endif
 }
 weak_alias (__libc_accept, accept)
 libc_hidden_def (accept)
diff --git a/sysdeps/unix/sysv/linux/bind.c b/sysdeps/unix/sysv/linux/bind.c
index db72df6..4c13b09 100644
--- a/sysdeps/unix/sysv/linux/bind.c
+++ b/sysdeps/unix/sysv/linux/bind.c
@@ -20,10 +20,16 @@
 #include <sys/socket.h>
 
 #include <socketcall.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
 
 int
 __bind (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len)
 {
+#ifdef __ASSUME_BIND_SYSCALL
+  return INLINE_SYSCALL (bind, 3, fd, addr.__sockaddr__, len);
+#else
   return SOCKETCALL (bind, fd, addr.__sockaddr__, len, 0, 0, 0);
+#endif
 }
 weak_alias (__bind, bind)
diff --git a/sysdeps/unix/sysv/linux/connect.c b/sysdeps/unix/sysv/linux/connect.c
index dd17e8c..d62e4d7 100644
--- a/sysdeps/unix/sysv/linux/connect.c
+++ b/sysdeps/unix/sysv/linux/connect.c
@@ -21,11 +21,17 @@
 
 #include <sysdep-cancel.h>
 #include <socketcall.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
 
 int
 __libc_connect (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len)
 {
+#ifdef __ASSUME_CONNECT_SYSCALL
+  return SYSCALL_CANCEL (connect, fd, addr.__sockaddr__, len);
+#else
   return SOCKETCALL_CANCEL (connect, fd, addr.__sockaddr__, len);
+#endif
 }
 weak_alias (__libc_connect, connect)
 weak_alias (__libc_connect, __connect)
diff --git a/sysdeps/unix/sysv/linux/getpeername.c b/sysdeps/unix/sysv/linux/getpeername.c
index 05fd2e8..cd5725b 100644
--- a/sysdeps/unix/sysv/linux/getpeername.c
+++ b/sysdeps/unix/sysv/linux/getpeername.c
@@ -20,10 +20,16 @@
 #include <sys/socket.h>
 
 #include <socketcall.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
 
 int
 __getpeername (int fd, __SOCKADDR_ARG addr, socklen_t *len)
 {
+#ifdef __ASSUME_GETPEERNAME_SYSCALL
+  return INLINE_SYSCALL (getpeername, 3, fd, addr.__sockaddr__, len);
+#else
   return SOCKETCALL (getpeername, fd, addr.__sockaddr__, len);
+#endif
 }
 weak_alias (__getpeername, getpeername)
diff --git a/sysdeps/unix/sysv/linux/getsockname.c b/sysdeps/unix/sysv/linux/getsockname.c
index 6c84ace..78b6050 100644
--- a/sysdeps/unix/sysv/linux/getsockname.c
+++ b/sysdeps/unix/sysv/linux/getsockname.c
@@ -20,10 +20,16 @@
 #include <sys/socket.h>
 
 #include <socketcall.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
 
 int
 __getsockname (int fd, __SOCKADDR_ARG addr, socklen_t *len)
 {
+#ifdef __ASSUME_GETSOCKNAME_SYSCALL
+  return INLINE_SYSCALL (getsockname, 3, fd, addr.__sockaddr__, len);
+#else
   return SOCKETCALL (getsockname, fd, addr.__sockaddr__, len);
+#endif
 }
 weak_alias (__getsockname, getsockname)
diff --git a/sysdeps/unix/sysv/linux/getsockopt.c b/sysdeps/unix/sysv/linux/getsockopt.c
index ba5681b..b194551 100644
--- a/sysdeps/unix/sysv/linux/getsockopt.c
+++ b/sysdeps/unix/sysv/linux/getsockopt.c
@@ -20,10 +20,16 @@
 #include <sys/socket.h>
 
 #include <socketcall.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
 
 int
 __getsockopt (int fd, int level, int optname, void *optval, socklen_t *len)
 {
+#ifdef __ASSUME_GETSOCKOPT_SYSCALL
+  return INLINE_SYSCALL (getsockopt, 5, fd, level, optname, optval, len);
+#else
   return SOCKETCALL (getsockopt, fd, level, optname, optval, len);
+#endif
 }
 weak_alias (__getsockopt, getsockopt)
diff --git a/sysdeps/unix/sysv/linux/listen.c b/sysdeps/unix/sysv/linux/listen.c
index 2e387a4..cf77c68 100644
--- a/sysdeps/unix/sysv/linux/listen.c
+++ b/sysdeps/unix/sysv/linux/listen.c
@@ -20,10 +20,16 @@
 #include <sys/socket.h>
 
 #include <socketcall.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
 
 int
 listen (int fd, int backlog)
 {
+#ifdef __ASSUME_LISTEN_SYSCALL
+  return INLINE_SYSCALL (listen, 2, fd, backlog);
+#else
   return SOCKETCALL (listen, fd, backlog);
+#endif
 }
 weak_alias (listen, __listen);
diff --git a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
index 7201cb4..8a536cf 100644
--- a/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/powerpc/kernel-features.h
@@ -30,6 +30,27 @@
 # define __ASSUME_RECVMMSG_SYSCALL	1
 #endif
 
+/* New syscalls added for PowerPC in 2.6.37.  */
+#if __LINUX_KERNEL_VERSION >= 0x020625
+# define __ASSUME_SOCKET_SYSCALL	1
+# define __ASSUME_BIND_SYSCALL		1
+# define __ASSUME_CONNECT_SYSCALL	1
+# define __ASSUME_LISTEN_SYSCALL	1
+# define __ASSUME_ACCEPT_SYSCALL	1
+# define __ASSUME_GETSOCKNAME_SYSCALL	1
+# define __ASSUME_GETPEERNAME_SYSCALL	1
+# define __ASSUME_SOCKETPAIR_SYSCALL	1
+# define __ASSUME_SEND_SYSCALL		1
+# define __ASSUME_SENDTO_SYSCALL	1
+# define __ASSUME_RECV_SYSCALL		1
+# define __ASSUME_RECVFROM_SYSCALL	1
+# define __ASSUME_SHUTDOWN_SYSCALL	1
+# define __ASSUME_GETSOCKOPT_SYSCALL	1
+# define __ASSUME_SETSOCKOPT_SYSCALL	1
+# define __ASSUME_SENDMSG_SYSCALL	1
+# define __ASSUME_RECVMSG_SYSCALL	1
+#endif
+
 /* The sendmmsg syscall was added for PowerPC in 3.0.  */
 #if __LINUX_KERNEL_VERSION >= 0x030000
 # define __ASSUME_SENDMMSG_SYSCALL	1
diff --git a/sysdeps/unix/sysv/linux/recv.c b/sysdeps/unix/sysv/linux/recv.c
index cd2bc1e..12be890 100644
--- a/sysdeps/unix/sysv/linux/recv.c
+++ b/sysdeps/unix/sysv/linux/recv.c
@@ -21,11 +21,17 @@
 
 #include <sysdep-cancel.h>
 #include <socketcall.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
 
 ssize_t
 __libc_recv (int fd, void *buf, size_t len, int flags)
 {
+#ifdef __ASSUME_RECV_SYSCALL
+  return SYSCALL_CANCEL (recv, fd, buf, len, flags);
+#else
   return SOCKETCALL_CANCEL (recv, fd, buf, len, flags);
+#endif
 }
 weak_alias (__libc_recv, recv)
 weak_alias (__libc_recv, __recv)
diff --git a/sysdeps/unix/sysv/linux/recvfrom.c b/sysdeps/unix/sysv/linux/recvfrom.c
index 90eb40d..19f59a7 100644
--- a/sysdeps/unix/sysv/linux/recvfrom.c
+++ b/sysdeps/unix/sysv/linux/recvfrom.c
@@ -21,13 +21,20 @@
 
 #include <sysdep-cancel.h>
 #include <socketcall.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
 
 ssize_t
 __libc_recvfrom (int fd, void *buf, size_t len, int flags,
 		 __SOCKADDR_ARG addr, socklen_t *addrlen)
 {
+#ifdef __ASSUME_RECVFROM_SYSCALL
+  return SYSCALL_CANCEL (recvfrom, fd, buf, len, flags, addr.__sockaddr__,
+                         addrlen);
+#else
   return SOCKETCALL_CANCEL (recvfrom, fd, buf, len, flags, addr.__sockaddr__,
 			    addrlen);
+#endif
 }
 weak_alias (__libc_recvfrom, recvfrom)
 weak_alias (__libc_recvfrom, __recvfrom)
diff --git a/sysdeps/unix/sysv/linux/recvmsg.c b/sysdeps/unix/sysv/linux/recvmsg.c
index cd7c9ca..952a0f2 100644
--- a/sysdeps/unix/sysv/linux/recvmsg.c
+++ b/sysdeps/unix/sysv/linux/recvmsg.c
@@ -21,11 +21,17 @@
 
 #include <sysdep-cancel.h>
 #include <socketcall.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
 
 ssize_t
 __libc_recvmsg (int fd, struct msghdr *msg, int flags)
 {
+#ifdef __ASSUME_RECVMSG_SYSCALL
+  return SYSCALL_CANCEL (recvmsg, fd, msg, flags);
+#else
   return SOCKETCALL_CANCEL (recvmsg, fd, msg, flags);
+#endif
 }
 weak_alias (__libc_recvmsg, recvmsg)
 weak_alias (__libc_recvmsg, __recvmsg)
diff --git a/sysdeps/unix/sysv/linux/send.c b/sysdeps/unix/sysv/linux/send.c
index f87ea86..d917e4d 100644
--- a/sysdeps/unix/sysv/linux/send.c
+++ b/sysdeps/unix/sysv/linux/send.c
@@ -21,11 +21,17 @@
 
 #include <sysdep-cancel.h>
 #include <socketcall.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
 
 ssize_t
 __libc_send (int fd, const void *buf, size_t len, int flags)
 {
+#ifdef __ASSUME_SEND_SYSCALL
+  return SYSCALL_CANCEL (send, fd, buf, len, flags);
+#else
   return SOCKETCALL_CANCEL (send, fd, buf, len, flags);
+#endif
 }
 weak_alias (__libc_send, send)
 weak_alias (__libc_send, __send)
diff --git a/sysdeps/unix/sysv/linux/sendmsg.c b/sysdeps/unix/sysv/linux/sendmsg.c
index e69ac3e..21ee009 100644
--- a/sysdeps/unix/sysv/linux/sendmsg.c
+++ b/sysdeps/unix/sysv/linux/sendmsg.c
@@ -21,11 +21,17 @@
 
 #include <sysdep-cancel.h>
 #include <socketcall.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
 
 ssize_t
 __libc_sendmsg (int fd, const struct msghdr *msg, int flags)
 {
+#ifdef __ASSUME_SENDMSG_SYSCALL
+  return SYSCALL_CANCEL (sendmsg, fd, msg, flags);
+#else
   return SOCKETCALL_CANCEL (sendmsg, fd, msg, flags);
+#endif
 }
 weak_alias (__libc_sendmsg, sendmsg)
 weak_alias (__libc_sendmsg, __sendmsg)
diff --git a/sysdeps/unix/sysv/linux/sendto.c b/sysdeps/unix/sysv/linux/sendto.c
index d2896a6..d7a2e53 100644
--- a/sysdeps/unix/sysv/linux/sendto.c
+++ b/sysdeps/unix/sysv/linux/sendto.c
@@ -21,13 +21,20 @@
 
 #include <sysdep-cancel.h>
 #include <socketcall.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
 
 ssize_t
 __libc_sendto (int fd, const void *buf, size_t len, int flags,
 	       __CONST_SOCKADDR_ARG addr, socklen_t addrlen)
 {
+#ifdef __ASSUME_SENDTO_SYSCALL
+  return SYSCALL_CANCEL (sendto, fd, buf, len, flags, addr.__sockaddr__,
+                         addrlen);
+#else
   return SOCKETCALL_CANCEL (sendto, fd, buf, len, flags, addr.__sockaddr__,
 			    addrlen);
+#endif
 }
 weak_alias (__libc_sendto, sendto)
 weak_alias (__libc_sendto, __sendto)
diff --git a/sysdeps/unix/sysv/linux/setsockopt.c b/sysdeps/unix/sysv/linux/setsockopt.c
index 626c55b..1e87f42 100644
--- a/sysdeps/unix/sysv/linux/setsockopt.c
+++ b/sysdeps/unix/sysv/linux/setsockopt.c
@@ -20,10 +20,16 @@
 #include <sys/socket.h>
 
 #include <socketcall.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
 
 int
 setsockopt (int fd, int level, int optname, const void *optval, socklen_t len)
 {
+#ifdef __ASSUME_SETSOCKOPT_SYSCALL
+  return INLINE_SYSCALL (setsockopt, 5, fd, level, optname, optval, len);
+#else
   return SOCKETCALL (setsockopt, fd, level, optname, optval, len);
+#endif
 }
 weak_alias (setsockopt, __setsockopt)
diff --git a/sysdeps/unix/sysv/linux/shutdown.c b/sysdeps/unix/sysv/linux/shutdown.c
index 8b3a3d8..21ec4cc 100644
--- a/sysdeps/unix/sysv/linux/shutdown.c
+++ b/sysdeps/unix/sysv/linux/shutdown.c
@@ -20,10 +20,16 @@
 #include <sys/socket.h>
 
 #include <socketcall.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
 
 int
 __shutdown (int fd, int how)
 {
+#ifdef __ASSUME_SHUTDOWN_SYSCALL
+  return INLINE_SYSCALL (shutdown, 2, fd, how);
+#else
   return SOCKETCALL (shutdown, fd, how);
+#endif
 }
 weak_alias (__shutdown, shutdown)
diff --git a/sysdeps/unix/sysv/linux/socket.c b/sysdeps/unix/sysv/linux/socket.c
index 3b2c7fe..4628d15 100644
--- a/sysdeps/unix/sysv/linux/socket.c
+++ b/sysdeps/unix/sysv/linux/socket.c
@@ -20,11 +20,17 @@
 #include <sys/socket.h>
 
 #include <socketcall.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
 
 int
 __socket (int fd, int type, int domain)
 {
+#ifdef __ASSUME_SOCKET_SYSCALL
+  return INLINE_SYSCALL (socket, 3, fd, type, domain);
+#else
   return SOCKETCALL (socket, fd, type, domain);
+#endif
 }
 libc_hidden_def (__socket)
 weak_alias (__socket, socket)
diff --git a/sysdeps/unix/sysv/linux/socketpair.c b/sysdeps/unix/sysv/linux/socketpair.c
index cb70bcf..5c68970 100644
--- a/sysdeps/unix/sysv/linux/socketpair.c
+++ b/sysdeps/unix/sysv/linux/socketpair.c
@@ -20,10 +20,16 @@
 #include <sys/socket.h>
 
 #include <socketcall.h>
+#include <kernel-features.h>
+#include <sys/syscall.h>
 
 int
 __socketpair (int domain, int type, int protocol, int sv[2])
 {
+#ifdef __ASSUME_SOCKETPAIR_SYSCALL
+  return INLINE_SYSCALL (socketpair, 4, domain, type, protocol, sv);
+#else
   return SOCKETCALL (socketpair, domain, type, protocol, sv);
+#endif
 }
 weak_alias (__socketpair, socketpair)

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

commit 18173559a23e28055640b152e623d9f0d40ecca8
Author: Paul E. Murphy <murphyp@linux.vnet.ibm.com>
Date:   Fri Aug 21 14:39:01 2015 -0500

    powerpc: Fix tabort usage in syscalls
    
    Fix usage of tabort in generated syscalls.  r0 has special meaning
    when used with this instruction, thus it will not generate
    persistent errors, nor return an error code.  This mitigates poor
    CPU usage when performing elided critical sections.
    
    Additionally, transactions should be aborted when entering a user
    invoked syscall.  Otherwise the results of the transaction may be
    undefined.
    
    2015-08-25  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
    
    	* sysdeps/powerpc/powerpc32/sysdep.h (ABORT_TRANSACTION): Use
    	register other than r0 for tabort, it has special meaning.
    	* sysdeps/powerpc/powerpc64/sysdep.h (ABORT_TRANSACTION): Likewise
    	* sysdeps/unix.sysv/linux/powerpc/syscall.S (syscall): Abort
    	transaction before starting syscall.

diff --git a/ChangeLog b/ChangeLog
index 13fc3fb..6e55d88 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-08-25  Paul E. Murphy  <murphyp@linux.vnet.ibm.com>
+
+	* sysdeps/powerpc/powerpc32/sysdep.h (ABORT_TRANSACTION): Use
+	register other than r0 for tabort, it has special meaning.
+	* sysdeps/powerpc/powerpc64/sysdep.h (ABORT_TRANSACTION): Likewise
+	* sysdeps/unix.sysv/linux/powerpc/syscall.S (syscall): Abort
+	transaction before starting syscall.
+
 2015-08-25  Rajalakshmi Srinivasaraghavan  <raji@linux.vnet.ibm.com>
 
 	* sysdeps/powerpc/powerpc64/power7/strstr.S: Handle worst case.
diff --git a/sysdeps/powerpc/powerpc32/sysdep.h b/sysdeps/powerpc/powerpc32/sysdep.h
index e16fe3e..ecb492a 100644
--- a/sysdeps/powerpc/powerpc32/sysdep.h
+++ b/sysdeps/powerpc/powerpc32/sysdep.h
@@ -95,8 +95,8 @@ GOT_LABEL:			;					      \
     lwz      0,TM_CAPABLE(2);	\
     cmpwi    0,0;		\
     beq	     1f;		\
-    li	     0,_ABORT_SYSCALL;	\
-    tabort.  0;			\
+    li       11,_ABORT_SYSCALL;	\
+    tabort.  11;		\
     .align 4;			\
 1:
 #else
diff --git a/sysdeps/powerpc/powerpc64/sysdep.h b/sysdeps/powerpc/powerpc64/sysdep.h
index bf2a884..a9d37ad 100644
--- a/sysdeps/powerpc/powerpc64/sysdep.h
+++ b/sysdeps/powerpc/powerpc64/sysdep.h
@@ -279,8 +279,8 @@ LT_LABELSUFFIX(name,_name_end): ; \
     lwz      0,TM_CAPABLE(13);	\
     cmpwi    0,0;		\
     beq	     1f;		\
-    li	     0,_ABORT_SYSCALL;	\
-    tabort.  0;			\
+    li       11,_ABORT_SYSCALL;	\
+    tabort.  11;		\
     .align 4;                   \
 1:
 #else
diff --git a/sysdeps/unix/sysv/linux/powerpc/syscall.S b/sysdeps/unix/sysv/linux/powerpc/syscall.S
index 157e3e3..4477303 100644
--- a/sysdeps/unix/sysv/linux/powerpc/syscall.S
+++ b/sysdeps/unix/sysv/linux/powerpc/syscall.S
@@ -18,6 +18,7 @@
 #include <sysdep.h>
 
 ENTRY (syscall)
+	ABORT_TRANSACTION
 	mr   r0,r3
 	mr   r3,r4
 	mr   r4,r5

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

commit fe7faec3e56a8dd64f78023a2f4a74fc8d42e79f
Author: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
Date:   Tue Aug 18 22:40:56 2015 +0530

    powerpc: Handle worstcase behavior in strstr() for POWER7
    
    Instead of checking needle length, constant 'n' number of comparisons
    is checked to fall back to default implementation.  This patch is tested
    on powerpc64 and powerpc64le.
    
    2015-08-25  Rajalakshmi Srinivasaraghavan  <raji@linux.vnet.ibm.com>
    
    	* sysdeps/powerpc/powerpc64/power7/strstr.S: Handle worst case.

diff --git a/ChangeLog b/ChangeLog
index a442ee1..13fc3fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2015-08-25  Rajalakshmi Srinivasaraghavan  <raji@linux.vnet.ibm.com>
+
+	* sysdeps/powerpc/powerpc64/power7/strstr.S: Handle worst case.
+
 2015-08-25  H.J. Lu  <hongjiu.lu@intel.com>
 
 	* sysdeps/x86_64/strlen.S: Replace %xmm[8-12] with %xmm[0-4].
diff --git a/sysdeps/powerpc/powerpc64/power7/strstr.S b/sysdeps/powerpc/powerpc64/power7/strstr.S
index bfb0c49..fb3c810 100644
--- a/sysdeps/powerpc/powerpc64/power7/strstr.S
+++ b/sysdeps/powerpc/powerpc64/power7/strstr.S
@@ -23,6 +23,8 @@
 /* The performance gain is obtained using aligned memory access, load
  * doubleword and usage of cmpb instruction for quicker comparison.  */
 
+#define ITERATIONS	64
+
 #ifndef STRLEN
 /* For builds with no IFUNC support, local calls should be made to internal
    GLIBC symbol (created by libc_hidden_builtin_def).  */
@@ -62,6 +64,8 @@ EALIGN (strstr, 4, 0)
 	cfi_offset(r30, -16)
 	std	r29, -24(r1)		/* Save callers register r29.  */
 	cfi_offset(r29, -24)
+	std	r28, -32(r1)		/* Save callers register r28.  */
+	cfi_offset(r28, -32)
 	std	r0, 16(r1)		/* Store the link register.  */
 	cfi_offset(lr, 16)
 	stdu	r1, -FRAMESIZE(r1)	/* Create the stack frame.  */
@@ -69,7 +73,6 @@ EALIGN (strstr, 4, 0)
 
 	dcbt	0, r3
 	dcbt	0, r4
-
 	cmpdi	cr7, r3, 0
 	beq	cr7, L(retnull)
 	cmpdi	cr7, r4, 0
@@ -84,10 +87,6 @@ EALIGN (strstr, 4, 0)
 	cmpdi	cr7, r3, 0	/* If search str is null.  */
 	beq	cr7, L(ret_r3)
 
-	/* Call __strstr_ppc if needle len > 2048 */
-	cmpdi	cr7, r3, 2048
-	bgt	cr7, L(default)
-
 	mr	r31, r3
 	mr	r4, r3
 	mr	r3, r29
@@ -105,7 +104,8 @@ EALIGN (strstr, 4, 0)
 	/* If first char of search str is not present.  */
 	cmpdi	cr7, r3, 0
 	ble	cr7, L(end)
-
+	/* Reg r28 is used to count the number of iterations. */
+	li	r28, 0
 	rldicl	r8, r3, 0, 52	/* Page cross check.  */
 	cmpldi	cr7, r8, 4096-16
 	bgt	cr7, L(bytebybyte)
@@ -324,6 +324,10 @@ L(return4):
 	.align	4
 L(begin):
 	mr	r3, r8
+	/* When our iterations exceed ITERATIONS,fall back to default. */
+	addi	r28, r28, 1
+	cmpdi	cr7, r28, ITERATIONS
+	beq	cr7, L(default)
 	lbz	r4, 0(r30)
 	bl	STRCHR
 	nop
@@ -423,6 +427,10 @@ L(nextbyte):
 	cmpdi	cr7, r9, -1
 	beq	cr7, L(end)
 	addi	r3, r4, 1
+	/* When our iterations exceed ITERATIONS,fall back to default. */
+	addi	r28, r28, 1
+	cmpdi	cr7, r28, ITERATIONS
+	beq	cr7, L(default)
 	lbz	r4, 0(r30)
 	bl	STRCHR
 	nop
@@ -490,7 +498,6 @@ L(retnull):
 
 	.align	4
 L(default):
-	mr	r3, r29
 	mr	r4, r30
 	bl	__strstr_ppc
 	nop
@@ -500,6 +507,7 @@ L(end):
 	addi	r1, r1, FRAMESIZE	/* Restore stack pointer.  */
 	cfi_adjust_cfa_offset(-FRAMESIZE)
 	ld	r0, 16(r1)	/* Restore the saved link register.  */
+	ld	r28, -32(r1)	/* Restore callers save register r28.  */
 	ld	r29, -24(r1)	/* Restore callers save register r29.  */
 	ld	r30, -16(r1)	/* Restore callers save register r30.  */
 	ld	r31, -8(r1)	/* Restore callers save register r31.  */

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

Summary of changes:
 ChangeLog                                         |   33 +++++++++++++++++++++
 sysdeps/powerpc/powerpc32/sysdep.h                |    4 +-
 sysdeps/powerpc/powerpc64/power7/strstr.S         |   22 +++++++++----
 sysdeps/powerpc/powerpc64/sysdep.h                |    4 +-
 sysdeps/unix/sysv/linux/accept.c                  |    6 ++++
 sysdeps/unix/sysv/linux/bind.c                    |    6 ++++
 sysdeps/unix/sysv/linux/connect.c                 |    6 ++++
 sysdeps/unix/sysv/linux/getpeername.c             |    6 ++++
 sysdeps/unix/sysv/linux/getsockname.c             |    6 ++++
 sysdeps/unix/sysv/linux/getsockopt.c              |    6 ++++
 sysdeps/unix/sysv/linux/listen.c                  |    6 ++++
 sysdeps/unix/sysv/linux/powerpc/kernel-features.h |   21 +++++++++++++
 sysdeps/unix/sysv/linux/powerpc/syscall.S         |    1 +
 sysdeps/unix/sysv/linux/recv.c                    |    6 ++++
 sysdeps/unix/sysv/linux/recvfrom.c                |    7 ++++
 sysdeps/unix/sysv/linux/recvmsg.c                 |    6 ++++
 sysdeps/unix/sysv/linux/send.c                    |    6 ++++
 sysdeps/unix/sysv/linux/sendmsg.c                 |    6 ++++
 sysdeps/unix/sysv/linux/sendto.c                  |    7 ++++
 sysdeps/unix/sysv/linux/setsockopt.c              |    6 ++++
 sysdeps/unix/sysv/linux/shutdown.c                |    6 ++++
 sysdeps/unix/sysv/linux/socket.c                  |    6 ++++
 sysdeps/unix/sysv/linux/socketpair.c              |    6 ++++
 23 files changed, 178 insertions(+), 11 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]