arch/powerpc/mm/book3s32/tlb.c

Source file repositories/reference/linux-study-clean/arch/powerpc/mm/book3s32/tlb.c

File Facts

System
Linux kernel
Corpus path
arch/powerpc/mm/book3s32/tlb.c
Extension
.c
Size
3139 bytes
Lines
117
Domain
Architecture Layer
Bucket
arch/powerpc
Inferred role
Architecture Layer: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

if (!pmd_none(*pmd)) {
			count = ((pmd_end - start) >> PAGE_SHIFT) + 1;
			flush_hash_pages(ctx, start, pmd_val(*pmd), count);
		}
		if (pmd_end == end)
			break;
		start = pmd_end + 1;
		++pmd;
	}
}
EXPORT_SYMBOL(hash__flush_range);

/*
 * Flush all the (user) entries for the address space described by mm.
 */
void hash__flush_tlb_mm(struct mm_struct *mm)
{
	struct vm_area_struct *mp;
	VMA_ITERATOR(vmi, mm, 0);

	/*
	 * It is safe to iterate the vmas when called from dup_mmap,
	 * holding mmap_lock.  It would also be safe from unmap_region
	 * or exit_mmap, but not from vmtruncate on SMP - but it seems
	 * dup_mmap is the only SMP case which gets here.
	 */
	for_each_vma(vmi, mp)
		hash__flush_range(mp->vm_mm, mp->vm_start, mp->vm_end);
}
EXPORT_SYMBOL(hash__flush_tlb_mm);

void hash__flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
{
	struct mm_struct *mm;
	pmd_t *pmd;

	mm = (vmaddr < TASK_SIZE)? vma->vm_mm: &init_mm;
	pmd = pmd_off(mm, vmaddr);
	if (!pmd_none(*pmd))
		flush_hash_pages(mm->context.id, vmaddr, pmd_val(*pmd), 1);
}
EXPORT_SYMBOL(hash__flush_tlb_page);

void hash__flush_gather(struct mmu_gather *tlb)
{
	if (tlb->fullmm || tlb->need_flush_all)
		hash__flush_tlb_mm(tlb->mm);
	else
		hash__flush_range(tlb->mm, tlb->start, tlb->end);
}
EXPORT_SYMBOL(hash__flush_gather);

Annotation

Implementation Notes