arch/s390/mm/init.c
Source file repositories/reference/linux-study-clean/arch/s390/mm/init.c
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/mm/init.c- Extension
.c- Size
- 7702 bytes
- Lines
- 320
- Domain
- Architecture Layer
- Bucket
- arch/s390
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cpufeature.hlinux/signal.hlinux/sched.hlinux/kernel.hlinux/errno.hlinux/string.hlinux/types.hlinux/ptrace.hlinux/mman.hlinux/mm.hlinux/swap.hlinux/swiotlb.hlinux/smp.hlinux/init.hlinux/pagemap.hlinux/memblock.hlinux/memory.hlinux/pfn.hlinux/poison.hlinux/initrd.hlinux/export.hlinux/cma.hlinux/gfp.hlinux/dma-direct.hlinux/percpu.hasm/processor.hlinux/uaccess.hasm/pgalloc.hasm/ctlreg.hasm/kfence.hasm/dma.hasm/abs_lowcore.h
Detected Declarations
struct s390_cma_mem_datafunction arch_setup_zero_pagesfunction arch_zone_limits_initfunction paging_initfunction mark_rodata_rofunction set_memory_encryptedfunction set_memory_decryptedfunction force_dma_unencryptedfunction pv_initfunction arch_mm_preinitfunction memory_block_size_bytesfunction pcpu_cpu_distancefunction pcpu_cpu_to_nodefunction setup_per_cpu_areasfunction s390_cma_check_rangefunction s390_cma_mem_notifierfunction s390_cma_mem_initfunction arch_add_memoryfunction arch_remove_memorymodule init s390_cma_mem_initexport page_noexec_maskexport segment_noexec_maskexport region_noexec_maskexport empty_zero_pageexport zero_page_maskexport __per_cpu_offset
Annotated Snippet
device_initcall(s390_cma_mem_init);
#endif /* CONFIG_CMA */
int arch_add_memory(int nid, u64 start, u64 size,
struct mhp_params *params)
{
unsigned long start_pfn = PFN_DOWN(start);
unsigned long size_pages = PFN_DOWN(size);
int rc;
if (WARN_ON_ONCE(pgprot_val(params->pgprot) != pgprot_val(PAGE_KERNEL)))
return -EINVAL;
VM_BUG_ON(!mhp_range_allowed(start, size, true));
rc = vmem_add_mapping(start, size);
if (rc)
return rc;
rc = __add_pages(nid, start_pfn, size_pages, params);
if (rc)
vmem_remove_mapping(start, size);
return rc;
}
void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap,
struct dev_pagemap *pgmap)
{
unsigned long start_pfn = start >> PAGE_SHIFT;
unsigned long nr_pages = size >> PAGE_SHIFT;
__remove_pages(start_pfn, nr_pages, altmap, pgmap);
vmem_remove_mapping(start, size);
}
#endif /* CONFIG_MEMORY_HOTPLUG */
#ifdef CONFIG_EXECMEM
static struct execmem_info execmem_info __ro_after_init;
struct execmem_info __init *execmem_arch_setup(void)
{
unsigned long module_load_offset = 0;
unsigned long start;
if (kaslr_enabled())
module_load_offset = get_random_u32_inclusive(1, 1024) * PAGE_SIZE;
start = MODULES_VADDR + module_load_offset;
execmem_info = (struct execmem_info){
.ranges = {
[EXECMEM_DEFAULT] = {
.flags = EXECMEM_KASAN_SHADOW,
.start = start,
.end = MODULES_END,
.pgprot = PAGE_KERNEL,
.alignment = MODULE_ALIGN,
},
},
};
return &execmem_info;
}
#endif /* CONFIG_EXECMEM */
Annotation
- Immediate include surface: `linux/cpufeature.h`, `linux/signal.h`, `linux/sched.h`, `linux/kernel.h`, `linux/errno.h`, `linux/string.h`, `linux/types.h`, `linux/ptrace.h`.
- Detected declarations: `struct s390_cma_mem_data`, `function arch_setup_zero_pages`, `function arch_zone_limits_init`, `function paging_init`, `function mark_rodata_ro`, `function set_memory_encrypted`, `function set_memory_decrypted`, `function force_dma_unencrypted`, `function pv_init`, `function arch_mm_preinit`.
- Atlas domain: Architecture Layer / arch/s390.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.