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 ADB5EC433EF for ; Wed, 6 Jul 2022 05:58:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CBDD08E0002; Wed, 6 Jul 2022 01:58:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C6D818E0001; Wed, 6 Jul 2022 01:58:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B5C078E0002; Wed, 6 Jul 2022 01:58:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id A65898E0001 for ; Wed, 6 Jul 2022 01:58:11 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 758E860779 for ; Wed, 6 Jul 2022 05:58:11 +0000 (UTC) X-FDA: 79655619582.18.D5D6DA1 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf06.hostedemail.com (Postfix) with ESMTP id 9370118000E for ; Wed, 6 Jul 2022 05:58:10 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EBF5A1570; Tue, 5 Jul 2022 22:58:09 -0700 (PDT) Received: from [10.163.43.16] (unknown [10.163.43.16]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3C01D3F70D; Tue, 5 Jul 2022 22:58:01 -0700 (PDT) Message-ID: <8a6ccbae-7d7c-6e08-cc28-eeb649f86112@arm.com> Date: Wed, 6 Jul 2022 11:27:59 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH V6 00/26] mm/mmap: Drop __SXXX/__PXXX macros from across platforms Content-Language: en-US To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: hch@infradead.org, christophe.leroy@csgroup.eu, linuxppc-dev@lists.ozlabs.org, sparclinux@vger.kernel.org, x86@kernel.org, openrisc@lists.librecores.org, linux-xtensa@linux-xtensa.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-parisc@vger.kernel.org, linux-alpha@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mips@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-um@lists.infradead.org, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220630051630.1718927-1-anshuman.khandual@arm.com> From: Anshuman Khandual In-Reply-To: <20220630051630.1718927-1-anshuman.khandual@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657087091; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jqT4PqoSwM3GSPZSIpvrDnpl1FW2Wxz05X4z6DuwziE=; b=t08M/qIIcU+XVPfBSFBv36T2bjY3vBnNWhqV3RHYEde7GKFovR2YXNV0Z3APzxVyya1/Sp MNIHzolKG6xlAjGuEdZHXD89ZlaQ8zTrZJwjYMtbchBmU6IT1JhwsS0GljW4Qz/GTPi1HR T989JWe+SWZkYLh9B4SsiXlhQKgdyRs= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf06.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657087091; a=rsa-sha256; cv=none; b=6q3DrnLknUYheDpNvvPFFYBXHm1gllcDVSDY7lX3mp6sDKaTk+D3828djmpxvEvXW1JYzD oTv0i4DEXX7HEdXjq4WNF/VgvuZTBs8wksgF6ud7HebGQ9o2GJJOwg+x4uQOgSoq54OEQu J6HeapBzJl0nfNVRlpxBuFUldURqyis= X-Rspamd-Server: rspam11 X-Rspam-User: X-Stat-Signature: 8f7dxygimwq7u3zzxc8ndbha45b8cxks X-Rspamd-Queue-Id: 9370118000E Authentication-Results: imf06.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf06.hostedemail.com: domain of anshuman.khandual@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=anshuman.khandual@arm.com X-HE-Tag: 1657087090-456473 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 6/30/22 10:46, Anshuman Khandual wrote: > __SXXX/__PXXX macros is an unnecessary abstraction layer in creating the > generic protection_map[] array which is used for vm_get_page_prot(). This > abstraction layer can be avoided, if the platforms just define the array > protection_map[] for all possible vm_flags access permission combinations > and also export vm_get_page_prot() implementation. > > This series drops __SXXX/__PXXX macros from across platforms in the tree. > First it build protects generic protection_map[] array with '#ifdef __P000' > and moves it inside platforms which enable ARCH_HAS_VM_GET_PAGE_PROT. Later > this build protects same array with '#ifdef ARCH_HAS_VM_GET_PAGE_PROT' and > moves inside remaining platforms while enabling ARCH_HAS_VM_GET_PAGE_PROT. > This adds a new macro DECLARE_VM_GET_PAGE_PROT defining the current generic > vm_get_page_prot(), in order for it to be reused on platforms that do not > require custom implementation. Finally, ARCH_HAS_VM_GET_PAGE_PROT can just > be dropped, as all platforms now define and export vm_get_page_prot(), via > looking up a private and static protection_map[] array. protection_map[] > data type has been changed as 'static const' on all platforms that do not > change it during boot. > > This series applies on v5.19-rc4 and has been build tested for multiple > platforms. While here it has dropped off all previous tags from folks after > the current restructuring. Series common CC list has been expanded to cover > all impacted platforms for wider reach. > > - Anshuman > > Changes in V6: > > - Converted protection_map[] array as 'static const' on sparc32 platform > - Rebased on v5.19-rc4 > - Collected tags There are two linux-next based build fixes for this series (listed below), when vm_get_page_prot() gets redefined with !CONFIG_MMU. Platform vm_get_page_prot() is required only with CONFIG_MMU enabled, otherwise there is a generic fallback stub in include/linux/mm.h https://lore.kernel.org/all/20220705221411.3381797-1-jcmvbkbc@gmail.com/ [xtensa] https://lore.kernel.org/all/20220706054002.1936820-1-anshuman.khandual@arm.com/ [sh] It does not seem CONFIG_MMU can be disabled on other platforms thus exposing a build failure. But just to be on the safer side, should all vm_get_page_prot() be wrapped around with #ifdef CONFIG_MMU ? In that case will resend the series with above build fixes folded back in as well. Please do suggest. Thank you. - Anshuman