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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3846C43217 for ; Fri, 18 Feb 2022 07:23:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6660B6B0074; Fri, 18 Feb 2022 02:23:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 615096B0075; Fri, 18 Feb 2022 02:23:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4DC2D6B0078; Fri, 18 Feb 2022 02:23:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0246.hostedemail.com [216.40.44.246]) by kanga.kvack.org (Postfix) with ESMTP id 3BC746B0074 for ; Fri, 18 Feb 2022 02:23:54 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E5321181AC9C6 for ; Fri, 18 Feb 2022 07:23:53 +0000 (UTC) X-FDA: 79155061146.14.3721B39 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf15.hostedemail.com (Postfix) with ESMTP id E2455A0004 for ; Fri, 18 Feb 2022 07:23:52 +0000 (UTC) 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 sin.source.kernel.org (Postfix) with ESMTPS id 6B99ACE3153 for ; Fri, 18 Feb 2022 07:23:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7046C340F7 for ; Fri, 18 Feb 2022 07:23:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645169026; bh=iX8k9YjATKpR4c62jPbZyUcM9GG/inNR2Rws8vh+5TI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MfE3DRj6hdmUnJC8PWE/J8NI5Xb7vzLSvmjxSj68RWTh2bxrEi4FDRZ7SQTVRhmUD CDmwYHK0HmoQ3JbzKSSWTyPKs0iDYpxb+V5PVYnhGTNLzIdT2kFtsQg9+RHXO7qlFv JwaKWZU94TsLOz/wPP4ho9HfsvwhYYkqmms7Ghj6RLE6YDZ+FbBWJxq/EGg562ZeQi NhSVDDRjxnzTpOPLdXdNVvcgQ+lCZzrLL/rqJ9mBNS7wpoywp5NUtuj1ow9gQEpzz9 qTE6XwVlHR2bJnyQ0N5ldqQ5ydxv63l0XvT/OVF109xLw40SUpl/VU7vKeVPVgvfOE 4yEkwx9CYDyzg== Received: by mail-wr1-f52.google.com with SMTP id m27so1176988wrb.4 for ; Thu, 17 Feb 2022 23:23:46 -0800 (PST) X-Gm-Message-State: AOAM533cRQJgpYhDKCAD3xlWY6KYAvv4pi50N4jeTimQMaTXZEmMlvQY a6zEwYXej6QEL4HlBSgyxaOnc9x1JzDW3PxfpJY= X-Google-Smtp-Source: ABdhPJy+O8dl23fyesXRWHjz7SZRLrJN54UunjRaSC3OSIYzwaAC/i9x7WkjUHComAvPWqTtg86CqT1E/gHbWgqhIZI= X-Received: by 2002:adf:90c1:0:b0:1e4:ad27:22b9 with SMTP id i59-20020adf90c1000000b001e4ad2722b9mr4994775wri.219.1645169025031; Thu, 17 Feb 2022 23:23:45 -0800 (PST) MIME-Version: 1.0 References: <20220216131332.1489939-1-arnd@kernel.org> <20220216131332.1489939-14-arnd@kernel.org> <20220218063450.GI22576@lst.de> In-Reply-To: <20220218063450.GI22576@lst.de> From: Arnd Bergmann Date: Fri, 18 Feb 2022 08:23:29 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 13/18] uaccess: generalize access_ok() To: Christoph Hellwig Cc: Linus Torvalds , linux-arch , Linux-MM , Linux API , Arnd Bergmann , Linux Kernel Mailing List , Al Viro , 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-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" X-Rspam-User: Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=MfE3DRj6; spf=pass (imf15.hostedemail.com: domain of arnd@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=arnd@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: E2455A0004 X-Stat-Signature: 3ar1j146bbnjs3cezckjnu87ry1o5pgz X-HE-Tag: 1645169032-93478 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Feb 18, 2022 at 7:34 AM Christoph Hellwig wrote: > > > +#include > > Instead of the asm-generic games, shouldn't we just define access_ok in > if not already defined by the architecture? I tried, but couldn't actually make it work because asm/uaccess.h tends to contain inline functions that rely on access_ok(). It could work once we move all the high-level functions into linux/uaccess.h, but that would likely require another long patch series. One option that can work is to require architectures to have an asm/access_ok.h header that gets included by linux/uaccess.h. On most architectures, that would be redirected to asm-generic/access_ok.h, as only ia64, x86, arm64 and um need to override the definition. Arnd