[PATCH] freepgt: arm26 FIRST_USER_ADDRESS PAGE_SIZE

ARM26 define FIRST_USER_ADDRESS as PAGE_SIZE (beyond the machine vectors when
they are mapped low), and use that definition in place of locally defined
MIN_MAP_ADDR. Previously, ARM26 permitted user mappings at 0 if the machine
vectors were mapped high; but that's inconsistent with ARM, and
FIRST_USER_ADDRESS would then have to be determined at runtime. Let's fix it
at PAGE_SIZE throughout the architecture.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Hugh Dickins and committed by Linus Torvalds cdfb82ff 6119be0b

+11 -5
+4 -5
arch/arm26/kernel/sys_arm.c
··· 64 64 flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); 65 65 66 66 /* 67 - * If we are doing a fixed mapping, and address < PAGE_SIZE, 67 + * If we are doing a fixed mapping, and address < FIRST_USER_ADDRESS, 68 68 * then deny it. 69 69 */ 70 - if (flags & MAP_FIXED && addr < PAGE_SIZE && vectors_base() == 0) 70 + if (flags & MAP_FIXED && addr < FIRST_USER_ADDRESS) 71 71 goto out; 72 72 73 73 error = -EBADF; ··· 121 121 unsigned long ret = -EINVAL; 122 122 123 123 /* 124 - * If we are doing a fixed mapping, and address < PAGE_SIZE, 124 + * If we are doing a fixed mapping, and address < FIRST_USER_ADDRESS, 125 125 * then deny it. 126 126 */ 127 - if (flags & MREMAP_FIXED && new_addr < PAGE_SIZE && 128 - vectors_base() == 0) 127 + if (flags & MREMAP_FIXED && new_addr < FIRST_USER_ADDRESS) 129 128 goto out; 130 129 131 130 down_write(&current->mm->mmap_sem);
+7
include/asm-arm26/pgtable.h
··· 62 62 #define PTRS_PER_PMD 1 63 63 #define PTRS_PER_PTE 32 64 64 65 + /* 66 + * This is the lowest virtual address we can permit any user space 67 + * mapping to be mapped at. This is particularly important for 68 + * non-high vector CPUs. 69 + */ 70 + #define FIRST_USER_ADDRESS PAGE_SIZE 71 + 65 72 #define FIRST_USER_PGD_NR 1 66 73 #define USER_PTRS_PER_PGD ((TASK_SIZE/PGD_SIZE) - FIRST_USER_PGD_NR) 67 74