···236236 This allows you to specify the maximum frame size a function may237237 have without the compiler complaining about it.238238239239-config ARCH_POPULATES_NODE_MAP240240- def_bool y241241-242239source "mm/Kconfig"243240244241comment "I/O subsystem configuration"
-1
arch/s390/defconfig
···119119CONFIG_CHECK_STACK=y120120CONFIG_STACK_GUARD=256121121# CONFIG_WARN_STACK is not set122122-CONFIG_ARCH_POPULATES_NODE_MAP=y123122CONFIG_SELECT_MEMORY_MODEL=y124123CONFIG_FLATMEM_MANUAL=y125124# CONFIG_DISCONTIGMEM_MANUAL is not set
+42-13
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];7374static unsigned long __initdata memory_end;74757576/*···358357 */359358void (*pm_power_off)(void) = machine_power_off;360359360360+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+361375static int __init early_parse_mem(char *p)362376{363377 memory_end = memparse(p, &p);···450434 lc->extended_save_area_addr = (__u32)451435 __alloc_bootmem(PAGE_SIZE, PAGE_SIZE, 0);452436 /* enable extended save area */453453- ctl_set_bit(14, 29);437437+ __ctl_set_bit(14, 29);454438 }455439#endif456440 set_prefix((u32)(unsigned long) lc);···494478{495479 unsigned long bootmap_size;496480 unsigned long start_pfn, end_pfn, init_pfn;481481+ unsigned long last_rw_end;497482 int i;498483499484 /*···550533 /*551534 * Register RAM areas with the bootmem allocator.552535 */536536+ last_rw_end = start_pfn;553537554538 for (i = 0; i < MEMORY_CHUNKS && memory_chunk[i].size > 0; i++) {555555- unsigned long start_chunk, end_chunk, pfn;539539+ unsigned long start_chunk, end_chunk;556540557541 if (memory_chunk[i].type != CHUNK_READ_WRITE)558542 continue;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);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+ }568563 }569564570565 psw_set_key(PAGE_DEFAULT_KEY);571566572572- free_bootmem_with_active_regions(0, max_pfn);573573- reserve_bootmem(0, PFN_PHYS(start_pfn));567567+ if (last_rw_end < end_pfn - 1)568568+ add_memory_hole(last_rw_end, end_pfn - 1);574569575570 /*576571 * Reserve the bootmem bitmap itself as well. We do this in two