diff options
Diffstat (limited to 'arch/sparc64/mm/init.c')
-rw-r--r-- | arch/sparc64/mm/init.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index c2b556106fc1..16d231703d6a 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -283,6 +283,7 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t p | |||
283 | struct mm_struct *mm; | 283 | struct mm_struct *mm; |
284 | struct tsb *tsb; | 284 | struct tsb *tsb; |
285 | unsigned long tag, flags; | 285 | unsigned long tag, flags; |
286 | unsigned long tsb_index, tsb_hash_shift; | ||
286 | 287 | ||
287 | if (tlb_type != hypervisor) { | 288 | if (tlb_type != hypervisor) { |
288 | unsigned long pfn = pte_pfn(pte); | 289 | unsigned long pfn = pte_pfn(pte); |
@@ -312,10 +313,26 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t p | |||
312 | 313 | ||
313 | mm = vma->vm_mm; | 314 | mm = vma->vm_mm; |
314 | 315 | ||
316 | tsb_index = MM_TSB_BASE; | ||
317 | tsb_hash_shift = PAGE_SHIFT; | ||
318 | |||
315 | spin_lock_irqsave(&mm->context.lock, flags); | 319 | spin_lock_irqsave(&mm->context.lock, flags); |
316 | 320 | ||
317 | tsb = &mm->context.tsb[(address >> PAGE_SHIFT) & | 321 | #ifdef CONFIG_HUGETLB_PAGE |
318 | (mm->context.tsb_nentries - 1UL)]; | 322 | if (mm->context.tsb_block[MM_TSB_HUGE].tsb != NULL) { |
323 | if ((tlb_type == hypervisor && | ||
324 | (pte_val(pte) & _PAGE_SZALL_4V) == _PAGE_SZHUGE_4V) || | ||
325 | (tlb_type != hypervisor && | ||
326 | (pte_val(pte) & _PAGE_SZALL_4U) == _PAGE_SZHUGE_4U)) { | ||
327 | tsb_index = MM_TSB_HUGE; | ||
328 | tsb_hash_shift = HPAGE_SHIFT; | ||
329 | } | ||
330 | } | ||
331 | #endif | ||
332 | |||
333 | tsb = mm->context.tsb_block[tsb_index].tsb; | ||
334 | tsb += ((address >> tsb_hash_shift) & | ||
335 | (mm->context.tsb_block[tsb_index].tsb_nentries - 1UL)); | ||
319 | tag = (address >> 22UL); | 336 | tag = (address >> 22UL); |
320 | tsb_insert(tsb, tag, pte_val(pte)); | 337 | tsb_insert(tsb, tag, pte_val(pte)); |
321 | 338 | ||