From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 587ACC433DF for ; Tue, 30 Jun 2020 13:16:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 39D1F206BE for ; Tue, 30 Jun 2020 13:16:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729083AbgF3NQ4 (ORCPT ); Tue, 30 Jun 2020 09:16:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726008AbgF3NQu (ORCPT ); Tue, 30 Jun 2020 09:16:50 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BE7FC061755; Tue, 30 Jun 2020 06:16:49 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jqG7s-002o2d-Hl; Tue, 30 Jun 2020 13:16:40 +0000 Date: Tue, 30 Jun 2020 14:16:40 +0100 From: Al Viro To: Linus Torvalds Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, David Miller , Tony Luck , Will Deacon Subject: Re: [PATCH 22/41] sparc: switch to ->get2() Message-ID: <20200630131640.GE2786714@ZenIV.linux.org.uk> References: <20200629182349.GA2786714@ZenIV.linux.org.uk> <20200629182628.529995-1-viro@ZenIV.linux.org.uk> <20200629182628.529995-22-viro@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200629182628.529995-22-viro@ZenIV.linux.org.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 29, 2020 at 07:26:09PM +0100, Al Viro wrote: > static int getregs64_get(struct task_struct *target, > const struct user_regset *regset, > - unsigned int pos, unsigned int count, > - void *kbuf, void __user *ubuf) > + struct membuf to) > { > const struct pt_regs *regs = task_pt_regs(target); > - int ret; > > if (target == current) > flushw_user(); > > - ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, > - regs->u_regs + 1, > - 0, 15 * sizeof(u64)); > - if (!ret) > - ret = user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf, > - 15 * sizeof(u64), 16 * sizeof(u64)); > - if (!ret) { > - /* TSTATE, TPC, TNPC */ > - ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, > - ®s->tstate, > - 16 * sizeof(u64), > - 19 * sizeof(u64)); > - } > - if (!ret) { > - unsigned long y = regs->y; > - > - ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf, > - &y, > - 19 * sizeof(u64), > - 20 * sizeof(u64)); > - } > - return ret; > + membuf_write(&to, regs->u_regs + 1, 15 * sizeof(u64)); > + return membuf_store(&to, (u64)0); ^^^^^^ Er... That should be simply + membuf_store(&to, (u64)0); > + membuf_write(&to, ®s->tstate, 3 * sizeof(u64)); > + return membuf_store(&to, (u64)regs->y); > }