Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp4039354pxb; Fri, 11 Feb 2022 13:41:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJx6GYw/BHFay3xx434At1Z7CtZtuSeCT5gsLSMdy7Cauo8txsyIWu96u3IWHTc6VEBhPfql X-Received: by 2002:a05:6402:26c7:: with SMTP id x7mr3977024edd.151.1644615662067; Fri, 11 Feb 2022 13:41:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644615662; cv=none; d=google.com; s=arc-20160816; b=n2TEj6K/B+wek3hzJPNvZyFtGH6sJCEjUoW5GKCUi0p0dNSoX+DRQjg2N9hK5dSazs xYG7+LC8fw/WOKgUFMwcNR4rIFHpXRvR2dQuGfLvwD+lO/+KaimBD8jDq5qHbq0VNU6y NKnfh7031rT8inX8+9jd/UbfxH05uSf/DyktOL8gdEQNRk0a10lzzYiMZEUVzx4hfFKL lmxzG3izy5kEWapHTpPhBQznKCM8iF1CRq4+9dzN/KxrydysWiQ0YS9S4YQe/D3i9hXC RYOYtfayJycEo3Rj6Pksj2RlBYJmfTsHoDotrOfwzLnNrE8UKKlXSJDu+SXGCxxgATze XksQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=IWZrSiXe1t7cJ6gf91kAYaCmZHHj4qhkSZOIEo/r/F4=; b=pIGCY0JtKBl1SApYS6eYWg3AgKIIr+7rZH/egHKAzHzzjWFEHUOcC7HLkiPCnkvEeP MrTzuyEXd9qT7jPp709BUJEAAGoTwWm0ms47oazdhHGBYN8RZkZ1FFv4BQRFnocp1TeM SymQksjEaMtnrafS2dgSyMTZq5DDAADf7hKtpz1Sk554s455rtkRsCbqi6EDjNdFYNm9 wALhlWEvlkWuOrOL4vAj7m07PunRQIymnLdaNp9ws2IEcnwWB+7IIZTNkD/8+XJDviIM jhAMlqlMj35mx58FMWilVaUBk2Ysxhb+E02Dt5dQ7rJxS8TR+JUW7d1+yVchvpKwckRh +EKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fDR5hskT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s1si19406505ejn.293.2022.02.11.13.40.37; Fri, 11 Feb 2022 13:41:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fDR5hskT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351857AbiBKRAH (ORCPT + 99 others); Fri, 11 Feb 2022 12:00:07 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:56608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240642AbiBKRAG (ORCPT ); Fri, 11 Feb 2022 12:00:06 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABE521A1; Fri, 11 Feb 2022 09:00:04 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5FDE4B82AF0; Fri, 11 Feb 2022 17:00:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E6E1C340ED; Fri, 11 Feb 2022 17:00:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644598802; bh=PH5ZGu/nOfR4rtVzTmQgDEFh7VhP/oNa2KDW9GMa1ZM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=fDR5hskTdsFn2goxIW3SnqXMDJUTstEauOnVedYwYL+XdFOFSHGfIgJrnY1Do2R8N 37IypVbzdLQMo9gTNGJOZxd9CN61Nxd8CbmllN1KZ2+yWhNA0qbQRk2cfYbsnzqsbx G2O7cX+ZN3yTppVLTwlKrzGktrikR/FfaZdyOd9gqtPYf89BEnwTzLiO5F8xDCKZDX 3tHPe4bsLRdLrAjIJjIIi5/zPlM2J+Gclzfv2o9QyUjzbySF8KgdRfRb50meHSM2AJ Xb8Ypw7UJFC3NgUqNbUYPk6sUwhx8o2EOpslc9lrxce98b9lZPGGrOY7HmS+DzTd27 fOg09vYrZy+QA== Received: by mail-wr1-f41.google.com with SMTP id j26so5445113wrb.7; Fri, 11 Feb 2022 09:00:01 -0800 (PST) X-Gm-Message-State: AOAM532WJU/DdZn6n2Q/kz0fbhCGYhb7aF9KsyrvlZ8/EvSoA4iIznj0 XJzVPHXG5DOI/33/KisCfIAc/rJROlJnAjV1wnQ= X-Received: by 2002:adf:e5ce:: with SMTP id a14mr2018413wrn.317.1644598800242; Fri, 11 Feb 2022 09:00:00 -0800 (PST) MIME-Version: 1.0 References: <20220117132757.1881981-1-arnd@kernel.org> <126ae5ee-342c-334c-9c07-c00213dd7b7e@xilinx.com> In-Reply-To: From: Arnd Bergmann Date: Fri, 11 Feb 2022 17:59:44 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] microblaze: remove CONFIG_SET_FS To: Stafford Horne Cc: Michal Simek , Linux-Arch , LKML , Christoph Hellwig , "Eric W . Biederman" , Al Viro , Linus Torvalds , Arnd Bergmann , Geert Uytterhoeven , "Peter Zijlstra (Intel)" , Catalin Marinas , Mark Rutland Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 11, 2022 at 1:17 AM Stafford Horne wrote: > On Thu, Feb 10, 2022 at 08:31:05AM +0900, Stafford Horne wrote: > > > Looking at it again, I wonder if it would help to use the __get_kernel_nofault() > > > and __get_kernel_nofault() helpers as the default in > > > include/asm-generic/uaccess.h. > > > > That would make sense. Perhaps also the __range_ok() function from OpenRISC > > could move there as I think other architectures would also want to use that. I have now uploaded a cleanup series to https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/log/?h=set_fs This uses the same access_ok() function across almost all architectures, with the exception of those that need something else, and I then I went further and killed off set_fs for everything other than ia64. > > > I see it's identical to the openrisc version and would probably be the same > > > for some of the other architectures that have no other use for > > > set_fs(). That may > > > help to do a bulk remove of set_fs for alpha, arc, csky, h8300, hexagon, nds32, > > > nios2, um and extensa, leaving only ia64, sparc and sh. > > > > If you could add it into include/asm-generic/uaccess.h I can test changing my > > patch to use it. > > Note, I would be happy to do the work to move these into include/asm-generic/uaccess.h. > But as I see it the existing include/asm-generic/uaccess.h is for NOMMU. How > should we go about having an MMU and NOMMU version? Should we move uaccess.h to > uaccess-nommu.h? Or add more ifdefs to uaccess.h? There are two parts of asm-generic/uaccess.h: - the CONFIG_UACCESS_MEMCPYsection is fundamentally limited to nommu targets and cannot be shared. Similarly, targets with an MMU must use a custom implementation to get the correct fixups. - the put_user/get_user implementation is fairly dumb, you can use these to avoid having your own ones, but you still need copy_{to,from}_user, and a custom implementation tends to produce better code. So chances are that you won't want to use either one. In my new branch, I added the common helpers to linux/uaccess.h and asm-generic/access-ok.h, respectively, both of which are used everywhere now. Arnd