From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anshuman Khandual Date: Wed, 06 Jul 2022 05:56:18 +0000 Subject: Re: [PATCH V6 00/26] mm/mmap: Drop __SXXX/__PXXX macros from across platforms Message-Id: <8a6ccbae-7d7c-6e08-cc28-eeb649f86112@arm.com> List-Id: References: <20220630051630.1718927-1-anshuman.khandual@arm.com> In-Reply-To: <20220630051630.1718927-1-anshuman.khandual@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 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