aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-09-18 14:58:32 -0400
committerDavid S. Miller <davem@davemloft.net>2013-11-12 18:22:33 -0500
commitc920745e6964bd4b9315a17b018d83fad66010d3 (patch)
tree07a872bac01d893a5a494b12ece22404ba159dce
parent10d0c9705e80bbd3d587c5fad24599aabaca6688 (diff)
sparc64: Clean up 64-bit mmap exclusion defines.
Older UltraSPARC chips had an address space hole due to the MMU only supporting 44-bit virtual addresses. The top end of this hole also has the same value as the current definition of PAGE_OFFSET, so this can be confusing. Consolidate the defines for the userspace mmap exclusion range into page_64.h and use them in sys_sparc_64.c and hugetlbpage.c Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Bob Picco <bob.picco@oracle.com>
-rw-r--r--arch/sparc/include/asm/page_64.h17
-rw-r--r--arch/sparc/kernel/sys_sparc_64.c3
-rw-r--r--arch/sparc/mm/hugetlbpage.c2
3 files changed, 15 insertions, 7 deletions
diff --git a/arch/sparc/include/asm/page_64.h b/arch/sparc/include/asm/page_64.h
index e15538899f3d..d95931247feb 100644
--- a/arch/sparc/include/asm/page_64.h
+++ b/arch/sparc/include/asm/page_64.h
@@ -93,9 +93,22 @@ typedef unsigned long pgprot_t;
93 93
94typedef pte_t *pgtable_t; 94typedef pte_t *pgtable_t;
95 95
96/* These two values define the virtual address space range in which we
97 * must forbid 64-bit user processes from making mappings. It
98 * represents the virtual address space hole present in most early
99 * sparc64 chips including UltraSPARC-I. The next two defines specify
100 * the actual exclusion region we enforce, wherein we use a 4GB red
101 * zone on each side of the VA hole.
102 */
103#define SPARC64_VA_HOLE_TOP _AC(0xfffff80000000000,UL)
104#define SPARC64_VA_HOLE_BOTTOM _AC(0x0000080000000000,UL)
105
106#define VA_EXCLUDE_START (SPARC64_VA_HOLE_BOTTOM - (1UL << 32UL))
107#define VA_EXCLUDE_END (SPARC64_VA_HOLE_TOP + (1UL << 32UL))
108
96#define TASK_UNMAPPED_BASE (test_thread_flag(TIF_32BIT) ? \ 109#define TASK_UNMAPPED_BASE (test_thread_flag(TIF_32BIT) ? \
97 (_AC(0x0000000070000000,UL)) : \ 110 _AC(0x0000000070000000,UL) : \
98 (_AC(0xfffff80000000000,UL) + (1UL << 32UL))) 111 VA_EXCLUDE_END)
99 112
100#include <asm-generic/memory_model.h> 113#include <asm-generic/memory_model.h>
101 114
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
index 51561b8b15ba..d05eb9c1d846 100644
--- a/arch/sparc/kernel/sys_sparc_64.c
+++ b/arch/sparc/kernel/sys_sparc_64.c
@@ -39,9 +39,6 @@ asmlinkage unsigned long sys_getpagesize(void)
39 return PAGE_SIZE; 39 return PAGE_SIZE;
40} 40}
41 41
42#define VA_EXCLUDE_START (0x0000080000000000UL - (1UL << 32UL))
43#define VA_EXCLUDE_END (0xfffff80000000000UL + (1UL << 32UL))
44
45/* Does addr --> addr+len fall within 4GB of the VA-space hole or 42/* Does addr --> addr+len fall within 4GB of the VA-space hole or
46 * overflow past the end of the 64-bit address space? 43 * overflow past the end of the 64-bit address space?
47 */ 44 */
diff --git a/arch/sparc/mm/hugetlbpage.c b/arch/sparc/mm/hugetlbpage.c
index 96399646570a..30963178d7e9 100644
--- a/arch/sparc/mm/hugetlbpage.c
+++ b/arch/sparc/mm/hugetlbpage.c
@@ -21,8 +21,6 @@
21/* Slightly simplified from the non-hugepage variant because by 21/* Slightly simplified from the non-hugepage variant because by
22 * definition we don't have to worry about any page coloring stuff 22 * definition we don't have to worry about any page coloring stuff
23 */ 23 */
24#define VA_EXCLUDE_START (0x0000080000000000UL - (1UL << 32UL))
25#define VA_EXCLUDE_END (0xfffff80000000000UL + (1UL << 32UL))
26 24
27static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *filp, 25static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *filp,
28 unsigned long addr, 26 unsigned long addr,