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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E9AAC433FE for ; Tue, 15 Feb 2022 13:17:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238180AbiBONR0 (ORCPT ); Tue, 15 Feb 2022 08:17:26 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:48250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238160AbiBONRV (ORCPT ); Tue, 15 Feb 2022 08:17:21 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 394D2D10A6; Tue, 15 Feb 2022 05:17:11 -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 D2493B819C2; Tue, 15 Feb 2022 13:17:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75858C340FA; Tue, 15 Feb 2022 13:17:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644931028; bh=yV4ORJd5b6IZao4Zu1H2u9bAD/0nkvfeGMC8j+boEO0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Y1UbQDYKVd/W55uCfVo2WGlgo3dfDZUC0yTFtlZUY0DOBzt83pgV9/7gMxh05e3AH lgukd8DqmxPwxja7mK4vtMYnDC6X4AvagIoktla5uPG7vSSfPBtEQFLrXn9FMcdgHH E1qEJeHLjvJUuBL6dqkrwsbxdH4jW8atiF/scjZBMC9lLF7Ype1WGnPRnqUer24JD8 tu4gGKuwZtD0+Nibza1Ys9PPtyZzsqg7g90GGNebDRKc+NU4HRCxVmDtvM0+9S5mSP qhfZT5HIgJ8aWSTxW8hfUnfgxShZHe3y/AzzhEX87Jyr/ToKwZr4yc1EXWSuI0q6BQ u0/dxkrR5dDfA== Received: by mail-wm1-f52.google.com with SMTP id l67-20020a1c2546000000b00353951c3f62so1379952wml.5; Tue, 15 Feb 2022 05:17:08 -0800 (PST) X-Gm-Message-State: AOAM531nWLz2K8rL/bc46tYq+Deksn/ZiXUMR8HxJ4KV/G/F9pyHwQOj z0x5V3QvmmSWc4VSjahm5CFqvuHjNvNkD91335I= X-Google-Smtp-Source: ABdhPJzhbiTSvbv50mQWSJ7smaLZnr2q978YJ0F6+MeQ3SrwEp5s0NrkvRE5+WnWUVexqYiFblH5E9BGGqHgxsxWGyI= X-Received: by 2002:a05:600c:4ecb:: with SMTP id g11mr3088436wmq.98.1644931026534; Tue, 15 Feb 2022 05:17:06 -0800 (PST) MIME-Version: 1.0 References: <20220214163452.1568807-1-arnd@kernel.org> <20220214163452.1568807-6-arnd@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Tue, 15 Feb 2022 14:16:50 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 05/14] uaccess: add generic __{get,put}_kernel_nofault To: Al Viro Cc: Linus Torvalds , Christoph Hellwig , linux-arch , Linux-MM , Linux API , Arnd Bergmann , Linux Kernel Mailing List , Russell King - ARM Linux , Will Deacon , Guo Ren , Brian Cain , Geert Uytterhoeven , Michal Simek , Thomas Bogendoerfer , Nick Hu , Greentime Hu , Dinh Nguyen , Stafford Horne , Helge Deller , Michael Ellerman , Peter Zijlstra , Ingo Molnar , Mark Rutland , Heiko Carstens , Rich Felker , David Miller , Richard Weinberger , "the arch/x86 maintainers" , Max Filippov , "Eric W . Biederman" , Andrew Morton , Ard Biesheuvel , alpha , "open list:SYNOPSYS ARC ARCHITECTURE" , Linux ARM , linux-csky@vger.kernel.org, "open list:QUALCOMM HEXAGON..." , linux-ia64@vger.kernel.org, linux-m68k , "open list:BROADCOM NVRAM DRIVER" , Openrisc , Parisc List , linuxppc-dev , linux-riscv , linux-s390 , Linux-sh list , sparclinux , linux-um , "open list:TENSILICA XTENSA PORT (xtensa)" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 15, 2022 at 1:31 AM Al Viro wrote: > > On Mon, Feb 14, 2022 at 05:34:43PM +0100, Arnd Bergmann wrote: > > From: Arnd Bergmann > > > > All architectures that don't provide __{get,put}_kernel_nofault() yet > > can implement this on top of __{get,put}_user. > > > > Add a generic version that lets everything use the normal > > copy_{from,to}_kernel_nofault() code based on these, removing the last > > use of get_fs()/set_fs() from architecture-independent code. > > I'd put the list of those architectures (AFAICS, that's alpha, ia64, > microblaze, nds32, nios2, openrisc, sh, sparc32, xtensa) into commit > message - it's not that hard to find out, but... done. > And AFAICS, you've missed nios2 - see > #define __put_user(x, ptr) put_user(x, ptr) > in there. nds32 oddities are dealt with earlier in the series, this > one is not... Ok, fixed my bug in nios2 __put_user() as well now. This one is not nearly as bad as nds32, at least without my patches it should work as expected. Unfortunately I also noticed that __get_user() on microblaze and nios2 is completely broken for 64-bit arguments, where these copy eight bytes into a four byte buffer. I'll try to come up with a fix for this as well then. Arnd