From patchwork Tue Jul 26 03:47:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Amvrosiadis X-Patchwork-Id: 9247601 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 94297607D8 for ; Tue, 26 Jul 2016 04:08:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A951212D6 for ; Tue, 26 Jul 2016 04:08:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F7E92621E; Tue, 26 Jul 2016 04:08:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BB99212D6 for ; Tue, 26 Jul 2016 04:08:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753599AbcGZEHc (ORCPT ); Tue, 26 Jul 2016 00:07:32 -0400 Received: from cliff.cs.toronto.edu ([128.100.3.120]:49956 "EHLO cliff.cs.toronto.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753511AbcGZEHa (ORCPT ); Tue, 26 Jul 2016 00:07:30 -0400 Received: from taylor.syslab.sandbox ([10.70.1.60] helo=taylor.cs.toronto.edu) by cliff.cs.toronto.edu with esmtp (Exim 4.86_2) (envelope-from ) id 1bRtKy-0000pE-Cc; Mon, 25 Jul 2016 23:47:20 -0400 Received: by taylor.cs.toronto.edu (Postfix, from userid 2040) id 4D7DC3603A; Mon, 25 Jul 2016 23:47:20 -0400 (EDT) Message-Id: <447c01092adfc8a8c61f6ee0723024220ef52dda.1469489884.git.gamvrosi@gmail.com> In-Reply-To: References: From: George Amvrosiadis To: Andrew Morton , Al Viro , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Cc: George Amvrosiadis Subject: [PATCH 2/3] mm/duet: syscall wiring Date: Mon, 25 Jul 2016 23:47:20 -0400 (EDT) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Usual syscall wiring for the four Duet syscalls. Signed-off-by: George Amvrosiadis --- arch/x86/entry/syscalls/syscall_32.tbl | 4 ++++ arch/x86/entry/syscalls/syscall_64.tbl | 4 ++++ include/linux/syscalls.h | 8 ++++++++ include/uapi/asm-generic/unistd.h | 12 +++++++++++- kernel/sys_ni.c | 6 ++++++ 5 files changed, 33 insertions(+), 1 deletion(-) diff --git a/arch/x86/entry/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl index 4cddd17..f34ff94 100644 --- a/arch/x86/entry/syscalls/syscall_32.tbl +++ b/arch/x86/entry/syscalls/syscall_32.tbl @@ -386,3 +386,7 @@ 377 i386 copy_file_range sys_copy_file_range 378 i386 preadv2 sys_preadv2 compat_sys_preadv2 379 i386 pwritev2 sys_pwritev2 compat_sys_pwritev2 +380 i386 duet_status sys_duet_status +381 i386 duet_init sys_duet_init +382 i386 duet_bmap sys_duet_bmap +383 i386 duet_get_path sys_duet_get_path diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl index 555263e..d04efaa 100644 --- a/arch/x86/entry/syscalls/syscall_64.tbl +++ b/arch/x86/entry/syscalls/syscall_64.tbl @@ -335,6 +335,10 @@ 326 common copy_file_range sys_copy_file_range 327 64 preadv2 sys_preadv2 328 64 pwritev2 sys_pwritev2 +329 common duet_status sys_duet_status +330 common duet_init sys_duet_init +331 common duet_bmap sys_duet_bmap +332 common duet_get_path sys_duet_get_path # # x32-specific system call numbers start at 512 to avoid cache impact diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index d022390..da1049e 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -65,6 +65,8 @@ struct old_linux_dirent; struct perf_event_attr; struct file_handle; struct sigaltstack; +struct duet_status_args; +struct duet_uuid_arg; union bpf_attr; #include @@ -898,4 +900,10 @@ asmlinkage long sys_copy_file_range(int fd_in, loff_t __user *off_in, asmlinkage long sys_mlock2(unsigned long start, size_t len, int flags); +asmlinkage long sys_duet_status(u16 flags, struct duet_status_args __user *arg); +asmlinkage long sys_duet_init(const char __user *taskname, u32 regmask, + const char __user *pathname); +asmlinkage long sys_duet_bmap(u16 flags, struct duet_uuid_arg __user *arg); +asmlinkage long sys_duet_get_path(struct duet_uuid_arg __user *uarg, + char __user *pathbuf, int pathbufsize); #endif diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index a26415b..7c287c0 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -725,8 +725,18 @@ __SC_COMP(__NR_preadv2, sys_preadv2, compat_sys_preadv2) #define __NR_pwritev2 287 __SC_COMP(__NR_pwritev2, sys_pwritev2, compat_sys_pwritev2) +/* mm/duet/syscall.c */ +#define __NR_duet_status 288 +__SYSCALL(__NR_duet_status, sys_duet_status) +#define __NR_duet_init 289 +__SYSCALL(__NR_duet_init, sys_duet_init) +#define __NR_duet_bmap 290 +__SYSCALL(__NR_duet_bmap, sys_duet_bmap) +#define __NR_duet_get_path 291 +__SYSCALL(__NR_duet_get_path, sys_duet_get_path) + #undef __NR_syscalls -#define __NR_syscalls 288 +#define __NR_syscalls 292 /* * All syscalls below here should go away really, diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c index 2c5e3a8..3d4c53a 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c @@ -176,6 +176,12 @@ cond_syscall(sys_capget); cond_syscall(sys_capset); cond_syscall(sys_copy_file_range); +/* Duet syscall entries */ +cond_syscall(sys_duet_status); +cond_syscall(sys_duet_init); +cond_syscall(sys_duet_bmap); +cond_syscall(sys_duet_get_path); + /* arch-specific weak syscall entries */ cond_syscall(sys_pciconfig_read); cond_syscall(sys_pciconfig_write);