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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D57DDC433EF for ; Tue, 15 Feb 2022 13:18:09 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4JyhV7688gz3cCv for ; Wed, 16 Feb 2022 00:18:07 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=en41RouE; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2604:1380:4601:e00::1; helo=ams.source.kernel.org; envelope-from=arnd@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=en41RouE; dkim-atps=neutral Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4JyhTK4kHXz2xYQ for ; Wed, 16 Feb 2022 00:17:25 +1100 (AEDT) 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 DB2A3B81977 for ; Tue, 15 Feb 2022 13:17:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EE23C340F2 for ; Tue, 15 Feb 2022 13:17:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644931038; bh=yV4ORJd5b6IZao4Zu1H2u9bAD/0nkvfeGMC8j+boEO0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=en41RouE/EA/f7wz63guGOJgQDzTzpSHu1gIzDlk0eh3+3mMTSAf00BnXMZlARt6s lMs/qZOv6PL6+MghQnSbA+7NV4vESrRm3svOh5B/rWCfo6LLtIapnoPyUEXNUCVUxZ SM5/eNjHSVB0faWLDASH4Z3RBCxDND/GXUOk0wBzYzTo35C9/bozc9mrIpu4PzzP4L vdJ0tSnn6vVBCH3McB/vLyXMNRN/hK/qgW/7ElOPsieLxNJU0DX0VVdQVgbX81UPGp 543MNrYS2T69bw5l7VfHlP0ByvGETR6i+fo7tz93ZNH2MLTYoNKcSPZjc3aKvb3lb/ rnqKGi4/pbe3g== Received: by mail-wm1-f52.google.com with SMTP id n8so6477497wms.3 for ; Tue, 15 Feb 2022 05:17:18 -0800 (PST) X-Gm-Message-State: AOAM530ett0Lji73Bv7dZAPKZFwwFfcwzgFS+WwSv15SQYrzlUV/mIVC 7pbhm1o9Aycg+mzfBcNlHqz6lrOVn8ud8jig4jE= 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 Content-Type: text/plain; charset="UTF-8" X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Rich Felker , linux-ia64@vger.kernel.org, Linux-sh list , Peter Zijlstra , "open list:BROADCOM NVRAM DRIVER" , Linux-MM , Guo Ren , sparclinux , "open list:QUALCOMM HEXAGON..." , linux-riscv , Will Deacon , Christoph Hellwig , linux-arch , linux-s390 , Brian Cain , Helge Deller , the arch/x86 maintainers , Russell King - ARM Linux , linux-csky@vger.kernel.org, Ard Biesheuvel , Ingo Molnar , Geert Uytterhoeven , "open list:SYNOPSYS ARC ARCHITECTURE" , "open list:TENSILICA XTENSA PORT \(xtensa\)" , Arnd Bergmann , Heiko Carstens , alpha , linux-um , linuxppc-dev , linux-m68k , Openrisc , Greentime Hu , Stafford Horne , Linux ARM , Michal Simek , Thomas Bogendoerfer , Parisc List , Nick Hu , Max Filippov , Linux API , Linux Kernel Mailing List , Dinh Nguyen , "Eric W . Biederman" , Richard Weinberger , Andrew Morton , Linus Torvalds , David Miller Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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