diff options
-rw-r--r-- | arch/powerpc/mm/hash_utils_64.c | 6 | ||||
-rw-r--r-- | arch/powerpc/mm/hugetlbpage.c | 6 | ||||
-rw-r--r-- | arch/powerpc/mm/slb_low.S | 13 | ||||
-rw-r--r-- | include/asm-ppc64/pgtable-4k.h | 3 | ||||
-rw-r--r-- | include/asm-ppc64/pgtable-64k.h | 3 |
5 files changed, 25 insertions, 6 deletions
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index b2f3dbca6952..f15dfb92dec0 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -329,12 +329,14 @@ static void __init htab_init_page_sizes(void) | |||
329 | */ | 329 | */ |
330 | if (mmu_psize_defs[MMU_PAGE_16M].shift) | 330 | if (mmu_psize_defs[MMU_PAGE_16M].shift) |
331 | mmu_huge_psize = MMU_PAGE_16M; | 331 | mmu_huge_psize = MMU_PAGE_16M; |
332 | /* With 4k/4level pagetables, we can't (for now) cope with a | ||
333 | * huge page size < PMD_SIZE */ | ||
332 | else if (mmu_psize_defs[MMU_PAGE_1M].shift) | 334 | else if (mmu_psize_defs[MMU_PAGE_1M].shift) |
333 | mmu_huge_psize = MMU_PAGE_1M; | 335 | mmu_huge_psize = MMU_PAGE_1M; |
334 | 336 | ||
335 | /* Calculate HPAGE_SHIFT and sanity check it */ | 337 | /* Calculate HPAGE_SHIFT and sanity check it */ |
336 | if (mmu_psize_defs[mmu_huge_psize].shift > 16 && | 338 | if (mmu_psize_defs[mmu_huge_psize].shift > MIN_HUGEPTE_SHIFT && |
337 | mmu_psize_defs[mmu_huge_psize].shift < 28) | 339 | mmu_psize_defs[mmu_huge_psize].shift < SID_SHIFT) |
338 | HPAGE_SHIFT = mmu_psize_defs[mmu_huge_psize].shift; | 340 | HPAGE_SHIFT = mmu_psize_defs[mmu_huge_psize].shift; |
339 | else | 341 | else |
340 | HPAGE_SHIFT = 0; /* No huge pages dude ! */ | 342 | HPAGE_SHIFT = 0; /* No huge pages dude ! */ |
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index 0073a04047e4..426c269e552e 100644 --- a/arch/powerpc/mm/hugetlbpage.c +++ b/arch/powerpc/mm/hugetlbpage.c | |||
@@ -212,6 +212,12 @@ static int prepare_high_area_for_htlb(struct mm_struct *mm, unsigned long area) | |||
212 | 212 | ||
213 | BUG_ON(area >= NUM_HIGH_AREAS); | 213 | BUG_ON(area >= NUM_HIGH_AREAS); |
214 | 214 | ||
215 | /* Hack, so that each addresses is controlled by exactly one | ||
216 | * of the high or low area bitmaps, the first high area starts | ||
217 | * at 4GB, not 0 */ | ||
218 | if (start == 0) | ||
219 | start = 0x100000000UL; | ||
220 | |||
215 | /* Check no VMAs are in the region */ | 221 | /* Check no VMAs are in the region */ |
216 | vma = find_vma(mm, start); | 222 | vma = find_vma(mm, start); |
217 | if (vma && (vma->vm_start < end)) | 223 | if (vma && (vma->vm_start < end)) |
diff --git a/arch/powerpc/mm/slb_low.S b/arch/powerpc/mm/slb_low.S index 3e18241b6f35..950ffc5848c7 100644 --- a/arch/powerpc/mm/slb_low.S +++ b/arch/powerpc/mm/slb_low.S | |||
@@ -80,12 +80,17 @@ _GLOBAL(slb_miss_kernel_load_virtual) | |||
80 | BEGIN_FTR_SECTION | 80 | BEGIN_FTR_SECTION |
81 | b 1f | 81 | b 1f |
82 | END_FTR_SECTION_IFCLR(CPU_FTR_16M_PAGE) | 82 | END_FTR_SECTION_IFCLR(CPU_FTR_16M_PAGE) |
83 | cmpldi r10,16 | ||
84 | |||
85 | lhz r9,PACALOWHTLBAREAS(r13) | ||
86 | mr r11,r10 | ||
87 | blt 5f | ||
88 | |||
83 | lhz r9,PACAHIGHHTLBAREAS(r13) | 89 | lhz r9,PACAHIGHHTLBAREAS(r13) |
84 | srdi r11,r10,(HTLB_AREA_SHIFT-SID_SHIFT) | 90 | srdi r11,r10,(HTLB_AREA_SHIFT-SID_SHIFT) |
85 | srd r9,r9,r11 | 91 | |
86 | lhz r11,PACALOWHTLBAREAS(r13) | 92 | 5: srd r9,r9,r11 |
87 | srd r11,r11,r10 | 93 | andi. r9,r9,1 |
88 | or. r9,r9,r11 | ||
89 | beq 1f | 94 | beq 1f |
90 | _GLOBAL(slb_miss_user_load_huge) | 95 | _GLOBAL(slb_miss_user_load_huge) |
91 | li r11,0 | 96 | li r11,0 |
diff --git a/include/asm-ppc64/pgtable-4k.h b/include/asm-ppc64/pgtable-4k.h index c883a2748558..e9590c06ad92 100644 --- a/include/asm-ppc64/pgtable-4k.h +++ b/include/asm-ppc64/pgtable-4k.h | |||
@@ -23,6 +23,9 @@ | |||
23 | #define PMD_SIZE (1UL << PMD_SHIFT) | 23 | #define PMD_SIZE (1UL << PMD_SHIFT) |
24 | #define PMD_MASK (~(PMD_SIZE-1)) | 24 | #define PMD_MASK (~(PMD_SIZE-1)) |
25 | 25 | ||
26 | /* With 4k base page size, hugepage PTEs go at the PMD level */ | ||
27 | #define MIN_HUGEPTE_SHIFT PMD_SHIFT | ||
28 | |||
26 | /* PUD_SHIFT determines what a third-level page table entry can map */ | 29 | /* PUD_SHIFT determines what a third-level page table entry can map */ |
27 | #define PUD_SHIFT (PMD_SHIFT + PMD_INDEX_SIZE) | 30 | #define PUD_SHIFT (PMD_SHIFT + PMD_INDEX_SIZE) |
28 | #define PUD_SIZE (1UL << PUD_SHIFT) | 31 | #define PUD_SIZE (1UL << PUD_SHIFT) |
diff --git a/include/asm-ppc64/pgtable-64k.h b/include/asm-ppc64/pgtable-64k.h index c5f437c86b3c..154f1840ece4 100644 --- a/include/asm-ppc64/pgtable-64k.h +++ b/include/asm-ppc64/pgtable-64k.h | |||
@@ -14,6 +14,9 @@ | |||
14 | #define PTRS_PER_PMD (1 << PMD_INDEX_SIZE) | 14 | #define PTRS_PER_PMD (1 << PMD_INDEX_SIZE) |
15 | #define PTRS_PER_PGD (1 << PGD_INDEX_SIZE) | 15 | #define PTRS_PER_PGD (1 << PGD_INDEX_SIZE) |
16 | 16 | ||
17 | /* With 4k base page size, hugepage PTEs go at the PMD level */ | ||
18 | #define MIN_HUGEPTE_SHIFT PAGE_SHIFT | ||
19 | |||
17 | /* PMD_SHIFT determines what a second-level page table entry can map */ | 20 | /* PMD_SHIFT determines what a second-level page table entry can map */ |
18 | #define PMD_SHIFT (PAGE_SHIFT + PTE_INDEX_SIZE) | 21 | #define PMD_SHIFT (PAGE_SHIFT + PTE_INDEX_SIZE) |
19 | #define PMD_SIZE (1UL << PMD_SHIFT) | 22 | #define PMD_SIZE (1UL << PMD_SHIFT) |