The patch titled Subject: sh: noMMU: fix vm_get_page_prot definition has been added to the -mm mm-unstable branch. Its filename is sh-mm-enable-arch_has_vm_get_page_prot-fix.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/sh-mm-enable-arch_has_vm_get_page_prot-fix.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Anshuman Khandual <anshuman.khandual@xxxxxxx> Subject: sh: noMMU: fix vm_get_page_prot definition Date: Wed, 6 Jul 2022 11:10:02 +0530 Don't define protection_map and don't use DECLARE_VM_GET_PAGE_PROT in noMMU configs, because in that case the definition for vm_get_page_prot is provided by the include/linux/mm.h Link: https://lkml.kernel.org/r/20220706054002.1936820-1-anshuman.khandual@xxxxxxx Fixes: 03a92d45899c ("sh/mm: enable ARCH_HAS_VM_GET_PAGE_PROT") Signed-off-by: Anshuman Khandual <anshuman.khandual@xxxxxxx> Cc: Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx> Cc: Rich Felker <dalias@xxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- arch/sh/mm/mmap.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) --- a/arch/sh/mm/mmap.c~sh-mm-enable-arch_has_vm_get_page_prot-fix +++ a/arch/sh/mm/mmap.c @@ -19,6 +19,26 @@ unsigned long shm_align_mask = PAGE_SIZE EXPORT_SYMBOL(shm_align_mask); #ifdef CONFIG_MMU +static const pgprot_t protection_map[16] = { + [VM_NONE] = PAGE_NONE, + [VM_READ] = PAGE_READONLY, + [VM_WRITE] = PAGE_COPY, + [VM_WRITE | VM_READ] = PAGE_COPY, + [VM_EXEC] = PAGE_EXECREAD, + [VM_EXEC | VM_READ] = PAGE_EXECREAD, + [VM_EXEC | VM_WRITE] = PAGE_COPY, + [VM_EXEC | VM_WRITE | VM_READ] = PAGE_COPY, + [VM_SHARED] = PAGE_NONE, + [VM_SHARED | VM_READ] = PAGE_READONLY, + [VM_SHARED | VM_WRITE] = PAGE_WRITEONLY, + [VM_SHARED | VM_WRITE | VM_READ] = PAGE_SHARED, + [VM_SHARED | VM_EXEC] = PAGE_EXECREAD, + [VM_SHARED | VM_EXEC | VM_READ] = PAGE_EXECREAD, + [VM_SHARED | VM_EXEC | VM_WRITE] = PAGE_RWX, + [VM_SHARED | VM_EXEC | VM_WRITE | VM_READ] = PAGE_RWX +}; +DECLARE_VM_GET_PAGE_PROT + /* * To avoid cache aliases, we map the shared page with same color. */ @@ -162,23 +182,3 @@ int valid_mmap_phys_addr_range(unsigned { return 1; } - -static const pgprot_t protection_map[16] = { - [VM_NONE] = PAGE_NONE, - [VM_READ] = PAGE_READONLY, - [VM_WRITE] = PAGE_COPY, - [VM_WRITE | VM_READ] = PAGE_COPY, - [VM_EXEC] = PAGE_EXECREAD, - [VM_EXEC | VM_READ] = PAGE_EXECREAD, - [VM_EXEC | VM_WRITE] = PAGE_COPY, - [VM_EXEC | VM_WRITE | VM_READ] = PAGE_COPY, - [VM_SHARED] = PAGE_NONE, - [VM_SHARED | VM_READ] = PAGE_READONLY, - [VM_SHARED | VM_WRITE] = PAGE_WRITEONLY, - [VM_SHARED | VM_WRITE | VM_READ] = PAGE_SHARED, - [VM_SHARED | VM_EXEC] = PAGE_EXECREAD, - [VM_SHARED | VM_EXEC | VM_READ] = PAGE_EXECREAD, - [VM_SHARED | VM_EXEC | VM_WRITE] = PAGE_RWX, - [VM_SHARED | VM_EXEC | VM_WRITE | VM_READ] = PAGE_RWX -}; -DECLARE_VM_GET_PAGE_PROT _ Patches currently in -mm which might be from anshuman.khandual@xxxxxxx are mm-mmap-build-protect-protection_map-with-__p000.patch mm-mmap-define-declare_vm_get_page_prot.patch powerpc-mm-move-protection_map-inside-the-platform.patch sparc-mm-move-protection_map-inside-the-platform.patch arm64-mm-move-protection_map-inside-the-platform.patch x86-mm-move-protection_map-inside-the-platform.patch mm-mmap-build-protect-protection_map-with-arch_has_vm_get_page_prot.patch microblaze-mm-enable-arch_has_vm_get_page_prot.patch loongarch-mm-enable-arch_has_vm_get_page_prot.patch openrisc-mm-enable-arch_has_vm_get_page_prot.patch xtensa-mm-enable-arch_has_vm_get_page_prot.patch hexagon-mm-enable-arch_has_vm_get_page_prot.patch parisc-mm-enable-arch_has_vm_get_page_prot.patch alpha-mm-enable-arch_has_vm_get_page_prot.patch nios2-mm-enable-arch_has_vm_get_page_prot.patch riscv-mm-enable-arch_has_vm_get_page_prot.patch csky-mm-enable-arch_has_vm_get_page_prot.patch s390-mm-enable-arch_has_vm_get_page_prot.patch ia64-mm-enable-arch_has_vm_get_page_prot.patch mips-mm-enable-arch_has_vm_get_page_prot.patch m68k-mm-enable-arch_has_vm_get_page_prot.patch arc-mm-enable-arch_has_vm_get_page_prot.patch arm-mm-enable-arch_has_vm_get_page_prot.patch um-mm-enable-arch_has_vm_get_page_prot.patch sh-mm-enable-arch_has_vm_get_page_prot.patch sh-mm-enable-arch_has_vm_get_page_prot-fix.patch mm-mmap-drop-arch_has_vm_get_page_prot.patch