--- The complications in those special pgtable allocators beg the question: does it really make sense to treat efi_mm and init_mm differently in e.g. apply_to_pte_range()? Maybe what we really need is a way to tell if an mm corresponds to user memory or not, and never use split locks for non-user mm's. Feedback and suggestions welcome! - Kevin [1] https://lore.kernel.org/linux-mm/20250103184415.2744423-1-kevin.brodsky@xxxxxxx/ [2] https://lore.kernel.org/linux-hardening/20250203101839.1223008-1-kevin.brodsky@xxxxxxx/ --- Cc: Albert Ou <aou@xxxxxxxxxxxxxxxxx> Cc: Andreas Larsson <andreas@xxxxxxxxxxx> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Catalin Marinas <catalin.marinas@xxxxxxx> Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx> Cc: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> Cc: Linus Walleij <linus.walleij@xxxxxxxxxx> Cc: Madhavan Srinivasan <maddy@xxxxxxxxxxxxx> Cc: Mark Rutland <mark.rutland@xxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx> Cc: "Mike Rapoport (IBM)" <rppt@xxxxxxxxxx> Cc: Palmer Dabbelt <palmer@xxxxxxxxxxx> Cc: Paul Walmsley <paul.walmsley@xxxxxxxxxx> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx> Cc: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx> Cc: Ryan Roberts <ryan.roberts@xxxxxxx> Cc: Will Deacon <will@xxxxxxxxxx> Cc: Yang Shi <yang@xxxxxxxxxxxxxxxxxxxxxx> Cc: linux-arch@xxxxxxxxxxxxxxx Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx Cc: linux-csky@xxxxxxxxxxxxxxx Cc: linux-kernel@xxxxxxxxxxxxxxx Cc: linux-m68k@xxxxxxxxxxxxxxxxxxxx Cc: linux-openrisc@xxxxxxxxxxxxxxx Cc: linux-riscv@xxxxxxxxxxxxxxxxxxx Cc: linux-s390@xxxxxxxxxxxxxxx Cc: linuxppc-dev@xxxxxxxxxxxxxxxx Cc: sparclinux@xxxxxxxxxxxxxxx --- Kevin Brodsky (11): mm: Pass mm down to pagetable_{pte,pmd}_ctor mm: Call ctor/dtor for kernel PTEs m68k: mm: Call ctor/dtor for kernel PTEs powerpc: mm: Call ctor/dtor for kernel PTEs sparc64: mm: Call ctor/dtor for kernel PTEs mm: Skip ptlock_init() for kernel PMDs arm64: mm: Use enum to identify pgtable level instead of *_SHIFT arm64: mm: Always call PTE/PMD ctor in __create_pgd_mapping() riscv: mm: Clarify ctor mm argument in alloc_{pte,pmd}_late arm64: mm: Call PUD/P4D ctor in __create_pgd_mapping() riscv: mm: Call PUD/P4D ctor in special kernel pgtable alloc arch/arm/mm/mmu.c | 2 +- arch/arm64/mm/mmu.c | 91 ++++++++++++++---------- arch/csky/include/asm/pgalloc.h | 2 +- arch/loongarch/include/asm/pgalloc.h | 2 +- arch/m68k/include/asm/mcf_pgalloc.h | 8 ++- arch/m68k/include/asm/motorola_pgalloc.h | 10 +-- arch/m68k/mm/motorola.c | 6 +- arch/microblaze/mm/pgtable.c | 2 +- arch/mips/include/asm/pgalloc.h | 2 +- arch/openrisc/mm/ioremap.c | 2 +- arch/parisc/include/asm/pgalloc.h | 2 +- arch/powerpc/mm/book3s64/pgtable.c | 2 +- arch/powerpc/mm/pgtable-frag.c | 30 ++++---- arch/riscv/mm/init.c | 26 ++++--- arch/s390/include/asm/pgalloc.h | 2 +- arch/s390/mm/pgalloc.c | 2 +- arch/sparc/mm/init_64.c | 29 ++++---- arch/sparc/mm/srmmu.c | 2 +- arch/x86/mm/pgtable.c | 2 +- include/asm-generic/pgalloc.h | 11 ++- include/linux/mm.h | 10 +-- 21 files changed, 137 insertions(+), 108 deletions(-) base-commit: 4701f33a10702d5fc577c32434eb62adde0a1ae1 -- 2.47.0