@@ -231,10 +231,10 @@ static void __init pmd_advanced_tests(struct pgtable_debug_args *args)
231231 set_pmd_at (args -> mm , vaddr , args -> pmdp , pmd );
232232 flush_dcache_page (page );
233233 pmdp_set_wrprotect (args -> mm , vaddr , args -> pmdp );
234- pmd = READ_ONCE ( * args -> pmdp );
234+ pmd = pmdp_get ( args -> pmdp );
235235 WARN_ON (pmd_write (pmd ));
236236 pmdp_huge_get_and_clear (args -> mm , vaddr , args -> pmdp );
237- pmd = READ_ONCE ( * args -> pmdp );
237+ pmd = pmdp_get ( args -> pmdp );
238238 WARN_ON (!pmd_none (pmd ));
239239
240240 pmd = pfn_pmd (args -> pmd_pfn , args -> page_prot );
@@ -245,18 +245,18 @@ static void __init pmd_advanced_tests(struct pgtable_debug_args *args)
245245 pmd = pmd_mkwrite (pmd , args -> vma );
246246 pmd = pmd_mkdirty (pmd );
247247 pmdp_set_access_flags (args -> vma , vaddr , args -> pmdp , pmd , 1 );
248- pmd = READ_ONCE ( * args -> pmdp );
248+ pmd = pmdp_get ( args -> pmdp );
249249 WARN_ON (!(pmd_write (pmd ) && pmd_dirty (pmd )));
250250 pmdp_huge_get_and_clear_full (args -> vma , vaddr , args -> pmdp , 1 );
251- pmd = READ_ONCE ( * args -> pmdp );
251+ pmd = pmdp_get ( args -> pmdp );
252252 WARN_ON (!pmd_none (pmd ));
253253
254254 pmd = pmd_mkhuge (pfn_pmd (args -> pmd_pfn , args -> page_prot ));
255255 pmd = pmd_mkyoung (pmd );
256256 set_pmd_at (args -> mm , vaddr , args -> pmdp , pmd );
257257 flush_dcache_page (page );
258258 pmdp_test_and_clear_young (args -> vma , vaddr , args -> pmdp );
259- pmd = READ_ONCE ( * args -> pmdp );
259+ pmd = pmdp_get ( args -> pmdp );
260260 WARN_ON (pmd_young (pmd ));
261261
262262 /* Clear the pte entries */
@@ -357,12 +357,12 @@ static void __init pud_advanced_tests(struct pgtable_debug_args *args)
357357 set_pud_at (args -> mm , vaddr , args -> pudp , pud );
358358 flush_dcache_page (page );
359359 pudp_set_wrprotect (args -> mm , vaddr , args -> pudp );
360- pud = READ_ONCE ( * args -> pudp );
360+ pud = pudp_get ( args -> pudp );
361361 WARN_ON (pud_write (pud ));
362362
363363#ifndef __PAGETABLE_PMD_FOLDED
364364 pudp_huge_get_and_clear (args -> mm , vaddr , args -> pudp );
365- pud = READ_ONCE ( * args -> pudp );
365+ pud = pudp_get ( args -> pudp );
366366 WARN_ON (!pud_none (pud ));
367367#endif /* __PAGETABLE_PMD_FOLDED */
368368 pud = pfn_pud (args -> pud_pfn , args -> page_prot );
@@ -374,12 +374,12 @@ static void __init pud_advanced_tests(struct pgtable_debug_args *args)
374374 pud = pud_mkwrite (pud );
375375 pud = pud_mkdirty (pud );
376376 pudp_set_access_flags (args -> vma , vaddr , args -> pudp , pud , 1 );
377- pud = READ_ONCE ( * args -> pudp );
377+ pud = pudp_get ( args -> pudp );
378378 WARN_ON (!(pud_write (pud ) && pud_dirty (pud )));
379379
380380#ifndef __PAGETABLE_PMD_FOLDED
381381 pudp_huge_get_and_clear_full (args -> vma , vaddr , args -> pudp , 1 );
382- pud = READ_ONCE ( * args -> pudp );
382+ pud = pudp_get ( args -> pudp );
383383 WARN_ON (!pud_none (pud ));
384384#endif /* __PAGETABLE_PMD_FOLDED */
385385
@@ -389,7 +389,7 @@ static void __init pud_advanced_tests(struct pgtable_debug_args *args)
389389 set_pud_at (args -> mm , vaddr , args -> pudp , pud );
390390 flush_dcache_page (page );
391391 pudp_test_and_clear_young (args -> vma , vaddr , args -> pudp );
392- pud = READ_ONCE ( * args -> pudp );
392+ pud = pudp_get ( args -> pudp );
393393 WARN_ON (pud_young (pud ));
394394
395395 pudp_huge_get_and_clear (args -> mm , vaddr , args -> pudp );
@@ -441,7 +441,7 @@ static void __init pmd_huge_tests(struct pgtable_debug_args *args)
441441 WRITE_ONCE (* args -> pmdp , __pmd (0 ));
442442 WARN_ON (!pmd_set_huge (args -> pmdp , __pfn_to_phys (args -> fixed_pmd_pfn ), args -> page_prot ));
443443 WARN_ON (!pmd_clear_huge (args -> pmdp ));
444- pmd = READ_ONCE ( * args -> pmdp );
444+ pmd = pmdp_get ( args -> pmdp );
445445 WARN_ON (!pmd_none (pmd ));
446446}
447447
@@ -461,7 +461,7 @@ static void __init pud_huge_tests(struct pgtable_debug_args *args)
461461 WRITE_ONCE (* args -> pudp , __pud (0 ));
462462 WARN_ON (!pud_set_huge (args -> pudp , __pfn_to_phys (args -> fixed_pud_pfn ), args -> page_prot ));
463463 WARN_ON (!pud_clear_huge (args -> pudp ));
464- pud = READ_ONCE ( * args -> pudp );
464+ pud = pudp_get ( args -> pudp );
465465 WARN_ON (!pud_none (pud ));
466466}
467467#else /* !CONFIG_HAVE_ARCH_HUGE_VMAP */
@@ -490,15 +490,15 @@ static void __init pgd_basic_tests(struct pgtable_debug_args *args)
490490#ifndef __PAGETABLE_PUD_FOLDED
491491static void __init pud_clear_tests (struct pgtable_debug_args * args )
492492{
493- pud_t pud = READ_ONCE ( * args -> pudp );
493+ pud_t pud = pudp_get ( args -> pudp );
494494
495495 if (mm_pmd_folded (args -> mm ))
496496 return ;
497497
498498 pr_debug ("Validating PUD clear\n" );
499499 WARN_ON (pud_none (pud ));
500500 pud_clear (args -> pudp );
501- pud = READ_ONCE ( * args -> pudp );
501+ pud = pudp_get ( args -> pudp );
502502 WARN_ON (!pud_none (pud ));
503503}
504504
@@ -515,7 +515,7 @@ static void __init pud_populate_tests(struct pgtable_debug_args *args)
515515 * Hence this must not qualify as pud_bad().
516516 */
517517 pud_populate (args -> mm , args -> pudp , args -> start_pmdp );
518- pud = READ_ONCE ( * args -> pudp );
518+ pud = pudp_get ( args -> pudp );
519519 WARN_ON (pud_bad (pud ));
520520}
521521#else /* !__PAGETABLE_PUD_FOLDED */
@@ -526,15 +526,15 @@ static void __init pud_populate_tests(struct pgtable_debug_args *args) { }
526526#ifndef __PAGETABLE_P4D_FOLDED
527527static void __init p4d_clear_tests (struct pgtable_debug_args * args )
528528{
529- p4d_t p4d = READ_ONCE ( * args -> p4dp );
529+ p4d_t p4d = p4dp_get ( args -> p4dp );
530530
531531 if (mm_pud_folded (args -> mm ))
532532 return ;
533533
534534 pr_debug ("Validating P4D clear\n" );
535535 WARN_ON (p4d_none (p4d ));
536536 p4d_clear (args -> p4dp );
537- p4d = READ_ONCE ( * args -> p4dp );
537+ p4d = p4dp_get ( args -> p4dp );
538538 WARN_ON (!p4d_none (p4d ));
539539}
540540
@@ -553,21 +553,21 @@ static void __init p4d_populate_tests(struct pgtable_debug_args *args)
553553 pud_clear (args -> pudp );
554554 p4d_clear (args -> p4dp );
555555 p4d_populate (args -> mm , args -> p4dp , args -> start_pudp );
556- p4d = READ_ONCE ( * args -> p4dp );
556+ p4d = p4dp_get ( args -> p4dp );
557557 WARN_ON (p4d_bad (p4d ));
558558}
559559
560560static void __init pgd_clear_tests (struct pgtable_debug_args * args )
561561{
562- pgd_t pgd = READ_ONCE ( * ( args -> pgdp ) );
562+ pgd_t pgd = pgdp_get ( args -> pgdp );
563563
564564 if (mm_p4d_folded (args -> mm ))
565565 return ;
566566
567567 pr_debug ("Validating PGD clear\n" );
568568 WARN_ON (pgd_none (pgd ));
569569 pgd_clear (args -> pgdp );
570- pgd = READ_ONCE ( * args -> pgdp );
570+ pgd = pgdp_get ( args -> pgdp );
571571 WARN_ON (!pgd_none (pgd ));
572572}
573573
@@ -586,7 +586,7 @@ static void __init pgd_populate_tests(struct pgtable_debug_args *args)
586586 p4d_clear (args -> p4dp );
587587 pgd_clear (args -> pgdp );
588588 pgd_populate (args -> mm , args -> pgdp , args -> start_p4dp );
589- pgd = READ_ONCE ( * args -> pgdp );
589+ pgd = pgdp_get ( args -> pgdp );
590590 WARN_ON (pgd_bad (pgd ));
591591}
592592#else /* !__PAGETABLE_P4D_FOLDED */
@@ -627,12 +627,12 @@ static void __init pte_clear_tests(struct pgtable_debug_args *args)
627627
628628static void __init pmd_clear_tests (struct pgtable_debug_args * args )
629629{
630- pmd_t pmd = READ_ONCE ( * args -> pmdp );
630+ pmd_t pmd = pmdp_get ( args -> pmdp );
631631
632632 pr_debug ("Validating PMD clear\n" );
633633 WARN_ON (pmd_none (pmd ));
634634 pmd_clear (args -> pmdp );
635- pmd = READ_ONCE ( * args -> pmdp );
635+ pmd = pmdp_get ( args -> pmdp );
636636 WARN_ON (!pmd_none (pmd ));
637637}
638638
@@ -646,7 +646,7 @@ static void __init pmd_populate_tests(struct pgtable_debug_args *args)
646646 * Hence this must not qualify as pmd_bad().
647647 */
648648 pmd_populate (args -> mm , args -> pmdp , args -> start_ptep );
649- pmd = READ_ONCE ( * args -> pmdp );
649+ pmd = pmdp_get ( args -> pmdp );
650650 WARN_ON (pmd_bad (pmd ));
651651}
652652
@@ -1251,7 +1251,7 @@ static int __init init_args(struct pgtable_debug_args *args)
12511251 ret = - ENOMEM ;
12521252 goto error ;
12531253 }
1254- args -> start_ptep = pmd_pgtable (READ_ONCE ( * args -> pmdp ));
1254+ args -> start_ptep = pmd_pgtable (pmdp_get ( args -> pmdp ));
12551255 WARN_ON (!args -> start_ptep );
12561256
12571257 init_fixed_pfns (args );
0 commit comments