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 99D4BC433E0 for ; Mon, 29 Jun 2020 20:30:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 81D5C2067D for ; Mon, 29 Jun 2020 20:30:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726931AbgF2Uaq (ORCPT ); Mon, 29 Jun 2020 16:30:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730127AbgF2Uah (ORCPT ); Mon, 29 Jun 2020 16:30:37 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90E53C061755; Mon, 29 Jun 2020 13:30:36 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jq0Q8-002Jaj-5k; Mon, 29 Jun 2020 20:30:28 +0000 Date: Mon, 29 Jun 2020 21:30:28 +0100 From: Al Viro To: Linus Torvalds Cc: linux-arch , Linux Kernel Mailing List , David Miller , Tony Luck , Will Deacon Subject: Re: [PATCH 18/41] regset: new method and helpers for it Message-ID: <20200629203028.GB2786714@ZenIV.linux.org.uk> References: <20200629182349.GA2786714@ZenIV.linux.org.uk> <20200629182628.529995-1-viro@ZenIV.linux.org.uk> <20200629182628.529995-18-viro@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 12:23:34PM -0700, Linus Torvalds wrote: > On Mon, Jun 29, 2020 at 11:28 AM Al Viro wrote: > > > > ->get2() takes task+regset+buffer, returns the amount of free space > > left in the buffer on success and -E... on error. > > Can we please give it a better name than "get2"? > > That's not a great name to begin with, and it's a completely > nonsensical name by the end of this series when you've removed the > original "get" function. > > So either: > > (a) add one final patch to rename "get2" all back to "get" after you > got rid of the old "get" Bad idea, IMO... > (b) or just call it something better to begin with. Maybe just > "get_regset" instead? Frankly, other field names there are also nasty - 'set' is not fun to grep for, but there are 'n' and 'size' as well. There's also 'bias' and 'align' (both completely unused)... > I'd prefer (b) just because I think it will be a lot clearer if we > ever end up having old patches forward-ported (or, more likely, > newpatches back-ported), so having a "get" function that changed > semantics but got back the old name sounds bad to me. > > Other than that, I can't really argue with the numbers: > > 41 files changed, 1368 insertions(+), 2347 deletions(-) > > looks good to me, and the code seems more understandable. FWIW, there's also ->set() side of that thing. Tons of boilerplate in those; I hadn't seriously looked into that part, but I suspect that "do copyin in the caller, pass the kernel buffer to the method, always start at offset 0" would also trim a lot of crap. I'd rather leave that one for later - this series had been painful enough. Other things in the same area: conversion of fdpic coredumps to regset (fairly easy, I've a patch series doing that in the local tree), conversion of the few remaining non-regset architectures to regset-based coredump (kill a large chunk of rotting code in fs/binfmt_elf.c, along with quite a few pieces of old per-arch coredump helpers), unification of compat ELF (done locally, mipsn32/mipso32 gone, all compat done via compat_binfmt_elf.c, x32 horrors sanitized - IMO #define PRSTATUS_SIZE \ (test_thread_flag(TIF_X32) \ ? sizeof(struct compat_elf_prstatus) \ : sizeof(struct i386_elf_prstatus)) #define SET_PR_FPVALID(S) \ (*(test_thread_flag(TIF_X32) \ ? &(S)->pr_fpvalid \ : &((struct i386_elf_prstatus *)(S))->pr_fpvalid) = 1) is much better than #define PRSTATUS_SIZE(S, R) (R != sizeof(S.pr_reg) ? 144 : 296) #define SET_PR_FPVALID(S, V, R) \ do { *(int *) (((void *) &((S)->pr_reg)) + R) = (V); } \ while (0) ) and a bunch of assorted cleanups that got trimmed from the regset series... I'll probably post fdpic and compat series tonight and get back to uaccess and VFS stuff.