[PATCH] freepgt: arch FIRST_USER_ADDRESS 0

Replace misleading definition of FIRST_USER_PGD_NR 0 by definition of
FIRST_USER_ADDRESS 0 in all the MMU architectures beyond arm and arm26.

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 d455a369 cdfb82ff

+21 -21
+1 -1
include/asm-alpha/pgtable.h
··· 42 #define PTRS_PER_PMD (1UL << (PAGE_SHIFT-3)) 43 #define PTRS_PER_PGD (1UL << (PAGE_SHIFT-3)) 44 #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 45 - #define FIRST_USER_PGD_NR 0 46 47 /* Number of pointers that fit on a page: this will go away. */ 48 #define PTRS_PER_PAGE (1UL << (PAGE_SHIFT-3))
··· 42 #define PTRS_PER_PMD (1UL << (PAGE_SHIFT-3)) 43 #define PTRS_PER_PGD (1UL << (PAGE_SHIFT-3)) 44 #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 45 + #define FIRST_USER_ADDRESS 0 46 47 /* Number of pointers that fit on a page: this will go away. */ 48 #define PTRS_PER_PAGE (1UL << (PAGE_SHIFT-3))
+1 -1
include/asm-cris/pgtable.h
··· 76 */ 77 78 #define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) 79 - #define FIRST_USER_PGD_NR 0 80 81 /* zero page used for uninitialized stuff */ 82 #ifndef __ASSEMBLY__
··· 76 */ 77 78 #define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) 79 + #define FIRST_USER_ADDRESS 0 80 81 /* zero page used for uninitialized stuff */ 82 #ifndef __ASSEMBLY__
+1 -1
include/asm-frv/pgtable.h
··· 141 #define PTRS_PER_PTE 4096 142 143 #define USER_PGDS_IN_LAST_PML4 (TASK_SIZE / PGDIR_SIZE) 144 - #define FIRST_USER_PGD_NR 0 145 146 #define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT) 147 #define KERNEL_PGD_PTRS (PTRS_PER_PGD - USER_PGD_PTRS)
··· 141 #define PTRS_PER_PTE 4096 142 143 #define USER_PGDS_IN_LAST_PML4 (TASK_SIZE / PGDIR_SIZE) 144 + #define FIRST_USER_ADDRESS 0 145 146 #define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT) 147 #define KERNEL_PGD_PTRS (PTRS_PER_PGD - USER_PGD_PTRS)
+1 -1
include/asm-i386/pgtable.h
··· 60 #define PGDIR_MASK (~(PGDIR_SIZE-1)) 61 62 #define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) 63 - #define FIRST_USER_PGD_NR 0 64 65 #define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT) 66 #define KERNEL_PGD_PTRS (PTRS_PER_PGD-USER_PGD_PTRS)
··· 60 #define PGDIR_MASK (~(PGDIR_SIZE-1)) 61 62 #define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) 63 + #define FIRST_USER_ADDRESS 0 64 65 #define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT) 66 #define KERNEL_PGD_PTRS (PTRS_PER_PGD-USER_PGD_PTRS)
+1 -1
include/asm-ia64/pgtable.h
··· 93 #define PGDIR_MASK (~(PGDIR_SIZE-1)) 94 #define PTRS_PER_PGD (1UL << (PAGE_SHIFT-3)) 95 #define USER_PTRS_PER_PGD (5*PTRS_PER_PGD/8) /* regions 0-4 are user regions */ 96 - #define FIRST_USER_PGD_NR 0 97 98 /* 99 * Definitions for second level:
··· 93 #define PGDIR_MASK (~(PGDIR_SIZE-1)) 94 #define PTRS_PER_PGD (1UL << (PAGE_SHIFT-3)) 95 #define USER_PTRS_PER_PGD (5*PTRS_PER_PGD/8) /* regions 0-4 are user regions */ 96 + #define FIRST_USER_ADDRESS 0 97 98 /* 99 * Definitions for second level:
+1 -1
include/asm-m32r/pgtable.h
··· 51 #define PGDIR_MASK (~(PGDIR_SIZE - 1)) 52 53 #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 54 - #define FIRST_USER_PGD_NR 0 55 56 #ifndef __ASSEMBLY__ 57 /* Just any arbitrary offset to the start of the vmalloc VM area: the
··· 51 #define PGDIR_MASK (~(PGDIR_SIZE - 1)) 52 53 #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 54 + #define FIRST_USER_ADDRESS 0 55 56 #ifndef __ASSEMBLY__ 57 /* Just any arbitrary offset to the start of the vmalloc VM area: the
+1 -1
include/asm-m68k/pgtable.h
··· 61 #define PTRS_PER_PGD 128 62 #endif 63 #define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) 64 - #define FIRST_USER_PGD_NR 0 65 66 /* Virtual address region for use by kernel_map() */ 67 #ifdef CONFIG_SUN3
··· 61 #define PTRS_PER_PGD 128 62 #endif 63 #define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) 64 + #define FIRST_USER_ADDRESS 0 65 66 /* Virtual address region for use by kernel_map() */ 67 #ifdef CONFIG_SUN3
+1 -1
include/asm-mips/pgtable-32.h
··· 74 #define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t)) 75 76 #define USER_PTRS_PER_PGD (0x80000000UL/PGDIR_SIZE) 77 - #define FIRST_USER_PGD_NR 0 78 79 #define VMALLOC_START KSEG2 80
··· 74 #define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t)) 75 76 #define USER_PTRS_PER_PGD (0x80000000UL/PGDIR_SIZE) 77 + #define FIRST_USER_ADDRESS 0 78 79 #define VMALLOC_START KSEG2 80
+1 -1
include/asm-mips/pgtable-64.h
··· 89 #define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t)) 90 91 #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 92 - #define FIRST_USER_PGD_NR 0 93 94 #define VMALLOC_START XKSEG 95 #define VMALLOC_END \
··· 89 #define PTRS_PER_PTE ((PAGE_SIZE << PTE_ORDER) / sizeof(pte_t)) 90 91 #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 92 + #define FIRST_USER_ADDRESS 0 93 94 #define VMALLOC_START XKSEG 95 #define VMALLOC_END \
+1 -1
include/asm-parisc/pgtable.h
··· 120 * pgd entries used up by user/kernel: 121 */ 122 123 - #define FIRST_USER_PGD_NR 0 124 125 #ifndef __ASSEMBLY__ 126 extern void *vmalloc_start;
··· 120 * pgd entries used up by user/kernel: 121 */ 122 123 + #define FIRST_USER_ADDRESS 0 124 125 #ifndef __ASSEMBLY__ 126 extern void *vmalloc_start;
+1 -1
include/asm-ppc/pgtable.h
··· 96 #define PTRS_PER_PGD (1 << (32 - PGDIR_SHIFT)) 97 98 #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 99 - #define FIRST_USER_PGD_NR 0 100 101 #define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT) 102 #define KERNEL_PGD_PTRS (PTRS_PER_PGD-USER_PGD_PTRS)
··· 96 #define PTRS_PER_PGD (1 << (32 - PGDIR_SHIFT)) 97 98 #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) 99 + #define FIRST_USER_ADDRESS 0 100 101 #define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT) 102 #define KERNEL_PGD_PTRS (PTRS_PER_PGD-USER_PGD_PTRS)
+1 -1
include/asm-ppc64/pgtable.h
··· 41 #define PTRS_PER_PGD (1 << PGD_INDEX_SIZE) 42 43 #define USER_PTRS_PER_PGD (1024) 44 - #define FIRST_USER_PGD_NR 0 45 46 #define EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \ 47 PGD_INDEX_SIZE + PAGE_SHIFT)
··· 41 #define PTRS_PER_PGD (1 << PGD_INDEX_SIZE) 42 43 #define USER_PTRS_PER_PGD (1024) 44 + #define FIRST_USER_ADDRESS 0 45 46 #define EADDR_SIZE (PTE_INDEX_SIZE + PMD_INDEX_SIZE + \ 47 PGD_INDEX_SIZE + PAGE_SHIFT)
+2 -2
include/asm-s390/pgtable.h
··· 95 # define USER_PTRS_PER_PGD 512 96 # define USER_PGD_PTRS 512 97 # define KERNEL_PGD_PTRS 512 98 - # define FIRST_USER_PGD_NR 0 99 #else /* __s390x__ */ 100 # define USER_PTRS_PER_PGD 2048 101 # define USER_PGD_PTRS 2048 102 # define KERNEL_PGD_PTRS 2048 103 - # define FIRST_USER_PGD_NR 0 104 #endif /* __s390x__ */ 105 106 #define pte_ERROR(e) \ 107 printk("%s:%d: bad pte %p.\n", __FILE__, __LINE__, (void *) pte_val(e))
··· 95 # define USER_PTRS_PER_PGD 512 96 # define USER_PGD_PTRS 512 97 # define KERNEL_PGD_PTRS 512 98 #else /* __s390x__ */ 99 # define USER_PTRS_PER_PGD 2048 100 # define USER_PGD_PTRS 2048 101 # define KERNEL_PGD_PTRS 2048 102 #endif /* __s390x__ */ 103 + 104 + #define FIRST_USER_ADDRESS 0 105 106 #define pte_ERROR(e) \ 107 printk("%s:%d: bad pte %p.\n", __FILE__, __LINE__, (void *) pte_val(e))
+1 -1
include/asm-sh/pgtable.h
··· 44 #define PGDIR_MASK (~(PGDIR_SIZE-1)) 45 46 #define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) 47 - #define FIRST_USER_PGD_NR 0 48 49 #define PTE_PHYS_MASK 0x1ffff000 50
··· 44 #define PGDIR_MASK (~(PGDIR_SIZE-1)) 45 46 #define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) 47 + #define FIRST_USER_ADDRESS 0 48 49 #define PTE_PHYS_MASK 0x1ffff000 50
+1 -1
include/asm-sh64/pgtable.h
··· 238 239 /* Round it up ! */ 240 #define USER_PTRS_PER_PGD ((TASK_SIZE+PGDIR_SIZE-1)/PGDIR_SIZE) 241 - #define FIRST_USER_PGD_NR 0 242 243 #ifndef __ASSEMBLY__ 244 #define VMALLOC_END 0xff000000
··· 238 239 /* Round it up ! */ 240 #define USER_PTRS_PER_PGD ((TASK_SIZE+PGDIR_SIZE-1)/PGDIR_SIZE) 241 + #define FIRST_USER_ADDRESS 0 242 243 #ifndef __ASSEMBLY__ 244 #define VMALLOC_END 0xff000000
+1 -1
include/asm-sparc/pgtable.h
··· 63 #define PTRS_PER_PMD BTFIXUP_SIMM13(ptrs_per_pmd) 64 #define PTRS_PER_PGD BTFIXUP_SIMM13(ptrs_per_pgd) 65 #define USER_PTRS_PER_PGD BTFIXUP_SIMM13(user_ptrs_per_pgd) 66 - #define FIRST_USER_PGD_NR 0 67 #define PTE_SIZE (PTRS_PER_PTE*4) 68 69 #define PAGE_NONE __pgprot(BTFIXUP_INT(page_none))
··· 63 #define PTRS_PER_PMD BTFIXUP_SIMM13(ptrs_per_pmd) 64 #define PTRS_PER_PGD BTFIXUP_SIMM13(ptrs_per_pgd) 65 #define USER_PTRS_PER_PGD BTFIXUP_SIMM13(user_ptrs_per_pgd) 66 + #define FIRST_USER_ADDRESS 0 67 #define PTE_SIZE (PTRS_PER_PTE*4) 68 69 #define PAGE_NONE __pgprot(BTFIXUP_INT(page_none))
+1 -1
include/asm-sparc64/pgtable.h
··· 78 #define PTRS_PER_PGD (1UL << PGDIR_BITS) 79 80 /* Kernel has a separate 44bit address space. */ 81 - #define FIRST_USER_PGD_NR 0 82 83 #define pte_ERROR(e) __builtin_trap() 84 #define pmd_ERROR(e) __builtin_trap()
··· 78 #define PTRS_PER_PGD (1UL << PGDIR_BITS) 79 80 /* Kernel has a separate 44bit address space. */ 81 + #define FIRST_USER_ADDRESS 0 82 83 #define pte_ERROR(e) __builtin_trap() 84 #define pmd_ERROR(e) __builtin_trap()
+1 -1
include/asm-um/pgtable-2level.h
··· 23 #define PTRS_PER_PTE 1024 24 #define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE) 25 #define PTRS_PER_PGD 1024 26 - #define FIRST_USER_PGD_NR 0 27 28 #define pte_ERROR(e) \ 29 printk("%s:%d: bad pte %p(%08lx).\n", __FILE__, __LINE__, &(e), \
··· 23 #define PTRS_PER_PTE 1024 24 #define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE) 25 #define PTRS_PER_PGD 1024 26 + #define FIRST_USER_ADDRESS 0 27 28 #define pte_ERROR(e) \ 29 printk("%s:%d: bad pte %p(%08lx).\n", __FILE__, __LINE__, &(e), \
+1 -1
include/asm-um/pgtable-3level.h
··· 31 #define PTRS_PER_PMD 512 32 #define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE) 33 #define PTRS_PER_PGD 512 34 - #define FIRST_USER_PGD_NR 0 35 36 #define pte_ERROR(e) \ 37 printk("%s:%d: bad pte %p(%016lx).\n", __FILE__, __LINE__, &(e), \
··· 31 #define PTRS_PER_PMD 512 32 #define USER_PTRS_PER_PGD ((TASK_SIZE + (PGDIR_SIZE - 1)) / PGDIR_SIZE) 33 #define PTRS_PER_PGD 512 34 + #define FIRST_USER_ADDRESS 0 35 36 #define pte_ERROR(e) \ 37 printk("%s:%d: bad pte %p(%016lx).\n", __FILE__, __LINE__, &(e), \
+1 -1
include/asm-x86_64/pgtable.h
··· 114 #define PGDIR_MASK (~(PGDIR_SIZE-1)) 115 116 #define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) 117 - #define FIRST_USER_PGD_NR 0 118 119 #ifndef __ASSEMBLY__ 120 #define MAXMEM 0x3fffffffffffUL
··· 114 #define PGDIR_MASK (~(PGDIR_SIZE-1)) 115 116 #define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) 117 + #define FIRST_USER_ADDRESS 0 118 119 #ifndef __ASSEMBLY__ 120 #define MAXMEM 0x3fffffffffffUL