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.

mm/page_table_check: provide addr parameter to page_table_check_ptes_set()

To provide support for powerpc platforms, provide an addr parameter to the
__page_table_check_ptes_set() and page_table_check_ptes_set() routines.
This parameter is needed on some powerpc platforms which do not encode
whether a mapping is for user or kernel in the pte. On such platforms,
this can be inferred from the addr parameter.

[ajd@linux.ibm.com: rebase on arm64 + riscv changes, update commit message]
Link: https://lkml.kernel.org/r/20251219-pgtable_check_v18rebase-v18-5-755bc151a50b@linux.ibm.com
Signed-off-by: Rohan McLure <rmclure@linux.ibm.com>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Acked-by: Alexandre Ghiti <alexghiti@rivosinc.com> # riscv
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Cc: Alexander Gordeev <agordeev@linux.ibm.com>
Cc: Alexandre Ghiti <alex@ghiti.fr>
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: 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

Rohan McLure and committed by
Andrew Morton
0a5ae448 6e2d8f9f

+12 -10
+1 -1
arch/arm64/include/asm/pgtable.h
··· 681 681 682 682 switch (pgsize) { 683 683 case PAGE_SIZE: 684 - page_table_check_ptes_set(mm, ptep, pte, nr); 684 + page_table_check_ptes_set(mm, addr, ptep, pte, nr); 685 685 break; 686 686 case PMD_SIZE: 687 687 page_table_check_pmds_set(mm, addr, (pmd_t *)ptep,
+1 -1
arch/riscv/include/asm/pgtable.h
··· 627 627 static inline void set_ptes(struct mm_struct *mm, unsigned long addr, 628 628 pte_t *ptep, pte_t pteval, unsigned int nr) 629 629 { 630 - page_table_check_ptes_set(mm, ptep, pteval, nr); 630 + page_table_check_ptes_set(mm, addr, ptep, pteval, nr); 631 631 632 632 for (;;) { 633 633 __set_pte_at(mm, ptep, pteval);
+7 -5
include/linux/page_table_check.h
··· 17 17 void __page_table_check_pte_clear(struct mm_struct *mm, pte_t pte); 18 18 void __page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd); 19 19 void __page_table_check_pud_clear(struct mm_struct *mm, pud_t pud); 20 - void __page_table_check_ptes_set(struct mm_struct *mm, pte_t *ptep, pte_t pte, 21 - unsigned int nr); 20 + void __page_table_check_ptes_set(struct mm_struct *mm, unsigned long addr, 21 + pte_t *ptep, pte_t pte, unsigned int nr); 22 22 void __page_table_check_pmds_set(struct mm_struct *mm, unsigned long addr, 23 23 pmd_t *pmdp, pmd_t pmd, unsigned int nr); 24 24 void __page_table_check_puds_set(struct mm_struct *mm, unsigned long addr, ··· 68 68 } 69 69 70 70 static inline void page_table_check_ptes_set(struct mm_struct *mm, 71 - pte_t *ptep, pte_t pte, unsigned int nr) 71 + unsigned long addr, pte_t *ptep, 72 + pte_t pte, unsigned int nr) 72 73 { 73 74 if (static_branch_likely(&page_table_check_disabled)) 74 75 return; 75 76 76 - __page_table_check_ptes_set(mm, ptep, pte, nr); 77 + __page_table_check_ptes_set(mm, addr, ptep, pte, nr); 77 78 } 78 79 79 80 static inline void page_table_check_pmds_set(struct mm_struct *mm, ··· 128 127 } 129 128 130 129 static inline void page_table_check_ptes_set(struct mm_struct *mm, 131 - pte_t *ptep, pte_t pte, unsigned int nr) 130 + unsigned long addr, pte_t *ptep, 131 + pte_t pte, unsigned int nr) 132 132 { 133 133 } 134 134
+1 -1
include/linux/pgtable.h
··· 429 429 static inline void set_ptes(struct mm_struct *mm, unsigned long addr, 430 430 pte_t *ptep, pte_t pte, unsigned int nr) 431 431 { 432 - page_table_check_ptes_set(mm, ptep, pte, nr); 432 + page_table_check_ptes_set(mm, addr, ptep, pte, nr); 433 433 434 434 for (;;) { 435 435 set_pte(ptep, pte);
+2 -2
mm/page_table_check.c
··· 196 196 } 197 197 } 198 198 199 - void __page_table_check_ptes_set(struct mm_struct *mm, pte_t *ptep, pte_t pte, 200 - unsigned int nr) 199 + void __page_table_check_ptes_set(struct mm_struct *mm, unsigned long addr, 200 + pte_t *ptep, pte_t pte, unsigned int nr) 201 201 { 202 202 unsigned int i; 203 203