diff options
Diffstat (limited to 'arch/powerpc/mm/tlb_hash64.c')
| -rw-r--r-- | arch/powerpc/mm/tlb_hash64.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/powerpc/mm/tlb_hash64.c b/arch/powerpc/mm/tlb_hash64.c index 2b2f35f6985e..1ec06576f619 100644 --- a/arch/powerpc/mm/tlb_hash64.c +++ b/arch/powerpc/mm/tlb_hash64.c | |||
| @@ -53,11 +53,6 @@ void hpte_need_flush(struct mm_struct *mm, unsigned long addr, | |||
| 53 | 53 | ||
| 54 | i = batch->index; | 54 | i = batch->index; |
| 55 | 55 | ||
| 56 | /* We mask the address for the base page size. Huge pages will | ||
| 57 | * have applied their own masking already | ||
| 58 | */ | ||
| 59 | addr &= PAGE_MASK; | ||
| 60 | |||
| 61 | /* Get page size (maybe move back to caller). | 56 | /* Get page size (maybe move back to caller). |
| 62 | * | 57 | * |
| 63 | * NOTE: when using special 64K mappings in 4K environment like | 58 | * NOTE: when using special 64K mappings in 4K environment like |
| @@ -68,12 +63,21 @@ void hpte_need_flush(struct mm_struct *mm, unsigned long addr, | |||
| 68 | if (huge) { | 63 | if (huge) { |
| 69 | #ifdef CONFIG_HUGETLB_PAGE | 64 | #ifdef CONFIG_HUGETLB_PAGE |
| 70 | psize = get_slice_psize(mm, addr); | 65 | psize = get_slice_psize(mm, addr); |
| 66 | /* Mask the address for the correct page size */ | ||
| 67 | addr &= ~((1UL << mmu_psize_defs[psize].shift) - 1); | ||
| 71 | #else | 68 | #else |
| 72 | BUG(); | 69 | BUG(); |
| 73 | psize = pte_pagesize_index(mm, addr, pte); /* shutup gcc */ | 70 | psize = pte_pagesize_index(mm, addr, pte); /* shutup gcc */ |
| 74 | #endif | 71 | #endif |
| 75 | } else | 72 | } else { |
| 76 | psize = pte_pagesize_index(mm, addr, pte); | 73 | psize = pte_pagesize_index(mm, addr, pte); |
| 74 | /* Mask the address for the standard page size. If we | ||
| 75 | * have a 64k page kernel, but the hardware does not | ||
| 76 | * support 64k pages, this might be different from the | ||
| 77 | * hardware page size encoded in the slice table. */ | ||
| 78 | addr &= PAGE_MASK; | ||
| 79 | } | ||
| 80 | |||
| 77 | 81 | ||
| 78 | /* Build full vaddr */ | 82 | /* Build full vaddr */ |
| 79 | if (!is_kernel_addr(addr)) { | 83 | if (!is_kernel_addr(addr)) { |
