From patchwork Mon Mar 20 08:16:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyle Huey X-Patchwork-Id: 9634569 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 4E1AA60327 for ; Mon, 20 Mar 2017 16:50:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EA4D267EC for ; Mon, 20 Mar 2017 16:50:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32DA427F8C; Mon, 20 Mar 2017 16:50:39 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM 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 1270426E73 for ; Mon, 20 Mar 2017 16:50:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755885AbdCTQtb (ORCPT ); Mon, 20 Mar 2017 12:49:31 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34269 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753198AbdCTIRO (ORCPT ); Mon, 20 Mar 2017 04:17:14 -0400 Received: by mail-pf0-f196.google.com with SMTP id o126so16012165pfb.1 for ; Mon, 20 Mar 2017 01:17:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kylehuey.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fprvnOLYY27cOemZWRPQ+BIkG14zTY0Xe7QgmeWkiUk=; b=kUV9/JYbjhgToyY7VJ7S96lAMJ6fqfGVNP4WgBmVVsEw5ANbSYxeTFKJMszHyBZM4c GAVvkyBtqFEhV7ilrb4vr8hBvtP02wU5NXiz2YamXcU6LRhjKt2gZ3v/VHZPBVWTzlvI FPPILQSWVKG+S9UcfP7EKDfS3WOE7u1b2VztvYDMbOORSan4y9xu6J2gumokKWsHOb2g v+5j1m6wDjN70vnCI3n6VLh+MagPGhPjDVtgo3NKbvZCLLoMm+EMu7cgJF0nKvYcrea3 577bs9VwCa/nZsmbW88B6Sb6AfD2xPYu06qYEZO8kcVSQ4sETtzweyoxwxkWb6zSZEqb Ybug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fprvnOLYY27cOemZWRPQ+BIkG14zTY0Xe7QgmeWkiUk=; b=uRlHasoHCyJ316dqrw+w00h6EhKe0HKMPYYSD4uPlJ6xUdYzG5+oe4oRDD/wgrLZuD qTPpU59su5X4XCGfMj5TRTJbHj0wlpq3giIKTTKpXDT9O40AJgQOoMADjn2Isb5feafV +VsA2ntM2iGNnMWWcjIeNeNnc20vJbPAbGDpQN3PGS9dg6kGCTGU2JJgJQVbkrCOTdtL OVCDHShbZRJTZYA84YGqvO41c8D3HfHlvHeuL0JAsQl9j8XYT0ie39+sjNXHHAF+5aUk KwtOGV4WhDz7pgPFtxxy+I2NJaC6YUhZ1kMJRBBFfwQ4peIc0ZxZ9KoQ4dkmhXtgtiw+ pW+g== X-Gm-Message-State: AFeK/H3+9vj/biGmqvZmOUCag/Go2sx2SbIeOXE5NFacb9nIWIkofix/SHE6MHUdNts/0w== X-Received: by 10.84.177.36 with SMTP id w33mr37632563plb.105.1489997823436; Mon, 20 Mar 2017 01:17:03 -0700 (PDT) Received: from minbar.home.kylehuey.com (c-50-150-100-179.hsd1.ca.comcast.net. [50.150.100.179]) by smtp.gmail.com with ESMTPSA id m20sm7792029pgd.32.2017.03.20.01.17.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Mar 2017 01:17:02 -0700 (PDT) From: Kyle Huey X-Google-Original-From: Kyle Huey To: Robert O'Callahan , Thomas Gleixner , Andy Lutomirski , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Jeff Dike , Richard Weinberger , Alexander Viro , Shuah Khan , Dave Hansen , Borislav Petkov , Peter Zijlstra , Boris Ostrovsky , Len Brown , "Rafael J. Wysocki" , Dmitry Safonov , David Matlack , Nadav Amit , Andi Kleen , Grzegorz Andrejczuk Cc: linux-kernel@vger.kernel.org, user-mode-linux-devel@lists.sourceforge.net, user-mode-linux-user@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org, kvm@vger.kernel.org Subject: [PATCH v16 02/10] x86/arch_prctl: Rename 'code' argument to 'option' Date: Mon, 20 Mar 2017 01:16:20 -0700 Message-Id: <20170320081628.18952-3-khuey@kylehuey.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170320081628.18952-1-khuey@kylehuey.com> References: <20170320081628.18952-1-khuey@kylehuey.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP arch_prctl arbitrarily changed prctl's 'option' to 'code'. Now that we're adding additional options, fix that. Signed-off-by: Kyle Huey --- arch/um/include/shared/os.h | 4 ++-- arch/x86/include/asm/proto.h | 2 +- arch/x86/kernel/process_64.c | 8 ++++---- arch/x86/um/asm/ptrace.h | 2 +- arch/x86/um/os-Linux/prctl.c | 4 ++-- arch/x86/um/syscalls_64.c | 13 +++++++------ 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h index de5d572225f3..32e41c4ef6d3 100644 --- a/arch/um/include/shared/os.h +++ b/arch/um/include/shared/os.h @@ -302,8 +302,8 @@ extern int ignore_sigio_fd(int fd); extern void maybe_sigio_broken(int fd, int read); extern void sigio_broken(int fd, int read); -/* sys-x86_64/prctl.c */ -extern int os_arch_prctl(int pid, int code, unsigned long *addr); +/* prctl.c */ +extern int os_arch_prctl(int pid, int option, unsigned long *addr); /* tty.c */ extern int get_pty(void); diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h index 9b9b30b19441..91675a960391 100644 --- a/arch/x86/include/asm/proto.h +++ b/arch/x86/include/asm/proto.h @@ -30,6 +30,6 @@ void x86_report_nx(void); extern int reboot_force; -long do_arch_prctl(struct task_struct *task, int code, unsigned long addr); +long do_arch_prctl(struct task_struct *task, int option, unsigned long addr); #endif /* _ASM_X86_PROTO_H */ diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index d6b784a5520d..4377cfe8e449 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -547,13 +547,13 @@ static long prctl_map_vdso(const struct vdso_image *image, unsigned long addr) } #endif -long do_arch_prctl(struct task_struct *task, int code, unsigned long addr) +long do_arch_prctl(struct task_struct *task, int option, unsigned long addr) { int ret = 0; int doit = task == current; int cpu; - switch (code) { + switch (option) { case ARCH_SET_GS: if (addr >= TASK_SIZE_MAX) return -EPERM; @@ -621,9 +621,9 @@ long do_arch_prctl(struct task_struct *task, int code, unsigned long addr) return ret; } -long sys_arch_prctl(int code, unsigned long addr) +long sys_arch_prctl(int option, unsigned long addr) { - return do_arch_prctl(current, code, addr); + return do_arch_prctl(current, option, addr); } unsigned long KSTK_ESP(struct task_struct *task) diff --git a/arch/x86/um/asm/ptrace.h b/arch/x86/um/asm/ptrace.h index e59eef20647b..b291ca5cf66b 100644 --- a/arch/x86/um/asm/ptrace.h +++ b/arch/x86/um/asm/ptrace.h @@ -78,7 +78,7 @@ static inline int ptrace_set_thread_area(struct task_struct *child, int idx, return -ENOSYS; } -extern long arch_prctl(struct task_struct *task, int code, +extern long arch_prctl(struct task_struct *task, int option, unsigned long __user *addr); #endif diff --git a/arch/x86/um/os-Linux/prctl.c b/arch/x86/um/os-Linux/prctl.c index 96eb2bd28832..0a6e16a35b77 100644 --- a/arch/x86/um/os-Linux/prctl.c +++ b/arch/x86/um/os-Linux/prctl.c @@ -6,7 +6,7 @@ #include #include -int os_arch_prctl(int pid, int code, unsigned long *addr) +int os_arch_prctl(int pid, int option, unsigned long *addr) { - return ptrace(PTRACE_ARCH_PRCTL, pid, (unsigned long) addr, code); + return ptrace(PTRACE_ARCH_PRCTL, pid, (unsigned long) addr, option); } diff --git a/arch/x86/um/syscalls_64.c b/arch/x86/um/syscalls_64.c index 10d907098c26..3c2dd8768992 100644 --- a/arch/x86/um/syscalls_64.c +++ b/arch/x86/um/syscalls_64.c @@ -11,7 +11,8 @@ #include /* XXX This should get the constants from libc */ #include -long arch_prctl(struct task_struct *task, int code, unsigned long __user *addr) +long arch_prctl(struct task_struct *task, int option + unsigned long __user *addr) { unsigned long *ptr = addr, tmp; long ret; @@ -30,7 +31,7 @@ long arch_prctl(struct task_struct *task, int code, unsigned long __user *addr) * arch_prctl is run on the host, then the registers are read * back. */ - switch (code) { + switch (option) { case ARCH_SET_FS: case ARCH_SET_GS: ret = restore_registers(pid, ¤t->thread.regs.regs); @@ -50,11 +51,11 @@ long arch_prctl(struct task_struct *task, int code, unsigned long __user *addr) ptr = &tmp; } - ret = os_arch_prctl(pid, code, ptr); + ret = os_arch_prctl(pid, option, ptr); if (ret) return ret; - switch (code) { + switch (option) { case ARCH_SET_FS: current->thread.arch.fs = (unsigned long) ptr; ret = save_registers(pid, ¤t->thread.regs.regs); @@ -73,9 +74,9 @@ long arch_prctl(struct task_struct *task, int code, unsigned long __user *addr) return ret; } -long sys_arch_prctl(int code, unsigned long addr) +long sys_arch_prctl(int option, unsigned long addr) { - return arch_prctl(current, code, (unsigned long __user *) addr); + return arch_prctl(current, option, (unsigned long __user *) addr); } void arch_switch_to(struct task_struct *to)