Re: [PATCH] mm/debug_vm_pgtable: Fix build failure with powerpc 8xx
From: Will Deacon
Date: Fri Jun 19 2020 - 04:00:38 EST
On Thu, Jun 18, 2020 at 02:31:29PM +0000, Christophe Leroy wrote:
> diff --git a/mm/debug_vm_pgtable.c b/mm/debug_vm_pgtable.c
> index e45623016aea..61ab16fb2e36 100644
> --- a/mm/debug_vm_pgtable.c
> +++ b/mm/debug_vm_pgtable.c
> @@ -246,13 +246,13 @@ static void __init pgd_populate_tests(struct mm_struct *mm, pgd_t *pgdp,
> static void __init pte_clear_tests(struct mm_struct *mm, pte_t *ptep,
> unsigned long vaddr)
> {
> - pte_t pte = READ_ONCE(*ptep);
> + pte_t pte = ptep_get(ptep);
>
> pte = __pte(pte_val(pte) | RANDOM_ORVALUE);
> set_pte_at(mm, vaddr, ptep, pte);
> barrier();
> pte_clear(mm, vaddr, ptep);
> - pte = READ_ONCE(*ptep);
> + pte = ptep_get(ptep);
> WARN_ON(!pte_none(pte));
> }
Acked-by: Will Deacon <will@xxxxxxxxxx>
I wonder if there's a way to do this with coccinelle in one big go (but the
resulting diff would obviously need manual inspection)?
Will