Received: by 10.223.176.46 with SMTP id f43csp3844556wra; Mon, 22 Jan 2018 23:28:51 -0800 (PST) X-Google-Smtp-Source: AH8x224CZSrbnD0BCeocTP95mnWlabtboe2kRLCdWzjEn0/h1i8sv9fpWUn56F7Yo8piM69w6eIq X-Received: by 2002:a17:902:5c6:: with SMTP id f64-v6mr4722886plf.266.1516692531233; Mon, 22 Jan 2018 23:28:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516692531; cv=none; d=google.com; s=arc-20160816; b=G+fQcp10rkeLews1AGh6nOuTwte10/mCpsEUL61e8rlF9wAoPmbOE413OOdNC3EKO8 qZVpJJn2yAjh+6l3mxzXFcMaXH1J2tbsGz72aGPmjOtnw4rowSki9Bvyz6f76Xz56uSp vLvoV1+f31nWbfh46BxIvVi+sMCZSW3oeV03jbd9vjdjtZh0cICDxkpxvbjoI8zxpLB+ LsSFcDIwfUt2aLvzSsDW1cgjBV3AU5xvtlp3EXNBMrpqBogtt79pjKoTNP4gdyRuFy9C 2RORupM+dqOduwbRXmi5sykNuIfqHdh/9Ye065kKdj2ljXYmM8/gJ6XhbEBgZyBoOwWe JbAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=J3xE/vFaxQGanwpKn+lAd2tVivXqo72pQAo1os8UjDM=; b=N5XChfd5Z/JwXKekM8Kc/Rg4AOGacsKn6/p/W2e4G6Mn5TS6UNGlMVXonlhZV4eeHy Dr7HJZMVPmqeG7aTVcmGIpbNTWP1tBzSv9PiUJvgSv3csML2vx49Z/jxiAlOqGviDN2H VStfPghrRg4VTmn8NXU2L21XtUWHRTCfbf8OTlKoFHFCRi06kl8slXBS8gfHeE16BfeD 2vrxWm6UaO0MTezSq79hr1iLzjLweLVgMd8qBzQIQmlt8GY7PZ6KJawhdeE8yH4BYAuc g7j7D0fhLA2tKlG7g1OXr0UukwZefryLdkjD8owYrfS8A5xWiVl2YjRqdWelyBdr+UEx isEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GoN9qlHZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2-v6si4391967plk.478.2018.01.22.23.28.37; Mon, 22 Jan 2018 23:28:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GoN9qlHZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751191AbeAWH2M (ORCPT + 99 others); Tue, 23 Jan 2018 02:28:12 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:34633 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751111AbeAWH2I (ORCPT ); Tue, 23 Jan 2018 02:28:08 -0500 Received: by mail-it0-f65.google.com with SMTP id m11so14199998iti.1; Mon, 22 Jan 2018 23:28:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=J3xE/vFaxQGanwpKn+lAd2tVivXqo72pQAo1os8UjDM=; b=GoN9qlHZN7/EUyehMI7ihMr7Z2xDDri8JC9qhZHBR2sIYTP/koW1Za5qquZi/CiRuC Bx2aG7Vkl7QgDbQ1UDwKM8HzS9VONPpUryFWbAHMvLiD7FFF3gckswapUzlWc07ZLs9l J6ZJ27trWcIb2gBcSITg4VCUKLxj2ZoSPB3rg4gRdiAFWp7ALaGONAEbyvYxu/8G103c nn2H/xLVam/UnDHHdKe6QszytrUGpJ20A26qql2ZC50Tj4UY9KsW23u5jvYwG36Cc/Vf 5kcHsoojpxHnH39z9yTF/prVsInmilazh2Dyzm282FRbzp/PtivHwEm05hbH0Ie7e8gZ 7qmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=J3xE/vFaxQGanwpKn+lAd2tVivXqo72pQAo1os8UjDM=; b=fvfTWMVhf+Ki4Y9No3VOoignyojI8rDYjxWd5X8BaMFm64zsF0lN0sgomQfditnjaJ Nlp9xdwqXbZp563KRtyYW5AHD2FfyBa34QixNfDTkFX3adjVHWFv+E6f4NwuBvaU1/fa dHRScVW+4divgbzta6zZXh6gSmg5P6ApKu+sZJCSVWhV6fJ80kYHHJVDmI+5U4XMq6QO 9wbT7Vpk18xxWN/P7iVZba8oDl8A1pTav4XZF0LyTvm4JwJNLb9U22AmVCR0UTf8EEXT jWPENcTkGbVrZcFt/u+tWhHrlRqrUVzYDjVKLP3CCVjUDzXdlbwH+mupTRC1INmP9VwA iTbg== X-Gm-Message-State: AKwxytcJgVv5sAmNDRovO/bAaASrMg2QB+AkPdQQsJIXmd7aLt8rvzic SC74w0d2f0WKwfN7Vab6+V1+gqAfiGBDDxMHupU= X-Received: by 10.36.172.6 with SMTP id s6mr2522308ite.88.1516692487742; Mon, 22 Jan 2018 23:28:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.175.34 with HTTP; Mon, 22 Jan 2018 23:28:07 -0800 (PST) In-Reply-To: References: <65ae3b5b7eabe8680857b1821c72127f611c950b.1515766253.git.green.hu@gmail.com> From: Vincent Chen Date: Tue, 23 Jan 2018 15:28:07 +0800 Message-ID: Subject: Re: [PATCH v6 22/36] nds32: Debugging support To: Arnd Bergmann Cc: Greentime Hu , Greentime , Linux Kernel Mailing List , linux-arch , Thomas Gleixner , Jason Cooper , Marc Zyngier , Rob Herring , Networking , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-01-18 18:37 GMT+08:00 Arnd Bergmann : > 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 Dear Arnd: Thanks for your comments. After referring to risc-v and arm64, I realize that PTRACE_GETREGSET and PTRACE_SETREGSET is used to replace arch specific command. The needed port for the two ptrace commands had done in current version patch. Could I keep them and just removing the code for old-style ptrace handling in the next version patch? Thanks Vincent