Re: [RFC V1 09/31] arm/mm: Enable ARCH_HAS_VM_GET_PAGE_PROT

From: Anshuman Khandual
Date: Mon Jan 24 2022 - 23:47:51 EST




On 1/24/22 10:36 PM, Russell King (Oracle) wrote:
> On Mon, Jan 24, 2022 at 06:26:46PM +0530, Anshuman Khandual wrote:
>> This defines and exports a platform specific custom vm_get_page_prot() via
>> subscribing ARCH_HAS_VM_GET_PAGE_PROT. Subsequently all __SXXX and __PXXX
>> macros can be dropped which are no longer needed.
>
> What is the fundamental advantage of this approach?
>

Remove multiple 'core MM <--> platform' abstraction layers to map
vm_flags access permission combination into page protection. From
the cover letter ..

----------
Currently there are multiple layers of abstraction i.e __SXXX/__PXXX macros
, protection_map[], arch_vm_get_page_prot() and arch_filter_pgprot() built
between the platform and generic MM, finally defining vm_get_page_prot().

Hence this series proposes to drop all these abstraction levels and instead
just move the responsibility of defining vm_get_page_prot() to the platform
itself making it clean and simple.
----------