linux/arch/sh/kernel
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
..
cpu Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
syscalls rseq: Implement sys_rseq_slice_yield() 2026-01-22 11:11:17 +01:00
vsyscall sysctl: Fix underflow value setting risk in vm_table 2025-02-17 11:33:46 +01:00
.gitignore
asm-offsets.c arch: Add the macro COMPILE_OFFSETS to all the asm-offsets.c 2025-09-25 09:57:15 +02:00
crash_dump.c vmcore: convert copy_oldmem_page() to take an iov_iter 2022-04-29 14:37:59 -07:00
debugtraps.S
disassemble.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
dma-coherent.c dma-mapping: merge <linux/dma-noncoherent.h> into <linux/dma-map-ops.h> 2020-10-06 07:07:06 +02:00
dumpstack.c sh: stacktrace: Remove stacktrace_ops.stack() 2020-08-14 22:05:11 -04:00
dwarf.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
entry-common.S sh: fix syscall tracing 2020-09-13 21:22:55 -04:00
ftrace.c ftrace: Cleanup ftrace_dyn_arch_init() 2021-10-08 19:41:39 -04:00
head_32.S arch, mm: consolidate empty_zero_page 2026-04-05 13:53:01 -07:00
hw_breakpoint.c
idle.c sh/cpu: Switch to arch_cpu_finalize_init() 2023-06-16 10:16:00 +02:00
io_trapped.c sh: remove CONFIG_SET_FS support 2022-02-25 09:36:06 +01:00
io.c
ioport.c sh: remove duplicate ioread/iowrite helpers 2025-03-11 10:41:18 +01:00
irq_32.c
irq.c sh: irq: Use seq_put_decimal_ull_width() for decimal values 2025-02-01 10:42:36 +01:00
kdebugfs.c
kgdb.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
kprobes.c sh: kprobes: Remove unused variables in kprobe_exceptions_notify() 2025-06-07 15:16:41 +02:00
machine_kexec.c Add a new optional ",cma" suffix to the crashkernel= command line option 2025-07-19 19:08:22 -07:00
machvec.c sh: machvec: Use char[] for section boundaries 2022-09-13 10:33:17 -07:00
Makefile arch: use always-$(KBUILD_BUILTIN) for vmlinux.lds 2025-06-07 14:38:07 +09:00
module.c move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
nmi_debug.c sh: nmi_debug: fix return value of __setup handler 2023-03-23 10:00:02 +01:00
perf_callchain.c sh: stacktrace: Remove stacktrace_ops.stack() 2020-08-14 22:05:11 -04:00
perf_event.c treewide: Update email address 2026-01-11 06:09:11 -10:00
process_32.c arch: copy_thread: pass clone_flags as u64 2025-09-01 15:31:34 +02:00
process.c
ptrace_32.c sh: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names 2025-07-14 22:27:48 -07:00
ptrace.c
reboot.c sh, kexec: fix the incorrect ifdeffery and dependency of CONFIG_KEXEC 2023-12-12 17:20:18 -08:00
relocate_kernel.S
return_address.c sh: return_address: Add missing #include <asm/ftrace.h> 2024-05-02 12:01:23 +02:00
setup.c sh: Migrate to the generic rule for built-in DTB 2025-02-01 10:43:18 +01:00
sh_bios.c
sh_ksyms_32.c arch, mm: consolidate empty_zero_page 2026-04-05 13:53:01 -07:00
signal_32.c sh: sanitize the flags on sigreturn 2023-03-09 10:01:59 -08:00
smp.c sh: smp: Protect setup_profiling_timer() by CONFIG_PROFILING 2024-05-13 15:37:11 +02:00
stacktrace.c sh: stacktrace: Remove stacktrace_ops.stack() 2020-08-14 22:05:11 -04:00
swsusp.c
sys_sh.c mmap locking API: use coccinelle to convert mmap_sem rwsem call sites 2020-06-09 09:39:14 -07:00
sys_sh32.c sh: rework sync_file_range ABI 2024-06-25 15:57:26 +02:00
syscalls_32.S
time.c
topology.c drivers/base/node: consolidate node device subsystem initialization in node_dev_init() 2022-03-22 15:57:10 -07:00
traps_32.c sh: traps: Make is_dsp_inst() static 2024-05-02 12:01:31 +02:00
traps.c sh: ftrace: Fix missing prototypes 2024-05-02 12:01:24 +02:00
unwinder.c
vmcore_info.c arch, crash: move arch_crash_save_vmcoreinfo() out to file vmcore_info.c 2024-02-23 17:48:25 -08:00
vmlinux.lds.S kbuild: Split .modinfo out from ELF_DETAILS 2026-02-26 11:50:19 -07:00