Re: [PATCH v15 9/9] x86/arch_prctl: Rename 'code' argument to 'option'
On Tue, Mar 14, 2017 at 1:07 PM, Thomas Gleixnerwrote: > On Sat, 11 Mar 2017, Kyle Huey wrote: > >> arch_prctl arbitrarily changed prctl's 'option' to 'code'. Now that we're >> adding additional options, fix that. > > And why is that at the end of the series instead of being the first patch? Laziness :) Will fix. - Kyle
Re: [PATCH v15 9/9] x86/arch_prctl: Rename 'code' argument to 'option'
On Tue, Mar 14, 2017 at 1:07 PM, Thomas Gleixner wrote: > On Sat, 11 Mar 2017, Kyle Huey wrote: > >> arch_prctl arbitrarily changed prctl's 'option' to 'code'. Now that we're >> adding additional options, fix that. > > And why is that at the end of the series instead of being the first patch? Laziness :) Will fix. - Kyle
Re: [PATCH v15 9/9] x86/arch_prctl: Rename 'code' argument to 'option'
On Sat, 11 Mar 2017, Kyle Huey wrote: > arch_prctl arbitrarily changed prctl's 'option' to 'code'. Now that we're > adding additional options, fix that. And why is that at the end of the series instead of being the first patch? Thanks, tglx
Re: [PATCH v15 9/9] x86/arch_prctl: Rename 'code' argument to 'option'
On Sat, 11 Mar 2017, Kyle Huey wrote: > arch_prctl arbitrarily changed prctl's 'option' to 'code'. Now that we're > adding additional options, fix that. And why is that at the end of the series instead of being the first patch? Thanks, tglx
[PATCH v15 9/9] x86/arch_prctl: Rename 'code' argument to 'option'
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 | 2 +- arch/x86/include/asm/proto.h | 4 ++-- arch/x86/kernel/process.c | 4 ++-- arch/x86/kernel/process_32.c | 4 ++-- arch/x86/kernel/process_64.c | 14 +++--- arch/x86/um/asm/ptrace.h | 2 +- arch/x86/um/os-Linux/prctl.c | 4 ++-- arch/x86/um/syscalls_32.c | 2 +- arch/x86/um/syscalls_64.c | 13 +++-- include/linux/compat.h| 2 +- tools/testing/selftests/x86/cpuid_fault.c | 4 ++-- 11 files changed, 28 insertions(+), 27 deletions(-) diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h index 2b47e0e8d414..fbabca435e7f 100644 --- a/arch/um/include/shared/os.h +++ b/arch/um/include/shared/os.h @@ -298,17 +298,17 @@ extern void os_set_ioignore(void); /* sigio.c */ extern int add_sigio_fd(int fd); 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 *arg2); +extern int os_arch_prctl(int pid, int option, unsigned long *arg2); /* tty.c */ extern int get_pty(void); /* sys-$ARCH/task_size.c */ extern unsigned long os_get_top_address(void); long syscall(long number, ...); diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h index 99836d9a893a..8d3964fc5f91 100644 --- a/arch/x86/include/asm/proto.h +++ b/arch/x86/include/asm/proto.h @@ -4,17 +4,17 @@ #include /* misc architecture specific prototypes */ void syscall_init(void); #ifdef CONFIG_X86_64 void entry_SYSCALL_64(void); -long do_arch_prctl_64(struct task_struct *task, int code, unsigned long arg2); +long do_arch_prctl_64(struct task_struct *task, int option, unsigned long arg2); #endif #ifdef CONFIG_X86_32 void entry_INT80_32(void); void entry_SYSENTER_32(void); void __begin_SYSENTER_singlestep_region(void); void __end_SYSENTER_singlestep_region(void); #endif @@ -26,12 +26,12 @@ void entry_SYSCALL_compat(void); void entry_INT80_compat(void); #endif void x86_configure_nx(void); void x86_report_nx(void); extern int reboot_force; -long do_arch_prctl_common(struct task_struct *task, int code, +long do_arch_prctl_common(struct task_struct *task, int option, unsigned long cpuid_enabled); #endif /* _ASM_X86_PROTO_H */ diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 37b512493b25..0bb88428cbf2 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -612,20 +612,20 @@ unsigned long get_wchan(struct task_struct *p) fp = READ_ONCE_NOCHECK(*(unsigned long *)fp); } while (count++ < 16 && p->state != TASK_RUNNING); out: put_task_stack(p); return ret; } -long do_arch_prctl_common(struct task_struct *task, int code, +long do_arch_prctl_common(struct task_struct *task, int option, unsigned long cpuid_enabled) { - switch (code) { + switch (option) { case ARCH_GET_CPUID: return get_cpuid_mode(); case ARCH_SET_CPUID: return set_cpuid_mode(task, cpuid_enabled); } return -EINVAL; } diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index cead0bd41678..ff40e74c9181 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c @@ -302,12 +302,12 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) this_cpu_write(current_task, next_p); /* Load the Intel cache allocation PQR MSR. */ intel_rdt_sched_in(); return prev_p; } -SYSCALL_DEFINE2(arch_prctl, int, code, unsigned long, arg2) +SYSCALL_DEFINE2(arch_prctl, int, option, unsigned long, arg2) { - return do_arch_prctl_common(current, code, arg2); + return do_arch_prctl_common(current, option, arg2); } diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index e6749cb2c96d..ea1a6180bf39 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -543,23 +543,23 @@ static long prctl_map_vdso(const struct vdso_image *image, unsigned long addr) ret = map_vdso_once(image, addr); if (ret) return ret; return (long)image->size; } #endif -long do_arch_prctl_64(struct task_struct *task, int code, unsigned long arg2) +long do_arch_prctl_64(struct task_struct *task, int option, unsigned long arg2) { int ret = 0; int doit = task == current; int cpu; - switch (code) { + switch (option) { case ARCH_SET_GS: if (arg2 >= TASK_SIZE_MAX) return
[PATCH v15 9/9] x86/arch_prctl: Rename 'code' argument to 'option'
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 | 2 +- arch/x86/include/asm/proto.h | 4 ++-- arch/x86/kernel/process.c | 4 ++-- arch/x86/kernel/process_32.c | 4 ++-- arch/x86/kernel/process_64.c | 14 +++--- arch/x86/um/asm/ptrace.h | 2 +- arch/x86/um/os-Linux/prctl.c | 4 ++-- arch/x86/um/syscalls_32.c | 2 +- arch/x86/um/syscalls_64.c | 13 +++-- include/linux/compat.h| 2 +- tools/testing/selftests/x86/cpuid_fault.c | 4 ++-- 11 files changed, 28 insertions(+), 27 deletions(-) diff --git a/arch/um/include/shared/os.h b/arch/um/include/shared/os.h index 2b47e0e8d414..fbabca435e7f 100644 --- a/arch/um/include/shared/os.h +++ b/arch/um/include/shared/os.h @@ -298,17 +298,17 @@ extern void os_set_ioignore(void); /* sigio.c */ extern int add_sigio_fd(int fd); 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 *arg2); +extern int os_arch_prctl(int pid, int option, unsigned long *arg2); /* tty.c */ extern int get_pty(void); /* sys-$ARCH/task_size.c */ extern unsigned long os_get_top_address(void); long syscall(long number, ...); diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h index 99836d9a893a..8d3964fc5f91 100644 --- a/arch/x86/include/asm/proto.h +++ b/arch/x86/include/asm/proto.h @@ -4,17 +4,17 @@ #include /* misc architecture specific prototypes */ void syscall_init(void); #ifdef CONFIG_X86_64 void entry_SYSCALL_64(void); -long do_arch_prctl_64(struct task_struct *task, int code, unsigned long arg2); +long do_arch_prctl_64(struct task_struct *task, int option, unsigned long arg2); #endif #ifdef CONFIG_X86_32 void entry_INT80_32(void); void entry_SYSENTER_32(void); void __begin_SYSENTER_singlestep_region(void); void __end_SYSENTER_singlestep_region(void); #endif @@ -26,12 +26,12 @@ void entry_SYSCALL_compat(void); void entry_INT80_compat(void); #endif void x86_configure_nx(void); void x86_report_nx(void); extern int reboot_force; -long do_arch_prctl_common(struct task_struct *task, int code, +long do_arch_prctl_common(struct task_struct *task, int option, unsigned long cpuid_enabled); #endif /* _ASM_X86_PROTO_H */ diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 37b512493b25..0bb88428cbf2 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -612,20 +612,20 @@ unsigned long get_wchan(struct task_struct *p) fp = READ_ONCE_NOCHECK(*(unsigned long *)fp); } while (count++ < 16 && p->state != TASK_RUNNING); out: put_task_stack(p); return ret; } -long do_arch_prctl_common(struct task_struct *task, int code, +long do_arch_prctl_common(struct task_struct *task, int option, unsigned long cpuid_enabled) { - switch (code) { + switch (option) { case ARCH_GET_CPUID: return get_cpuid_mode(); case ARCH_SET_CPUID: return set_cpuid_mode(task, cpuid_enabled); } return -EINVAL; } diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index cead0bd41678..ff40e74c9181 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c @@ -302,12 +302,12 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) this_cpu_write(current_task, next_p); /* Load the Intel cache allocation PQR MSR. */ intel_rdt_sched_in(); return prev_p; } -SYSCALL_DEFINE2(arch_prctl, int, code, unsigned long, arg2) +SYSCALL_DEFINE2(arch_prctl, int, option, unsigned long, arg2) { - return do_arch_prctl_common(current, code, arg2); + return do_arch_prctl_common(current, option, arg2); } diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index e6749cb2c96d..ea1a6180bf39 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -543,23 +543,23 @@ static long prctl_map_vdso(const struct vdso_image *image, unsigned long addr) ret = map_vdso_once(image, addr); if (ret) return ret; return (long)image->size; } #endif -long do_arch_prctl_64(struct task_struct *task, int code, unsigned long arg2) +long do_arch_prctl_64(struct task_struct *task, int option, unsigned long arg2) { int ret = 0; int doit = task == current; int cpu; - switch (code) { + switch (option) { case ARCH_SET_GS: if (arg2 >= TASK_SIZE_MAX) return -EPERM;