mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 14:42:08 +02:00
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>
This commit is contained in:
parent
9ac4941ace
commit
ee329c29fd
|
|
@ -1332,6 +1332,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)
|
||||
{
|
||||
|
|
@ -1359,7 +1360,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,
|
||||
|
|
@ -1398,7 +1399,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 */
|
||||
|
||||
|
|
|
|||
|
|
@ -155,11 +155,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);
|
||||
|
|
@ -203,7 +204,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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user