^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Memory subsystem initialization for Hexagon
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/init.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/mm.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/memblock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <asm/atomic.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/highmem.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <asm/tlb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <asm/sections.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <asm/vm_mmu.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * Define a startpg just past the end of the kernel image and a lastpg
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * that corresponds to the end of real or simulated platform memory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define bootmem_startpg (PFN_UP(((unsigned long) _end) - PAGE_OFFSET + PHYS_OFFSET))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) unsigned long bootmem_lastpg; /* Should be set by platform code */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) unsigned long __phys_offset; /* physical kernel offset >> 12 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) /* Set as variable to limit PMD copies */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) int max_kernel_seg = 0x303;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) /* indicate pfn's of high memory */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) unsigned long highstart_pfn, highend_pfn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) /* Default cache attribute for newly created page tables */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) unsigned long _dflt_cache_att = CACHEDEF;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) * The current "generation" of kernel map, which should not roll
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) * over until Hell freezes over. Actual bound in years needs to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) * calculated to confirm.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) DEFINE_SPINLOCK(kmap_gen_lock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) /* checkpatch says don't init this to 0. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) unsigned long long kmap_generation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) * mem_init - initializes memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) * Frees up bootmem
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) * Fixes up more stuff for HIGHMEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) * Calculates and displays memory available/used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) void __init mem_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) /* No idea where this is actually declared. Seems to evade LXR. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) memblock_free_all();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) mem_init_print_info(NULL);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) * To-Do: someone somewhere should wipe out the bootmem map
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) * after we're done?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) * This can be moved to some more virtual-memory-specific
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) * initialization hook at some point. Set the init_mm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) * descriptors "context" value to point to the initial
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) * kernel segment table's physical address.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) init_mm.context.ptbase = __pa(init_mm.pgd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) void sync_icache_dcache(pte_t pte)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) unsigned long addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) struct page *page;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) page = pte_page(pte);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) addr = (unsigned long) page_address(page);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) __vmcache_idsync(addr, PAGE_SIZE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) * In order to set up page allocator "nodes",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) * somebody has to call free_area_init() for UMA.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) * In this mode, we only have one pg_data_t
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) * structure: contig_mem_data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) void __init paging_init(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) unsigned long max_zone_pfn[MAX_NR_ZONES] = {0, };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) * This is not particularly well documented anywhere, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) * give ZONE_NORMAL all the memory, including the big holes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) * left by the kernel+bootmem_map which are already left as reserved
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) * in the bootmem_map; free_area_init should see those bits and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) * adjust accordingly.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) max_zone_pfn[ZONE_NORMAL] = max_low_pfn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) free_area_init(max_zone_pfn); /* sets up the zonelists and mem_map */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) * Start of high memory area. Will probably need something more
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) * fancy if we... get more fancy.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) high_memory = (void *)((bootmem_lastpg + 1) << PAGE_SHIFT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) #ifndef DMA_RESERVE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) #define DMA_RESERVE (4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) #define DMA_CHUNKSIZE (1<<22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) #define DMA_RESERVED_BYTES (DMA_RESERVE * DMA_CHUNKSIZE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) * Pick out the memory size. We look for mem=size,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) * where size is "size[KkMm]"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) static int __init early_mem(char *p)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) unsigned long size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) char *endp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) size = memparse(p, &endp);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) bootmem_lastpg = PFN_DOWN(size);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) early_param("mem", early_mem);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) size_t hexagon_coherent_pool_size = (size_t) (DMA_RESERVE << 22);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) void __init setup_arch_memory(void)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) /* XXX Todo: this probably should be cleaned up */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) u32 *segtable = (u32 *) &swapper_pg_dir[0];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) u32 *segtable_end;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) * Set up boot memory allocator
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) * The Gorman book also talks about these functions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) * This needs to change for highmem setups.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) /* Prior to this, bootmem_lastpg is actually mem size */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) bootmem_lastpg += ARCH_PFN_OFFSET;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) /* Memory size needs to be a multiple of 16M */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) bootmem_lastpg = PFN_DOWN((bootmem_lastpg << PAGE_SHIFT) &
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) ~((BIG_KERNEL_PAGE_SIZE) - 1));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) memblock_add(PHYS_OFFSET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) (bootmem_lastpg - ARCH_PFN_OFFSET) << PAGE_SHIFT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) /* Reserve kernel text/data/bss */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) memblock_reserve(PHYS_OFFSET,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) (bootmem_startpg - ARCH_PFN_OFFSET) << PAGE_SHIFT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) * Reserve the top DMA_RESERVE bytes of RAM for DMA (uncached)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) * memory allocation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) max_low_pfn = bootmem_lastpg - PFN_DOWN(DMA_RESERVED_BYTES);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) min_low_pfn = ARCH_PFN_OFFSET;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) memblock_reserve(PFN_PHYS(max_low_pfn), DMA_RESERVED_BYTES);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) printk(KERN_INFO "bootmem_startpg: 0x%08lx\n", bootmem_startpg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) printk(KERN_INFO "bootmem_lastpg: 0x%08lx\n", bootmem_lastpg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) printk(KERN_INFO "min_low_pfn: 0x%08lx\n", min_low_pfn);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) printk(KERN_INFO "max_low_pfn: 0x%08lx\n", max_low_pfn);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) * The default VM page tables (will be) populated with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) * VA=PA+PAGE_OFFSET mapping. We go in and invalidate entries
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) * higher than what we have memory for.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) /* this is pointer arithmetic; each entry covers 4MB */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) segtable = segtable + (PAGE_OFFSET >> 22);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) /* this actually only goes to the end of the first gig */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) segtable_end = segtable + (1<<(30-22));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) * Move forward to the start of empty pages; take into account
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) * phys_offset shift.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) segtable += (bootmem_lastpg-ARCH_PFN_OFFSET)>>(22-PAGE_SHIFT);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) for (i = 1 ; i <= DMA_RESERVE ; i++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) segtable[-i] = ((segtable[-i] & __HVM_PTE_PGMASK_4MB)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) | __HVM_PTE_R | __HVM_PTE_W | __HVM_PTE_X
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) | __HEXAGON_C_UNC << 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) | __HVM_PDE_S_4MB);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) printk(KERN_INFO "clearing segtable from %p to %p\n", segtable,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) segtable_end);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) while (segtable < (segtable_end-8))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) *(segtable++) = __HVM_PDE_S_INVALID;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) /* stop the pointer at the device I/O 4MB page */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) printk(KERN_INFO "segtable = %p (should be equal to _K_io_map)\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) segtable);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) #if 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) /* Other half of the early device table from vm_init_segtable. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) printk(KERN_INFO "&_K_init_devicetable = 0x%08x\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) (unsigned long) _K_init_devicetable-PAGE_OFFSET);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) *segtable = ((u32) (unsigned long) _K_init_devicetable-PAGE_OFFSET) |
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) __HVM_PDE_S_4KB;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) printk(KERN_INFO "*segtable = 0x%08x\n", *segtable);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) * The bootmem allocator seemingly just lives to feed memory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) * to the paging system
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) printk(KERN_INFO "PAGE_SIZE=%lu\n", PAGE_SIZE);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) paging_init(); /* See Gorman Book, 2.3 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) * At this point, the page allocator is kind of initialized, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) * apparently no pages are available (just like with the bootmem
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) * allocator), and need to be freed themselves via mem_init(),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) * which is called by start_kernel() later on in the process
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) }