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: reinstate address parameter in [__]page_table_check_pud_clear()

This reverts commit 931c38e16499 ("mm/page_table_check: remove unused
parameter in [__]page_table_check_pud_clear").

Reinstate previously unused parameters for the purpose of supporting
powerpc platforms, as many do not encode user/kernel ownership of the page
in the pte, but instead in the address of the access.

[ajd@linux.ibm.com: rebase on arm64 changes]
Link: https://lkml.kernel.org/r/20251219-pgtable_check_v18rebase-v18-6-755bc151a50b@linux.ibm.com
Signed-off-by: Rohan McLure <rmclure@linux.ibm.com>
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Acked-by: Ingo Molnar <mingo@kernel.org> # x86
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: 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
2e6ac078 0a5ae448

+14 -10
+1 -1
arch/arm64/include/asm/pgtable.h
··· 1349 1349 break; 1350 1350 #ifndef __PAGETABLE_PMD_FOLDED 1351 1351 case PUD_SIZE: 1352 - page_table_check_pud_clear(mm, pte_pud(pte)); 1352 + page_table_check_pud_clear(mm, address, pte_pud(pte)); 1353 1353 break; 1354 1354 #endif 1355 1355 default:
+1 -1
arch/riscv/include/asm/pgtable.h
··· 1101 1101 pud_clear(pudp); 1102 1102 #endif 1103 1103 1104 - page_table_check_pud_clear(mm, pud); 1104 + page_table_check_pud_clear(mm, address, pud); 1105 1105 1106 1106 return pud; 1107 1107 }
+1 -1
arch/x86/include/asm/pgtable.h
··· 1330 1330 { 1331 1331 pud_t pud = native_pudp_get_and_clear(pudp); 1332 1332 1333 - page_table_check_pud_clear(mm, pud); 1333 + page_table_check_pud_clear(mm, addr, pud); 1334 1334 1335 1335 return pud; 1336 1336 }
+7 -4
include/linux/page_table_check.h
··· 16 16 void __page_table_check_zero(struct page *page, unsigned int order); 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 - void __page_table_check_pud_clear(struct mm_struct *mm, pud_t pud); 19 + void __page_table_check_pud_clear(struct mm_struct *mm, unsigned long addr, 20 + pud_t pud); 20 21 void __page_table_check_ptes_set(struct mm_struct *mm, unsigned long addr, 21 22 pte_t *ptep, pte_t pte, unsigned int nr); 22 23 void __page_table_check_pmds_set(struct mm_struct *mm, unsigned long addr, ··· 60 59 __page_table_check_pmd_clear(mm, pmd); 61 60 } 62 61 63 - static inline void page_table_check_pud_clear(struct mm_struct *mm, pud_t pud) 62 + static inline void page_table_check_pud_clear(struct mm_struct *mm, 63 + unsigned long addr, pud_t pud) 64 64 { 65 65 if (static_branch_likely(&page_table_check_disabled)) 66 66 return; 67 67 68 - __page_table_check_pud_clear(mm, pud); 68 + __page_table_check_pud_clear(mm, addr, pud); 69 69 } 70 70 71 71 static inline void page_table_check_ptes_set(struct mm_struct *mm, ··· 125 123 { 126 124 } 127 125 128 - static inline void page_table_check_pud_clear(struct mm_struct *mm, pud_t pud) 126 + static inline void page_table_check_pud_clear(struct mm_struct *mm, 127 + unsigned long addr, pud_t pud) 129 128 { 130 129 } 131 130
+1 -1
include/linux/pgtable.h
··· 801 801 pud_t pud = *pudp; 802 802 803 803 pud_clear(pudp); 804 - page_table_check_pud_clear(mm, pud); 804 + page_table_check_pud_clear(mm, address, pud); 805 805 806 806 return pud; 807 807 }
+3 -2
mm/page_table_check.c
··· 167 167 } 168 168 EXPORT_SYMBOL(__page_table_check_pmd_clear); 169 169 170 - void __page_table_check_pud_clear(struct mm_struct *mm, pud_t pud) 170 + void __page_table_check_pud_clear(struct mm_struct *mm, unsigned long addr, 171 + pud_t pud) 171 172 { 172 173 if (&init_mm == mm) 173 174 return; ··· 254 253 return; 255 254 256 255 for (i = 0; i < nr; i++) 257 - __page_table_check_pud_clear(mm, *(pudp + i)); 256 + __page_table_check_pud_clear(mm, addr + PUD_SIZE * i, *(pudp + i)); 258 257 if (pud_user_accessible_page(pud)) 259 258 page_table_check_set(pud_pfn(pud), stride * nr, pud_write(pud)); 260 259 }