Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1091987pxb; Fri, 18 Feb 2022 00:02:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJz7M4AKFjrhTBb0qQ1owHZLAYEDvybeQxb+1yaJYcABHq8cdTz5NRTwT3v8SRrXgSWk8ipB X-Received: by 2002:a05:6402:5254:b0:410:def7:132c with SMTP id t20-20020a056402525400b00410def7132cmr6921277edd.161.1645171347340; Fri, 18 Feb 2022 00:02:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645171347; cv=none; d=google.com; s=arc-20160816; b=ABssckX8juTeQBRu7OaDzhbZQiJBBJ5QkqFS3B8u33dE4FNjMMB+z8NsbXuVplA19P +BeewoTNT+FGge4PJAnCYH027KnKdeTTnJUvus15FshW2KEYtc6v77R+54YN1iZvAIlb PVJJ+6gqtx6wHcBvBWqgHgGaAL0fi7NsLRpgra80Qtp7NDF/7Vq8UkklRblfiTVJb/OP 4dNc7Q+wgFDVk/J2yO/e1+ML/P40MKPiCUZT7ihd/C5/YAxxZER7efwenGRnJsX5Zkn8 VmwJH7lHokozc33RkhPh+jXHVNSCgDO1evDml4fZXk3a9UduyGyw4M2xOqwQV8ARlpII 5ogA== 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=bYtgVqrnw6HHWJl43vE/SYJIq/hifo8MkArcP/xS/QY=; b=MB7rUdHGIRXevEmDJ2pw/MLHuRQhfuuGr9FuBQqy0R7E77Lt4OE23gYgs5Av1zyRQc GQEZvutyQ+JWv3j3tabEi1fqC20hzJGPP6KIhlnKvjTsIULJPcwHHDpr7+AQuAKPIHwE XlHHWtYFz7TMgg3X6pdHZoNEDnhJoTUB/rpTkRlZWgpdWV1Wr5xe9NLGThZxClhuSWhD PwRpsPL71ZIcusDAktOSr5523HRO+Rjd/DITj1GDrK8qraUqd7lLGpzg/zvBEdyG4OW4 q/I7Z3kussXvgT76KE+Y0pT31AXUoZoH0GyHR5TjKRj9QssIZiUK5WekJGMLsbIoURfF ePKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MfE3DRj6; 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 he38si3442397ejc.63.2022.02.18.00.02.03; Fri, 18 Feb 2022 00:02:27 -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=MfE3DRj6; 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 S231974AbiBRHYJ (ORCPT + 99 others); Fri, 18 Feb 2022 02:24:09 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:39670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230168AbiBRHYF (ORCPT ); Fri, 18 Feb 2022 02:24:05 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF9C925595; Thu, 17 Feb 2022 23:23:49 -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 sin.source.kernel.org (Postfix) with ESMTPS id 50697CE314C; Fri, 18 Feb 2022 07:23:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4A39C340F1; 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-f54.google.com with SMTP id k1so12962990wrd.8; Thu, 17 Feb 2022 23:23:46 -0800 (PST) X-Gm-Message-State: AOAM530hLtE8+9g41xS11L8qP/RJMJiCLpPsP/ddwe/zzgXRcOmAxZnd J6s6q6529BE224nUJgttRUU4nvJDsMeNgZRSGmI= 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-Spam-Status: No, score=-7.2 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 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