aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/i386/kernel/syscall_table.S1
-rw-r--r--arch/x86_64/ia32/ia32entry.S1
-rw-r--r--include/asm-i386/unistd.h3
-rw-r--r--include/linux/syscalls.h5
-rw-r--r--kernel/compat.c23
-rw-r--r--kernel/sys_ni.c1
6 files changed, 33 insertions, 1 deletions
diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S
index af56987f69b0..dd63d4775398 100644
--- a/arch/i386/kernel/syscall_table.S
+++ b/arch/i386/kernel/syscall_table.S
@@ -316,3 +316,4 @@ ENTRY(sys_call_table)
316 .long sys_sync_file_range 316 .long sys_sync_file_range
317 .long sys_tee /* 315 */ 317 .long sys_tee /* 315 */
318 .long sys_vmsplice 318 .long sys_vmsplice
319 .long sys_move_pages
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S
index 5a92fed2d1d5..4ec594ab1a98 100644
--- a/arch/x86_64/ia32/ia32entry.S
+++ b/arch/x86_64/ia32/ia32entry.S
@@ -696,4 +696,5 @@ ia32_sys_call_table:
696 .quad sys_sync_file_range 696 .quad sys_sync_file_range
697 .quad sys_tee 697 .quad sys_tee
698 .quad compat_sys_vmsplice 698 .quad compat_sys_vmsplice
699 .quad compat_sys_move_pages
699ia32_syscall_end: 700ia32_syscall_end:
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index de2ccc149e34..fc1c8ddae149 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -322,10 +322,11 @@
322#define __NR_sync_file_range 314 322#define __NR_sync_file_range 314
323#define __NR_tee 315 323#define __NR_tee 315
324#define __NR_vmsplice 316 324#define __NR_vmsplice 316
325#define __NR_move_pages 317
325 326
326#ifdef __KERNEL__ 327#ifdef __KERNEL__
327 328
328#define NR_syscalls 317 329#define NR_syscalls 318
329 330
330/* 331/*
331 * user-visible error numbers are in the range -1 - -128: see 332 * user-visible error numbers are in the range -1 - -128: see
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 7e3f23490918..e42738c69166 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -521,6 +521,11 @@ asmlinkage long sys_move_pages(pid_t pid, unsigned long nr_pages,
521 const int __user *nodes, 521 const int __user *nodes,
522 int __user *status, 522 int __user *status,
523 int flags); 523 int flags);
524asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_page,
525 void __user *pages,
526 const int __user *nodes,
527 int __user *status,
528 int flags);
524asmlinkage long sys_mbind(unsigned long start, unsigned long len, 529asmlinkage long sys_mbind(unsigned long start, unsigned long len,
525 unsigned long mode, 530 unsigned long mode,
526 unsigned long __user *nmask, 531 unsigned long __user *nmask,
diff --git a/kernel/compat.c b/kernel/compat.c
index c1601a84f8d8..ccea93e28954 100644
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -21,6 +21,7 @@
21#include <linux/unistd.h> 21#include <linux/unistd.h>
22#include <linux/security.h> 22#include <linux/security.h>
23#include <linux/timex.h> 23#include <linux/timex.h>
24#include <linux/migrate.h>
24 25
25#include <asm/uaccess.h> 26#include <asm/uaccess.h>
26 27
@@ -934,3 +935,25 @@ asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp)
934 935
935 return ret; 936 return ret;
936} 937}
938
939#ifdef CONFIG_NUMA
940asmlinkage long compat_sys_move_pages(pid_t pid, unsigned long nr_pages,
941 void __user *pages32,
942 const int __user *nodes,
943 int __user *status,
944 int flags)
945{
946 const void __user * __user *pages;
947 int i;
948
949 pages = compat_alloc_user_space(nr_pages * sizeof(void *));
950 for (i = 0; i < nr_pages; i++) {
951 compat_uptr_t p;
952
953 if (get_user(p, (compat_uptr_t *)(pages32 + i)) ||
954 put_user(compat_ptr(p), pages + i))
955 return -EFAULT;
956 }
957 return sys_move_pages(pid, nr_pages, pages, nodes, status, flags);
958}
959#endif
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 597229749dec..6991bece67e8 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -133,3 +133,4 @@ cond_syscall(sys_mincore);
133cond_syscall(sys_madvise); 133cond_syscall(sys_madvise);
134cond_syscall(sys_mremap); 134cond_syscall(sys_mremap);
135cond_syscall(sys_remap_file_pages); 135cond_syscall(sys_remap_file_pages);
136cond_syscall(compat_sys_move_pages);