]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
arm64/mm: add addr parameter to __ptep_get_and_clear_anysz()
authorAndrew Donnellan <ajd@linux.ibm.com>
Wed, 13 Aug 2025 06:26:03 +0000 (16:26 +1000)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 18 Aug 2025 05:08:54 +0000 (22:08 -0700)
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/20250813062614.51759-3-ajd@linux.ibm.com
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Nicholas Miehlbradt <nicholas@linux.ibm.com>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Rohan McLure <rmclure@linux.ibm.com>
Cc: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/arm64/include/asm/pgtable.h
arch/arm64/mm/hugetlbpage.c

index ed644be48d871836f879ddfd86957a595017c3f3..66b5309fcad868a65d1b3f7fdf123da32d736d05 100644 (file)
@@ -1357,6 +1357,7 @@ static inline int pmdp_test_and_clear_young(struct vm_area_struct *vma,
 #endif /* CONFIG_TRANSPARENT_HUGEPAGE || CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG */
 
 static inline pte_t __ptep_get_and_clear_anysz(struct mm_struct *mm,
+                                              unsigned long address,
                                               pte_t *ptep,
                                               unsigned long pgsize)
 {
@@ -1384,7 +1385,7 @@ static inline pte_t __ptep_get_and_clear_anysz(struct mm_struct *mm,
 static inline pte_t __ptep_get_and_clear(struct mm_struct *mm,
                                       unsigned long address, pte_t *ptep)
 {
-       return __ptep_get_and_clear_anysz(mm, ptep, PAGE_SIZE);
+       return __ptep_get_and_clear_anysz(mm, address, ptep, PAGE_SIZE);
 }
 
 static inline void __clear_full_ptes(struct mm_struct *mm, unsigned long addr,
@@ -1423,7 +1424,7 @@ static inline pte_t __get_and_clear_full_ptes(struct mm_struct *mm,
 static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
                                            unsigned long address, pmd_t *pmdp)
 {
-       return pte_pmd(__ptep_get_and_clear_anysz(mm, (pte_t *)pmdp, PMD_SIZE));
+       return pte_pmd(__ptep_get_and_clear_anysz(mm, address, (pte_t *)pmdp, PMD_SIZE));
 }
 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 
index 1003b502075208d4252c27ffdacb1aaf4928639b..bcc28031eb7aa4ba175b5552f5449e69c6af5e61 100644 (file)
@@ -159,11 +159,12 @@ static pte_t get_clear_contig(struct mm_struct *mm,
        pte_t pte, tmp_pte;
        bool present;
 
-       pte = __ptep_get_and_clear_anysz(mm, ptep, pgsize);
+       pte = __ptep_get_and_clear_anysz(mm, addr, ptep, pgsize);
        present = pte_present(pte);
        while (--ncontig) {
                ptep++;
-               tmp_pte = __ptep_get_and_clear_anysz(mm, ptep, pgsize);
+               addr += pgsize;
+               tmp_pte = __ptep_get_and_clear_anysz(mm, addr, ptep, pgsize);
                if (present) {
                        if (pte_dirty(tmp_pte))
                                pte = pte_mkdirty(pte);
@@ -207,7 +208,7 @@ static void clear_flush(struct mm_struct *mm,
        unsigned long i, saddr = addr;
 
        for (i = 0; i < ncontig; i++, addr += pgsize, ptep++)
-               __ptep_get_and_clear_anysz(mm, ptep, pgsize);
+               __ptep_get_and_clear_anysz(mm, addr, ptep, pgsize);
 
        if (mm == &init_mm)
                flush_tlb_kernel_range(saddr, addr);