Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp538810pxm; Wed, 2 Mar 2022 03:49:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJzkfMXJa2e6G8EsUqUkjUiC2v0nEP8GEaS2DsLucFNPdRysvOrg8iQqOueeXLlv8e2ZBGay X-Received: by 2002:a17:907:da6:b0:6d6:f8ce:e03 with SMTP id go38-20020a1709070da600b006d6f8ce0e03mr5103357ejc.516.1646221775971; Wed, 02 Mar 2022 03:49:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646221775; cv=none; d=google.com; s=arc-20160816; b=RTLHxNFcGe9gqkT8Vms475Sy86KjB2TLZNd7XZVnB9Ellx6+rKBwCnXDMj9Q8Ju9Yi epTYdMUv34MMX682unqCo4/5ZqS9FO96g1eION0ZYMnQEfZbADf9qVvJEmeku79LGP6+ 6sE5L0tVy2abzXc/hKSnqWbfEHYPXGNIupwb5hWRZ0CTfBnGwUruyXnj2MMb/eOMwyDc +d36/AgXnmz+knQxXJ3n+pjqTMl5yxL84IZ5IPEbV9bySTr4HWZ/8+D61JdyEsVR5LT5 7bS7nIYOefyqxN9s27fNnBWAqQlrqEuhCh7nbxBWhepNb+lOxkAJmdMOX3uNZYmSJY+n rytQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=I1/BTw8u15H3AVnQDepPulkDIkTQG/EDO8JslQ2y518=; b=laNHlcUmIa4NZAvnCBQKcQiqY+FFiCfYyzZ8u6L2OUJfTE9R845EO2BJOx0R2PAlYs aSC2OsVZGpttKK832d40L2wwBmgTaOyTuVk1RSoJofv1lUAjoZSNNJ4Nf8d5dRzSsF5N ylPyeVRWAUabqEky7kzfV4dv4eGQjeR3qZ7ViDcNjdlZvDGlK77Rve05R+g1VyHXt+Jl ja8jXAX6tvNfZI5MIy7YC/oPny9EwH/5GgwSz/BWDCFRFvaJ6CKlNs1Aa0ecLTjrkaXG VXu41/OZAPYXWOyk5O/Ys0kFmTBJrAW5xVWqd6M8RqH1mfQeM2/kXHOWj8+BNMNk9k+h Flqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=yzUOmQTC; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s5-20020a50d485000000b004131076c8bbsi10935160edi.13.2022.03.02.03.49.11; Wed, 02 Mar 2022 03:49:35 -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=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=yzUOmQTC; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235342AbiCBLUy (ORCPT + 99 others); Wed, 2 Mar 2022 06:20:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241529AbiCBLUm (ORCPT ); Wed, 2 Mar 2022 06:20:42 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E146645F; Wed, 2 Mar 2022 03:19:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=I1/BTw8u15H3AVnQDepPulkDIkTQG/EDO8JslQ2y518=; b=yzUOmQTC9SehCgZYgd4h+Ey12C IF3SwMxqhKSw9mftTnudCgM/6vhgVjqN1K54lqRScHZdWomhMSw8gc4Q17z82/t4ePZPTadPDNBW0 RAYoi7RTG5lEPYnuj/W83EiMnjCPrblb+04/X34ls5AXk4/1qSt0tzJPYiQCOWZ8wtXGi6o/0W54C JYouMTieLlNBty6aTd82+iHFYVBl998jCqSMezXTJKHViIkOZV4L90kAOBr7Bjp+j1Cc20Fo3g2xF ZHXM5LboaCYqutYgpLpdk+j1UVvj2hjc2fYOc6snFpF3IOhlr7vydYbVzzsl941esiWGhbWsi5Amp qfJLh3Qg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:57592) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nPN0v-0002K5-5r; Wed, 02 Mar 2022 11:19:25 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1nPN0s-00085f-7p; Wed, 02 Mar 2022 11:19:22 +0000 Date: Wed, 2 Mar 2022 11:19:22 +0000 From: "Russell King (Oracle)" To: Anshuman Khandual Cc: Geert Uytterhoeven , Christophe Leroy , "linux-ia64@vger.kernel.org" , "linux-sh@vger.kernel.org" , "linux-mips@vger.kernel.org" , "linux-mm@kvack.org" , "sparclinux@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "linux-arch@vger.kernel.org" , "linux-s390@vger.kernel.org" , "linux-hexagon@vger.kernel.org" , "linux-csky@vger.kernel.org" , Christoph Hellwig , "linux-snps-arc@lists.infradead.org" , "linux-xtensa@linux-xtensa.org" , Arnd Bergmann , "linux-um@lists.infradead.org" , "linux-m68k@lists.linux-m68k.org" , "openrisc@lists.librecores.org" , "linux-arm-kernel@lists.infradead.org" , "linux-parisc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-alpha@vger.kernel.org" , "akpm@linux-foundation.org" , "linuxppc-dev@lists.ozlabs.org" Subject: Re: [PATCH V3 09/30] arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT Message-ID: References: <1646045273-9343-10-git-send-email-anshuman.khandual@arm.com> <542fa048-131e-240b-cc3a-fd4fff7ce4ba@arm.com> <52866c88-59f9-2d1c-6f5a-5afcaf23f2bb@csgroup.eu> <9caa90f5-c10d-75dd-b403-1388b7a3d296@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, 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 Wed, Mar 02, 2022 at 04:36:52PM +0530, Anshuman Khandual wrote: > On 3/2/22 3:35 PM, Geert Uytterhoeven wrote: > > I doubt the switch() variant would give better code on any platform. > > > > What about using tables everywhere, using designated initializers > > to improve readability? > > Designated initializers ? Could you please be more specific. A table look > up on arm platform would be something like this and arm_protection_map[] > needs to be updated with user_pgprot like before. There is *absolutely* nothing wrong with that. Updating it once during boot is way more efficient than having to compute the value each time vm_get_page_prot() gets called. Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!