Patchwork [v3,2/2] Use direct socket syscalls for new kernels on sparc

login
register
mail settings
Submitter Aurelien Jarno
Date March 4, 2016, 5:50 p.m.
Message ID <1457113849-16532-3-git-send-email-aurelien@aurel32.net>
Download mbox | patch
Permalink /patch/11199/
State New
Headers show

Comments

Aurelien Jarno - March 4, 2016, 5:50 p.m.
All direct socket syscalls have been added in kernel version 4.4 for
SPARC32.

The 3 missing direct socket syscalls bind, listen and setsockopt have
been added in kernel version 4.4 for SPARC64. All others were already
present for SPARC64 in kernel versions 3.2 or earlier.

Changelog:
	* sysdeps/unix/sysv/linux/sparc/kernel-features.h
	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
	(ASSUME_ACCEPT_SYSCALL): New macro.
	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
	(ASSUME_CONNECT_SYSCALL): Likewise.
	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
	(ASSUME_GETPEERNAME_SYSCALL): Likewise.
	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
	(ASSUME_GETSOCKNAME_SYSCALL): Likewise.
	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
	(ASSUME_GETSOCKOPT_SYSCALL): Likewise.
	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
	(ASSUME_RECV_SYSCALL): Likewise.
	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
	(ASSUME_RECVFROM_SYSCALL): Likewise.
	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
	(ASSUME_RECVMSG_SYSCALL): Likewise.
	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
	(ASSUME_SENDMSG_SYSCALL): Likewise.
	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
	(ASSUME_SENDTO_SYSCALL): Likewise.
	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
	(ASSUME_SENDTO_FOR_SEND_SYSCALL): Likewise.
	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
	(ASSUME_SHUTDOWN_SYSCALL): Likewise.
	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
	(ASSUME_SOCKET_SYSCALL): Likewise.
	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
	(ASSUME_SOCKETPAIR_SYSCALL): Likewise.
	[__LINUX_KERNEL_VERSION >= 0x040400] (__ASSUME_BIND_SYSCALL):
	Likewise.
	[__LINUX_KERNEL_VERSION >= 0x040400] (__ASSUME_LISTEN_SYSCALL):
	Likewise.
	[__LINUX_KERNEL_VERSION >= 0x040400] (__ASSUME_SETSOCKOPT_SYSCALL):
	Likewise.
---
 ChangeLog                                       | 35 +++++++++++++++++++++++++
 sysdeps/unix/sysv/linux/sparc/kernel-features.h | 25 ++++++++++++++++++
 2 files changed, 60 insertions(+)
Dmitry Levin - March 4, 2016, 6:25 p.m.
On Fri, Mar 04, 2016 at 06:50:49PM +0100, Aurelien Jarno wrote:
> All direct socket syscalls have been added in kernel version 4.4 for
> SPARC32.
> 
> The 3 missing direct socket syscalls bind, listen and setsockopt have
> been added in kernel version 4.4 for SPARC64. All others were already
> present for SPARC64 in kernel versions 3.2 or earlier.
> 
> Changelog:
> 	* sysdeps/unix/sysv/linux/sparc/kernel-features.h
> 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> 	(ASSUME_ACCEPT_SYSCALL): New macro.
> 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> 	(ASSUME_CONNECT_SYSCALL): Likewise.
> 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> 	(ASSUME_GETPEERNAME_SYSCALL): Likewise.
> 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> 	(ASSUME_GETSOCKNAME_SYSCALL): Likewise.
> 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> 	(ASSUME_GETSOCKOPT_SYSCALL): Likewise.
> 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> 	(ASSUME_RECV_SYSCALL): Likewise.
> 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> 	(ASSUME_RECVFROM_SYSCALL): Likewise.
> 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> 	(ASSUME_RECVMSG_SYSCALL): Likewise.
> 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> 	(ASSUME_SENDMSG_SYSCALL): Likewise.
> 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> 	(ASSUME_SENDTO_SYSCALL): Likewise.
> 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> 	(ASSUME_SENDTO_FOR_SEND_SYSCALL): Likewise.
> 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> 	(ASSUME_SHUTDOWN_SYSCALL): Likewise.
> 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> 	(ASSUME_SOCKET_SYSCALL): Likewise.
> 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> 	(ASSUME_SOCKETPAIR_SYSCALL): Likewise.
> 	[__LINUX_KERNEL_VERSION >= 0x040400] (__ASSUME_BIND_SYSCALL):
> 	Likewise.
> 	[__LINUX_KERNEL_VERSION >= 0x040400] (__ASSUME_LISTEN_SYSCALL):
> 	Likewise.
> 	[__LINUX_KERNEL_VERSION >= 0x040400] (__ASSUME_SETSOCKOPT_SYSCALL):
> 	Likewise.

I suggest to make the ChangeLog entry for this change more compact, e.g.

	* sysdeps/unix/sysv/linux/sparc/kernel-features.h
	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
	(__ASSUME_ACCEPT_SYSCALL, __ASSUME_CONNECT_SYSCALL,
	__ASSUME_GETPEERNAME_SYSCALL, __ASSUME_GETSOCKNAME_SYSCALL,
	__ASSUME_GETSOCKOPT_SYSCALL, __ASSUME_RECV_SYSCALL,
	__ASSUME_RECVFROM_SYSCALL, __ASSUME_RECVMSG_SYSCALL,
	__ASSUME_SENDMSG_SYSCALL, __ASSUME_SENDTO_SYSCALL,
	__ASSUME_SENDTO_FOR_SEND_SYSCALL, __ASSUME_SHUTDOWN_SYSCALL,
	__ASSUME_SOCKET_SYSCALL, __ASSUME_SOCKETPAIR_SYSCALL):
	New macros.
	[__LINUX_KERNEL_VERSION >= 0x040400] (__ASSUME_BIND_SYSCALL,
	__ASSUME_LISTEN_SYSCALL, __ASSUME_SETSOCKOPT_SYSCALL): Likewise.
Aurelien Jarno - March 6, 2016, 11:50 p.m.
On 2016-03-04 21:25, Dmitry V. Levin wrote:
> On Fri, Mar 04, 2016 at 06:50:49PM +0100, Aurelien Jarno wrote:
> > All direct socket syscalls have been added in kernel version 4.4 for
> > SPARC32.
> > 
> > The 3 missing direct socket syscalls bind, listen and setsockopt have
> > been added in kernel version 4.4 for SPARC64. All others were already
> > present for SPARC64 in kernel versions 3.2 or earlier.
> > 
> > Changelog:
> > 	* sysdeps/unix/sysv/linux/sparc/kernel-features.h
> > 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> > 	(ASSUME_ACCEPT_SYSCALL): New macro.
> > 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> > 	(ASSUME_CONNECT_SYSCALL): Likewise.
> > 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> > 	(ASSUME_GETPEERNAME_SYSCALL): Likewise.
> > 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> > 	(ASSUME_GETSOCKNAME_SYSCALL): Likewise.
> > 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> > 	(ASSUME_GETSOCKOPT_SYSCALL): Likewise.
> > 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> > 	(ASSUME_RECV_SYSCALL): Likewise.
> > 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> > 	(ASSUME_RECVFROM_SYSCALL): Likewise.
> > 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> > 	(ASSUME_RECVMSG_SYSCALL): Likewise.
> > 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> > 	(ASSUME_SENDMSG_SYSCALL): Likewise.
> > 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> > 	(ASSUME_SENDTO_SYSCALL): Likewise.
> > 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> > 	(ASSUME_SENDTO_FOR_SEND_SYSCALL): Likewise.
> > 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> > 	(ASSUME_SHUTDOWN_SYSCALL): Likewise.
> > 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> > 	(ASSUME_SOCKET_SYSCALL): Likewise.
> > 	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
> > 	(ASSUME_SOCKETPAIR_SYSCALL): Likewise.
> > 	[__LINUX_KERNEL_VERSION >= 0x040400] (__ASSUME_BIND_SYSCALL):
> > 	Likewise.
> > 	[__LINUX_KERNEL_VERSION >= 0x040400] (__ASSUME_LISTEN_SYSCALL):
> > 	Likewise.
> > 	[__LINUX_KERNEL_VERSION >= 0x040400] (__ASSUME_SETSOCKOPT_SYSCALL):
> > 	Likewise.
> 
> I suggest to make the ChangeLog entry for this change more compact, e.g.

Thanks for the hint, I'll use that in the next version.

Patch

diff --git a/ChangeLog b/ChangeLog
index 05277f9..32b1fc7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,41 @@ 
 
 	* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list (bind, listen,
 	send, setsockopt): Remove.
+	* sysdeps/unix/sysv/linux/sparc/kernel-features.h
+	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
+	(ASSUME_ACCEPT_SYSCALL): New macro.
+	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
+	(ASSUME_CONNECT_SYSCALL): Likewise.
+	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
+	(ASSUME_GETPEERNAME_SYSCALL): Likewise.
+	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
+	(ASSUME_GETSOCKNAME_SYSCALL): Likewise.
+	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
+	(ASSUME_GETSOCKOPT_SYSCALL): Likewise.
+	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
+	(ASSUME_RECV_SYSCALL): Likewise.
+	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
+	(ASSUME_RECVFROM_SYSCALL): Likewise.
+	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
+	(ASSUME_RECVMSG_SYSCALL): Likewise.
+	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
+	(ASSUME_SENDMSG_SYSCALL): Likewise.
+	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
+	(ASSUME_SENDTO_SYSCALL): Likewise.
+	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
+	(ASSUME_SENDTO_FOR_SEND_SYSCALL): Likewise.
+	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
+	(ASSUME_SHUTDOWN_SYSCALL): Likewise.
+	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
+	(ASSUME_SOCKET_SYSCALL): Likewise.
+	[ __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400]
+	(ASSUME_SOCKETPAIR_SYSCALL): Likewise.
+	[__LINUX_KERNEL_VERSION >= 0x040400] (__ASSUME_BIND_SYSCALL):
+	Likewise.
+	[__LINUX_KERNEL_VERSION >= 0x040400] (__ASSUME_LISTEN_SYSCALL):
+	Likewise.
+	[__LINUX_KERNEL_VERSION >= 0x040400] (__ASSUME_SETSOCKOPT_SYSCALL):
+	Likewise.
 
 2016-03-01  H.J. Lu  <hongjiu.lu@intel.com>
 
diff --git a/sysdeps/unix/sysv/linux/sparc/kernel-features.h b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
index 3a7baa7..25e7434 100644
--- a/sysdeps/unix/sysv/linux/sparc/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/sparc/kernel-features.h
@@ -32,6 +32,31 @@ 
 #define __ASSUME_SENDMMSG_SYSCALL	1
 #define __ASSUME_SENDMMSG_SYSCALL_WITH_SOCKETCALL	1
 
+/* Direct socketcalls available for SPARC64 in 3.2 and for SPARC32 in 4.4.  */
+#if __arch64__ || __LINUX_KERNEL_VERSION >= 0x040400
+# define __ASSUME_ACCEPT_SYSCALL		1
+# define __ASSUME_CONNECT_SYSCALL		1
+# define __ASSUME_GETPEERNAME_SYSCALL		1
+# define __ASSUME_GETSOCKNAME_SYSCALL		1
+# define __ASSUME_GETSOCKOPT_SYSCALL		1
+# define __ASSUME_RECV_SYSCALL			1
+# define __ASSUME_RECVFROM_SYSCALL		1
+# define __ASSUME_RECVMSG_SYSCALL		1
+# define __ASSUME_SENDMSG_SYSCALL		1
+# define __ASSUME_SENDTO_SYSCALL		1
+# define __ASSUME_SENDTO_FOR_SEND_SYSCALL	1
+# define __ASSUME_SHUTDOWN_SYSCALL		1
+# define __ASSUME_SOCKET_SYSCALL		1
+# define __ASSUME_SOCKETPAIR_SYSCALL		1
+#endif
+
+/* Direct socketcalls available for SPARC32 and for SPARC64 in 4.4.  */
+#if __LINUX_KERNEL_VERSION >= 0x040400
+# define __ASSUME_BIND_SYSCALL			1
+# define __ASSUME_LISTEN_SYSCALL		1
+# define __ASSUME_SETSOCKOPT_SYSCALL		1
+#endif
+
 #include_next <kernel-features.h>
 
 /* 32-bit SPARC kernels do not support