···233233 This allows you to specify the maximum frame size a function may234234 have without the compiler complaining about it.235235236236+config ARCH_POPULATES_NODE_MAP237237+ def_bool y238238+236239source "mm/Kconfig"237240238241comment "I/O subsystem configuration"
+1
arch/s390/defconfig
···118118CONFIG_CHECK_STACK=y119119CONFIG_STACK_GUARD=256120120# CONFIG_WARN_STACK is not set121121+CONFIG_ARCH_POPULATES_NODE_MAP=y121122CONFIG_SELECT_MEMORY_MODEL=y122123CONFIG_FLATMEM_MANUAL=y123124# CONFIG_DISCONTIGMEM_MANUAL is not set
+13-42
arch/s390/kernel/setup.c
···7070#define CHUNK_READ_WRITE 07171#define CHUNK_READ_ONLY 17272volatile int __cpu_logical_map[NR_CPUS]; /* logical cpu to cpu address */7373-unsigned long __initdata zholes_size[MAX_NR_ZONES];7473static unsigned long __initdata memory_end;75747675/*···357358 */358359void (*pm_power_off)(void) = machine_power_off;359360360360-static void __init361361-add_memory_hole(unsigned long start, unsigned long end)362362-{363363- unsigned long dma_pfn = MAX_DMA_ADDRESS >> PAGE_SHIFT;364364-365365- if (end <= dma_pfn)366366- zholes_size[ZONE_DMA] += end - start + 1;367367- else if (start > dma_pfn)368368- zholes_size[ZONE_NORMAL] += end - start + 1;369369- else {370370- zholes_size[ZONE_DMA] += dma_pfn - start + 1;371371- zholes_size[ZONE_NORMAL] += end - dma_pfn;372372- }373373-}374374-375361static int __init early_parse_mem(char *p)376362{377363 memory_end = memparse(p, &p);···478494{479495 unsigned long bootmap_size;480496 unsigned long start_pfn, end_pfn, init_pfn;481481- unsigned long last_rw_end;482497 int i;483498484499 /*···526543#endif527544528545 /*529529- * Initialize the boot-time allocator (with low memory only):546546+ * Initialize the boot-time allocator530547 */531548 bootmap_size = init_bootmem(start_pfn, end_pfn);532549533550 /*534551 * Register RAM areas with the bootmem allocator.535552 */536536- last_rw_end = start_pfn;537553538554 for (i = 0; i < MEMORY_CHUNKS && memory_chunk[i].size > 0; i++) {539539- unsigned long start_chunk, end_chunk;555555+ unsigned long start_chunk, end_chunk, pfn;540556541557 if (memory_chunk[i].type != CHUNK_READ_WRITE)542558 continue;543543- start_chunk = (memory_chunk[i].addr + PAGE_SIZE - 1);544544- start_chunk >>= PAGE_SHIFT;545545- end_chunk = (memory_chunk[i].addr + memory_chunk[i].size);546546- end_chunk >>= PAGE_SHIFT;547547- if (start_chunk < start_pfn)548548- start_chunk = start_pfn;549549- if (end_chunk > end_pfn)550550- end_chunk = end_pfn;551551- if (start_chunk < end_chunk) {552552- /* Initialize storage key for RAM pages */553553- for (init_pfn = start_chunk ; init_pfn < end_chunk;554554- init_pfn++)555555- page_set_storage_key(init_pfn << PAGE_SHIFT,556556- PAGE_DEFAULT_KEY);557557- free_bootmem(start_chunk << PAGE_SHIFT,558558- (end_chunk - start_chunk) << PAGE_SHIFT);559559- if (last_rw_end < start_chunk)560560- add_memory_hole(last_rw_end, start_chunk - 1);561561- last_rw_end = end_chunk;562562- }559559+ start_chunk = PFN_DOWN(memory_chunk[i].addr);560560+ end_chunk = start_chunk + PFN_DOWN(memory_chunk[i].size) - 1;561561+ end_chunk = min(end_chunk, end_pfn);562562+ if (start_chunk >= end_chunk)563563+ continue;564564+ add_active_range(0, start_chunk, end_chunk);565565+ pfn = max(start_chunk, start_pfn);566566+ for (; pfn <= end_chunk; pfn++)567567+ page_set_storage_key(PFN_PHYS(pfn), PAGE_DEFAULT_KEY);563568 }564569565570 psw_set_key(PAGE_DEFAULT_KEY);566571567567- if (last_rw_end < end_pfn - 1)568568- add_memory_hole(last_rw_end, end_pfn - 1);572572+ free_bootmem_with_active_regions(0, max_pfn);573573+ reserve_bootmem(0, PFN_PHYS(start_pfn));569574570575 /*571576 * Reserve the bootmem bitmap itself as well. We do this in two