Skip to content

Commit 00de2c9

Browse files
Qi Zhengakpm00
authored andcommitted
arm64: mm: use ptep_clear() instead of pte_clear() in clear_flush()
In clear_flush(), the original pte may be a present entry, so we should use ptep_clear() to let page_table_check track the pte clearing operation, otherwise it may cause false positive in subsequent set_pte_at(). Link: https://lkml.kernel.org/r/20230810093241.1181142-1-qi.zheng@linux.dev Fixes: 42b2547 ("arm64/mm: enable ARCH_SUPPORTS_PAGE_TABLE_CHECK") Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com> Acked-by: Will Deacon <will@kernel.org> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Kefeng Wang <wangkefeng.wang@huawei.com> Cc: Muchun Song <muchun.song@linux.dev> Cc: Pasha Tatashin <pasha.tatashin@soleen.com> Cc: Qi Zheng <zhengqi.arch@bytedance.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 5003a2b commit 00de2c9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/arm64/mm/hugetlbpage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ static void clear_flush(struct mm_struct *mm,
236236
unsigned long i, saddr = addr;
237237

238238
for (i = 0; i < ncontig; i++, addr += pgsize, ptep++)
239-
pte_clear(mm, addr, ptep);
239+
ptep_clear(mm, addr, ptep);
240240

241241
flush_tlb_range(&vma, saddr, addr);
242242
}

0 commit comments

Comments
 (0)