linux/arch/xtensa/include/asm
Mike Rapoport (Microsoft) 6215d9f447 arch, mm: consolidate empty_zero_page
Reduce 22 declarations of empty_zero_page to 3 and 23 declarations of
ZERO_PAGE() to 4.

Every architecture defines empty_zero_page that way or another, but for the
most of them it is always a page aligned page in BSS and most definitions
of ZERO_PAGE do virt_to_page(empty_zero_page).

Move Linus vetted x86 definition of empty_zero_page and ZERO_PAGE() to the
core MM and drop these definitions in architectures that do not implement
colored zero page (MIPS and s390).

ZERO_PAGE() remains a macro because turning it to a wrapper for a static
inline causes severe pain in header dependencies.

For the most part the change is mechanical, with these being noteworthy:

* alpha: aliased empty_zero_page with ZERO_PGE that was also used for boot
  parameters. Switching to a generic empty_zero_page removes the aliasing
  and keeps ZERO_PGE for boot parameters only
* arm64: uses __pa_symbol() in ZERO_PAGE() so that definition of
  ZERO_PAGE() is kept intact.
* m68k/parisc/um: allocated empty_zero_page from memblock,
  although they do not support zero page coloring and having it in BSS
  will work fine.
* sparc64 can have empty_zero_page in BSS rather allocate it, but it
  can't use virt_to_page() for BSS. Keep it's definition of ZERO_PAGE()
  but instead of allocating it, make mem_map_zero point to
  empty_zero_page.
* sh: used empty_zero_page for boot parameters at the very early boot.
  Rename the parameters page to boot_params_page and let sh use the generic
  empty_zero_page.
* hexagon: had an amusing comment about empty_zero_page

	/* A handy thing to have if one has the RAM. Declared in head.S */

  that unfortunately had to go :)

Link: https://lkml.kernel.org/r/20260211103141.3215197-4-rppt@kernel.org
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Acked-by: Helge Deller <deller@gmx.de>		[parisc]
Tested-by: Helge Deller <deller@gmx.de>		[parisc]
Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Magnus Lindholm <linmag7@gmail.com>	[alpha]
Acked-by: Dinh Nguyen <dinguyen@kernel.org>	[nios2]
Acked-by: Andreas Larsson <andreas@gaisler.com>	[sparc]
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Acked-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: "Borislav Petkov (AMD)" <bp@alien8.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Guo Ren <guoren@kernel.org>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Stafford Horne <shorne@gmail.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vineet Gupta <vgupta@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-04-05 13:53:01 -07:00
..
asm-offsets.h
asm-prototypes.h xtensa: add asm-prototypes.h 2023-06-12 19:48:57 -07:00
asm-uaccess.h uaccess: remove CONFIG_SET_FS 2022-02-25 09:36:06 +01:00
asmmacro.h xtensa: replace <asm-generic/export.h> with <linux/export.h> 2023-11-29 01:54:45 -08:00
atomic.h locking/atomic: xtensa: add preprocessor symbols 2023-06-05 09:57:18 +02:00
barrier.h xtensa: enable KCSAN 2022-05-01 19:51:22 -07:00
bitops.h xtensa: Add __attribute_const__ to ffs()-family implementations 2025-09-08 14:58:52 -07:00
bootparam.h xtensa: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-06-06 01:03:35 -07:00
cache.h
cacheasm.h
cacheflush.h xtensa: remove redundant flush_dcache_page and ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE macros 2024-04-28 21:18:18 -07:00
cachetype.h Introduce cpu_dcache_is_aliasing() across all architectures 2024-02-22 15:27:19 -08:00
checksum.h
cmpxchg.h xtensa: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-06-06 01:03:35 -07:00
coprocessor.h xtensa: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-06-06 01:03:35 -07:00
core.h xtensa: add default definition for XCHAL_HAVE_DIV32 2023-09-20 04:56:41 -07:00
current.h xtensa: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-06-06 01:03:35 -07:00
delay.h
dma.h PCI: Move isa_dma_bridge_buggy out of asm/dma.h 2022-07-22 17:24:47 -05:00
elf.h xtensa: add FDPIC and static PIE support for noMMU 2022-09-13 18:28:00 -07:00
fixmap.h
flat.h move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
ftrace.h xtensa: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-06-06 01:03:35 -07:00
futex.h futex: Fix additional regressions 2021-12-11 23:31:51 +01:00
highmem.h mm: constify highmem related functions for improved const-correctness 2025-09-21 14:22:15 -07:00
hw_breakpoint.h xtensa: hw_breakpoint: include header for missing prototype 2023-09-20 05:03:21 -07:00
initialize_mmu.h xtensa: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-06-06 01:03:35 -07:00
io.h mm/ioremap: pass pgprot_t to ioremap_prot() instead of unsigned long 2025-03-16 22:06:23 -07:00
irq.h
irqflags.h
jump_label.h xtensa: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-06-06 01:03:35 -07:00
kasan.h xtensa: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-06-06 01:03:35 -07:00
Kbuild loongarch, um, xtensa: get rid of generated arch/$ARCH/include/asm/param.h 2025-06-24 22:02:05 -04:00
kmem_layout.h xtensa: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-06-06 01:03:35 -07:00
linkage.h
mmu_context.h
mmu.h
mtd-xip.h xtensa: add XIP-aware MTD support 2023-08-28 18:25:23 -07:00
mxregs.h
nommu_context.h
page.h treewide: provide a generic clear_user_page() variant 2026-01-20 19:24:39 -08:00
pci-bridge.h xtensa: Remove unused early_read_config_byte() et al declarations 2022-03-06 20:17:09 -08:00
pci.h PCI: Remove pci_get_legacy_ide_irq() and asm-generic/pci.h 2022-07-22 17:23:45 -05:00
perf_event.h
pgalloc.h asm-generic: pgalloc: provide generic __pgd_{alloc,free} 2025-01-25 20:22:24 -08:00
pgtable.h arch, mm: consolidate empty_zero_page 2026-04-05 13:53:01 -07:00
platform.h xtensa: drop platform_halt and platform_power_off 2023-06-12 19:48:56 -07:00
processor.h xtensa: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-06-06 01:03:35 -07:00
ptrace.h Xtensa updates for v6.17 2025-08-09 07:35:03 +03:00
regs.h
seccomp.h
sections.h xtensa: add XIP-aware MTD support 2023-08-28 18:25:23 -07:00
serial.h
shmparam.h
signal.h xtensa: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-06-06 01:03:35 -07:00
smp.h xtensa: smp: add headers for missing function prototypes 2023-09-20 05:03:20 -07:00
spinlock_types.h Improve consistency of '#error' directive messages 2024-11-11 17:17:04 -08:00
spinlock.h
stackprotector.h stackprotector: actually use get_random_canary() 2022-11-18 02:18:10 +01:00
stacktrace.h xtensa: Implement "current_stack_pointer" 2022-02-25 18:21:23 -08:00
string.h xtensa: drop bcopy implementation 2023-06-12 19:48:57 -07:00
switch_to.h
syscall.h syscall.h: Remove unused SYSCALL_MAX_ARGS 2026-01-05 16:47:48 +00:00
sysmem.h
thread_info.h xtensa: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-06-06 01:03:35 -07:00
timex.h xtensa: use fallback for random_get_entropy() instead of zero 2022-05-13 23:59:23 +02:00
tlb.h xtensa: tlb: include <asm/tlb.h> for missing prototype 2023-09-20 05:03:21 -07:00
tlbflush.h xtensa: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers 2025-06-06 01:03:35 -07:00
traps.h xtensa: add load/store exception handler 2023-06-13 21:56:27 -07:00
uaccess.h uaccess: remove CONFIG_SET_FS 2022-02-25 09:36:06 +01:00
ucontext.h
unistd.h clone3: drop __ARCH_WANT_SYS_CLONE3 macro 2024-07-10 14:23:38 +02:00
vectors.h
vermagic.h
vmalloc.h