Skip to contentSkip to conversation

ARM: Wire up userfaultfd and mlock2 syscalls

PATCH New Thierry Reding 1 participant 3 messages Aug 7, 2015 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

cover ARM: Wire up userfaultfd and mlock2 syscalls

From: Thierry Reding <[email protected]>

These are two fairly trivial patches to wire up the userfaultfd and mlock2 syscalls on 32-bit ARM. I've verified that these work by running the userfaultfd and mlock2-tests tests from tools/testing/selftests/vm/ and they give good results. Note that mlock2-tests doesn't work without additional fixups in linux-next needed to remove VM flags clashes.

I suppose this would have to wait until both of the above syscalls have actually been merged, but I figured I'd post them anyway since I already did the work and verified that they work.

Thierry

Thierry Reding (2):
ARM: Wire up userfaultfd syscall
ARM: Wire up mlock2 syscall

 arch/arm/include/asm/unistd.h      | 2 +-
 arch/arm/include/uapi/asm/unistd.h | 2 ++
 arch/arm/kernel/calls.S            | 2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)
Signature · 1 line
2.4.5
#1 lore raw

PATCH 1/2 ARM: Wire up userfaultfd syscall

From: Thierry Reding <[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(-)
arch/arm/include/asm/unistd.h +1 -1
index 32640c431a08..7cba573c2cc9 100644
@@ -19,7 +19,7 @@
  * This may need to be greater than __NR_last_syscall+1 in order to
  * account for the padding in the syscall table
  */
-#define __NR_syscalls  (388)
+#define __NR_syscalls  (392)
 
 /*
  * *NOTE*: This is a ghost syscall private to the kernel.  Only the
arch/arm/include/uapi/asm/unistd.h +1 -0
index 0c3f5a0dafd3..ca96eca3453c 100644
@@ -414,6 +414,7 @@
 #define __NR_memfd_create		(__NR_SYSCALL_BASE+385)
 #define __NR_bpf			(__NR_SYSCALL_BASE+386)
 #define __NR_execveat			(__NR_SYSCALL_BASE+387)
+#define __NR_userfaultfd		(__NR_SYSCALL_BASE+388)
 
 /*
  * The following SWIs are ARM private.
arch/arm/kernel/calls.S +1 -0
index 05745eb838c5..84c405670ff0 100644
@@ -397,6 +397,7 @@
 /* 385 */	CALL(sys_memfd_create)
 		CALL(sys_bpf)
 		CALL(sys_execveat)
+		CALL(sys_userfaultfd)
 #ifndef syscalls_counted
 .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
 #define syscalls_counted
Signature · 1 line
2.4.5
#2 lore raw

PATCH 2/2 ARM: Wire up mlock2 syscall

In reply to Thierry Reding

From: Thierry Reding <[email protected]>

---
 arch/arm/include/uapi/asm/unistd.h | 1 +
 arch/arm/kernel/calls.S            | 1 +
 2 files changed, 2 insertions(+)
arch/arm/include/uapi/asm/unistd.h +1 -0
index ca96eca3453c..977831f49576 100644
@@ -415,6 +415,7 @@
 #define __NR_bpf			(__NR_SYSCALL_BASE+386)
 #define __NR_execveat			(__NR_SYSCALL_BASE+387)
 #define __NR_userfaultfd		(__NR_SYSCALL_BASE+388)
+#define __NR_mlock2			(__NR_SYSCALL_BASE+389)
 
 /*
  * The following SWIs are ARM private.
arch/arm/kernel/calls.S +1 -0
index 84c405670ff0..e9705ba5a1ff 100644
@@ -398,6 +398,7 @@
 		CALL(sys_bpf)
 		CALL(sys_execveat)
 		CALL(sys_userfaultfd)
+		CALL(sys_mlock2)
 #ifndef syscalls_counted
 .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
 #define syscalls_counted
Signature · 1 line
2.4.5