Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

arm64/mm: add addr parameter to __ptep_get_and_clear_anysz()

To provide support for page table check on powerpc, we need to
reinstate the address parameter in several functions, including
page_table_check_{pte,pmd,pud}_clear().

In preparation for this, add the addr parameter to arm64's
__ptep_get_and_clear_anysz() and change its callsites accordingly.

Link: https://lkml.kernel.org/r/20251219-pgtable_check_v18rebase-v18-2-755bc151a50b@linux.ibm.com
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Donet Tom <donettom@linux.ibm.com>
Cc: Guo Weikang <guoweikang.kernel@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jason Gunthorpe <jgg@ziepe.ca>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Magnus Lindholm <linmag7@gmail.com>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Miehlbradt <nicholas@linux.ibm.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Paul Mackerras <paulus@ozlabs.org>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: "Ritesh Harjani (IBM)" <ritesh.list@gmail.com>
Cc: Rohan McLure <rmclure@linux.ibm.com>
Cc: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Cc: Thomas Huth <thuth@redhat.com>
Cc: "Vishal Moola (Oracle)" <vishal.moola@gmail.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Andrew Donnellan and committed by
Andrew Morton
ee329c29 9ac4941a

+7 -5
+3 -2
arch/arm64/include/asm/pgtable.h
··· 1332 1332 #endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG */ 1333 1333 1334 1334 static inline pte_t __ptep_get_and_clear_anysz(struct mm_struct *mm, 1335 + unsigned long address, 1335 1336 pte_t *ptep, 1336 1337 unsigned long pgsize) 1337 1338 { ··· 1360 1359 static inline pte_t __ptep_get_and_clear(struct mm_struct *mm, 1361 1360 unsigned long address, pte_t *ptep) 1362 1361 { 1363 - return __ptep_get_and_clear_anysz(mm, ptep, PAGE_SIZE); 1362 + return __ptep_get_and_clear_anysz(mm, address, ptep, PAGE_SIZE); 1364 1363 } 1365 1364 1366 1365 static inline void __clear_full_ptes(struct mm_struct *mm, unsigned long addr, ··· 1399 1398 static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm, 1400 1399 unsigned long address, pmd_t *pmdp) 1401 1400 { 1402 - return pte_pmd(__ptep_get_and_clear_anysz(mm, (pte_t *)pmdp, PMD_SIZE)); 1401 + return pte_pmd(__ptep_get_and_clear_anysz(mm, address, (pte_t *)pmdp, PMD_SIZE)); 1403 1402 } 1404 1403 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ 1405 1404
+4 -3
arch/arm64/mm/hugetlbpage.c
··· 155 155 pte_t pte, tmp_pte; 156 156 bool present; 157 157 158 - pte = __ptep_get_and_clear_anysz(mm, ptep, pgsize); 158 + pte = __ptep_get_and_clear_anysz(mm, addr, ptep, pgsize); 159 159 present = pte_present(pte); 160 160 while (--ncontig) { 161 161 ptep++; 162 - tmp_pte = __ptep_get_and_clear_anysz(mm, ptep, pgsize); 162 + addr += pgsize; 163 + tmp_pte = __ptep_get_and_clear_anysz(mm, addr, ptep, pgsize); 163 164 if (present) { 164 165 if (pte_dirty(tmp_pte)) 165 166 pte = pte_mkdirty(pte); ··· 204 203 unsigned long i, saddr = addr; 205 204 206 205 for (i = 0; i < ncontig; i++, addr += pgsize, ptep++) 207 - __ptep_get_and_clear_anysz(mm, ptep, pgsize); 206 + __ptep_get_and_clear_anysz(mm, addr, ptep, pgsize); 208 207 209 208 if (mm == &init_mm) 210 209 flush_tlb_kernel_range(saddr, addr);