s390/setup: re-arrange memblock setup

- Avoid using ULONG_MAX in memblock_remove, it has no functional change
  but makes memblock_dbg output a range which makes sense.

- Actually finish memblock memory setup before doing amode31/cr/uv
  setup.

- Move memblock_dump_all() debug output after memblock memory setup is
  complete. This gives us final "memory" regions if they were trimmed
  due to addressing limits and still "physmem" regions as original info
  which came from mem_detect.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
Vasily Gorbik 2021-10-14 13:45:35 +02:00 committed by Heiko Carstens
parent 5dbc4cb466
commit 6ad5f024d1
1 changed files with 4 additions and 5 deletions

View File

@ -606,7 +606,7 @@ static void __init setup_resources(void)
static void __init setup_memory_end(void)
{
memblock_remove(ident_map_size, ULONG_MAX);
memblock_remove(ident_map_size, PHYS_ADDR_MAX - ident_map_size);
max_pfn = max_low_pfn = PFN_DOWN(ident_map_size);
pr_notice("The maximum memory size is %luMB\n", ident_map_size >> 20);
}
@ -777,7 +777,6 @@ static void __init memblock_add_mem_detect_info(void)
}
memblock_set_bottom_up(false);
memblock_set_node(0, ULONG_MAX, &memblock.memory, 0);
memblock_dump_all();
}
/*
@ -999,13 +998,13 @@ void __init setup_arch(char **cmdline_p)
memblock_add_mem_detect_info();
free_mem_detect_info();
setup_memory_end();
memblock_dump_all();
setup_memory();
relocate_amode31_section();
setup_cr();
setup_uv();
setup_memory_end();
setup_memory();
dma_contiguous_reserve(ident_map_size);
vmcp_cma_reserve();
if (MACHINE_HAS_EDAT2)