#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/ptrace.h>
#include <linux/mman.h>
#include <linux/mm.h>
#include <linux/swap.h>
#include <linux/smp.h>
#include <linux/init.h>
#include <linux/initrd.h>
#include <linux/pagemap.h>
#include <linux/memblock.h>
#include <linux/proc_fs.h>
#include <linux/pci.h>
#include <linux/pfn.h>
#include <linux/poison.h>
#include <linux/dma-mapping.h>
#include <linux/memory.h>
#include <linux/memory_hotplug.h>
#include <linux/memremap.h>
#include <linux/nmi.h>
#include <linux/gfp.h>
#include <linux/kcore.h>
#include <linux/bootmem_info.h>
#include <asm/processor.h>
#include <asm/bios_ebda.h>
#include <linux/uaccess.h>
#include <asm/pgalloc.h>
#include <asm/dma.h>
#include <asm/fixmap.h>
#include <asm/e820/api.h>
#include <asm/apic.h>
#include <asm/tlb.h>
#include <asm/mmu_context.h>
#include <asm/proto.h>
#include <asm/smp.h>
#include <asm/sections.h>
#include <asm/kdebug.h>
#include <asm/numa.h>
#include <asm/set_memory.h>
#include <asm/init.h>
#include <asm/uv/uv.h>
#include <asm/setup.h>
#include <asm/ftrace.h>
#include "mm_internal.h"
#include "ident_map.c"
#define DEFINE_POPULATE(fname, type1, type2, init) …
DEFINE_POPULATE(p4d_populate, p4d, pud, init)
DEFINE_POPULATE(pgd_populate, pgd, p4d, init)
DEFINE_POPULATE(pud_populate, pud, pmd, init)
DEFINE_POPULATE(pmd_populate_kernel, pmd, pte, init)
#define DEFINE_ENTRY(type1, type2, init) …
DEFINE_ENTRY(p4d, p4d, init)
DEFINE_ENTRY(pud, pud, init)
DEFINE_ENTRY(pmd, pmd, init)
DEFINE_ENTRY(pte, pte, init)
static inline pgprot_t prot_sethuge(pgprot_t prot)
{ … }
pteval_t __supported_pte_mask __read_mostly = …;
pteval_t __default_kernel_pte_mask __read_mostly = …;
EXPORT_SYMBOL_GPL(…);
EXPORT_SYMBOL(…);
int force_personality32;
static int __init nonx32_setup(char *str)
{ … }
__setup(…);
static void sync_global_pgds_l5(unsigned long start, unsigned long end)
{ … }
static void sync_global_pgds_l4(unsigned long start, unsigned long end)
{ … }
static void sync_global_pgds(unsigned long start, unsigned long end)
{ … }
static __ref void *spp_getpage(void)
{ … }
static p4d_t *fill_p4d(pgd_t *pgd, unsigned long vaddr)
{ … }
static pud_t *fill_pud(p4d_t *p4d, unsigned long vaddr)
{ … }
static pmd_t *fill_pmd(pud_t *pud, unsigned long vaddr)
{ … }
static pte_t *fill_pte(pmd_t *pmd, unsigned long vaddr)
{ … }
static void __set_pte_vaddr(pud_t *pud, unsigned long vaddr, pte_t new_pte)
{ … }
void set_pte_vaddr_p4d(p4d_t *p4d_page, unsigned long vaddr, pte_t new_pte)
{ … }
void set_pte_vaddr_pud(pud_t *pud_page, unsigned long vaddr, pte_t new_pte)
{ … }
void set_pte_vaddr(unsigned long vaddr, pte_t pteval)
{ … }
pmd_t * __init populate_extra_pmd(unsigned long vaddr)
{ … }
pte_t * __init populate_extra_pte(unsigned long vaddr)
{ … }
static void __init __init_extra_mapping(unsigned long phys, unsigned long size,
enum page_cache_mode cache)
{ … }
void __init init_extra_mapping_wb(unsigned long phys, unsigned long size)
{ … }
void __init init_extra_mapping_uc(unsigned long phys, unsigned long size)
{ … }
void __init cleanup_highmap(void)
{ … }
static unsigned long __meminit
phys_pte_init(pte_t *pte_page, unsigned long paddr, unsigned long paddr_end,
pgprot_t prot, bool init)
{ … }
static unsigned long __meminit
phys_pmd_init(pmd_t *pmd_page, unsigned long paddr, unsigned long paddr_end,
unsigned long page_size_mask, pgprot_t prot, bool init)
{ … }
static unsigned long __meminit
phys_pud_init(pud_t *pud_page, unsigned long paddr, unsigned long paddr_end,
unsigned long page_size_mask, pgprot_t _prot, bool init)
{ … }
static unsigned long __meminit
phys_p4d_init(p4d_t *p4d_page, unsigned long paddr, unsigned long paddr_end,
unsigned long page_size_mask, pgprot_t prot, bool init)
{ … }
static unsigned long __meminit
__kernel_physical_mapping_init(unsigned long paddr_start,
unsigned long paddr_end,
unsigned long page_size_mask,
pgprot_t prot, bool init)
{ … }
unsigned long __meminit
kernel_physical_mapping_init(unsigned long paddr_start,
unsigned long paddr_end,
unsigned long page_size_mask, pgprot_t prot)
{ … }
unsigned long __meminit
kernel_physical_mapping_change(unsigned long paddr_start,
unsigned long paddr_end,
unsigned long page_size_mask)
{ … }
#ifndef CONFIG_NUMA
void __init initmem_init(void)
{
memblock_set_node(0, PHYS_ADDR_MAX, &memblock.memory, 0);
}
#endif
void __init paging_init(void)
{ … }
#ifdef CONFIG_SPARSEMEM_VMEMMAP
#define PAGE_UNUSED …
static unsigned long unused_pmd_start __meminitdata;
static void __meminit vmemmap_flush_unused_pmd(void)
{ … }
#ifdef CONFIG_MEMORY_HOTPLUG
static bool __meminit vmemmap_pmd_is_unused(unsigned long addr, unsigned long end)
{ … }
#endif
static void __meminit __vmemmap_use_sub_pmd(unsigned long start)
{ … }
static void __meminit vmemmap_use_sub_pmd(unsigned long start, unsigned long end)
{ … }
static void __meminit vmemmap_use_new_sub_pmd(unsigned long start, unsigned long end)
{ … }
#endif
#ifdef CONFIG_MEMORY_HOTPLUG
static void update_end_of_memory_vars(u64 start, u64 size)
{ … }
int add_pages(int nid, unsigned long start_pfn, unsigned long nr_pages,
struct mhp_params *params)
{ … }
int arch_add_memory(int nid, u64 start, u64 size,
struct mhp_params *params)
{ … }
static void __meminit free_pagetable(struct page *page, int order)
{ … }
static void __meminit free_hugepage_table(struct page *page,
struct vmem_altmap *altmap)
{ … }
static void __meminit free_pte_table(pte_t *pte_start, pmd_t *pmd)
{ … }
static void __meminit free_pmd_table(pmd_t *pmd_start, pud_t *pud)
{ … }
static void __meminit free_pud_table(pud_t *pud_start, p4d_t *p4d)
{ … }
static void __meminit
remove_pte_table(pte_t *pte_start, unsigned long addr, unsigned long end,
bool direct)
{ … }
static void __meminit
remove_pmd_table(pmd_t *pmd_start, unsigned long addr, unsigned long end,
bool direct, struct vmem_altmap *altmap)
{ … }
static void __meminit
remove_pud_table(pud_t *pud_start, unsigned long addr, unsigned long end,
struct vmem_altmap *altmap, bool direct)
{ … }
static void __meminit
remove_p4d_table(p4d_t *p4d_start, unsigned long addr, unsigned long end,
struct vmem_altmap *altmap, bool direct)
{ … }
static void __meminit
remove_pagetable(unsigned long start, unsigned long end, bool direct,
struct vmem_altmap *altmap)
{ … }
void __ref vmemmap_free(unsigned long start, unsigned long end,
struct vmem_altmap *altmap)
{ … }
static void __meminit
kernel_physical_mapping_remove(unsigned long start, unsigned long end)
{ … }
void __ref arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
{ … }
#endif
static struct kcore_list kcore_vsyscall;
static void __init register_page_bootmem_info(void)
{ … }
static void __init preallocate_vmalloc_pages(void)
{ … }
void __init mem_init(void)
{ … }
int kernel_set_to_readonly;
void mark_rodata_ro(void)
{ … }
#define MAX_BLOCK_SIZE …
#define MEM_SIZE_FOR_LARGE_BLOCK …
static unsigned long set_memory_block_size;
int __init set_memory_block_size_order(unsigned int order)
{ … }
static unsigned long probe_memory_block_size(void)
{ … }
static unsigned long memory_block_size_probed;
unsigned long memory_block_size_bytes(void)
{ … }
#ifdef CONFIG_SPARSEMEM_VMEMMAP
static long __meminitdata addr_start, addr_end;
static void __meminitdata *p_start, *p_end;
static int __meminitdata node_start;
void __meminit vmemmap_set_pmd(pmd_t *pmd, void *p, int node,
unsigned long addr, unsigned long next)
{ … }
int __meminit vmemmap_check_pmd(pmd_t *pmd, int node,
unsigned long addr, unsigned long next)
{ … }
int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
struct vmem_altmap *altmap)
{ … }
#ifdef CONFIG_HAVE_BOOTMEM_INFO_NODE
void register_page_bootmem_memmap(unsigned long section_nr,
struct page *start_page, unsigned long nr_pages)
{ … }
#endif
void __meminit vmemmap_populate_print_last(void)
{ … }
#endif