linux/arch/microblaze/include/asm
Kevin Brodsky a9b3c355c2 asm-generic: pgalloc: provide generic __pgd_{alloc,free}
We already have a generic implementation of alloc/free up to P4D level, as
well as pgd_free().  Let's finish the work and add a generic PGD-level
alloc helper as well.

Unlike at lower levels, almost all architectures need some specific magic
at PGD level (typically initialising PGD entries), so introducing a
generic pgd_alloc() isn't worth it.  Instead we introduce two new helpers,
__pgd_alloc() and __pgd_free(), and make use of them in the arch-specific
pgd_alloc() and pgd_free() wherever possible.  To accommodate as many arch
as possible, __pgd_alloc() takes a page allocation order.

Because pagetable_alloc() allocates zeroed pages, explicit zeroing in
pgd_alloc() becomes redundant and we can get rid of it.  Some trivial
implementations of pgd_free() also become unnecessary once __pgd_alloc()
is used; remove them.

Another small improvement is consistent accounting of PGD pages by using
GFP_PGTABLE_{USER,KERNEL} as appropriate.

Not all PGD allocations can be handled by the generic helpers.  In
particular, multiple architectures allocate PGDs from a kmem_cache, and
those PGDs may not be page-sized.

Link: https://lkml.kernel.org/r/20250103184415.2744423-6-kevin.brodsky@arm.com
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-01-25 20:22:24 -08:00
..
Kbuild asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
asm-compat.h
asm-offsets.h
barrier.h
cache.h microblaze: move the ARCH_{DMA,SLAB}_MINALIGN definitions to asm/cache.h 2023-06-19 16:19:24 -07:00
cacheflush.h microblaze: implement the new page table range API 2023-08-24 16:20:21 -07:00
checksum.h
cpuinfo.h
current.h
delay.h
dma.h
elf.h
entry.h
exceptions.h
fixmap.h
flat.h move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
ftrace.h arch: add missing prepare_ftrace_return() prototypes 2023-11-23 11:32:32 +01:00
futex.h
hash.h
highmem.h
io.h
irq.h
irqflags.h
kgdb.h
mmu.h
mmu_context.h
mmu_context_mm.h
module.h
page.h asm-generic updates for 6.13 2024-11-20 15:13:02 -08:00
pci-bridge.h microblaze/PCI: Remove support for Xilinx PCI host bridge 2022-11-25 11:39:23 +01:00
pci.h microblaze/PCI: Remove support for Xilinx PCI host bridge 2022-11-25 11:39:23 +01:00
pgalloc.h asm-generic: pgalloc: provide generic __pgd_{alloc,free} 2025-01-25 20:22:24 -08:00
pgtable.h microblaze: add missing forward declaration 2023-12-20 19:26:30 -05:00
processor.h kernel: exit: cleanup release_thread() 2022-09-11 21:55:07 -07:00
ptrace.h
pvr.h
registers.h
seccomp.h
sections.h
setup.h microblaze: Remove zalloc_maybe_bootmem() 2023-08-23 09:35:22 +02:00
string.h
switch_to.h
syscall.h
thread_info.h
timex.h
tlbflush.h microblaze: implement the new page table range API 2023-08-24 16:20:21 -07:00
uaccess.h
unistd.h
unwind.h
vmalloc.h
xilinx_mb_manager.h microblaze: Add support for error injection 2022-09-26 14:13:29 +02:00