Commit e75d07bd authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman
Browse files

powerpc: Remove find_current_mm_pte()



Last usage of find_current_mm_pte() was removed by
commit 15759cb0 ("powerpc/perf/callchain: Use
__get_user_pages_fast in read_user_stack_slow")

Remove it.

Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/ec79f462a3bfa8365b7df505e574d5d85246bc68.1646818177.git.christophe.leroy@csgroup.eu
parent 58369476
Loading
Loading
Loading
Loading
+0 −25
Original line number Diff line number Diff line
@@ -60,29 +60,4 @@ static inline phys_addr_t ppc_find_vmap_phys(unsigned long addr)
	return pa;
}

/*
 * This is what we should always use. Any other lockless page table lookup needs
 * careful audit against THP split.
 */
static inline pte_t *find_current_mm_pte(pgd_t *pgdir, unsigned long ea,
					 bool *is_thp, unsigned *hshift)
{
	pte_t *pte;

	VM_WARN(!arch_irqs_disabled(), "%s called with irq enabled\n", __func__);
	VM_WARN(pgdir != current->mm->pgd,
		"%s lock less page table lookup called on wrong mm\n", __func__);
	pte = __find_linux_pte(pgdir, ea, is_thp, hshift);

#if defined(CONFIG_DEBUG_VM) &&						\
	!(defined(CONFIG_HUGETLB_PAGE) || defined(CONFIG_TRANSPARENT_HUGEPAGE))
	/*
	 * We should not find huge page if these configs are not enabled.
	 */
	if (hshift)
		WARN_ON(*hshift);
#endif
	return pte;
}

#endif /* _ASM_POWERPC_PTE_WALK_H */
+2 −2
Original line number Diff line number Diff line
@@ -100,14 +100,14 @@ static void do_serialize(void *arg)
}

/*
 * Serialize against find_current_mm_pte which does lock-less
 * Serialize against __find_linux_pte() which does lock-less
 * lookup in page tables with local interrupts disabled. For huge pages
 * it casts pmd_t to pte_t. Since format of pte_t is different from
 * pmd_t we want to prevent transit from pmd pointing to page table
 * to pmd pointing to huge page (and back) while interrupts are disabled.
 * We clear pmd to possibly replace it with page table pointer in
 * different code paths. So make sure we wait for the parallel
 * find_current_mm_pte to finish.
 * __find_linux_pte() to finish.
 */
void serialize_against_pte_lookup(struct mm_struct *mm)
{