Re: [PATCH V3 2/2] mm/mmap: Drop generic protection_map[] array

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 17, 2022 at 05:48:11AM +0000, Christophe Leroy wrote:
> Is it a good idea to duplicate vm_get_page_prot() in each architecture ? 

It is a completely trivial array index.  And I really like the idea
of not having the protection_map in common code - it really is an
implementation detail.  But what we could do is something like

#define DECLARE_VM_GET_PAGE_PROT				\
pgprot_t vm_get_page_prot(unsigned long vm_flags)		\
{								\
        return protection_map[vm_flags &			\
		(VM_READ | VM_WRITE | VM_EXEC | VM_SHARED)];	\
}								\
EXPORT_SYMBOL(vm_get_page_prot);

as a helper for the architectures.

> Maybe it is, but it will also mean changing common code like 
> mm/debug_vm_pgtable.c which accesses protection_map[] directly as of today.

That's already gone thanks to the good work from Anshuman.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux