mirror-linux/arch/alpha/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
..
Kbuild asm-generic: introduce text-patching.h 2024-11-07 14:25:15 -08:00
agp_backend.h
asm-prototypes.h alpha: move __udiv_qrnnd library function to arch/alpha/lib/ 2021-09-18 14:45:48 -07:00
atomic.h locking/atomic: treewide: delete arch_atomic_*() kerneldoc 2023-06-05 09:57:24 +02:00
barrier.h
bitops.h alpha: Add __attribute_const__ to ffs()-family implementations 2025-09-08 14:58:51 -07:00
bug.h
cache.h
cacheflush.h mm: rationalise flush_icache_pages() and flush_icache_page() 2023-08-24 16:20:25 -07:00
checksum.h
cmpxchg.h alpha: no need to include asm/xchg.h twice 2024-08-19 09:45:27 +02:00
compiler.h alpha: remove undef inline in compiler.h 2021-07-25 22:18:20 -07:00
console.h alpha: Replace __ASSEMBLY__ with __ASSEMBLER__ in the alpha headers 2025-12-08 23:10:30 +01:00
core_cia.h alpha: add full ioread64/iowrite64 implementation 2022-10-04 11:23:29 +02:00
core_irongate.h
core_marvel.h alpha: add full ioread64/iowrite64 implementation 2022-10-04 11:23:29 +02:00
core_mcpcia.h alpha: add full ioread64/iowrite64 implementation 2022-10-04 11:23:29 +02:00
core_polaris.h
core_t2.h alpha: sable: remove early machine support 2024-05-03 22:09:55 +02:00
core_titan.h
core_tsunami.h
core_wildfire.h
delay.h
device.h
dma-mapping.h alpha: remove DECpc AXP150 (Jensen) support 2024-05-03 22:09:50 +02:00
dma.h alpha: remove LCA and APECS based machines 2024-05-03 22:09:59 +02:00
elf.h alpha/elf: Fix misc/setarch test of util-linux by removing 32bit support 2025-02-06 07:35:38 -08:00
emergency-restart.h
err_common.h
err_ev6.h
err_ev7.h
extable.h
floppy.h floppy: Remove unused CROSS_64KB() macro from arch/ code 2025-08-25 14:46:42 -06:00
fpu.h alpha: lazy FPU switching 2023-02-24 23:14:22 -05:00
ftrace.h
futex.h
gct.h
hardirq.h
hw_irq.h
hwrpb.h alpha: Replace one-element array with flexible array member 2025-02-14 14:06:15 -05:00
io.h alpha: stop using asm-generic/iomap.h 2025-03-10 16:20:25 +01:00
io_trivial.h alpha: add full ioread64/iowrite64 implementation 2022-10-04 11:23:29 +02:00
irq.h alpha: cabriolet: remove EV5 CPU support 2024-05-03 22:10:03 +02:00
irqflags.h
linkage.h
local.h locking/local, arch: Rewrite local_add_unless() as a static inline function 2023-10-04 11:38:11 +02:00
machvec.h alpha: drop pre-EV56 support 2024-05-06 12:05:00 +02:00
mc146818rtc.h
mce.h
mmu.h
mmu_context.h alpha: drop pre-EV56 support 2024-05-06 12:05:00 +02:00
module.h
page.h treewide: provide a generic clear_user_page() variant 2026-01-20 19:24:39 -08:00
pal.h alpha: Replace __ASSEMBLY__ with __ASSEMBLER__ in the alpha headers 2025-12-08 23:10:30 +01:00
parport.h
pci.h PCI/sysfs: Move declarations to linux/pci.h 2023-08-14 12:05:18 -05:00
percpu.h mm/percpu: conditionally define _shared_alloc_tag via CONFIG_ARCH_MODULE_NEEDS_WEAK_PER_CPU 2025-07-09 22:42:15 -07:00
perf_event.h
pgalloc.h mm/thp: define default pmd_pgtable() 2021-07-01 11:06:03 -07:00
pgtable.h arch, mm: consolidate empty_zero_page 2026-04-05 13:53:01 -07:00
processor.h alpha/elf: Fix misc/setarch test of util-linux by removing 32bit support 2025-02-06 07:35:38 -08:00
ptrace.h kill signal_pt_regs() 2022-10-23 18:06:54 -04:00
rwonce.h
serial.h
setup.h alpha: Use absolute_pointer to define COMMAND_LINE 2021-09-15 12:04:28 -07:00
sfp-machine.h
shmparam.h
signal.h
smp.h
socket.h
sparsemem.h
special_insns.h alpha: drop pre-EV56 support 2024-05-06 12:05:00 +02:00
spinlock.h
spinlock_types.h Improve consistency of '#error' directive messages 2024-11-11 17:17:04 -08:00
string.h
switch_to.h
syscall.h alpha: Add syscall_get_return_value() 2021-07-25 22:33:03 -07:00
thread_info.h alpha: Replace __ASSEMBLY__ with __ASSEMBLER__ in the alpha headers 2025-12-08 23:10:30 +01:00
timex.h alpha: define get_cycles macro for arch-override 2022-05-13 23:59:23 +02:00
tlb.h alpha: mm: enable MMU_GATHER_RCU_TABLE_FREE 2026-02-06 15:47:17 -08:00
tlbflush.h alpha: fix user-space corruption during memory compaction 2026-01-24 10:35:52 +01:00
topology.h alpha: remove DISCONTIGMEM and NUMA 2021-06-29 10:53:55 -07:00
types.h
uaccess.h alpha: drop pre-EV56 support 2024-05-06 12:05:00 +02:00
ucontext.h
unistd.h alpha: replace NR_SYSCALLS by NR_syscalls 2023-02-14 12:37:17 -05:00
user.h asm/user.h: killed unused macros 2022-01-30 21:17:00 -05:00
vga.h alpha: sort scr_mem{cpy,move}w() out 2024-05-03 22:08:50 +02:00
vmalloc.h
word-at-a-time.h
wrperfmon.h
xor.h lib/xor: make xor prototypes more friendly to compiler vectorization 2022-02-11 20:39:39 +11:00