linux/arch/arm/mm
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>
History 2026-04-05 13:53:01 -07:00
..
abort-ev4.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
abort-ev4t.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
abort-ev5t.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
abort-ev5tj.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
abort-ev6.S ARM: 9263/1: use .arch directives instead of assembler command line flags 2022-11-08 18:36:17 +00:00
abort-ev7.S ARM: 9263/1: use .arch directives instead of assembler command line flags 2022-11-08 18:36:17 +00:00
abort-lv4t.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
abort-macro.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
abort-nommu.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
alignment.c ARM: fix branch predictor hardening 2025-12-10 12:22:15 +00:00
cache-b15-rac.c syscore: Pass context data to callbacks 2025-11-14 10:01:52 +01:00
cache-fa.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
cache-feroceon-l2.c arm: Handle KCOV __init vs inline mismatches 2025-07-21 21:43:39 -07:00
cache-l2x0-pmu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cache-l2x0.c ARM: 9451/1: mm: l2x0: use string choices helper 2025-10-02 08:44:27 +01:00
cache-nop.S ARM: 9387/2: mm: Rewrite cacheflush vtables in CFI safe C 2024-04-29 14:14:18 +01:00
cache-tauros2.c arm: Handle KCOV __init vs inline mismatches 2025-07-21 21:43:39 -07:00
cache-tauros3.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 171 2019-05-30 11:26:39 -07:00
cache-uniphier.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cache-v4.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
cache-v4wb.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
cache-v4wt.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
cache-v6.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
cache-v7.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
cache-v7m.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
cache-xsc3l2.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333 2019-06-05 17:37:06 +02:00
cache.c ARM: 9387/2: mm: Rewrite cacheflush vtables in CFI safe C 2024-04-29 14:14:18 +01:00
context.c ARM: mm: make vmalloc_seq handling SMP safe 2022-01-25 09:53:52 +01:00
copypage-fa.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
copypage-feroceon.c ARM: 9263/1: use .arch directives instead of assembler command line flags 2022-11-08 18:36:17 +00:00
copypage-v4mc.c mm: introduce memdesc_flags_t 2025-09-13 16:55:07 -07:00
copypage-v4wb.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
copypage-v4wt.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
copypage-v6.c mm: introduce memdesc_flags_t 2025-09-13 16:55:07 -07:00
copypage-xsc3.c ARM: PXA: fix multi-cpu build of xsc3 2022-05-07 22:56:16 +02:00
copypage-xscale.c mm: introduce memdesc_flags_t 2025-09-13 16:55:07 -07:00
dma-mapping-nommu.c ARM: 9435/1: ARM/nommu: Fix typo "absence" 2024-11-12 23:51:05 +00:00
dma-mapping.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
dma.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dump.c mm/treewide: replace pmd_large() with pmd_leaf() 2024-03-06 13:04:19 -08:00
extable.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fault-armv.c mm: introduce memdesc_flags_t 2025-09-13 16:55:07 -07:00
fault.c ARM: fix branch predictor hardening 2025-12-10 12:22:15 +00:00
fault.h ARM: 9304/1: add prototype for function called only from asm 2023-06-19 09:35:52 +01:00
flush.c mm: introduce memdesc_flags_t 2025-09-13 16:55:07 -07:00
fsr-2level.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
fsr-3level.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
idmap.c ARM: 9420/1: smp: Fix SMP for xip kernels 2024-11-12 16:38:47 +00:00
init.c arch, mm: consolidate initialization of SPARSE memory model 2026-01-26 20:02:18 -08:00
iomap.c ARM: 8923/1: mm: include <asm/vga.h> for vga_base 2019-10-31 16:58:54 +00:00
ioremap.c ARM: 9447/1: arm/memremap: fix arch_memremap_can_ram_remap() 2025-04-16 16:27:18 +01:00
kasan_init.c kasan: call kasan_init_generic in kasan_init 2025-09-21 14:21:58 -07:00
Kconfig vdso: Drop Kconfig GENERIC_VDSO_DATA_STORE 2025-09-04 11:23:50 +02:00
l2c-common.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
l2c-l2x0-resume.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Makefile kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
mm.h arm: implement the new page table range API 2023-08-24 16:20:20 -07:00
mmap.c mm: make arch_get_unmapped_area() take vm_flags by default 2024-09-09 16:39:13 -07:00
mmu.c arch, mm: consolidate empty_zero_page 2026-04-05 13:53:01 -07:00
nommu.c arch, mm: consolidate empty_zero_page 2026-04-05 13:53:01 -07:00
pabort-legacy.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pabort-v6.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pabort-v7.S License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
pageattr.c minmax: add in_range() macro 2023-08-24 16:20:18 -07:00
pgd.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
physaddr.c ARM: 9467/1: mm: Don't use %pK through printk 2026-01-31 12:59:09 +00:00
pmsa-v7.c ARM: 9069/1: NOMMU: Fix conversion for_each_membock() to for_each_mem_range() 2021-03-25 10:25:20 +00:00
pmsa-v8.c ARM: mm: Make virt_to_pfn() a static inline 2023-05-29 11:27:08 +02:00
proc-arm7tdmi.S ARM: 9388/2: mm: Type-annotate all per-processor assembly routines 2024-04-29 14:14:19 +01:00
proc-arm9tdmi.S ARM: 9388/2: mm: Type-annotate all per-processor assembly routines 2024-04-29 14:14:19 +01:00
proc-arm720.S ARM: 9388/2: mm: Type-annotate all per-processor assembly routines 2024-04-29 14:14:19 +01:00
proc-arm740.S ARM: 9388/2: mm: Type-annotate all per-processor assembly routines 2024-04-29 14:14:19 +01:00
proc-arm920.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
proc-arm922.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
proc-arm925.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
proc-arm926.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
proc-arm940.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
proc-arm946.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
proc-arm1020.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
proc-arm1020e.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
proc-arm1022.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
proc-arm1026.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
proc-fa526.S ARM: 9388/2: mm: Type-annotate all per-processor assembly routines 2024-04-29 14:14:19 +01:00
proc-feroceon.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
proc-macros.S ARM: 9387/2: mm: Rewrite cacheflush vtables in CFI safe C 2024-04-29 14:14:18 +01:00
proc-mohawk.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
proc-sa110.S ARM: 9388/2: mm: Type-annotate all per-processor assembly routines 2024-04-29 14:14:19 +01:00
proc-sa1100.S ARM: 9388/2: mm: Type-annotate all per-processor assembly routines 2024-04-29 14:14:19 +01:00
proc-syms.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
proc-v6.S ARM: 9388/2: mm: Type-annotate all per-processor assembly routines 2024-04-29 14:14:19 +01:00
proc-v7-2level.S ARM: 9388/2: mm: Type-annotate all per-processor assembly routines 2024-04-29 14:14:19 +01:00
proc-v7-3level.S ARM: 9388/2: mm: Type-annotate all per-processor assembly routines 2024-04-29 14:14:19 +01:00
proc-v7-bugs.c ARM: 9213/1: Print message about disabled Spectre workarounds only once 2022-07-06 22:44:49 +01:00
proc-v7.S ARM: 9434/1: cfi: Fix compilation corner case 2024-11-12 23:51:05 +00:00
proc-v7m.S ARM: 9388/2: mm: Type-annotate all per-processor assembly routines 2024-04-29 14:14:19 +01:00
proc-xsc3.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
proc-xscale.S ARM: 9388/2: mm: Type-annotate all per-processor assembly routines 2024-04-29 14:14:19 +01:00
proc.c ARM: 9408/1: mm: CFI: Fix some erroneous reset prototypes 2024-07-02 09:19:14 +01:00
ptdump_debugfs.c ARM: 9074/1: ptdump: convert to DEFINE_SHOW_ATTRIBUTE 2021-04-18 19:15:13 +01:00
pv-fixup-asm.S ARM: mm: Make virt_to_pfn() a static inline 2023-05-29 11:27:08 +02:00
tlb-fa.S ARM: 9384/2: mm: Make tlbflush routines CFI safe 2024-04-29 14:14:15 +01:00
tlb-v4.S kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI 2025-09-24 14:29:14 -07:00
tlb-v4wb.S ARM: 9384/2: mm: Make tlbflush routines CFI safe 2024-04-29 14:14:15 +01:00
tlb-v4wbi.S ARM: 9384/2: mm: Make tlbflush routines CFI safe 2024-04-29 14:14:15 +01:00
tlb-v6.S ARM: 9384/2: mm: Make tlbflush routines CFI safe 2024-04-29 14:14:15 +01:00
tlb-v7.S ARM: 9384/2: mm: Make tlbflush routines CFI safe 2024-04-29 14:14:15 +01:00
tlb.c ARM: 9384/2: mm: Make tlbflush routines CFI safe 2024-04-29 14:14:15 +01:00