diff options
author | David S. Miller <davem@davemloft.net> | 2014-09-27 00:58:33 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-10-05 19:53:39 -0400 |
commit | 4397bed080598001e88f612deb8b080bb1cc2322 (patch) | |
tree | c649278e09119997cb28176bb5b090b8b881fc5c /arch/sparc | |
parent | ac55c768143aa34cc3789c4820cbb0809a76fd9c (diff) |
sparc64: Define VA hole at run time, rather than at compile time.
Now that we use 4-level page tables, we can provide up to 53-bits of
virtual address space to the user.
Adjust the VA hole based upon the capabilities of the cpu type probed.
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Bob Picco <bob.picco@oracle.com>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/include/asm/page_64.h | 15 | ||||
-rw-r--r-- | arch/sparc/mm/init_64.c | 21 |
2 files changed, 25 insertions, 11 deletions
diff --git a/arch/sparc/include/asm/page_64.h b/arch/sparc/include/asm/page_64.h index 09ceb68e72b7..2211a8036bfa 100644 --- a/arch/sparc/include/asm/page_64.h +++ b/arch/sparc/include/asm/page_64.h | |||
@@ -102,21 +102,14 @@ typedef unsigned long pgprot_t; | |||
102 | 102 | ||
103 | typedef pte_t *pgtable_t; | 103 | typedef pte_t *pgtable_t; |
104 | 104 | ||
105 | /* These two values define the virtual address space range in which we | 105 | extern unsigned long sparc64_va_hole_top; |
106 | * must forbid 64-bit user processes from making mappings. It used to | 106 | extern unsigned long sparc64_va_hole_bottom; |
107 | * represent precisely the virtual address space hole present in most | ||
108 | * early sparc64 chips including UltraSPARC-I. But now it also is | ||
109 | * further constrained by the limits of our page tables, which is | ||
110 | * 43-bits of virtual address. | ||
111 | */ | ||
112 | #define SPARC64_VA_HOLE_TOP _AC(0xfffffc0000000000,UL) | ||
113 | #define SPARC64_VA_HOLE_BOTTOM _AC(0x0000040000000000,UL) | ||
114 | 107 | ||
115 | /* The next two defines specify the actual exclusion region we | 108 | /* The next two defines specify the actual exclusion region we |
116 | * enforce, wherein we use a 4GB red zone on each side of the VA hole. | 109 | * enforce, wherein we use a 4GB red zone on each side of the VA hole. |
117 | */ | 110 | */ |
118 | #define VA_EXCLUDE_START (SPARC64_VA_HOLE_BOTTOM - (1UL << 32UL)) | 111 | #define VA_EXCLUDE_START (sparc64_va_hole_bottom - (1UL << 32UL)) |
119 | #define VA_EXCLUDE_END (SPARC64_VA_HOLE_TOP + (1UL << 32UL)) | 112 | #define VA_EXCLUDE_END (sparc64_va_hole_top + (1UL << 32UL)) |
120 | 113 | ||
121 | #define TASK_UNMAPPED_BASE (test_thread_flag(TIF_32BIT) ? \ | 114 | #define TASK_UNMAPPED_BASE (test_thread_flag(TIF_32BIT) ? \ |
122 | _AC(0x0000000070000000,UL) : \ | 115 | _AC(0x0000000070000000,UL) : \ |
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 091f846e6192..c241c5723373 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c | |||
@@ -1630,25 +1630,46 @@ static void __init page_offset_shift_patch(unsigned long phys_bits) | |||
1630 | } | 1630 | } |
1631 | } | 1631 | } |
1632 | 1632 | ||
1633 | unsigned long sparc64_va_hole_top = 0xfffff80000000000UL; | ||
1634 | unsigned long sparc64_va_hole_bottom = 0x0000080000000000UL; | ||
1635 | |||
1633 | static void __init setup_page_offset(void) | 1636 | static void __init setup_page_offset(void) |
1634 | { | 1637 | { |
1635 | unsigned long max_phys_bits = 40; | 1638 | unsigned long max_phys_bits = 40; |
1636 | 1639 | ||
1637 | if (tlb_type == cheetah || tlb_type == cheetah_plus) { | 1640 | if (tlb_type == cheetah || tlb_type == cheetah_plus) { |
1641 | /* Cheetah/Panther support a full 64-bit virtual | ||
1642 | * address, so we can use all that our page tables | ||
1643 | * support. | ||
1644 | */ | ||
1645 | sparc64_va_hole_top = 0xfff0000000000000UL; | ||
1646 | sparc64_va_hole_bottom = 0x0010000000000000UL; | ||
1647 | |||
1638 | max_phys_bits = 42; | 1648 | max_phys_bits = 42; |
1639 | } else if (tlb_type == hypervisor) { | 1649 | } else if (tlb_type == hypervisor) { |
1640 | switch (sun4v_chip_type) { | 1650 | switch (sun4v_chip_type) { |
1641 | case SUN4V_CHIP_NIAGARA1: | 1651 | case SUN4V_CHIP_NIAGARA1: |
1642 | case SUN4V_CHIP_NIAGARA2: | 1652 | case SUN4V_CHIP_NIAGARA2: |
1653 | /* T1 and T2 support 48-bit virtual addresses. */ | ||
1654 | sparc64_va_hole_top = 0xffff800000000000UL; | ||
1655 | sparc64_va_hole_bottom = 0x0000800000000000UL; | ||
1656 | |||
1643 | max_phys_bits = 39; | 1657 | max_phys_bits = 39; |
1644 | break; | 1658 | break; |
1645 | case SUN4V_CHIP_NIAGARA3: | 1659 | case SUN4V_CHIP_NIAGARA3: |
1660 | /* T3 supports 48-bit virtual addresses. */ | ||
1661 | sparc64_va_hole_top = 0xffff800000000000UL; | ||
1662 | sparc64_va_hole_bottom = 0x0000800000000000UL; | ||
1663 | |||
1646 | max_phys_bits = 43; | 1664 | max_phys_bits = 43; |
1647 | break; | 1665 | break; |
1648 | case SUN4V_CHIP_NIAGARA4: | 1666 | case SUN4V_CHIP_NIAGARA4: |
1649 | case SUN4V_CHIP_NIAGARA5: | 1667 | case SUN4V_CHIP_NIAGARA5: |
1650 | case SUN4V_CHIP_SPARC64X: | 1668 | case SUN4V_CHIP_SPARC64X: |
1651 | default: | 1669 | default: |
1670 | /* T4 and later support 52-bit virtual addresses. */ | ||
1671 | sparc64_va_hole_top = 0xfff8000000000000UL; | ||
1672 | sparc64_va_hole_bottom = 0x0008000000000000UL; | ||
1652 | max_phys_bits = 47; | 1673 | max_phys_bits = 47; |
1653 | break; | 1674 | break; |
1654 | } | 1675 | } |