Skip to contentSkip to conversation

m68k: System call updates

PATCH Superseded Geert Uytterhoeven 3 participants 10 messages Sep 14, 2015 – Sep 17, 2015 2 messages not in the archive m68k architecture

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Geert Uytterhoeven

author maintainer
#0 lore raw

v2 cover m68k: System call updates

	Hi,

This patch series, intended for v4.3, updates the m68k system calls:
- Wire up direct socket and ipc calls,
- Wire up new userfaultfd and membarrier system calls.

Changes compared to v1:
- Add missing recvmmsg and sendmmsg,
- Renumbered userfaultfd,
- New patches 3 and 4.

Geert Uytterhoeven (4):
m68k: Wire up direct socket calls
m68k: Wire up userfaultfd
m68k: Wire up direct ipc calls
m68k: Wire up membarrier

 arch/m68k/include/asm/unistd.h      |  2 +-
 arch/m68k/include/uapi/asm/unistd.h | 30 ++++++++++++++++++++++++++++++
 arch/m68k/kernel/syscalltable.S     | 31 ++++++++++++++++++++++++++++++-
 3 files changed, 61 insertions(+), 2 deletions(-)
Signature · 12 lines
1.9.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
author maintainer
#1 lore raw

PATCH v2 1/4 m68k: Wire up direct socket calls

---
v2:
- Drop RFC state,
- Add Acked-by,
- Add missing recvmmsg and sendmmsg.

---
 arch/m68k/include/asm/unistd.h      |  2 +-
 arch/m68k/include/uapi/asm/unistd.h | 17 +++++++++++++++++
 arch/m68k/kernel/syscalltable.S     | 18 +++++++++++++++++-
 3 files changed, 35 insertions(+), 2 deletions(-)
arch/m68k/include/asm/unistd.h +1 -1
index 244e0dbe45dbeda3..7599cb94f9a0edea 100644
@@ -4,7 +4,7 @@
 #include <uapi/asm/unistd.h>
 
 
-#define NR_syscalls		356
+#define NR_syscalls		373
 
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_OLD_STAT
arch/m68k/include/uapi/asm/unistd.h +17 -0
index 61fb6cb9d2ae3c66..b29ef18adb4aa8c5 100644
@@ -361,5 +361,22 @@
 #define __NR_memfd_create	353
 #define __NR_bpf		354
 #define __NR_execveat		355
+#define __NR_socket		356
+#define __NR_socketpair		357
+#define __NR_bind		358
+#define __NR_connect		359
+#define __NR_listen		360
+#define __NR_accept4		361
+#define __NR_getsockopt		362
+#define __NR_setsockopt		363
+#define __NR_getsockname	364
+#define __NR_getpeername	365
+#define __NR_sendto		366
+#define __NR_sendmsg		367
+#define __NR_recvfrom		368
+#define __NR_recvmsg		369
+#define __NR_shutdown		370
+#define __NR_recvmmsg		371
+#define __NR_sendmmsg		372
 
 #endif /* _UAPI_ASM_M68K_UNISTD_H_ */
arch/m68k/kernel/syscalltable.S +17 -1
index a0ec4303f2c8e57a..e0fe52b62a3e8bec 100644
@@ -376,4 +376,20 @@ ENTRY(sys_call_table)
 	.long sys_memfd_create
 	.long sys_bpf
 	.long sys_execveat		/* 355 */
-
+	.long sys_socket
+	.long sys_socketpair
+	.long sys_bind
+	.long sys_connect
+	.long sys_listen		/* 360 */
+	.long sys_accept4
+	.long sys_getsockopt
+	.long sys_setsockopt
+	.long sys_getsockname
+	.long sys_getpeername		/* 365 */
+	.long sys_sendto
+	.long sys_sendmsg
+	.long sys_recvfrom
+	.long sys_recvmsg
+	.long sys_shutdown		/* 370 */
+	.long sys_recvmmsg
+	.long sys_sendmmsg
Signature · 1 line
1.9.1
author maintainer
#2 lore raw

PATCH v2 2/4 m68k: Wire up userfaultfd

In reply to Geert Uytterhoeven
$ ./userfaultfd 10 99
nr_pages: 2560, nr_pages_per_cpu: 2560
bounces: 98, mode: racing, userfaults: 1121
bounces: 97, mode: rnd, userfaults: 977
bounces: 96, mode:, userfaults: 1119
bounces: 95, mode: rnd racing ver poll, userfaults: 1040
bounces: 94, mode: racing ver poll, userfaults: 1022
bounces: 93, mode: rnd ver poll, userfaults: 946
bounces: 92, mode: ver poll, userfaults: 1115
bounces: 91, mode: rnd racing poll, userfaults: 977
bounces: 90, mode: racing poll, userfaults: 899
bounces: 89, mode: rnd poll, userfaults: 881
bounces: 88, mode: poll, userfaults: 1069
bounces: 87, mode: rnd racing ver, userfaults: 1114
bounces: 86, mode: racing ver, userfaults: 1109
bounces: 85, mode: rnd ver, userfaults: 1165
bounces: 84, mode: ver, userfaults: 1107
bounces: 83, mode: rnd racing, userfaults: 1134
bounces: 82, mode: racing, userfaults: 1105
bounces: 81, mode: rnd, userfaults: 1323
bounces: 80, mode:, userfaults: 1103
bounces: 79, mode: rnd racing ver poll, userfaults: 909
bounces: 78, mode: racing ver poll, userfaults: 1095
bounces: 77, mode: rnd ver poll, userfaults: 951
bounces: 76, mode: ver poll, userfaults: 1099
bounces: 75, mode: rnd racing poll, userfaults: 1035
bounces: 74, mode: racing poll, userfaults: 1097
bounces: 73, mode: rnd poll, userfaults: 1159
bounces: 72, mode: poll, userfaults: 1042
bounces: 71, mode: rnd racing ver, userfaults: 848
bounces: 70, mode: racing ver, userfaults: 1093
bounces: 69, mode: rnd ver, userfaults: 892
bounces: 68, mode: ver, userfaults: 1091
bounces: 67, mode: rnd racing, userfaults: 1219
bounces: 66, mode: racing, userfaults: 1089
bounces: 65, mode: rnd, userfaults: 988
bounces: 64, mode:, userfaults: 1087
bounces: 63, mode: rnd racing ver poll, userfaults: 882
bounces: 62, mode: racing ver poll, userfaults: 984
bounces: 61, mode: rnd ver poll, userfaults: 701
bounces: 60, mode: ver poll, userfaults: 1071
bounces: 59, mode: rnd racing poll, userfaults: 1137
bounces: 58, mode: racing poll, userfaults: 1032
bounces: 57, mode: rnd poll, userfaults: 911
bounces: 56, mode: poll, userfaults: 1079
bounces: 55, mode: rnd racing ver, userfaults: 1106
bounces: 54, mode: racing ver, userfaults: 1077
bounces: 53, mode: rnd ver, userfaults: 886
bounces: 52, mode: ver, userfaults: 1075
bounces: 51, mode: rnd racing, userfaults: 1101
bounces: 50, mode: racing, userfaults: 1073
bounces: 49, mode: rnd, userfaults: 1070
bounces: 48, mode:, userfaults: 1071
bounces: 47, mode: rnd racing ver poll, userfaults: 1077
bounces: 46, mode: racing ver poll, userfaults: 910
bounces: 45, mode: rnd ver poll, userfaults: 1063
bounces: 44, mode: ver poll, userfaults: 1028
bounces: 43, mode: rnd racing poll, userfaults: 1043
bounces: 42, mode: racing poll, userfaults: 1065
bounces: 41, mode: rnd poll, userfaults: 912
bounces: 40, mode: poll, userfaults: 1063
bounces: 39, mode: rnd racing ver, userfaults: 880
bounces: 38, mode: racing ver, userfaults: 1061
bounces: 37, mode: rnd ver, userfaults: 1144
bounces: 36, mode: ver, userfaults: 1059
bounces: 35, mode: rnd racing, userfaults: 967
bounces: 34, mode: racing, userfaults: 1057
bounces: 33, mode: rnd, userfaults: 1076
bounces: 32, mode:, userfaults: 1055
bounces: 31, mode: rnd racing ver poll, userfaults: 997
bounces: 30, mode: racing ver poll, userfaults: 1053
bounces: 29, mode: rnd ver poll, userfaults: 968
bounces: 28, mode: ver poll, userfaults: 978
bounces: 27, mode: rnd racing poll, userfaults: 1008
bounces: 26, mode: racing poll, userfaults: 1049
bounces: 25, mode: rnd poll, userfaults: 900
bounces: 24, mode: poll, userfaults: 1047
bounces: 23, mode: rnd racing ver, userfaults: 988
bounces: 22, mode: racing ver, userfaults: 1045
bounces: 21, mode: rnd ver, userfaults: 1027
bounces: 20, mode: ver, userfaults: 1043
bounces: 19, mode: rnd racing, userfaults: 1017
bounces: 18, mode: racing, userfaults: 1041
bounces: 17, mode: rnd, userfaults: 979
bounces: 16, mode:, userfaults: 1039
bounces: 15, mode: rnd racing ver poll, userfaults: 1134
bounces: 14, mode: racing ver poll, userfaults: 1037
bounces: 13, mode: rnd ver poll, userfaults: 1046
bounces: 12, mode: ver poll, userfaults: 1035
bounces: 11, mode: rnd racing poll, userfaults: 1060
bounces: 10, mode: racing poll, userfaults: 1033
bounces: 9, mode: rnd poll, userfaults: 1003
bounces: 8, mode: poll, userfaults: 929
bounces: 7, mode: rnd racing ver, userfaults: 964
bounces: 6, mode: racing ver, userfaults: 1029
bounces: 5, mode: rnd ver, userfaults: 1053
bounces: 4, mode: ver, userfaults: 1027
bounces: 3, mode: rnd racing, userfaults: 863
bounces: 2, mode: racing, userfaults: 1025
bounces: 1, mode: rnd, userfaults: 1043
bounces: 0, mode:, userfaults: 950

---
v2:
- Add Acked-by,
- Rebased and renumbered.

---
 arch/m68k/include/asm/unistd.h      | 2 +-
 arch/m68k/include/uapi/asm/unistd.h | 1 +
 arch/m68k/kernel/syscalltable.S     | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
arch/m68k/include/asm/unistd.h +1 -1
index 7599cb94f9a0edea..d25d5a5c83cb6d6b 100644
@@ -4,7 +4,7 @@
 #include <uapi/asm/unistd.h>
 
 
-#define NR_syscalls		373
+#define NR_syscalls		374
 
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_OLD_STAT
arch/m68k/include/uapi/asm/unistd.h +1 -0
index b29ef18adb4aa8c5..0eebb28488eced36 100644
@@ -378,5 +378,6 @@
 #define __NR_shutdown		370
 #define __NR_recvmmsg		371
 #define __NR_sendmmsg		372
+#define __NR_userfaultfd	373
 
 #endif /* _UAPI_ASM_M68K_UNISTD_H_ */
arch/m68k/kernel/syscalltable.S +1 -0
index e0fe52b62a3e8bec..7b5a315f6df2c770 100644
@@ -393,3 +393,4 @@ ENTRY(sys_call_table)
 	.long sys_shutdown		/* 370 */
 	.long sys_recvmmsg
 	.long sys_sendmmsg
+	.long sys_userfaultfd
Signature · 1 line
1.9.1
author maintainer
#3 lore raw

PATCH v2 3/4 m68k: Wire up direct ipc calls

In reply to Geert Uytterhoeven

---
v2:
- New.

---
 arch/m68k/include/asm/unistd.h      |  2 +-
 arch/m68k/include/uapi/asm/unistd.h | 11 +++++++++++
 arch/m68k/kernel/syscalltable.S     | 11 +++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)
arch/m68k/include/asm/unistd.h +1 -1
index d25d5a5c83cb6d6b..887667ad6a2f9536 100644
@@ -4,7 +4,7 @@
 #include <uapi/asm/unistd.h>
 
 
-#define NR_syscalls		374
+#define NR_syscalls		385
 
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_OLD_STAT
arch/m68k/include/uapi/asm/unistd.h +11 -0
index 0eebb28488eced36..98298206127d0930 100644
@@ -379,5 +379,16 @@
 #define __NR_recvmmsg		371
 #define __NR_sendmmsg		372
 #define __NR_userfaultfd	373
+#define __NR_msgget		374
+#define __NR_msgctl		375
+#define __NR_msgrcv		376
+#define __NR_msgsnd		377
+#define __NR_semget		378
+#define __NR_semctl		379
+#define __NR_semtimedop		380
+#define __NR_shmget		381
+#define __NR_shmctl		382
+#define __NR_shmat		383
+#define __NR_shmdt		384
 
 #endif /* _UAPI_ASM_M68K_UNISTD_H_ */
arch/m68k/kernel/syscalltable.S +11 -0
index 7b5a315f6df2c770..dd6de8bb9b7c7aa4 100644
@@ -394,3 +394,14 @@ ENTRY(sys_call_table)
 	.long sys_recvmmsg
 	.long sys_sendmmsg
 	.long sys_userfaultfd
+	.long sys_msgget
+	.long sys_msgctl		/* 375 */
+	.long sys_msgrcv
+	.long sys_msgsnd
+	.long sys_semget
+	.long sys_semctl
+	.long sys_semtimedop		/* 380 */
+	.long sys_shmget
+	.long sys_shmctl
+	.long sys_shmat
+	.long sys_shmdt
Signature · 1 line
1.9.1
#4 lore raw

Re: [PATCH v2 3/4] m68k: Wire up direct ipc calls

Quoted 32 lines · Geert Uytterhoeven

---
v2:
- New.

---
 arch/m68k/include/asm/unistd.h      |  2 +-
 arch/m68k/include/uapi/asm/unistd.h | 11 +++++++++++
 arch/m68k/kernel/syscalltable.S     | 11 +++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)
arch/m68k/include/asm/unistd.h +1 -1
index d25d5a5c83cb6d6b..887667ad6a2f9536 100644
@@ -4,7 +4,7 @@
 #include <uapi/asm/unistd.h>
 
 
-#define NR_syscalls		374
+#define NR_syscalls		385
 
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_OLD_STAT
arch/m68k/include/uapi/asm/unistd.h +1 -0
index 0eebb28488eced36..98298206127d0930 100644
@@ -379,5 +379,16 @@
 #define __NR_recvmmsg		371
 #define __NR_sendmmsg		372
 #define __NR_userfaultfd	373
+#define __NR_msgget		374

arch/m68k/include/uapi/asm/unistd.h line 392

Quoted 10 lines
arch/m68k/include/uapi/asm/unistd.h +10 -0
+#define __NR_msgctl		375
+#define __NR_msgrcv		376
+#define __NR_msgsnd		377
+#define __NR_semget		378
+#define __NR_semctl		379
+#define __NR_semtimedop		380
+#define __NR_shmget		381
+#define __NR_shmctl		382
+#define __NR_shmat		383
+#define __NR_shmdt		384

It would be nice if the direct syscalls would drop the use of ipc_parse_version. Currently, apart from going through the ipc multiplexer, the semctl, shmctl and msgctl wrappers in libc need to add the IPC_64 bit to the cmd operand. If that would be implied then no special wrappers would be needed any more for direct syscalls.

Andreas.

Signature · 3 lines
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

A message that is not in the archive (sent off-list or not yet received): CAMuHMdUncyXjxkS99SDTjx0-sU26jtCmFuHeU1=0DoqZL2AWvQ@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

author maintainer
#7 lore raw

Re: [PATCH v2 3/4] m68k: Wire up direct ipc calls

Hi Andreas,

Quoted 8 lines · Andreas Schwab
Quoted 3 lines · Geert Uytterhoeven

You mean that we should drop "select ARCH_WANT_IPC_PARSE_VERSION", but we can't do that because an indirect call through sys_ipc() would still need it when dispatching to sys_{sem,shm,msg}ctl()?

Yes. But all architectures that currently use both sys_ipc and ARCH_WANT_IPC_PARSE_VERSION would benefit from decoupling it when they add the direct syscalls.

Do we currently have architectures that use both sys_ipc and the direct syscalls, where keeping ipc_parse_version() in the direct syscalls is required?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#8 lore raw

Re: [PATCH v2 3/4] m68k: Wire up direct ipc calls

Quoted 2 lines · Geert Uytterhoeven

Do we currently have architectures that use both sys_ipc and the direct syscalls, where keeping ipc_parse_version() in the direct syscalls is required?

IMHO it doesn't make sense to suport IPC_OLD via the direct syscalls, even for those architectures that started with them in the first place. There are quite a few architectures that define ARCH_WANT_IPC_PARSE_VERSION even though they started life after IPC_64 was added. They probably just forgot to adjust ipc/util.h back then.

Andreas.

Signature · 3 lines
Andreas Schwab, [email protected]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."
author maintainer
#9 lore raw

PATCH v2 3/4 m68k: Wire up direct ipc calls

In reply to Geert Uytterhoeven

---
v2:
- New.

---
 arch/m68k/include/asm/unistd.h      |  2 +-
 arch/m68k/include/uapi/asm/unistd.h | 11 +++++++++++
 arch/m68k/kernel/syscalltable.S     | 11 +++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)
arch/m68k/include/asm/unistd.h +1 -1
index d25d5a5c83cb6d6b..887667ad6a2f9536 100644
@@ -4,7 +4,7 @@
 #include <uapi/asm/unistd.h>
 
 
-#define NR_syscalls		374
+#define NR_syscalls		385
 
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_OLD_STAT
arch/m68k/include/uapi/asm/unistd.h +11 -0
index 0eebb28488eced36..98298206127d0930 100644
@@ -379,5 +379,16 @@
 #define __NR_recvmmsg		371
 #define __NR_sendmmsg		372
 #define __NR_userfaultfd	373
+#define __NR_msgget		374
+#define __NR_msgctl		375
+#define __NR_msgrcv		376
+#define __NR_msgsnd		377
+#define __NR_semget		378
+#define __NR_semctl		379
+#define __NR_semtimedop		380
+#define __NR_shmget		381
+#define __NR_shmctl		382
+#define __NR_shmat		383
+#define __NR_shmdt		384
 
 #endif /* _UAPI_ASM_M68K_UNISTD_H_ */
arch/m68k/kernel/syscalltable.S +11 -0
index 7b5a315f6df2c770..dd6de8bb9b7c7aa4 100644
@@ -394,3 +394,14 @@ ENTRY(sys_call_table)
 	.long sys_recvmmsg
 	.long sys_sendmmsg
 	.long sys_userfaultfd
+	.long sys_msgget
+	.long sys_msgctl		/* 375 */
+	.long sys_msgrcv
+	.long sys_msgsnd
+	.long sys_semget
+	.long sys_semctl
+	.long sys_semtimedop		/* 380 */
+	.long sys_shmget
+	.long sys_shmctl
+	.long sys_shmat
+	.long sys_shmdt
Signature · 1 line
1.9.1
Acked-by on v2 3/4
#10 lore raw

Re: [PATCH v2 3/4] m68k: Wire up direct ipc calls

Hi Geert,

Quoted 1 line · Geert Uytterhoeven

Both new patches look fine to me,

Regards
Greg

Quoted 62 lines

---
v2:
- New.

---
  arch/m68k/include/asm/unistd.h      |  2 +-
  arch/m68k/include/uapi/asm/unistd.h | 11 +++++++++++
  arch/m68k/kernel/syscalltable.S     | 11 +++++++++++
  3 files changed, 23 insertions(+), 1 deletion(-)
arch/m68k/include/asm/unistd.h +1 -1
index d25d5a5c83cb6d6b..887667ad6a2f9536 100644
@@ -4,7 +4,7 @@
  #include <uapi/asm/unistd.h>
 
 
-#define NR_syscalls		374
+#define NR_syscalls		385
 
  #define __ARCH_WANT_OLD_READDIR
  #define __ARCH_WANT_OLD_STAT
arch/m68k/include/uapi/asm/unistd.h +11 -0
index 0eebb28488eced36..98298206127d0930 100644
@@ -379,5 +379,16 @@
  #define __NR_recvmmsg		371
  #define __NR_sendmmsg		372
  #define __NR_userfaultfd	373
+#define __NR_msgget		374
+#define __NR_msgctl		375
+#define __NR_msgrcv		376
+#define __NR_msgsnd		377
+#define __NR_semget		378
+#define __NR_semctl		379
+#define __NR_semtimedop		380
+#define __NR_shmget		381
+#define __NR_shmctl		382
+#define __NR_shmat		383
+#define __NR_shmdt		384
 
  #endif /* _UAPI_ASM_M68K_UNISTD_H_ */
arch/m68k/kernel/syscalltable.S +11 -0
index 7b5a315f6df2c770..dd6de8bb9b7c7aa4 100644
@@ -394,3 +394,14 @@ ENTRY(sys_call_table)
  	.long sys_recvmmsg
  	.long sys_sendmmsg
  	.long sys_userfaultfd
+	.long sys_msgget
+	.long sys_msgctl		/* 375 */
+	.long sys_msgrcv
+	.long sys_msgsnd
+	.long sys_semget
+	.long sys_semctl
+	.long sys_semtimedop		/* 380 */
+	.long sys_shmget
+	.long sys_shmctl
+	.long sys_shmat
+	.long sys_shmdt
author maintainer
#11 lore raw

PATCH v2 4/4 m68k: Wire up membarrier

In reply to Geert Uytterhoeven
$ ./membarrier_test
membarrier MEMBARRIER_CMD_QUERY syscall available.
membarrier: MEMBARRIER_CMD_SHARED success.
membarrier: tests done!
$

--
v2:
- New.

---
 arch/m68k/include/asm/unistd.h      | 2 +-
 arch/m68k/include/uapi/asm/unistd.h | 1 +
 arch/m68k/kernel/syscalltable.S     | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)
arch/m68k/include/asm/unistd.h +1 -1
index 887667ad6a2f9536..b38c32fd7d96ab6a 100644
@@ -4,7 +4,7 @@
 #include <uapi/asm/unistd.h>
 
 
-#define NR_syscalls		385
+#define NR_syscalls		386
 
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_OLD_STAT
arch/m68k/include/uapi/asm/unistd.h +1 -0
index 98298206127d0930..239fefc60e737343 100644
@@ -390,5 +390,6 @@
 #define __NR_shmctl		382
 #define __NR_shmat		383
 #define __NR_shmdt		384
+#define __NR_membarrier		385
 
 #endif /* _UAPI_ASM_M68K_UNISTD_H_ */
arch/m68k/kernel/syscalltable.S +1 -0
index dd6de8bb9b7c7aa4..42dca8613ef02b38 100644
@@ -405,3 +405,4 @@ ENTRY(sys_call_table)
 	.long sys_shmctl
 	.long sys_shmat
 	.long sys_shmdt
+	.long sys_membarrier		/* 385 */
Signature · 1 line
1.9.1