From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 In-Reply-To: <20160921185824.18980-4-khuey@kylehuey.com> References: <20160921185824.18980-1-khuey@kylehuey.com> <20160921185824.18980-4-khuey@kylehuey.com> From: Andy Lutomirski Date: Thu, 22 Sep 2016 15:19:09 -0700 Message-ID: Subject: Re: [PATCH v5 3/6] x86/arch_prctl Add a new do_arch_prctl Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org To: Kyle Huey Cc: Robert O'Callahan , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , X86 ML , Jeff Dike , Richard Weinberger , Andy Lutomirski , Borislav Petkov , Dmitry Safonov , Dave Hansen , Peter Zijlstra , Boris Ostrovsky , Alexander Viro , Shuah Khan , Len Brown , "Rafael J . Wysocki" , Srinivas Pandruvada , "linux-kernel@vger.kernel.org" , "user-mode-linux-devel@lists.sourceforge.net" , "open list:USER-MODE LINUX (UML)" , "open list:KERNEL SELFTEST FRAMEWORK" , Linux API List-ID: On Wed, Sep 21, 2016 at 11:58 AM, Kyle Huey wrote: > Add a new do_arch_prctl to handle arch_prctls that are not specific to 64 > bits. Call it from the syscall entry point, but not any of the other > callsites in the kernel, which all want one of the existing 64 bit only > arch_prctls. > > Signed-off-by: Kyle Huey > --- > arch/x86/include/asm/proto.h | 1 + > arch/x86/kernel/process.c | 5 +++++ > arch/x86/kernel/process_64.c | 8 +++++++- > 3 files changed, 13 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h > index 95c3e51..94a57cc 100644 > --- a/arch/x86/include/asm/proto.h > +++ b/arch/x86/include/asm/proto.h > @@ -30,6 +30,7 @@ void x86_report_nx(void); > > extern int reboot_force; > > +long do_arch_prctl(struct task_struct *task, int code, unsigned long arg2); > #ifdef CONFIG_X86_64 > long do_arch_prctl_64(struct task_struct *task, int code, unsigned long arg2); > #endif > diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c > index 62c0b0e..97aa104 100644 > --- a/arch/x86/kernel/process.c > +++ b/arch/x86/kernel/process.c > @@ -567,3 +567,8 @@ unsigned long get_wchan(struct task_struct *p) > } while (count++ < 16 && p->state != TASK_RUNNING); > return 0; > } > + > +long do_arch_prctl(struct task_struct *task, int code, unsigned long arg2) > +{ > + return -EINVAL; > +} This should be do_arch_prctl_common or similar to avoid confusion. P.S. The subject should be "x86/arch_prctl: ...".