xtensa: noMMU: fix vm_get_page_prot definition
Subsystems (2)
Max Filippov
maintainerPATCH 1/1 xtensa: noMMU: fix vm_get_page_prot definition
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
--- arch/xtensa/mm/init.c | 2 ++ 1 file changed, 2 insertions(+)
arch/xtensa/mm/init.c +2 -0
@@ -217,6 +217,7 @@ static int __init parse_memmap_opt(char *str) }early_param ("memmap" , parse_memmap_opt); +#ifdef CONFIG_MMU static const pgprot_t protection_map[16 ] = { [VM_NONE ] =PAGE_NONE , [VM_READ] = PAGE_READONLY,
@@ -236,3 +237,4 @@ static const pgprot_t protection_map[16] = { [VM_SHARED | VM_EXEC | VM_WRITE | VM_READ] = PAGE_SHARED_EXEC }; DECLARE_VM_GET_PAGE_PROT +#endif
Signature · 1 line
2.30.2
Hello Max,
I could reproduce the build failure with nommu_kc705_defconfig.
Quoted 3 lines · Max Filippov
Don't define
protection_mapand don't useDECLARE_VM_GET_PAGE_PROTin noMMU configs, because in that case the definition forvm_get_page_protis provided by theinclude/linux/mm.h
Right, a fallback (!CONFIG_MMU) stub definition is provided there.
Quoted 20 lines
Fixes 61ab8053710f ("xtensa/mm: enable ARCH_HAS_VM_GET_PAGE_PROT")Signed-off-by Max Filippov <[email protected]>--- arch/xtensa/mm/init.c | 2 ++ 1 file changed, 2 insertions(+)arch/xtensa/mm/init.c +1
-0@@ -217,6 +217,7 @@ static int __init parse_memmap_opt(char *str) }early_param ("memmap" , parse_memmap_opt); +#ifdef CONFIG_MMU static const pgprot_t protection_map[16 ] = { [VM_NONE ] =PAGE_NONE , [VM_READ] = PAGE_READONLY,
arch/xtensa/mm/init.c static const pgprot_t protection_map[16] = { · line 240
Quoted 4 lines
arch/xtensa/mm/init.c +1
-0@@ -236,3 +237,4 @@ static const pgprot_t protection_map[16] = { [VM_SHARED | VM_EXEC | VM_WRITE | VM_READ] = PAGE_SHARED_EXEC }; DECLARE_VM_GET_PAGE_PROT +#endif
LGTM and fixes the build problem.
Reviewing CONFIG_MMU dependency for other platforms ....
* powerpc - No CONFIG_MMU found - config MMU - bool default y
* sparc - No CONFIG_MMU found - config MMU - bool default y
* arm64 - No CONFIG_MMU found - config MMU - bool default y
* x86 - No CONFIG_MMU found - config MMU - bool default y
* microblaze - No CONFIG_MMU found - config MMU - bool default y
* loongarch - No CONFIG_MMU found - config MMU - bool default y
* openrisc - No CONFIG_MMU found - config MMU - bool default y
* xtensa - This fix here
* hexagon - No CONFIG_MMU found - config MMU - bool default y
* parisc - No CONFIG_MMU found - config MMU - bool default y
* alpha - No CONFIG_MMU found - config MMU - bool default y
* nios2 - No CONFIG_MMU found - config MMU - bool default y
* riscv - Both protection_map[] and DECLARE_VM_GET_PAGE_PROT
are inside CONFIG_MMU
* csky - No CONFIG_MMU found - config MMU - bool default y
* s390 - No CONFIG_MMU found - config MMU - bool default y
* ia64 - No CONFIG_MMU found - config MMU - bool default y
* mips - No CONFIG_MMU found - config MMU - bool default y* m68k - Both protection_map[] and DECLARE_VM_GET_PAGE_PROT
are inside CONFIG_MMU (SUN3, MOTOROLA, COLDFIRE)
* arc - No CONFIG_MMU found - config MMU - bool default y
* arm - Both protection_map[] and DECLARE_VM_GET_PAGE_PROT
are inside CONFIG_MMU
* um - No CONFIG_MMU found - config MMU - bool default y
* sh - Both protection_map[] and DECLARE_VM_GET_PAGE_PROT
needs to be moved inside CONFIG_MMU, will send a patch soon.
So apart from xtensa and sh, no other platform seems to have this CONFIG_MMU related build problem. But please do let me know if I might have missed something.
- Anshuman