2014-04-11 10:26:11

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 00/15] wire up renameat2 syscall for various archs

This series wires up the recently added renameat2 syscall for archs that are
up-to-date in the sense that they appear to support the latest syscalls. I
haven't touched the rest of them..

Plus three NR_syscalls miscalculation fixes.

Untested.

Thanks,
Miklos

---
Miklos Szeredi (15):
i386: add renameat2 syscall
arm: __NR_syscalls fix
arm: add renameat2 syscall
arm64: __NR_compat_syscalls fix
arm64: add renameat2 syscall
m68k: add renameat2 syscall
mips: add renameat2 syscall
ia64: add renameat2 syscall
parisc: add renameat2 syscall
powerpc: add renameat2 syscall
s390: NR_syscalls fix
s390: add renameat2 syscall
sparc: add renameat2 syscall
xtensa: add renameat2 syscall
asm-generic: add renameat2 syscall

---
arch/arm/include/asm/unistd.h | 2 +-
arch/arm/include/uapi/asm/unistd.h | 1 +
arch/arm/kernel/calls.S | 1 +
arch/arm64/include/asm/unistd32.h | 3 ++-
arch/ia64/include/asm/unistd.h | 2 +-
arch/ia64/include/uapi/asm/unistd.h | 1 +
arch/m68k/include/asm/unistd.h | 2 +-
arch/m68k/include/uapi/asm/unistd.h | 1 +
arch/m68k/kernel/syscalltable.S | 1 +
arch/mips/include/uapi/asm/unistd.h | 15 +++++++++------
arch/mips/kernel/scall32-o32.S | 1 +
arch/mips/kernel/scall64-64.S | 1 +
arch/mips/kernel/scall64-n32.S | 1 +
arch/mips/kernel/scall64-o32.S | 1 +
arch/parisc/include/uapi/asm/unistd.h | 3 ++-
arch/parisc/kernel/syscall_table.S | 1 +
arch/powerpc/include/asm/systbl.h | 1 +
arch/powerpc/include/asm/unistd.h | 2 +-
arch/powerpc/include/uapi/asm/unistd.h | 1 +
arch/s390/include/uapi/asm/unistd.h | 3 ++-
arch/s390/kernel/compat_wrapper.c | 1 +
arch/s390/kernel/syscalls.S | 1 +
arch/sparc/include/uapi/asm/unistd.h | 3 ++-
arch/sparc/kernel/systbls_32.S | 1 +
arch/sparc/kernel/systbls_64.S | 2 ++
arch/x86/syscalls/syscall_32.tbl | 1 +
arch/xtensa/include/uapi/asm/unistd.h | 5 ++++-
include/uapi/asm-generic/unistd.h | 4 +++-
28 files changed, 46 insertions(+), 16 deletions(-)


2014-04-11 10:26:29

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 10/15] powerpc: add renameat2 syscall

From: Miklos Szeredi <[email protected]>

Signed-off-by: Miklos Szeredi <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
---
arch/powerpc/include/asm/systbl.h | 1 +
arch/powerpc/include/asm/unistd.h | 2 +-
arch/powerpc/include/uapi/asm/unistd.h | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h
index 3ddf70276706..ea4dc3a89c1f 100644
--- a/arch/powerpc/include/asm/systbl.h
+++ b/arch/powerpc/include/asm/systbl.h
@@ -361,3 +361,4 @@ SYSCALL(finit_module)
SYSCALL(ni_syscall) /* sys_kcmp */
SYSCALL_SPU(sched_setattr)
SYSCALL_SPU(sched_getattr)
+SYSCALL_SPU(renameat2)
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h
index 4494f029b632..9b892bbd9d84 100644
--- a/arch/powerpc/include/asm/unistd.h
+++ b/arch/powerpc/include/asm/unistd.h
@@ -12,7 +12,7 @@
#include <uapi/asm/unistd.h>


-#define __NR_syscalls 357
+#define __NR_syscalls 358

#define __NR__exit __NR_exit
#define NR_syscalls __NR_syscalls
diff --git a/arch/powerpc/include/uapi/asm/unistd.h b/arch/powerpc/include/uapi/asm/unistd.h
index 881bf2e2560d..2d526f7b48da 100644
--- a/arch/powerpc/include/uapi/asm/unistd.h
+++ b/arch/powerpc/include/uapi/asm/unistd.h
@@ -379,5 +379,6 @@
#define __NR_kcmp 354
#define __NR_sched_setattr 355
#define __NR_sched_getattr 356
+#define __NR_renameat2 357

#endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
--
1.8.1.4

2014-04-11 10:26:49

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 15/15] asm-generic: add renameat2 syscall

From: Miklos Szeredi <[email protected]>

Signed-off-by: Miklos Szeredi <[email protected]>
Cc: Arnd Bergmann <[email protected]>
---
include/uapi/asm-generic/unistd.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h
index 6db66783d268..333640608087 100644
--- a/include/uapi/asm-generic/unistd.h
+++ b/include/uapi/asm-generic/unistd.h
@@ -697,9 +697,11 @@ __SYSCALL(__NR_finit_module, sys_finit_module)
__SYSCALL(__NR_sched_setattr, sys_sched_setattr)
#define __NR_sched_getattr 275
__SYSCALL(__NR_sched_getattr, sys_sched_getattr)
+#define __NR_renameat2 276
+__SYSCALL(__NR_renameat2, sys_renameat2)

#undef __NR_syscalls
-#define __NR_syscalls 276
+#define __NR_syscalls 277

/*
* All syscalls below here should go away really,
--
1.8.1.4

2014-04-11 10:27:50

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 14/15] xtensa: add renameat2 syscall

From: Miklos Szeredi <[email protected]>

Signed-off-by: Miklos Szeredi <[email protected]>
Cc: Chris Zankel <[email protected]>
---
arch/xtensa/include/uapi/asm/unistd.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/xtensa/include/uapi/asm/unistd.h b/arch/xtensa/include/uapi/asm/unistd.h
index b9395529f02d..8883fc877c5c 100644
--- a/arch/xtensa/include/uapi/asm/unistd.h
+++ b/arch/xtensa/include/uapi/asm/unistd.h
@@ -739,7 +739,10 @@ __SYSCALL(334, sys_sched_setattr, 2)
#define __NR_sched_getattr 335
__SYSCALL(335, sys_sched_getattr, 3)

-#define __NR_syscall_count 336
+#define __NR_renameat2 336
+__SYSCALL(336, sys_renameat2, 5)
+
+#define __NR_syscall_count 337

/*
* sysxtensa syscall handler
--
1.8.1.4

2014-04-11 10:28:18

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 13/15] sparc: add renameat2 syscall

From: Miklos Szeredi <[email protected]>

Signed-off-by: Miklos Szeredi <[email protected]>
Cc: David S. Miller <[email protected]>
---
arch/sparc/include/uapi/asm/unistd.h | 3 ++-
arch/sparc/kernel/systbls_32.S | 1 +
arch/sparc/kernel/systbls_64.S | 2 ++
3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/sparc/include/uapi/asm/unistd.h b/arch/sparc/include/uapi/asm/unistd.h
index b73274fb961a..42f2bca1d338 100644
--- a/arch/sparc/include/uapi/asm/unistd.h
+++ b/arch/sparc/include/uapi/asm/unistd.h
@@ -410,8 +410,9 @@
#define __NR_finit_module 342
#define __NR_sched_setattr 343
#define __NR_sched_getattr 344
+#define __NR_renameat2 345

-#define NR_syscalls 345
+#define NR_syscalls 346

/* Bitmask values returned from kern_features system call. */
#define KERN_FEATURE_MIXED_MODE_STACK 0x00000001
diff --git a/arch/sparc/kernel/systbls_32.S b/arch/sparc/kernel/systbls_32.S
index 151ace8766cc..85fe9b1087cd 100644
--- a/arch/sparc/kernel/systbls_32.S
+++ b/arch/sparc/kernel/systbls_32.S
@@ -86,3 +86,4 @@ sys_call_table:
/*330*/ .long sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime
/*335*/ .long sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev
/*340*/ .long sys_ni_syscall, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr
+/*345*/ .long sys_renameat2
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S
index 4bd4e2bb26cf..814beaeda4dc 100644
--- a/arch/sparc/kernel/systbls_64.S
+++ b/arch/sparc/kernel/systbls_64.S
@@ -87,6 +87,7 @@ sys_call_table32:
/*330*/ .word compat_sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, compat_sys_open_by_handle_at, compat_sys_clock_adjtime
.word sys_syncfs, compat_sys_sendmmsg, sys_setns, compat_sys_process_vm_readv, compat_sys_process_vm_writev
/*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr
+ .word sys_renameat2

#endif /* CONFIG_COMPAT */

@@ -165,3 +166,4 @@ sys_call_table:
/*330*/ .word sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, sys_open_by_handle_at, sys_clock_adjtime
.word sys_syncfs, sys_sendmmsg, sys_setns, sys_process_vm_readv, sys_process_vm_writev
/*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module, sys_sched_setattr, sys_sched_getattr
+ .word sys_renameat2
--
1.8.1.4

2014-04-11 10:26:21

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 06/15] m68k: add renameat2 syscall

From: Miklos Szeredi <[email protected]>

Signed-off-by: Miklos Szeredi <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
---
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(-)

diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h
index 9d38b73989eb..33afa56ad47a 100644
--- a/arch/m68k/include/asm/unistd.h
+++ b/arch/m68k/include/asm/unistd.h
@@ -4,7 +4,7 @@
#include <uapi/asm/unistd.h>


-#define NR_syscalls 351
+#define NR_syscalls 352

#define __ARCH_WANT_OLD_READDIR
#define __ARCH_WANT_OLD_STAT
diff --git a/arch/m68k/include/uapi/asm/unistd.h b/arch/m68k/include/uapi/asm/unistd.h
index b932dd470041..9cd82fbc7817 100644
--- a/arch/m68k/include/uapi/asm/unistd.h
+++ b/arch/m68k/include/uapi/asm/unistd.h
@@ -356,5 +356,6 @@
#define __NR_finit_module 348
#define __NR_sched_setattr 349
#define __NR_sched_getattr 350
+#define __NR_renameat2 351

#endif /* _UAPI_ASM_M68K_UNISTD_H_ */
diff --git a/arch/m68k/kernel/syscalltable.S b/arch/m68k/kernel/syscalltable.S
index b6223dc41d82..b63bb8845c4c 100644
--- a/arch/m68k/kernel/syscalltable.S
+++ b/arch/m68k/kernel/syscalltable.S
@@ -371,4 +371,5 @@ ENTRY(sys_call_table)
.long sys_finit_module
.long sys_sched_setattr
.long sys_sched_getattr /* 350 */
+ .long sys_sched_renameat2

--
1.8.1.4

2014-04-11 10:28:45

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 11/15] s390: NR_syscalls fix

From: Miklos Szeredi <[email protected]>

Signed-off-by: Miklos Szeredi <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
---
arch/s390/include/uapi/asm/unistd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/s390/include/uapi/asm/unistd.h b/arch/s390/include/uapi/asm/unistd.h
index 5eb5c9ddb120..57194268fe63 100644
--- a/arch/s390/include/uapi/asm/unistd.h
+++ b/arch/s390/include/uapi/asm/unistd.h
@@ -282,7 +282,7 @@
#define __NR_finit_module 344
#define __NR_sched_setattr 345
#define __NR_sched_getattr 346
-#define NR_syscalls 345
+#define NR_syscalls 347

/*
* There are some system calls that are not present on 64 bit, some
--
1.8.1.4

2014-04-11 10:28:42

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 12/15] s390: add renameat2 syscall

From: Miklos Szeredi <[email protected]>

Signed-off-by: Miklos Szeredi <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
---
arch/s390/include/uapi/asm/unistd.h | 3 ++-
arch/s390/kernel/compat_wrapper.c | 1 +
arch/s390/kernel/syscalls.S | 1 +
3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/s390/include/uapi/asm/unistd.h b/arch/s390/include/uapi/asm/unistd.h
index 57194268fe63..3802d2d3a18d 100644
--- a/arch/s390/include/uapi/asm/unistd.h
+++ b/arch/s390/include/uapi/asm/unistd.h
@@ -282,7 +282,8 @@
#define __NR_finit_module 344
#define __NR_sched_setattr 345
#define __NR_sched_getattr 346
-#define NR_syscalls 347
+#define __NR_renameat2 347
+#define NR_syscalls 348

/*
* There are some system calls that are not present on 64 bit, some
diff --git a/arch/s390/kernel/compat_wrapper.c b/arch/s390/kernel/compat_wrapper.c
index 824c39dfddfc..030051840ccd 100644
--- a/arch/s390/kernel/compat_wrapper.c
+++ b/arch/s390/kernel/compat_wrapper.c
@@ -213,3 +213,4 @@ COMPAT_SYSCALL_WRAP5(kcmp, pid_t, pid1, pid_t, pid2, int, type, unsigned long, i
COMPAT_SYSCALL_WRAP3(finit_module, int, fd, const char __user *, uargs, int, flags);
COMPAT_SYSCALL_WRAP3(sched_setattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, flags);
COMPAT_SYSCALL_WRAP4(sched_getattr, pid_t, pid, struct sched_attr __user *, attr, unsigned int, size, unsigned int, flags);
+COMPAT_SYSCALL_WRAP5(renameat2, int, olddfd, const char __user *, oldname, int, newdfd, const char __user *, newname, unsigned int, flags);
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S
index 542ef488bac1..fe5cdf29a001 100644
--- a/arch/s390/kernel/syscalls.S
+++ b/arch/s390/kernel/syscalls.S
@@ -355,3 +355,4 @@ SYSCALL(sys_kcmp,sys_kcmp,compat_sys_kcmp)
SYSCALL(sys_finit_module,sys_finit_module,compat_sys_finit_module)
SYSCALL(sys_sched_setattr,sys_sched_setattr,compat_sys_sched_setattr) /* 345 */
SYSCALL(sys_sched_getattr,sys_sched_getattr,compat_sys_sched_getattr)
+SYSCALL(sys_renameat2,sys_renameat2,compat_sys_renameat2)
--
1.8.1.4

2014-04-11 10:30:54

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 09/15] parisc: add renameat2 syscall

From: Miklos Szeredi <[email protected]>

Signed-off-by: Miklos Szeredi <[email protected]>
Cc: Helge Deller <[email protected]>
---
arch/parisc/include/uapi/asm/unistd.h | 3 ++-
arch/parisc/kernel/syscall_table.S | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/parisc/include/uapi/asm/unistd.h b/arch/parisc/include/uapi/asm/unistd.h
index 265ae5190b0a..47e0e21d2272 100644
--- a/arch/parisc/include/uapi/asm/unistd.h
+++ b/arch/parisc/include/uapi/asm/unistd.h
@@ -829,8 +829,9 @@
#define __NR_sched_setattr (__NR_Linux + 334)
#define __NR_sched_getattr (__NR_Linux + 335)
#define __NR_utimes (__NR_Linux + 336)
+#define __NR_renameat2 (__NR_Linux + 337)

-#define __NR_Linux_syscalls (__NR_utimes + 1)
+#define __NR_Linux_syscalls (__NR_renameat2 + 1)


#define __IGNORE_select /* newselect */
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index 80e5dd248934..a595266fdb4d 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -432,6 +432,7 @@
ENTRY_SAME(sched_setattr)
ENTRY_SAME(sched_getattr) /* 335 */
ENTRY_COMP(utimes)
+ ENTRY_COMP(renameat2)

/* Nothing yet */

--
1.8.1.4

2014-04-11 10:31:37

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 08/15] ia64: add renameat2 syscall

From: Miklos Szeredi <[email protected]>

Signed-off-by: Miklos Szeredi <[email protected]>
Cc: Tony Luck <[email protected]>
---
arch/ia64/include/asm/unistd.h | 2 +-
arch/ia64/include/uapi/asm/unistd.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h
index ae763d8bf55a..fb13dc5e8f8c 100644
--- a/arch/ia64/include/asm/unistd.h
+++ b/arch/ia64/include/asm/unistd.h
@@ -11,7 +11,7 @@



-#define NR_syscalls 314 /* length of syscall table */
+#define NR_syscalls 315 /* length of syscall table */

/*
* The following defines stop scripts/checksyscalls.sh from complaining about
diff --git a/arch/ia64/include/uapi/asm/unistd.h b/arch/ia64/include/uapi/asm/unistd.h
index 715e85f858de..7de0a2d65da4 100644
--- a/arch/ia64/include/uapi/asm/unistd.h
+++ b/arch/ia64/include/uapi/asm/unistd.h
@@ -327,5 +327,6 @@
#define __NR_finit_module 1335
#define __NR_sched_setattr 1336
#define __NR_sched_getattr 1337
+#define __NR_renameat2 1338

#endif /* _UAPI_ASM_IA64_UNISTD_H */
--
1.8.1.4

2014-04-11 10:32:05

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 07/15] mips: add renameat2 syscall

From: Miklos Szeredi <[email protected]>

Signed-off-by: Miklos Szeredi <[email protected]>
Cc: Ralf Baechle <[email protected]>
---
arch/mips/include/uapi/asm/unistd.h | 15 +++++++++------
arch/mips/kernel/scall32-o32.S | 1 +
arch/mips/kernel/scall64-64.S | 1 +
arch/mips/kernel/scall64-n32.S | 1 +
arch/mips/kernel/scall64-o32.S | 1 +
5 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/arch/mips/include/uapi/asm/unistd.h b/arch/mips/include/uapi/asm/unistd.h
index d6e154a9e6a5..5805414777e0 100644
--- a/arch/mips/include/uapi/asm/unistd.h
+++ b/arch/mips/include/uapi/asm/unistd.h
@@ -371,16 +371,17 @@
#define __NR_finit_module (__NR_Linux + 348)
#define __NR_sched_setattr (__NR_Linux + 349)
#define __NR_sched_getattr (__NR_Linux + 350)
+#define __NR_renameat2 (__NR_Linux + 351)

/*
* Offset of the last Linux o32 flavoured syscall
*/
-#define __NR_Linux_syscalls 350
+#define __NR_Linux_syscalls 351

#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */

#define __NR_O32_Linux 4000
-#define __NR_O32_Linux_syscalls 350
+#define __NR_O32_Linux_syscalls 351

#if _MIPS_SIM == _MIPS_SIM_ABI64

@@ -699,16 +700,17 @@
#define __NR_getdents64 (__NR_Linux + 308)
#define __NR_sched_setattr (__NR_Linux + 309)
#define __NR_sched_getattr (__NR_Linux + 310)
+#define __NR_renameat2 (__NR_Linux + 311)

/*
* Offset of the last Linux 64-bit flavoured syscall
*/
-#define __NR_Linux_syscalls 310
+#define __NR_Linux_syscalls 311

#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */

#define __NR_64_Linux 5000
-#define __NR_64_Linux_syscalls 310
+#define __NR_64_Linux_syscalls 311

#if _MIPS_SIM == _MIPS_SIM_NABI32

@@ -1031,15 +1033,16 @@
#define __NR_finit_module (__NR_Linux + 312)
#define __NR_sched_setattr (__NR_Linux + 313)
#define __NR_sched_getattr (__NR_Linux + 314)
+#define __NR_renameat2 (__NR_Linux + 315)

/*
* Offset of the last N32 flavoured syscall
*/
-#define __NR_Linux_syscalls 314
+#define __NR_Linux_syscalls 315

#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */

#define __NR_N32_Linux 6000
-#define __NR_N32_Linux_syscalls 314
+#define __NR_N32_Linux_syscalls 315

#endif /* _UAPI_ASM_UNISTD_H */
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
index fdc70b400442..3245474f19d5 100644
--- a/arch/mips/kernel/scall32-o32.S
+++ b/arch/mips/kernel/scall32-o32.S
@@ -577,3 +577,4 @@ EXPORT(sys_call_table)
PTR sys_finit_module
PTR sys_sched_setattr
PTR sys_sched_getattr /* 4350 */
+ PTR sys_renameat2
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
index dd99c3285aea..be2fedd4ae33 100644
--- a/arch/mips/kernel/scall64-64.S
+++ b/arch/mips/kernel/scall64-64.S
@@ -430,4 +430,5 @@ EXPORT(sys_call_table)
PTR sys_getdents64
PTR sys_sched_setattr
PTR sys_sched_getattr /* 5310 */
+ PTR sys_renameat2
.size sys_call_table,.-sys_call_table
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index f68d2f4f0090..c1dbcda4b816 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -423,4 +423,5 @@ EXPORT(sysn32_call_table)
PTR sys_finit_module
PTR sys_sched_setattr
PTR sys_sched_getattr
+ PTR sys_renameat2 /* 6315 */
.size sysn32_call_table,.-sysn32_call_table
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 70f6acecd928..f1343ccd7ed7 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -556,4 +556,5 @@ EXPORT(sys32_call_table)
PTR sys_finit_module
PTR sys_sched_setattr
PTR sys_sched_getattr /* 4350 */
+ PTR sys_renameat2
.size sys32_call_table,.-sys32_call_table
--
1.8.1.4

2014-04-11 10:26:16

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 02/15] arm: __NR_syscalls fix

From: Miklos Szeredi <[email protected]>

Signed-off-by: Miklos Szeredi <[email protected]>
Cc: Russell King <[email protected]>
---
arch/arm/include/asm/unistd.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
index 43876245fc57..c4cd2060cac2 100644
--- a/arch/arm/include/asm/unistd.h
+++ b/arch/arm/include/asm/unistd.h
@@ -15,7 +15,7 @@

#include <uapi/asm/unistd.h>

-#define __NR_syscalls (384)
+#define __NR_syscalls (382)
#define __ARM_NR_cmpxchg (__ARM_NR_BASE+0x00fff0)

#define __ARCH_WANT_STAT64
--
1.8.1.4

2014-04-11 10:32:53

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 05/15] arm64: add renameat2 syscall

From: Miklos Szeredi <[email protected]>

Signed-off-by: Miklos Szeredi <[email protected]>
Cc: Catalin Marinas <[email protected]>
---
arch/arm64/include/asm/unistd32.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h
index faa0e1ce59df..c8d8fc17bd5a 100644
--- a/arch/arm64/include/asm/unistd32.h
+++ b/arch/arm64/include/asm/unistd32.h
@@ -403,8 +403,9 @@ __SYSCALL(378, sys_kcmp)
__SYSCALL(379, sys_finit_module)
__SYSCALL(380, sys_sched_setattr)
__SYSCALL(381, sys_sched_getattr)
+__SYSCALL(382, sys_renameat2)

-#define __NR_compat_syscalls 382
+#define __NR_compat_syscalls 383

/*
* Compat syscall numbers used by the AArch64 kernel.
--
1.8.1.4

2014-04-11 10:26:14

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 01/15] i386: add renameat2 syscall

From: Miklos Szeredi <[email protected]>

Signed-off-by: Miklos Szeredi <[email protected]>
Cc: H. Peter Anvin <[email protected]>
---
arch/x86/syscalls/syscall_32.tbl | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/x86/syscalls/syscall_32.tbl b/arch/x86/syscalls/syscall_32.tbl
index 96bc506ac6de..d6b867921612 100644
--- a/arch/x86/syscalls/syscall_32.tbl
+++ b/arch/x86/syscalls/syscall_32.tbl
@@ -359,3 +359,4 @@
350 i386 finit_module sys_finit_module
351 i386 sched_setattr sys_sched_setattr
352 i386 sched_getattr sys_sched_getattr
+353 i386 renameat2 sys_renameat2
--
1.8.1.4

2014-04-11 10:34:19

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 04/15] arm64: __NR_compat_syscalls fix

From: Miklos Szeredi <[email protected]>

Signed-off-by: Miklos Szeredi <[email protected]>
Cc: Catalin Marinas <[email protected]>
---
arch/arm64/include/asm/unistd32.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h
index bb8eb8a78e67..faa0e1ce59df 100644
--- a/arch/arm64/include/asm/unistd32.h
+++ b/arch/arm64/include/asm/unistd32.h
@@ -404,7 +404,7 @@ __SYSCALL(379, sys_finit_module)
__SYSCALL(380, sys_sched_setattr)
__SYSCALL(381, sys_sched_getattr)

-#define __NR_compat_syscalls 379
+#define __NR_compat_syscalls 382

/*
* Compat syscall numbers used by the AArch64 kernel.
--
1.8.1.4

2014-04-11 10:34:34

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH 02/15] arm: __NR_syscalls fix

On Fri, Apr 11, 2014 at 12:25:38PM +0200, Miklos Szeredi wrote:
> From: Miklos Szeredi <[email protected]>
>
> Signed-off-by: Miklos Szeredi <[email protected]>
> Cc: Russell King <[email protected]>
> ---

This has me wondering...

(a) what you think it fixes
(b) whether you tried to build-test this

The ARM instruction set supports 8-bit immediate constants with an even
power of two shift. 384 fits that (0x180), 382 does not (0x17e), and
in your following patch, 383 definitely doesn't (0x17f).

Having this constant larger than necessary does not cause any problem
for the syscall table: we explicitly pad it with calls to sys_ni_syscall
to make up the difference.

--
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.

2014-04-11 10:35:48

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH 03/15] arm: add renameat2 syscall

On Fri, Apr 11, 2014 at 12:25:39PM +0200, Miklos Szeredi wrote:
> From: Miklos Szeredi <[email protected]>
>
> Signed-off-by: Miklos Szeredi <[email protected]>
> Cc: Russell King <[email protected]>

Same comments for the previous patch. What is/where is the remainder of
the series, or at least the cover message to explain what the series is
about (which may also show why the other patches are not relevant to
everyone.)

--
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.

2014-04-11 10:35:41

by Miklos Szeredi

[permalink] [raw]
Subject: [PATCH 03/15] arm: add renameat2 syscall

From: Miklos Szeredi <[email protected]>

Signed-off-by: Miklos Szeredi <[email protected]>
Cc: Russell King <[email protected]>
---
arch/arm/include/asm/unistd.h | 2 +-
arch/arm/include/uapi/asm/unistd.h | 1 +
arch/arm/kernel/calls.S | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
index c4cd2060cac2..fbda7a3e5abe 100644
--- a/arch/arm/include/asm/unistd.h
+++ b/arch/arm/include/asm/unistd.h
@@ -15,7 +15,7 @@

#include <uapi/asm/unistd.h>

-#define __NR_syscalls (382)
+#define __NR_syscalls (383)
#define __ARM_NR_cmpxchg (__ARM_NR_BASE+0x00fff0)

#define __ARCH_WANT_STAT64
diff --git a/arch/arm/include/uapi/asm/unistd.h b/arch/arm/include/uapi/asm/unistd.h
index fb5584d0cc05..ba94446c72d9 100644
--- a/arch/arm/include/uapi/asm/unistd.h
+++ b/arch/arm/include/uapi/asm/unistd.h
@@ -408,6 +408,7 @@
#define __NR_finit_module (__NR_SYSCALL_BASE+379)
#define __NR_sched_setattr (__NR_SYSCALL_BASE+380)
#define __NR_sched_getattr (__NR_SYSCALL_BASE+381)
+#define __NR_renameat2 (__NR_SYSCALL_BASE+382)

/*
* This may need to be greater than __NR_last_syscall+1 in order to
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index 166e945de832..8f51bdcdacbb 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -391,6 +391,7 @@
CALL(sys_finit_module)
/* 380 */ CALL(sys_sched_setattr)
CALL(sys_sched_getattr)
+ CALL(sys_renameat2)
#ifndef syscalls_counted
.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
#define syscalls_counted
--
1.8.1.4

2014-04-11 11:24:22

by Martin Schwidefsky

[permalink] [raw]
Subject: Re: [PATCH 11/15] s390: NR_syscalls fix

On Fri, 11 Apr 2014 12:25:47 +0200
Miklos Szeredi <[email protected]> wrote:

> From: Miklos Szeredi <[email protected]>
>
> Signed-off-by: Miklos Szeredi <[email protected]>
> Cc: Martin Schwidefsky <[email protected]>
> ---
> arch/s390/include/uapi/asm/unistd.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/s390/include/uapi/asm/unistd.h b/arch/s390/include/uapi/asm/unistd.h
> index 5eb5c9ddb120..57194268fe63 100644
> --- a/arch/s390/include/uapi/asm/unistd.h
> +++ b/arch/s390/include/uapi/asm/unistd.h
> @@ -282,7 +282,7 @@
> #define __NR_finit_module 344
> #define __NR_sched_setattr 345
> #define __NR_sched_getattr 346
> -#define NR_syscalls 345
> +#define NR_syscalls 347
>
> /*
> * There are some system calls that are not present on 64 bit, some

Is this patch part of a patch series that does upstream directly?
I am asking because Heiko already created a patch for this and we have
added it to the linux-s390:fixes branch for upstream integration.

--
blue skies,
Martin.

"Reality continues to ruin my life." - Calvin.

2014-04-11 11:48:09

by Miklos Szeredi

[permalink] [raw]
Subject: Re: [PATCH 03/15] arm: add renameat2 syscall

On Fri, Apr 11, 2014 at 12:35 PM, Russell King - ARM Linux
<[email protected]> wrote:
> On Fri, Apr 11, 2014 at 12:25:39PM +0200, Miklos Szeredi wrote:
>> From: Miklos Szeredi <[email protected]>
>>
>> Signed-off-by: Miklos Szeredi <[email protected]>
>> Cc: Russell King <[email protected]>
>
> Same comments for the previous patch. What is/where is the remainder of
> the series, or at least the cover message to explain what the series is
> about (which may also show why the other patches are not relevant to
> everyone.)

All the series went to linux-arch, with the relevant parts CC-d to
each architecture's maintainer.

It would probably have been a good idea to CC all maintainers on the
cover letter, but I don't know how I could do that with "git
send-email".

Thanks,
Miklos

2014-04-11 11:50:53

by Miklos Szeredi

[permalink] [raw]
Subject: Re: [PATCH 02/15] arm: __NR_syscalls fix

On Fri, Apr 11, 2014 at 12:33 PM, Russell King - ARM Linux
<[email protected]> wrote:
> On Fri, Apr 11, 2014 at 12:25:38PM +0200, Miklos Szeredi wrote:
>> From: Miklos Szeredi <[email protected]>
>>
>> Signed-off-by: Miklos Szeredi <[email protected]>
>> Cc: Russell King <[email protected]>
>> ---
>
> This has me wondering...
>
> (a) what you think it fixes
> (b) whether you tried to build-test this
>
> The ARM instruction set supports 8-bit immediate constants with an even
> power of two shift. 384 fits that (0x180), 382 does not (0x17e), and
> in your following patch, 383 definitely doesn't (0x17f).
>
> Having this constant larger than necessary does not cause any problem
> for the syscall table: we explicitly pad it with calls to sys_ni_syscall
> to make up the difference.

Yes, and the padding will be of wrong length if NR_syscalls is
incorrect (which may be Oopsable?). At least that is my impression
from a casual glance.

Thanks,
Miklos

2014-04-11 11:54:59

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH 02/15] arm: __NR_syscalls fix

On Fri, Apr 11, 2014 at 01:50:50PM +0200, Miklos Szeredi wrote:
> On Fri, Apr 11, 2014 at 12:33 PM, Russell King - ARM Linux
> <[email protected]> wrote:
> > On Fri, Apr 11, 2014 at 12:25:38PM +0200, Miklos Szeredi wrote:
> >> From: Miklos Szeredi <[email protected]>
> >>
> >> Signed-off-by: Miklos Szeredi <[email protected]>
> >> Cc: Russell King <[email protected]>
> >> ---
> >
> > This has me wondering...
> >
> > (a) what you think it fixes
> > (b) whether you tried to build-test this
> >
> > The ARM instruction set supports 8-bit immediate constants with an even
> > power of two shift. 384 fits that (0x180), 382 does not (0x17e), and
> > in your following patch, 383 definitely doesn't (0x17f).
> >
> > Having this constant larger than necessary does not cause any problem
> > for the syscall table: we explicitly pad it with calls to sys_ni_syscall
> > to make up the difference.
>
> Yes, and the padding will be of wrong length if NR_syscalls is
> incorrect (which may be Oopsable?). At least that is my impression
> from a casual glance.

Please explain.

--
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.

2014-04-11 11:58:14

by Miklos Szeredi

[permalink] [raw]
Subject: Re: [PATCH 11/15] s390: NR_syscalls fix

On Fri, Apr 11, 2014 at 1:24 PM, Martin Schwidefsky
<[email protected]> wrote:
> On Fri, 11 Apr 2014 12:25:47 +0200
> Miklos Szeredi <[email protected]> wrote:
>
>> From: Miklos Szeredi <[email protected]>
>>
>> Signed-off-by: Miklos Szeredi <[email protected]>
>> Cc: Martin Schwidefsky <[email protected]>
>> ---
>> arch/s390/include/uapi/asm/unistd.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/s390/include/uapi/asm/unistd.h b/arch/s390/include/uapi/asm/unistd.h
>> index 5eb5c9ddb120..57194268fe63 100644
>> --- a/arch/s390/include/uapi/asm/unistd.h
>> +++ b/arch/s390/include/uapi/asm/unistd.h
>> @@ -282,7 +282,7 @@
>> #define __NR_finit_module 344
>> #define __NR_sched_setattr 345
>> #define __NR_sched_getattr 346
>> -#define NR_syscalls 345
>> +#define NR_syscalls 347
>>
>> /*
>> * There are some system calls that are not present on 64 bit, some
>
> Is this patch part of a patch series that does upstream directly?
> I am asking because Heiko already created a patch for this and we have
> added it to the linux-s390:fixes branch for upstream integration.

No, I don't mean to upstream directly. So you can just drop my submission...

Thanks,
Miklos

2014-04-11 12:02:35

by Miklos Szeredi

[permalink] [raw]
Subject: Re: [PATCH 02/15] arm: __NR_syscalls fix

On Fri, Apr 11, 2014 at 1:54 PM, Russell King - ARM Linux
<[email protected]> wrote:
> On Fri, Apr 11, 2014 at 01:50:50PM +0200, Miklos Szeredi wrote:
>> On Fri, Apr 11, 2014 at 12:33 PM, Russell King - ARM Linux
>> <[email protected]> wrote:
>> > On Fri, Apr 11, 2014 at 12:25:38PM +0200, Miklos Szeredi wrote:
>> >> From: Miklos Szeredi <[email protected]>
>> >>
>> >> Signed-off-by: Miklos Szeredi <[email protected]>
>> >> Cc: Russell King <[email protected]>
>> >> ---
>> >
>> > This has me wondering...
>> >
>> > (a) what you think it fixes
>> > (b) whether you tried to build-test this
>> >
>> > The ARM instruction set supports 8-bit immediate constants with an even
>> > power of two shift. 384 fits that (0x180), 382 does not (0x17e), and
>> > in your following patch, 383 definitely doesn't (0x17f).
>> >
>> > Having this constant larger than necessary does not cause any problem
>> > for the syscall table: we explicitly pad it with calls to sys_ni_syscall
>> > to make up the difference.
>>
>> Yes, and the padding will be of wrong length if NR_syscalls is
>> incorrect (which may be Oopsable?). At least that is my impression
>> from a casual glance.
>
> Please explain.

Look at ending lines of arch/arm/kernel/calls.S: if NR_syscalls is a
multiple of 4, then syscalls_padding will be zero. I.e. no padding
despite the fact that there is in fact only 382 system calls in table
and there should be 2 sys_ni_syscall pads.

So there's some crap in there, for sure. If it causes actual
problems, I don't know.

Thanks,
Miklos

2014-04-11 12:45:43

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH 02/15] arm: __NR_syscalls fix

On Fri, Apr 11, 2014 at 02:02:32PM +0200, Miklos Szeredi wrote:
> On Fri, Apr 11, 2014 at 1:54 PM, Russell King - ARM Linux
> <[email protected]> wrote:
> > On Fri, Apr 11, 2014 at 01:50:50PM +0200, Miklos Szeredi wrote:
> >> Yes, and the padding will be of wrong length if NR_syscalls is
> >> incorrect (which may be Oopsable?). At least that is my impression
> >> from a casual glance.
> >
> > Please explain.
>
> Look at ending lines of arch/arm/kernel/calls.S: if NR_syscalls is a
> multiple of 4, then syscalls_padding will be zero. I.e. no padding
> despite the fact that there is in fact only 382 system calls in table
> and there should be 2 sys_ni_syscall pads.

Hmm, it looks like you're right... this used to work fine until...

commit 1f66e06fb6414732bef7bf4a071ef76a837badec
Author: Wade Farnsworth <[email protected]>
Date: Fri Sep 7 18:18:25 2012 +0100

ARM: 7524/1: support syscall tracing

because the tracing code wanted to know the number of syscalls. I don't
know what the answer is here, because the current solution is IMHO far
to fragile.

--
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.

2014-04-11 17:39:21

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 03/15] arm: add renameat2 syscall

From: Miklos Szeredi <[email protected]>
Date: Fri, 11 Apr 2014 13:48:05 +0200

> It would probably have been a good idea to CC all maintainers on the
> cover letter, but I don't know how I could do that with "git
> send-email".

I strongly suggest that this _not_ be done.

There is a 1024 character limit imposed for email header fields in order
to reduce spam at vger.kernel.org

We have lists like linux-arch for a reason, CC:'ing tons of people who
should absolutely be on that list doesn't make any sense at all and
as I just described is not going to work.

Subject: [tip:x86/urgent] i386: Wire up the renameat2() syscall

Commit-ID: ab0a9358ecf87bb801ce124473e7db713457bec4
Gitweb: http://git.kernel.org/tip/ab0a9358ecf87bb801ce124473e7db713457bec4
Author: Miklos Szeredi <[email protected]>
AuthorDate: Fri, 11 Apr 2014 12:25:37 +0200
Committer: H. Peter Anvin <[email protected]>
CommitDate: Fri, 11 Apr 2014 13:59:58 -0700

i386: Wire up the renameat2() syscall

The renameat2() system call was only wired up for x86-64.

Signed-off-by: Miklos Szeredi <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Cc: H. Peter Anvin <[email protected]>
Signed-off-by: H. Peter Anvin <[email protected]>
---
arch/x86/syscalls/syscall_32.tbl | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/x86/syscalls/syscall_32.tbl b/arch/x86/syscalls/syscall_32.tbl
index 96bc506..d6b8679 100644
--- a/arch/x86/syscalls/syscall_32.tbl
+++ b/arch/x86/syscalls/syscall_32.tbl
@@ -359,3 +359,4 @@
350 i386 finit_module sys_finit_module
351 i386 sched_setattr sys_sched_setattr
352 i386 sched_getattr sys_sched_getattr
+353 i386 renameat2 sys_renameat2

2014-04-14 16:29:54

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 06/15] m68k: add renameat2 syscall

Hi Miklos,

On Fri, Apr 11, 2014 at 12:25 PM, Miklos Szeredi <[email protected]> wrote:
> From: Miklos Szeredi <[email protected]>

Thanks!

> Signed-off-by: Miklos Szeredi <[email protected]>
> Cc: Geert Uytterhoeven <[email protected]>

Acked-by: Geert Uytterhoeven <[email protected]>

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

2014-04-14 16:32:18

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 00/15] wire up renameat2 syscall for various archs

Hi Miklos,

On Fri, Apr 11, 2014 at 12:25 PM, Miklos Szeredi <[email protected]> wrote:
> This series wires up the recently added renameat2 syscall for archs that are
> up-to-date in the sense that they appear to support the latest syscalls. I
> haven't touched the rest of them..
>
> Plus three NR_syscalls miscalculation fixes.

Do you plan to collect acks, and ask Linus to pull this series later, or
do you want each arch maintainer to take the patches for his/her pet
architecture?

Note that I don't plan to send another pull request for 3.15 for m68k,
unless Something Really Bad happens.

Thanks!

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

2014-04-14 20:11:31

by Miklos Szeredi

[permalink] [raw]
Subject: Re: [PATCH 00/15] wire up renameat2 syscall for various archs

On Mon, Apr 14, 2014 at 6:32 PM, Geert Uytterhoeven
<[email protected]> wrote:
> Hi Miklos,
>
> On Fri, Apr 11, 2014 at 12:25 PM, Miklos Szeredi <[email protected]> wrote:
>> This series wires up the recently added renameat2 syscall for archs that are
>> up-to-date in the sense that they appear to support the latest syscalls. I
>> haven't touched the rest of them..
>>
>> Plus three NR_syscalls miscalculation fixes.
>
> Do you plan to collect acks, and ask Linus to pull this series later, or
> do you want each arch maintainer to take the patches for his/her pet
> architecture?

Whichever works best for you.

>
> Note that I don't plan to send another pull request for 3.15 for m68k,
> unless Something Really Bad happens.

So, if that's okay, I'll send it off to Linus sometime later.

Thanks,
Miklos

2014-04-15 07:45:43

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 00/15] wire up renameat2 syscall for various archs

Hi Miklos,

On Mon, Apr 14, 2014 at 10:11 PM, Miklos Szeredi <[email protected]> wrote:
> On Mon, Apr 14, 2014 at 6:32 PM, Geert Uytterhoeven
> <[email protected]> wrote:
>> On Fri, Apr 11, 2014 at 12:25 PM, Miklos Szeredi <[email protected]> wrote:
>>> This series wires up the recently added renameat2 syscall for archs that are
>>> up-to-date in the sense that they appear to support the latest syscalls. I
>>> haven't touched the rest of them..
>>>
>>> Plus three NR_syscalls miscalculation fixes.
>>
>> Do you plan to collect acks, and ask Linus to pull this series later, or
>> do you want each arch maintainer to take the patches for his/her pet
>> architecture?
>
> Whichever works best for you.
>
>> Note that I don't plan to send another pull request for 3.15 for m68k,
>> unless Something Really Bad happens.
>
> So, if that's okay, I'll send it off to Linus sometime later.

That's fine for me!

Thanks, it's been a while someone went through the hard work of adding
a syscall to all architectures ;-)

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

2014-04-19 18:54:14

by Helge Deller

[permalink] [raw]
Subject: Re: [PATCH 09/15] parisc: add renameat2 syscall

On 04/11/2014 12:25 PM, Miklos Szeredi wrote:
> From: Miklos Szeredi <[email protected]>

Thanks Miklos!

> Signed-off-by: Miklos Szeredi <[email protected]>
> Cc: Helge Deller <[email protected]>

Acked-by: Helge Deller <[email protected]>

Can you please push it with the other arches.

Helge

> ---
> arch/parisc/include/uapi/asm/unistd.h | 3 ++-
> arch/parisc/kernel/syscall_table.S | 1 +
> 2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/parisc/include/uapi/asm/unistd.h b/arch/parisc/include/uapi/asm/unistd.h
> index 265ae5190b0a..47e0e21d2272 100644
> --- a/arch/parisc/include/uapi/asm/unistd.h
> +++ b/arch/parisc/include/uapi/asm/unistd.h
> @@ -829,8 +829,9 @@
> #define __NR_sched_setattr (__NR_Linux + 334)
> #define __NR_sched_getattr (__NR_Linux + 335)
> #define __NR_utimes (__NR_Linux + 336)
> +#define __NR_renameat2 (__NR_Linux + 337)
>
> -#define __NR_Linux_syscalls (__NR_utimes + 1)
> +#define __NR_Linux_syscalls (__NR_renameat2 + 1)
>
>
> #define __IGNORE_select /* newselect */
> diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
> index 80e5dd248934..a595266fdb4d 100644
> --- a/arch/parisc/kernel/syscall_table.S
> +++ b/arch/parisc/kernel/syscall_table.S
> @@ -432,6 +432,7 @@
> ENTRY_SAME(sched_setattr)
> ENTRY_SAME(sched_getattr) /* 335 */
> ENTRY_COMP(utimes)
> + ENTRY_COMP(renameat2)
>
> /* Nothing yet */
>
>

2014-04-21 08:10:33

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 06/15] m68k: add renameat2 syscall

Hi Miklos,

On Fri, Apr 11, 2014 at 12:25 PM, Miklos Szeredi <[email protected]> wrote:
> --- a/arch/m68k/kernel/syscalltable.S
> +++ b/arch/m68k/kernel/syscalltable.S
> @@ -371,4 +371,5 @@ ENTRY(sys_call_table)
> .long sys_finit_module
> .long sys_sched_setattr
> .long sys_sched_getattr /* 350 */
> + .long sys_sched_renameat2

"sys_renameat2", please.

Sorry for not noticing before I threw it at the compiler.

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

2014-04-22 15:32:25

by Miklos Szeredi

[permalink] [raw]
Subject: Re: [PATCH 06/15] m68k: add renameat2 syscall

On Mon, Apr 21, 2014 at 10:10 AM, Geert Uytterhoeven
<[email protected]> wrote:
> Hi Miklos,
>
> On Fri, Apr 11, 2014 at 12:25 PM, Miklos Szeredi <[email protected]> wrote:
>> --- a/arch/m68k/kernel/syscalltable.S
>> +++ b/arch/m68k/kernel/syscalltable.S
>> @@ -371,4 +371,5 @@ ENTRY(sys_call_table)
>> .long sys_finit_module
>> .long sys_sched_setattr
>> .long sys_sched_getattr /* 350 */
>> + .long sys_sched_renameat2
>
> "sys_renameat2", please.
>
> Sorry for not noticing before I threw it at the compiler.


Fixed. Thanks!

Miklos

2014-04-22 15:33:27

by Miklos Szeredi

[permalink] [raw]
Subject: Re: [PATCH 09/15] parisc: add renameat2 syscall

On Sat, Apr 19, 2014 at 8:54 PM, Helge Deller <[email protected]> wrote:
> On 04/11/2014 12:25 PM, Miklos Szeredi wrote:
>> From: Miklos Szeredi <[email protected]>
>
> Thanks Miklos!
>
>> Signed-off-by: Miklos Szeredi <[email protected]>
>> Cc: Helge Deller <[email protected]>
>
> Acked-by: Helge Deller <[email protected]>
>
> Can you please push it with the other arches.

Sure.

Thanks,
Miklos

2014-04-22 16:58:54

by Catalin Marinas

[permalink] [raw]
Subject: Re: [PATCH 04/15] arm64: __NR_compat_syscalls fix

On Fri, Apr 11, 2014 at 11:25:40AM +0100, Miklos Szeredi wrote:
> From: Miklos Szeredi <[email protected]>
>
> Signed-off-by: Miklos Szeredi <[email protected]>
> Cc: Catalin Marinas <[email protected]>
> ---
> arch/arm64/include/asm/unistd32.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h
> index bb8eb8a78e67..faa0e1ce59df 100644
> --- a/arch/arm64/include/asm/unistd32.h
> +++ b/arch/arm64/include/asm/unistd32.h
> @@ -404,7 +404,7 @@ __SYSCALL(379, sys_finit_module)
> __SYSCALL(380, sys_sched_setattr)
> __SYSCALL(381, sys_sched_getattr)
>
> -#define __NR_compat_syscalls 379
> +#define __NR_compat_syscalls 382

I picked up this patch, together with a Cc: stable and longer comment.

What's your plan with the other patches? Do you submit them as a series
or would like the arch maintainers to pick them up?

Thanks.

--
Catalin

2014-04-22 17:02:10

by Catalin Marinas

[permalink] [raw]
Subject: Re: [PATCH 05/15] arm64: add renameat2 syscall

On Fri, Apr 11, 2014 at 11:25:41AM +0100, Miklos Szeredi wrote:
> From: Miklos Szeredi <[email protected]>
>
> Signed-off-by: Miklos Szeredi <[email protected]>
> Cc: Catalin Marinas <[email protected]>

Acked-by: Catalin Marinas <[email protected]>

2014-04-23 08:46:45

by Miklos Szeredi

[permalink] [raw]
Subject: Re: [PATCH 04/15] arm64: __NR_compat_syscalls fix

On Tue, Apr 22, 2014 at 6:58 PM, Catalin Marinas
<[email protected]> wrote:
> On Fri, Apr 11, 2014 at 11:25:40AM +0100, Miklos Szeredi wrote:
>> From: Miklos Szeredi <[email protected]>
>>
>> Signed-off-by: Miklos Szeredi <[email protected]>
>> Cc: Catalin Marinas <[email protected]>
>> ---
>> arch/arm64/include/asm/unistd32.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h
>> index bb8eb8a78e67..faa0e1ce59df 100644
>> --- a/arch/arm64/include/asm/unistd32.h
>> +++ b/arch/arm64/include/asm/unistd32.h
>> @@ -404,7 +404,7 @@ __SYSCALL(379, sys_finit_module)
>> __SYSCALL(380, sys_sched_setattr)
>> __SYSCALL(381, sys_sched_getattr)
>>
>> -#define __NR_compat_syscalls 379
>> +#define __NR_compat_syscalls 382
>
> I picked up this patch, together with a Cc: stable and longer comment.
>
> What's your plan with the other patches? Do you submit them as a series
> or would like the arch maintainers to pick them up?

Either is OK for me. I'll collect ACKs for those which the maintainer
doesn't want to submit, and I'll submit them in one batch.

But if you have patches anyway, please feel free to pick this up as well.

Thanks,
Miklois

2014-04-23 09:41:15

by Catalin Marinas

[permalink] [raw]
Subject: Re: [PATCH 04/15] arm64: __NR_compat_syscalls fix

On Wed, Apr 23, 2014 at 09:46:40AM +0100, Miklos Szeredi wrote:
> On Tue, Apr 22, 2014 at 6:58 PM, Catalin Marinas
> <[email protected]> wrote:
> > What's your plan with the other patches? Do you submit them as a series
> > or would like the arch maintainers to pick them up?
>
> Either is OK for me. I'll collect ACKs for those which the maintainer
> doesn't want to submit, and I'll submit them in one batch.
>
> But if you have patches anyway, please feel free to pick this up as well.

OK, I took the renameat2 wiring as well. Thanks.

--
Catalin

2014-04-23 10:28:16

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH 02/15] arm: __NR_syscalls fix

On Fri, Apr 11, 2014 at 01:45:02PM +0100, Russell King - ARM Linux wrote:
> On Fri, Apr 11, 2014 at 02:02:32PM +0200, Miklos Szeredi wrote:
> > On Fri, Apr 11, 2014 at 1:54 PM, Russell King - ARM Linux
> > <[email protected]> wrote:
> > > On Fri, Apr 11, 2014 at 01:50:50PM +0200, Miklos Szeredi wrote:
> > >> Yes, and the padding will be of wrong length if NR_syscalls is
> > >> incorrect (which may be Oopsable?). At least that is my impression
> > >> from a casual glance.
> > >
> > > Please explain.
> >
> > Look at ending lines of arch/arm/kernel/calls.S: if NR_syscalls is a
> > multiple of 4, then syscalls_padding will be zero. I.e. no padding
> > despite the fact that there is in fact only 382 system calls in table
> > and there should be 2 sys_ni_syscall pads.
>
> Hmm, it looks like you're right... this used to work fine until...
>
> commit 1f66e06fb6414732bef7bf4a071ef76a837badec
> Author: Wade Farnsworth <[email protected]>
> Date: Fri Sep 7 18:18:25 2012 +0100
>
> ARM: 7524/1: support syscall tracing
>
> because the tracing code wanted to know the number of syscalls. I don't
> know what the answer is here, because the current solution is IMHO far
> to fragile.

Actually, no, you're wrong. Look closely at the definitions. __NR_syscalls
is not the same as NR_syscalls.

__NR_syscalls is the statically defined size of the syscall table for
*probes purposes.

NR_syscalls is the assembly-counted number of CALL() macros in
arch/arm/kernel/calls.S.

So, patch 2 isn't required, and patch 3 needs to be fixed up to take
this into account...

--
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.

2014-04-23 11:40:20

by James Hogan

[permalink] [raw]
Subject: Re: [PATCH 07/15] mips: add renameat2 syscall

(cc'ing linux-mips list)

On 11 April 2014 11:25, Miklos Szeredi <[email protected]> wrote:
> From: Miklos Szeredi <[email protected]>
>
> Signed-off-by: Miklos Szeredi <[email protected]>
> Cc: Ralf Baechle <[email protected]>

Identical to the patch I just sent to linux-mips, so:
Reviewed-by: James Hogan <[email protected]>

Cheers
James

> ---
> arch/mips/include/uapi/asm/unistd.h | 15 +++++++++------
> arch/mips/kernel/scall32-o32.S | 1 +
> arch/mips/kernel/scall64-64.S | 1 +
> arch/mips/kernel/scall64-n32.S | 1 +
> arch/mips/kernel/scall64-o32.S | 1 +
> 5 files changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/arch/mips/include/uapi/asm/unistd.h b/arch/mips/include/uapi/asm/unistd.h
> index d6e154a9e6a5..5805414777e0 100644
> --- a/arch/mips/include/uapi/asm/unistd.h
> +++ b/arch/mips/include/uapi/asm/unistd.h
> @@ -371,16 +371,17 @@
> #define __NR_finit_module (__NR_Linux + 348)
> #define __NR_sched_setattr (__NR_Linux + 349)
> #define __NR_sched_getattr (__NR_Linux + 350)
> +#define __NR_renameat2 (__NR_Linux + 351)
>
> /*
> * Offset of the last Linux o32 flavoured syscall
> */
> -#define __NR_Linux_syscalls 350
> +#define __NR_Linux_syscalls 351
>
> #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
>
> #define __NR_O32_Linux 4000
> -#define __NR_O32_Linux_syscalls 350
> +#define __NR_O32_Linux_syscalls 351
>
> #if _MIPS_SIM == _MIPS_SIM_ABI64
>
> @@ -699,16 +700,17 @@
> #define __NR_getdents64 (__NR_Linux + 308)
> #define __NR_sched_setattr (__NR_Linux + 309)
> #define __NR_sched_getattr (__NR_Linux + 310)
> +#define __NR_renameat2 (__NR_Linux + 311)
>
> /*
> * Offset of the last Linux 64-bit flavoured syscall
> */
> -#define __NR_Linux_syscalls 310
> +#define __NR_Linux_syscalls 311
>
> #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
>
> #define __NR_64_Linux 5000
> -#define __NR_64_Linux_syscalls 310
> +#define __NR_64_Linux_syscalls 311
>
> #if _MIPS_SIM == _MIPS_SIM_NABI32
>
> @@ -1031,15 +1033,16 @@
> #define __NR_finit_module (__NR_Linux + 312)
> #define __NR_sched_setattr (__NR_Linux + 313)
> #define __NR_sched_getattr (__NR_Linux + 314)
> +#define __NR_renameat2 (__NR_Linux + 315)
>
> /*
> * Offset of the last N32 flavoured syscall
> */
> -#define __NR_Linux_syscalls 314
> +#define __NR_Linux_syscalls 315
>
> #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
>
> #define __NR_N32_Linux 6000
> -#define __NR_N32_Linux_syscalls 314
> +#define __NR_N32_Linux_syscalls 315
>
> #endif /* _UAPI_ASM_UNISTD_H */
> diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S
> index fdc70b400442..3245474f19d5 100644
> --- a/arch/mips/kernel/scall32-o32.S
> +++ b/arch/mips/kernel/scall32-o32.S
> @@ -577,3 +577,4 @@ EXPORT(sys_call_table)
> PTR sys_finit_module
> PTR sys_sched_setattr
> PTR sys_sched_getattr /* 4350 */
> + PTR sys_renameat2
> diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S
> index dd99c3285aea..be2fedd4ae33 100644
> --- a/arch/mips/kernel/scall64-64.S
> +++ b/arch/mips/kernel/scall64-64.S
> @@ -430,4 +430,5 @@ EXPORT(sys_call_table)
> PTR sys_getdents64
> PTR sys_sched_setattr
> PTR sys_sched_getattr /* 5310 */
> + PTR sys_renameat2
> .size sys_call_table,.-sys_call_table
> diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
> index f68d2f4f0090..c1dbcda4b816 100644
> --- a/arch/mips/kernel/scall64-n32.S
> +++ b/arch/mips/kernel/scall64-n32.S
> @@ -423,4 +423,5 @@ EXPORT(sysn32_call_table)
> PTR sys_finit_module
> PTR sys_sched_setattr
> PTR sys_sched_getattr
> + PTR sys_renameat2 /* 6315 */
> .size sysn32_call_table,.-sysn32_call_table
> diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
> index 70f6acecd928..f1343ccd7ed7 100644
> --- a/arch/mips/kernel/scall64-o32.S
> +++ b/arch/mips/kernel/scall64-o32.S
> @@ -556,4 +556,5 @@ EXPORT(sys32_call_table)
> PTR sys_finit_module
> PTR sys_sched_setattr
> PTR sys_sched_getattr /* 4350 */
> + PTR sys_renameat2
> .size sys32_call_table,.-sys32_call_table
> --
> 1.8.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arch" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html



--
James Hogan

2014-04-23 11:47:00

by James Hogan

[permalink] [raw]
Subject: Re: [PATCH 15/15] asm-generic: add renameat2 syscall

Hi Miklos,

On 11 April 2014 11:25, Miklos Szeredi <[email protected]> wrote:
> From: Miklos Szeredi <[email protected]>
>
> Signed-off-by: Miklos Szeredi <[email protected]>
> Cc: Arnd Bergmann <[email protected]>

Acked-by: James Hogan <[email protected]> [metag]

Thanks
James

> ---
> include/uapi/asm-generic/unistd.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h
> index 6db66783d268..333640608087 100644
> --- a/include/uapi/asm-generic/unistd.h
> +++ b/include/uapi/asm-generic/unistd.h
> @@ -697,9 +697,11 @@ __SYSCALL(__NR_finit_module, sys_finit_module)
> __SYSCALL(__NR_sched_setattr, sys_sched_setattr)
> #define __NR_sched_getattr 275
> __SYSCALL(__NR_sched_getattr, sys_sched_getattr)
> +#define __NR_renameat2 276
> +__SYSCALL(__NR_renameat2, sys_renameat2)
>
> #undef __NR_syscalls
> -#define __NR_syscalls 276
> +#define __NR_syscalls 277
>
> /*
> * All syscalls below here should go away really,
> --
> 1.8.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-arch" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

2014-04-23 12:00:55

by Miklos Szeredi

[permalink] [raw]
Subject: Re: [PATCH 02/15] arm: __NR_syscalls fix

On Wed, Apr 23, 2014 at 12:27 PM, Russell King - ARM Linux
<[email protected]> wrote:
> On Fri, Apr 11, 2014 at 01:45:02PM +0100, Russell King - ARM Linux wrote:
>> On Fri, Apr 11, 2014 at 02:02:32PM +0200, Miklos Szeredi wrote:
>> > On Fri, Apr 11, 2014 at 1:54 PM, Russell King - ARM Linux
>> > <[email protected]> wrote:
>> > > On Fri, Apr 11, 2014 at 01:50:50PM +0200, Miklos Szeredi wrote:
>> > >> Yes, and the padding will be of wrong length if NR_syscalls is
>> > >> incorrect (which may be Oopsable?). At least that is my impression
>> > >> from a casual glance.
>> > >
>> > > Please explain.
>> >
>> > Look at ending lines of arch/arm/kernel/calls.S: if NR_syscalls is a
>> > multiple of 4, then syscalls_padding will be zero. I.e. no padding
>> > despite the fact that there is in fact only 382 system calls in table
>> > and there should be 2 sys_ni_syscall pads.
>>
>> Hmm, it looks like you're right... this used to work fine until...
>>
>> commit 1f66e06fb6414732bef7bf4a071ef76a837badec
>> Author: Wade Farnsworth <[email protected]>
>> Date: Fri Sep 7 18:18:25 2012 +0100
>>
>> ARM: 7524/1: support syscall tracing
>>
>> because the tracing code wanted to know the number of syscalls. I don't
>> know what the answer is here, because the current solution is IMHO far
>> to fragile.
>
> Actually, no, you're wrong. Look closely at the definitions. __NR_syscalls
> is not the same as NR_syscalls.
>
> __NR_syscalls is the statically defined size of the syscall table for
> *probes purposes.
>
> NR_syscalls is the assembly-counted number of CALL() macros in
> arch/arm/kernel/calls.S.

All I can say is: UGGGGH.

But I've not had close encounters with arch code, so this may be
acceptable to you. Whatever...

Thanks,
Miklos