mirror-linux/arch/sh/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
adc.h sh: remove __KERNEL__ ifdefs from non-UAPI headers 2020-08-14 22:05:14 -04:00
addrspace.h sh: remove __KERNEL__ ifdefs from non-UAPI headers 2020-08-14 22:05:14 -04:00
alignment.h
asm-offsets.h
atomic-grb.h locking/atomic: sh: add preprocessor symbols 2023-06-05 09:57:16 +02:00
atomic-irq.h locking/atomic: sh: add preprocessor symbols 2023-06-05 09:57:16 +02:00
atomic-llsc.h locking/atomic: sh: add preprocessor symbols 2023-06-05 09:57:16 +02:00
atomic.h locking/atomic: make atomic*_{cmp,}xchg optional 2023-06-05 09:57:14 +02:00
barrier.h
bitops-cas.h
bitops-grb.h
bitops-llsc.h
bitops-op32.h provide arch_test_bit_acquire for architectures that define test_bit 2022-08-27 09:49:54 -07:00
bitops.h sh: Add __attribute_const__ to ffs()-family implementations 2025-09-08 14:58:51 -07:00
bl_bit.h
bl_bit_32.h
bug.h bugs/sh: Concatenate 'cond_str' with '__FILE__' in __WARN_FLAGS(), to extend WARN_ON/BUG_ON output 2025-07-28 08:06:43 +02:00
cache.h sh: Replace __ASSEMBLY__ with __ASSEMBLER__ in all headers 2025-06-07 15:16:21 +02:00
cache_insns.h
cache_insns_32.h
cacheflush.h sh: cache: Move forward declarations to <asm/cacheflush.h> 2024-05-02 12:01:31 +02:00
cachetype.h Introduce cpu_dcache_is_aliasing() across all architectures 2024-02-22 15:27:19 -08:00
checksum.h
checksum_32.h sh: checksum: add missing linux/uaccess.h include 2023-01-30 21:04:21 -08:00
clock.h
cmpxchg-cas.h
cmpxchg-grb.h
cmpxchg-irq.h
cmpxchg-llsc.h
cmpxchg-xchg.h
cmpxchg.h sh: Emulate one-byte cmpxchg 2024-09-13 07:10:38 -07:00
device.h
dma-register.h
dma.h sh: dma: Remove unused functionality 2024-05-02 12:01:25 +02:00
dmabrg.h
dwarf.h sh: Replace __ASSEMBLY__ with __ASSEMBLER__ in all headers 2025-06-07 15:16:21 +02:00
elf.h sh: remove __KERNEL__ ifdefs from non-UAPI headers 2020-08-14 22:05:14 -04:00
entry-macros.S
extable.h
fixmap.h sh/highmem: Remove all traces of unused cruft 2020-11-06 23:14:54 +01:00
flat.h move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
fpu.h sh: Replace __ASSEMBLY__ with __ASSEMBLER__ in all headers 2025-06-07 15:16:21 +02:00
freq.h sh: remove __KERNEL__ ifdefs from non-UAPI headers 2020-08-14 22:05:14 -04:00
ftrace.h sh: Replace __ASSEMBLY__ with __ASSEMBLER__ in all headers 2025-06-07 15:16:21 +02:00
futex-cas.h
futex-irq.h
futex-llsc.h
futex.h sh: remove __KERNEL__ ifdefs from non-UAPI headers 2020-08-14 22:05:14 -04:00
hardirq.h sh: irqstat: Use the generic irq_cpustat_t 2020-11-23 10:31:06 +01:00
hd64461.h sh: hd64461: Handle virq offset for offchip IRQ base and HD64461 IRQ 2023-07-13 08:37:53 +02:00
heartbeat.h
hugetlb.h mm: introduce memdesc_flags_t 2025-09-13 16:55:07 -07:00
hw_breakpoint.h sh: hw_breakpoint: Add missing forward declaration for arch_bp_generic_fields() 2024-05-02 12:01:23 +02:00
hw_irq.h
i2c-sh7760.h
io.h - The 6 patch series "Enable strict percpu address space checks" from 2025-04-01 09:29:18 -07:00
io_generic.h
io_noioport.h sh: add <asm-generic/io.h> including 2023-08-18 10:12:34 -07:00
io_trapped.h
irq.h sh: Remove unused declarations for make_maskreg_irq() and irq_mask_register 2024-09-26 17:24:51 +02:00
irqflags.h
kdebug.h Revert "sh: add loglvl to printk_address()" 2020-08-14 22:05:07 -04:00
kexec.h sh, kexec: fix the incorrect ifdeffery and dependency of CONFIG_KEXEC 2023-12-12 17:20:18 -08:00
kgdb.h
kprobes.h kprobes: unify kprobes_exceptions_nofify() prototypes 2023-11-10 19:59:05 +09:00
linkage.h
machvec.h sh: machvec: Remove custom ioport_{un,}map() 2023-10-25 16:50:30 +02:00
mmiowb.h
mmu.h sh: Replace __ASSEMBLY__ with __ASSEMBLER__ in all headers 2025-06-07 15:16:21 +02:00
mmu_context.h sh: use asm-generic/mmu_context.h for no-op implementations 2020-10-27 16:02:38 +01:00
mmu_context_32.h sh: use asm-generic/mmu_context.h for no-op implementations 2020-10-27 16:02:38 +01:00
mmzone.h arch, mm: move definition of node_data to generic code 2024-09-03 21:15:28 -07:00
module.h
page.h sh: Replace __ASSEMBLY__ with __ASSEMBLER__ in all headers 2025-06-07 15:16:21 +02: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 mm: pgtable: convert some architectures to use tlb_remove_ptdesc() 2025-04-01 15:17:13 -07:00
pgtable-2level.h
pgtable-3level.h sh/mm: Fix pmd_t for real 2023-01-10 05:31:42 -06:00
pgtable.h arch, mm: consolidate empty_zero_page 2026-04-05 13:53:01 -07:00
pgtable_32.h mm: pgtable: fix pte_swp_exclusive 2025-06-11 14:52:08 -07:00
platform_early.h
posix_types.h
processor.h sh: Replace __ASSEMBLY__ with __ASSEMBLER__ in all headers 2025-06-07 15:16:21 +02:00
processor_32.h sh: sanitize the flags on sigreturn 2023-03-09 10:01:59 -08:00
ptrace.h
ptrace_32.h
push-switch.h
reboot.h
romimage-macros.h
rtc.h init: consolidate prototypes in linux/init.h 2023-06-09 17:44:16 -07:00
seccomp.h sh: Enable seccomp architecture tracking 2020-11-20 11:16:35 -08:00
sections.h sh: machvec: Use char[] for section boundaries 2022-09-13 10:33:17 -07:00
setup.h arch, mm: consolidate empty_zero_page 2026-04-05 13:53:01 -07:00
sfp-machine.h sh: define __BIG_ENDIAN for math-emu 2021-10-27 16:51:24 -04:00
sh7760fb.h
sh_bios.h
shmparam.h
siu.h
smc37c93x.h sh: Replace __ASSEMBLY__ with __ASSEMBLER__ in all headers 2025-06-07 15:16:21 +02:00
smp-ops.h sh/cpu: Mark play_dead() __noreturn 2023-03-08 08:44:24 -08:00
smp.h treewide: Convert macro and uses of __section(foo) to __section("foo") 2020-10-25 14:51:49 -07:00
sparsemem.h Cleanup, SECCOMP_FILTER support, message printing fixes, and other 2020-08-15 18:50:32 -07:00
spi.h
spinlock-cas.h
spinlock-llsc.h
spinlock.h
spinlock_types.h Improve consistency of '#error' directive messages 2024-11-11 17:17:04 -08:00
sram.h
stackprotector.h stackprotector: actually use get_random_canary() 2022-11-18 02:18:10 +01:00
stacktrace.h sh: stacktrace: Remove stacktrace_ops.stack() 2020-08-14 22:05:11 -04:00
string.h
string_32.h Cleanup, SECCOMP_FILTER support, message printing fixes, and other 2020-08-15 18:50:32 -07:00
suspend.h sh: Replace __ASSEMBLY__ with __ASSEMBLER__ in all headers 2025-06-07 15:16:21 +02:00
switch_to.h
switch_to_32.h
syscall.h
syscall_32.h syscall.h: introduce syscall_set_nr() 2025-05-11 17:48:15 -07:00
syscalls.h sh: syscall: Add missing forward declaration for sys_cacheflush() 2024-05-02 12:01:23 +02:00
syscalls_32.h sh: remove __KERNEL__ ifdefs from non-UAPI headers 2020-08-14 22:05:14 -04:00
thread_info.h sh: Replace __ASSEMBLY__ with __ASSEMBLER__ in all headers 2025-06-07 15:16:21 +02:00
timex.h
tlb.h sh: Replace __ASSEMBLY__ with __ASSEMBLER__ in all headers 2025-06-07 15:16:21 +02:00
tlbflush.h
topology.h
traps.h
traps_32.h arch: add do_page_fault prototypes 2023-11-23 11:32:32 +01:00
types.h sh: Replace __ASSEMBLY__ with __ASSEMBLER__ in all headers 2025-06-07 15:16:21 +02:00
uaccess.h sh: remove CONFIG_SET_FS support 2022-02-25 09:36:06 +01:00
uaccess_32.h sh: Implement __get_user_u64() required for 64-bit get_user() 2020-08-14 22:05:04 -04:00
uncached.h
unistd.h clone3: drop __ARCH_WANT_SYS_CLONE3 macro 2024-07-10 14:23:38 +02:00
unwinder.h
user.h asm/user.h: killed unused macros 2022-01-30 21:17:00 -05:00
vermagic.h
vmalloc.h
vmlinux.lds.h
watchdog.h sh: remove __KERNEL__ ifdefs from non-UAPI headers 2020-08-14 22:05:14 -04:00
word-at-a-time.h kernel.h: removed REPEAT_BYTE from kernel.h 2024-02-01 09:47:59 -08:00