Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp655805pxa; Tue, 11 Aug 2020 11:38:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMeRsIZ0GsFpbQ3uspDcAl5N9E7p4brrFbsPjRbYvCTXcbLQks9kd9TxtFj7esMy5yF2Jt X-Received: by 2002:a17:907:20b7:: with SMTP id pw23mr29093419ejb.148.1597171118800; Tue, 11 Aug 2020 11:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597171118; cv=none; d=google.com; s=arc-20160816; b=rMt1nJ8Qq0MjMBfug2Cj1vDiC+uM5mdstG+joknKvq8Lw+dIVhtI+LUyUCr2dIJLde zONdfu4bHoFXWdEDaym9uJYgTDR1LCoMQofqhqxF+bi8SNINenw9NcoJjFkaM42mrtC3 oR9zChb3K1XNKO8CpwgCfU3mGpfED0Rq4izoAgEayQijaAYDarIoBd5fVWr3Srtk8Iq9 t18cXrcYH5i44FdjB8gbfE7ETwBs4WXWFQrtGAOch7zqJqs0vE1N+wn0B8zc16qBTHdX wkFyKhXgfluv9CbQpE1VMUmgpO6tukQ4FUFla5ubU7dQUFO7T4tYrbRqxyRLXXDAWNzM P6Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from:reply-to:dmarc-filter :dkim-signature; bh=HLfx66Qfv2Fz/O1/H/r9cB91ctPu5jWiwIdXdnUxrZ8=; b=rc4fC/CDSD5RfU4NNW+pA7unwJ9kEbWkfY/xjURIptIs7krgeGNLdSRj0n6hMa03ip WgTF5mzdyYoyHl8kn/uIbTomyHWpqynlsnuknBhCkF7koPUXZNx4nRtFEbGe4wf5NSM3 4zhsz9r1piBCUVrk4IPXwq+ZKYekugKAZR9jt8ruNYhV3syqMLC/yWQ7nN2ocY6Y7pOX kOItpb4N0wt0c73F7vjxLhXflPdRGuwwUzPXeZrQ6GSKxx+4+CWFjciaH+3RxeyXBqWp Zdys0KPrjdKnFt5MIoXYAYWOA+o2MFBdhjsEtnr4rJS7LWd+K5qsqmchQgEp96aNPGxT J/4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="AuEf7/08"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z12si13918056edp.120.2020.08.11.11.38.16; Tue, 11 Aug 2020 11:38:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="AuEf7/08"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726488AbgHKSf2 (ORCPT + 99 others); Tue, 11 Aug 2020 14:35:28 -0400 Received: from mail29.static.mailgun.info ([104.130.122.29]:34957 "EHLO mail29.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726127AbgHKSf1 (ORCPT ); Tue, 11 Aug 2020 14:35:27 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1597170927; h=Content-Transfer-Encoding: Content-Type: MIME-Version: Message-ID: Date: Subject: In-Reply-To: References: Cc: To: From: Reply-To: Sender; bh=HLfx66Qfv2Fz/O1/H/r9cB91ctPu5jWiwIdXdnUxrZ8=; b=AuEf7/08/pQCsprI3beHNCS+QsYPMS6YdWsyB0wHYbjwIUUqbfEox6n5wZtoa5gApSMA9A9X IqoLNX8fu4GyiRqtpBVa6hEFUCIB130LMode/WxNQHGdQMT7Mghe+gnVX+K1X6wAAgW8sv6P 8KujHBTPDqbrOOlfTpIXhkw1PAM= X-Mailgun-Sending-Ip: 104.130.122.29 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n13.prod.us-east-1.postgun.com with SMTP id 5f32e4ee856720175157cf0d (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 11 Aug 2020 18:35:26 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 20066C433CB; Tue, 11 Aug 2020 18:35:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from BCAIN (104-54-226-75.lightspeed.austtx.sbcglobal.net [104.54.226.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bcain) by smtp.codeaurora.org (Postfix) with ESMTPSA id A1525C433C9; Tue, 11 Aug 2020 18:35:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A1525C433C9 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=bcain@codeaurora.org Reply-To: From: "Brian Cain" To: "'Al Viro'" , "'Linus Torvalds'" Cc: , , "'David Miller'" , "'Tony Luck'" , "'Will Deacon'" References: <20200629182349.GA2786714@ZenIV.linux.org.uk> <20200629182628.529995-1-viro@ZenIV.linux.org.uk> <20200629182628.529995-33-viro@ZenIV.linux.org.uk> In-Reply-To: <20200629182628.529995-33-viro@ZenIV.linux.org.uk> Subject: RE: [PATCH 33/41] hexagon: switch to ->get2() Date: Tue, 11 Aug 2020 13:35:23 -0500 Message-ID: <038001d6700e$2da6af80$88f40e80$@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQEanwUtOMewLvTwAuMraiGO5PXRUAF01hBRAYLg5auqkyCGQA== Content-Language: en-us Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: linux-arch-owner@vger.kernel.org > On Behalf Of Al Viro Acked-by: Brian Cain > From: Al Viro > > Signed-off-by: Al Viro > --- > arch/hexagon/kernel/ptrace.c | 62 +++++++++++++++----------------------------- > 1 file changed, 21 insertions(+), 41 deletions(-) > > diff --git a/arch/hexagon/kernel/ptrace.c b/arch/hexagon/kernel/ptrace.c index > dcbf7ea960cc..fa6287d1a061 100644 > --- a/arch/hexagon/kernel/ptrace.c > +++ b/arch/hexagon/kernel/ptrace.c > @@ -35,58 +35,38 @@ void user_disable_single_step(struct task_struct *child) > > static int genregs_get(struct task_struct *target, > const struct user_regset *regset, > - unsigned int pos, unsigned int count, > - void *kbuf, void __user *ubuf) > + srtuct membuf to) > { > - int ret; > - unsigned int dummy; > struct pt_regs *regs = task_pt_regs(target); > > - > - if (!regs) > - return -EIO; > - > /* The general idea here is that the copyout must happen in > * exactly the same order in which the userspace expects these > * regs. Now, the sequence in userspace does not match the > * sequence in the kernel, so everything past the 32 gprs > * happens one at a time. > */ > - ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, > - ®s->r00, 0, 32*sizeof(unsigned long)); > - > -#define ONEXT(KPT_REG, USR_REG) \ > - if (!ret) \ > - ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, \ > - KPT_REG, offsetof(struct user_regs_struct, USR_REG), > \ > - offsetof(struct user_regs_struct, USR_REG) + \ > - sizeof(unsigned long)); > - > + membuf_write(&to, ®s->r00, 32*sizeof(unsigned long)); > /* Must be exactly same sequence as struct user_regs_struct */ > - ONEXT(®s->sa0, sa0); > - ONEXT(®s->lc0, lc0); > - ONEXT(®s->sa1, sa1); > - ONEXT(®s->lc1, lc1); > - ONEXT(®s->m0, m0); > - ONEXT(®s->m1, m1); > - ONEXT(®s->usr, usr); > - ONEXT(®s->preds, p3_0); > - ONEXT(®s->gp, gp); > - ONEXT(®s->ugp, ugp); > - ONEXT(&pt_elr(regs), pc); > - dummy = pt_cause(regs); > - ONEXT(&dummy, cause); > - ONEXT(&pt_badva(regs), badva); > + membuf_store(&to, regs->sa0); > + membuf_store(&to, regs->lc0); > + membuf_store(&to, regs->sa1); > + membuf_store(&to, regs->lc1); > + membuf_store(&to, regs->m0); > + membuf_store(&to, regs->m1); > + membuf_store(&to, regs->usr); > + membuf_store(&to, regs->p3_0); > + membuf_store(&to, regs->gp); > + membuf_store(&to, regs->ugp); > + membuf_store(&to, pt_elr(regs)); // pc > + membuf_store(&to, (unsigned long)pt_cause(regs)); // cause > + membuf_store(&to, pt_badva(regs)); // badva > #if CONFIG_HEXAGON_ARCH_VERSION >=4 > - ONEXT(®s->cs0, cs0); > - ONEXT(®s->cs1, cs1); > + membuf_store(&to, regs->cs0); > + membuf_store(&to, regs->cs1); > + return membuf_zero(&to, sizeof(unsigned long)); #else > + return membuf_zero(&to, 3 * sizeof(unsigned long)); > #endif > - > - /* Pad the rest with zeros, if needed */ > - if (!ret) > - ret = user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf, > - offsetof(struct user_regs_struct, > pad1), -1); > - return ret; > } > > static int genregs_set(struct task_struct *target, @@ -159,7 +139,7 @@ static > const struct user_regset hexagon_regsets[] = { > .n = ELF_NGREG, > .size = sizeof(unsigned long), > .align = sizeof(unsigned long), > - .get = genregs_get, > + .get2 = genregs_get, > .set = genregs_set, > }, > }; > -- > 2.11.0