mirror-linux/arch/x86/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
..
amd x86/ibs: Fix typo in dc_l2tlb_miss comment 2026-02-02 22:01:07 +01:00
cpuid
e820 x86/boot/e820: Simplify the e820__range_remove() API 2025-12-14 09:19:42 +01:00
fpu arch: copy_thread: pass clone_flags as u64 2025-09-01 15:31:34 +02:00
numachip
shared x86/boot: Move boot_*msr helpers to asm/shared/msr.h 2025-10-30 16:29:53 +01:00
trace x86/fpu: Remove unused trace events 2025-05-31 09:40:40 +02:00
uv x86/platform/uv: Fix UBSAN array-index-out-of-bounds 2025-12-14 08:46:53 +01:00
vdso * VDSO rework and cleanups 2026-02-10 19:34:26 -08:00
xen xen: replace XENFEAT_auto_translated_physmap with xen_pv_domain() 2025-09-08 17:01:36 +02:00
GEN-for-each-reg.h
Kbuild
acenv.h
acpi.h x86: Handle KCOV __init vs inline mismatches 2025-07-24 16:55:11 -07:00
acrn.h
agp.h
alternative.h objtool: Remove newlines and tabs from annotation macros 2025-12-03 19:42:37 +01:00
apic.h x86/paravirt: Remove not needed includes of paravirt.h 2026-01-12 11:26:52 +01:00
apicdef.h x86/apic: Populate .read()/.write() callbacks of Secure AVIC driver 2025-08-31 22:07:35 +02:00
apm.h
arch_hweight.h
archrandom.h x86/asm: Remove code depending on __GCC_ASM_FLAG_OUTPUTS__ 2025-09-08 15:38:06 +02:00
asm-offsets.h
asm-prototypes.h
asm.h x86/asm: Remove ANNOTATE_DATA_SPECIAL usage 2025-12-03 16:53:19 +01:00
atomic.h
atomic64_32.h
atomic64_64.h
audit.h
barrier.h
bios_ebda.h
bitops.h - Simplify inline asm flag output operands now that the minimum compiler 2025-10-11 10:51:14 -07:00
boot.h efistub/x86: Remap inittext read-execute when needed 2025-09-03 18:05:42 +02:00
bootparam_utils.h
bug.h x86/headers: Replace __ASSEMBLY__ stragglers with __ASSEMBLER__ 2026-02-23 11:19:12 +01:00
bugs.h
cache.h
cacheflush.h
cacheinfo.h
ce4100.h serial: 8250: Move CE4100 quirks to a module under 8250 driver 2025-06-29 14:24:46 +02:00
cfi.h x86/cfi: Fix CFI rewrite for odd alignments 2026-02-23 11:19:11 +01:00
checksum.h
checksum_32.h
checksum_64.h x86/lib: Inline csum_ipv6_magic() 2026-01-05 10:14:05 -08:00
clocksource.h
cmdline.h
cmpxchg.h x86/asm: Remove code depending on __GCC_ASM_FLAG_OUTPUTS__ 2025-09-08 15:38:06 +02:00
cmpxchg_32.h x86/asm: Remove code depending on __GCC_ASM_FLAG_OUTPUTS__ 2025-09-08 15:38:06 +02:00
cmpxchg_64.h x86/asm: Remove code depending on __GCC_ASM_FLAG_OUTPUTS__ 2025-09-08 15:38:06 +02:00
coco.h
compat.h
cpu.h
cpu_device_id.h
cpu_entry_area.h
cpufeature.h Address various objtool scalability bugs/inefficiencies exposed by 2025-12-06 11:56:51 -08:00
cpufeatures.h Loongarch: 2026-02-13 11:31:15 -08:00
cpuidle_haltpoll.h
cpumask.h cpumask: Don't use "proxy" headers 2025-11-24 16:08:18 -05:00
crash.h
crash_reserve.h
current.h
debugreg.h x86/traps: Initialize DR7 by writing its architectural reset value 2025-06-24 13:15:52 -07:00
delay.h
desc.h
desc_defs.h
device.h
div64.h lib: mul_u64_u64_div_u64(): optimise multiply on 32bit x86 2025-11-20 14:03:42 -08:00
dma-mapping.h
dma.h
dmi.h
doublefault.h
dwarf2.h x86/entry/vdso32: Remove open-coded DWARF in sigreturn.S 2026-01-13 16:37:58 -08:00
edac.h
efi.h x86/efi: defer freeing of boot services memory 2026-02-25 12:02:48 +01:00
elf.h x86/entry/vdso: Rename vdso_image_* to vdso*_image 2026-01-13 15:33:20 -08:00
elfcore-compat.h
emergency-restart.h
emulate_prefix.h
enclu.h
entry-common.h x86/vmscape: Add conditional IBPB mitigation 2025-08-14 10:37:18 -07:00
espfix.h
exec.h
extable.h
extable_fixup_types.h
fixmap.h
floppy.h floppy: Replace custom SZ_64K constant 2025-08-25 14:46:42 -06:00
fpu.h
frame.h
fred.h x86/fred: Fix 64bit identifier in fred_ss 2025-10-13 14:05:42 -07:00
fsgsbase.h
ftrace.h x86/fgraph,bpf: Switch kprobe_multi program stack unwind to hw_regs path 2026-01-30 13:40:08 -08:00
futex.h x86/futex: Convert to scoped user access 2025-11-04 08:28:29 +01:00
gart.h
genapic.h
geode.h
gsseg.h
hardirq.h perf/x86/core: Register a new vector for handling mediated guest PMIs 2025-12-17 13:31:05 +01:00
highmem.h x86/paravirt: Remove not needed includes of paravirt.h 2026-01-12 11:26:52 +01:00
hpet.h
hugetlb.h
hw_breakpoint.h
hw_irq.h x86/irq: Plug vector setup race 2025-08-04 23:34:03 +02:00
hyperv_timer.h
hypervisor.h x86/cpu: Detect FreeBSD Bhyve hypervisor 2025-09-15 14:06:44 +02:00
i8259.h
ia32.h
ibt.h x86,ibt: Use UDB instead of 0xEA 2025-09-04 21:59:09 +02:00
idtentry.h perf/x86/core: Register a new vector for handling mediated guest PMIs 2025-12-17 13:31:05 +01:00
imr.h
inat.h x86/insn: Add XOP prefix instructions decoder support 2025-08-18 17:15:02 +02:00
inat_types.h
init.h x86/boot: Move startup code out of __head section 2025-09-03 18:06:04 +02:00
insn-eval.h x86/insn,uprobes,alternative: Unify insn_is_nop() 2025-10-16 11:13:47 +02:00
insn.h x86/insn: Simplify for_each_insn_prefix() 2025-10-16 11:13:48 +02:00
inst.h
intel-family.h x86/cpu: Add/fix core comments for {Panther,Nova} Lake 2025-10-30 11:34:02 +01:00
intel-mid.h
intel_ds.h perf/x86/intel: Setup PEBS data configuration and enable legacy groups 2025-11-07 15:08:22 +01:00
intel_pt.h
intel_punit_ipc.h
intel_telemetry.h platform/x86: intel_telemetry: Remove unused telemetry_raw_read_events() 2025-06-11 10:56:06 +03:00
invpcid.h
io.h
io_apic.h
io_bitmap.h
iomap.h
iommu.h
iosf_mbi.h
irq.h
irq_remapping.h x86/irq_remapping: Sanitize posted_msi_supported() 2025-12-18 22:59:40 +01:00
irq_stack.h objtool: Remove newlines and tabs from annotation macros 2025-12-03 19:42:37 +01:00
irq_vectors.h perf/x86/core: Register a new vector for handling mediated guest PMIs 2025-12-17 13:31:05 +01:00
irq_work.h
irqdomain.h
irqflags.h x86/headers: Replace __ASSEMBLY__ stragglers with __ASSEMBLER__ 2026-02-23 11:19:12 +01:00
ist.h
jailhouse_para.h
jump_label.h objtool: Remove newlines and tabs from annotation macros 2025-12-03 19:42:37 +01:00
kasan.h
kaslr.h
kbdleds.h
kdebug.h
kexec-bzimage64.h
kexec.h x86/sme: Use percpu boolean to control WBINVD during kexec 2025-09-05 10:40:40 -07:00
kfence.h x86/kfence: fix booting on 32bit non-PAE systems 2026-02-02 18:43:55 -08:00
kgdb.h
kmsan.h
kprobes.h
kvm-x86-ops.h KVM: TDX: Convert INIT_MEM_REGION and INIT_VCPU to "unlocked" vCPU ioctl 2025-11-05 11:17:30 -08:00
kvm-x86-pmu-ops.h KVM: x86/pmu: Load/put mediated PMU context when entering/exiting guest 2026-01-08 11:52:11 -08:00
kvm_host.h KVM: x86: Introduce KVM_X86_QUIRK_VMCS12_ALLOW_FREEZE_IN_SMM 2026-03-11 18:41:11 +01:00
kvm_page_track.h
kvm_para.h x86/kvm: Make kvm_async_pf_task_wake() a local static helper 2025-09-11 08:57:16 -07:00
kvm_types.h x86: Restrict KVM-induced symbol exports to KVM modules where obvious/possible 2025-11-12 15:29:38 -08:00
kvm_vcpu_regs.h
kvmclock.h
linkage.h x86/cfi: Fix CFI rewrite for odd alignments 2026-02-23 11:19:11 +01:00
local.h
mach_timer.h
mach_traps.h
math_emu.h
mc146818rtc.h
mce.h x86/mce: Add support for physical address valid bit 2025-11-21 10:32:28 +01:00
mem_encrypt.h
memtype.h
microcode.h
misc.h
mman.h
mmconfig.h
mmu.h
mmu_context.h x86/mm: Hide mm_free_global_asid() definition under CONFIG_BROADCAST_TLB_FLUSH 2026-01-16 22:16:32 +01:00
module.h x86/its: move its_pages array to struct mod_arch_specific 2025-06-11 11:20:51 +02:00
mpspec.h
mpspec_def.h
mshyperv.h x86/paravirt: Remove not needed includes of paravirt.h 2026-01-12 11:26:52 +01:00
msi.h
msr-index.h x86/sev: Allow IBPB-on-Entry feature for SNP guests 2026-03-02 11:08:59 +01:00
msr-trace.h
msr.h Generic: 2025-06-02 12:24:58 -07:00
mtrr.h x86/mtrr: Remove license boilerplate text with bad FSF address 2025-08-22 19:37:11 +02:00
mwait.h x86/idle: Use MONITORX and MWAITX mnemonics in <asm/mwait.h> 2025-08-22 13:52:21 +02:00
nmi.h
nops.h
nospec-branch.h Address various objtool scalability bugs/inefficiencies exposed by 2025-12-06 11:56:51 -08:00
numa.h x86/numa: Store extra copy of numa_nodes_parsed 2026-03-04 16:35:08 +01:00
olpc.h
olpc_ofw.h
orc_header.h
orc_lookup.h
orc_types.h
page.h treewide: provide a generic clear_user_page() variant 2026-01-20 19:24:39 -08:00
page_32.h x86/mm: simplify clear_page_* 2026-01-20 19:24:40 -08:00
page_32_types.h
page_64.h x86/clear_page: introduce clear_pages() 2026-01-20 19:24:40 -08:00
page_64_types.h
page_types.h
paravirt-base.h x86/pvlocks: Move paravirt spinlock functions into own header 2026-01-13 14:57:45 +01:00
paravirt-spinlock.h x86/paravirt: Use XOR r32,r32 to clear register in pv_vcpu_is_preempted() 2026-01-15 11:44:29 +01:00
paravirt.h mm.git review status for linus..mm-stable 2026-02-12 11:32:37 -08:00
paravirt_types.h x86/paravirt: Remove trailing semicolons from alternative asm templates 2026-01-15 11:14:47 +01:00
parport.h
pc-conf-reg.h
pci-direct.h
pci-functions.h
pci.h
pci_x86.h
percpu.h x86/headers: Replace __ASSEMBLY__ stragglers with __ASSEMBLER__ 2026-02-23 11:19:12 +01:00
perf_event.h perf/x86/intel: Add support for rdpmc user disable feature 2026-01-15 10:04:28 +01:00
perf_event_p4.h
pgalloc.h
pgtable-2level.h
pgtable-2level_types.h
pgtable-3level.h
pgtable-3level_types.h
pgtable-invert.h
pgtable.h arch, mm: consolidate empty_zero_page 2026-04-05 13:53:01 -07:00
pgtable_32.h x86/paravirt: Remove not needed includes of paravirt.h 2026-01-12 11:26:52 +01:00
pgtable_32_areas.h
pgtable_32_types.h
pgtable_64.h x86/xen: Build identity mapping page tables dynamically for XENPV 2026-03-03 14:21:44 +01:00
pgtable_64_types.h x86/mm/64: define ARCH_PAGE_TABLE_SYNC_MASK and arch_sync_kernel_mappings() 2025-08-27 22:45:44 -07:00
pgtable_areas.h
pgtable_types.h Summary of significant series in this pull request: 2025-07-31 14:57:54 -07:00
pkeys.h mm/pkeys: remove unused tsk parameter from arch_set_user_pkey_access() 2026-04-05 13:52:57 -07:00
pkru.h
platform_sst_audio.h
pm-trace.h
posix_types.h
posted_intr.h
preempt.h
probe_roms.h
processor-cyrix.h
processor-flags.h
processor.h x86/sme: Use percpu boolean to control WBINVD during kexec 2025-09-05 10:40:40 -07:00
prom.h
proto.h
pti.h
ptrace.h x86/paravirt: Introduce new paravirt-base.h header 2026-01-12 18:58:28 +01:00
purgatory.h
pvclock-abi.h
pvclock.h
qrwlock.h
qspinlock.h x86/pvlocks: Move paravirt spinlock functions into own header 2026-01-13 14:57:45 +01:00
qspinlock_paravirt.h
realmode.h x86: Handle KCOV __init vs inline mismatches 2025-07-24 16:55:11 -07:00
reboot.h
reboot_fixups.h
resctrl.h x86/resctrl: Remove the rdt_mon_features global variable 2025-09-15 11:55:50 +02:00
rmwcc.h x86/asm: Remove code depending on __GCC_ASM_FLAG_OUTPUTS__ 2025-09-08 15:38:06 +02:00
rqspinlock.h
runtime-const.h x86/headers: Replace __ASSEMBLY__ stragglers with __ASSEMBLER__ 2026-02-23 11:19:12 +01:00
seccomp.h
sections.h
segment.h x86/segment: Use MOVL when reading segment registers 2026-01-20 12:34:58 +01:00
serial.h
set_memory.h x86/crash: Use set_memory_p() instead of __set_memory_prot() 2026-01-13 15:28:59 +01:00
setup.h x86/boot: Create a confined code area for startup code 2025-09-03 18:00:01 +02:00
setup_arch.h
setup_data.h
sev-common.h x86/apic/savic: Do not use snp_abort() 2025-09-04 13:12:51 +02:00
sev.h - Simplify inline asm flag output operands now that the minimum compiler 2025-10-11 10:51:14 -07:00
sgx.h x86/sgx: Fix a typo in the kernel-doc comment for enum sgx_attribute 2025-11-14 15:30:32 -08:00
shmparam.h
shstk.h Performance events updates for v6.18: 2025-09-30 11:11:21 -07:00
sigcontext.h
sigframe.h
sighandling.h x86/fred/signal: Prevent immediate repeat of single step trap on return from SIGTRAP handler 2025-06-09 08:50:58 -07:00
signal.h x86/asm: Remove code depending on __GCC_ASM_FLAG_OUTPUTS__ 2025-09-08 15:38:06 +02:00
simd.h
smap.h Address various objtool scalability bugs/inefficiencies exposed by 2025-12-06 11:56:51 -08:00
smp.h x86/smpboot: Mark native_play_dead() as __noreturn 2025-10-30 08:29:41 -07:00
softirq_stack.h
sparsemem.h
spec-ctrl.h
special_insns.h x86/asm: Remove code depending on __GCC_ASM_FLAG_OUTPUTS__ 2025-09-08 15:38:06 +02:00
spinlock.h x86/paravirt: Remove not needed includes of paravirt.h 2026-01-12 11:26:52 +01:00
spinlock_types.h
stackprotector.h
stacktrace.h
static_call.h objtool: Remove newlines and tabs from annotation macros 2025-12-03 19:42:37 +01:00
string.h x86/asm: Introduce inline memcpy and memset 2025-11-18 10:38:26 -08:00
string_32.h
string_64.h arch/x86: replace "__auto_type" with "auto" 2025-12-08 15:32:15 -08:00
suspend.h
suspend_32.h
suspend_64.h
svm.h KVM: SVM: Treat exit_code as an unsigned 64-bit value through all of KVM 2026-01-13 17:37:03 -08:00
switch_to.h
sync_bitops.h
sync_core.h
syscall.h
syscall_wrapper.h
syscalls.h
tdx.h x86/virt/tdx: Use precalculated TDVPR page physical address 2025-09-11 11:38:28 -07:00
tdx_global_metadata.h
text-patching.h KVM: x86: Implement test_cc() in C 2025-08-18 14:23:04 +02:00
thermal.h
thread_info.h x86/xen: use lazy_mmu_state when context-switching 2026-01-20 19:24:35 -08:00
time.h
timer.h x86/paravirt: Move paravirt_sched_clock() related code into tsc.c 2026-01-12 18:47:39 +01:00
timex.h
tlb.h
tlbbatch.h
tlbflush.h - A nice cleanup to the paravirt code containing a unification of the paravirt 2026-02-10 19:01:45 -08:00
topology.h x86/topo: Add topology_num_nodes_per_package() 2026-03-04 16:35:08 +01:00
trace_clock.h
trap_pf.h
trapnr.h
traps.h x86/bug: Handle __WARN_printf() trap in early_fixup_exception() 2026-02-23 11:19:11 +01:00
tsc.h
uaccess.h x86/uaccess: Use unsafe wrappers for ASM GOTO 2025-11-03 15:26:09 +01:00
uaccess_32.h
uaccess_64.h arch/x86: replace "__auto_type" with "auto" 2025-12-08 15:32:15 -08:00
umip.h
unaccepted_memory.h
unistd.h
unwind.h
unwind_hints.h
unwind_user.h x86/unwind_user: Simplify unwind_user_word_size() 2025-12-17 13:31:08 +01:00
uprobes.h unwind_user/x86: Teach FP unwind about start of function 2025-10-29 10:29:58 +01:00
user.h
user32.h
user_32.h
user_64.h
vdso.h x86/entry/vdso: Rename vdso_image_* to vdso*_image 2026-01-13 15:33:20 -08:00
vermagic.h
vga.h
vgtod.h
video.h Fix access to video_is_primary_device() when compiled without CONFIG_VIDEO 2025-09-10 09:35:33 -05:00
vm86.h
vmalloc.h
vmware.h x86/vmware: Fix hypercall clobbers 2026-02-06 14:51:03 -08:00
vmx.h KVM: x86/pmu: Load/save GLOBAL_CTRL via entry/exit fields for mediated PMU 2026-01-08 11:52:07 -08:00
vmxfeatures.h
vsyscall.h
word-at-a-time.h
x86_init.h x86/platform: Fix and extend kernel-doc comments in <asm/x86_init.h> 2025-12-01 21:57:16 +01:00
xor.h
xor_32.h
xor_64.h
xor_avx.h