From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH v6 22/36] nds32: Debugging support Date: Thu, 18 Jan 2018 11:37:02 +0100 Message-ID: References: <65ae3b5b7eabe8680857b1821c72127f611c950b.1515766253.git.green.hu@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: <65ae3b5b7eabe8680857b1821c72127f611c950b.1515766253.git.green.hu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Greentime Hu Cc: Greentime , Linux Kernel Mailing List , linux-arch , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring , Networking , Vincent Chen , DTML , Al Viro , David Howells , Will Deacon , Daniel Lezcano , linux-serial-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Geert Uytterhoeven , Linus Walleij , Mark Rutland , Greg KH , Guo Ren List-Id: linux-arch.vger.kernel.org On Mon, Jan 15, 2018 at 6:53 AM, Greentime Hu wrote: > From: Greentime Hu > > This patch adds ptrace support. > > Signed-off-by: Vincent Chen > Signed-off-by: Greentime Hu I must have missed this patch earlier, unfortunately I don't think this is ready: > +long arch_ptrace(struct task_struct *child, long request, unsigned long addr, > + unsigned long data) > +{ > + int ret; > + > + switch (request) { > + case PTRACE_PEEKUSR: > + ret = > + ptrace_read_user(child, addr, (unsigned long __user *)data); > + break; > + > + case PTRACE_POKEUSR: > + ret = ptrace_write_user(child, addr, data); > + break; > + > + case PTRACE_GETREGS: > + ret = ptrace_getregs(child, (void __user *)data); > + break; > + > + case PTRACE_SETREGS: > + ret = ptrace_setregs(child, (void __user *)data); > + break; > + > + case PTRACE_GETFPREGS: > + ret = ptrace_getfpregs(child, (void __user *)data); > + break; > + > + case PTRACE_SETFPREGS: > + ret = ptrace_setfpregs(child, (void __user *)data); > + break; > + > + default: > + ret = ptrace_request(child, request, addr, data); > + break; > + } > + > + return ret; > +} It appears that you are implementing the old-style ptrace handling with architecture specific commands. Please have a look at how this is done in risc-v or arm64. If this takes more too much time to address, I'd suggest using an empty stub function for sys_ptrace and adding it back at a later point, but not send the current version upstream. Arnd -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f65.google.com ([209.85.218.65]:45963 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754759AbeARKhD (ORCPT ); Thu, 18 Jan 2018 05:37:03 -0500 MIME-Version: 1.0 In-Reply-To: <65ae3b5b7eabe8680857b1821c72127f611c950b.1515766253.git.green.hu@gmail.com> References: <65ae3b5b7eabe8680857b1821c72127f611c950b.1515766253.git.green.hu@gmail.com> From: Arnd Bergmann Date: Thu, 18 Jan 2018 11:37:02 +0100 Message-ID: Subject: Re: [PATCH v6 22/36] nds32: Debugging support Content-Type: text/plain; charset="UTF-8" Sender: linux-arch-owner@vger.kernel.org List-ID: To: Greentime Hu Cc: Greentime , Linux Kernel Mailing List , linux-arch , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring , Networking , Vincent Chen , DTML , Al Viro , David Howells , Will Deacon , Daniel Lezcano , linux-serial@vger.kernel.org, Geert Uytterhoeven , Linus Walleij , Mark Rutland , Greg KH , Guo Ren , Randy Dunlap , David Miller , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Vincent Chen Message-ID: <20180118103702.2Fl-b-p4nEMFEkVgk2u2x-xVqPhM0fcJtcghU39siWg@z> On Mon, Jan 15, 2018 at 6:53 AM, Greentime Hu wrote: > From: Greentime Hu > > This patch adds ptrace support. > > Signed-off-by: Vincent Chen > Signed-off-by: Greentime Hu I must have missed this patch earlier, unfortunately I don't think this is ready: > +long arch_ptrace(struct task_struct *child, long request, unsigned long addr, > + unsigned long data) > +{ > + int ret; > + > + switch (request) { > + case PTRACE_PEEKUSR: > + ret = > + ptrace_read_user(child, addr, (unsigned long __user *)data); > + break; > + > + case PTRACE_POKEUSR: > + ret = ptrace_write_user(child, addr, data); > + break; > + > + case PTRACE_GETREGS: > + ret = ptrace_getregs(child, (void __user *)data); > + break; > + > + case PTRACE_SETREGS: > + ret = ptrace_setregs(child, (void __user *)data); > + break; > + > + case PTRACE_GETFPREGS: > + ret = ptrace_getfpregs(child, (void __user *)data); > + break; > + > + case PTRACE_SETFPREGS: > + ret = ptrace_setfpregs(child, (void __user *)data); > + break; > + > + default: > + ret = ptrace_request(child, request, addr, data); > + break; > + } > + > + return ret; > +} It appears that you are implementing the old-style ptrace handling with architecture specific commands. Please have a look at how this is done in risc-v or arm64. If this takes more too much time to address, I'd suggest using an empty stub function for sys_ptrace and adding it back at a later point, but not send the current version upstream. Arnd