aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/mm/pgtable.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c
index db4a6253df92..533fc6fa6726 100644
--- a/arch/powerpc/mm/pgtable.c
+++ b/arch/powerpc/mm/pgtable.c
@@ -372,13 +372,25 @@ pte_t *__find_linux_pte(pgd_t *pgdir, unsigned long ea,
372 pdshift = PMD_SHIFT; 372 pdshift = PMD_SHIFT;
373 pmdp = pmd_offset(&pud, ea); 373 pmdp = pmd_offset(&pud, ea);
374 pmd = READ_ONCE(*pmdp); 374 pmd = READ_ONCE(*pmdp);
375
375 /* 376 /*
376 * A hugepage collapse is captured by pmd_none, because 377 * A hugepage collapse is captured by this condition, see
377 * it mark the pmd none and do a hpte invalidate. 378 * pmdp_collapse_flush.
378 */ 379 */
379 if (pmd_none(pmd)) 380 if (pmd_none(pmd))
380 return NULL; 381 return NULL;
381 382
383#ifdef CONFIG_PPC_BOOK3S_64
384 /*
385 * A hugepage split is captured by this condition, see
386 * pmdp_invalidate.
387 *
388 * Huge page modification can be caught here too.
389 */
390 if (pmd_is_serializing(pmd))
391 return NULL;
392#endif
393
382 if (pmd_trans_huge(pmd) || pmd_devmap(pmd)) { 394 if (pmd_trans_huge(pmd) || pmd_devmap(pmd)) {
383 if (is_thp) 395 if (is_thp)
384 *is_thp = true; 396 *is_thp = true;