]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
s390/setup: re-arrange memblock setup
authorVasily Gorbik <gor@linux.ibm.com>
Thu, 14 Oct 2021 11:45:35 +0000 (13:45 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 16 Nov 2021 11:29:19 +0000 (12:29 +0100)
- 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>
arch/s390/kernel/setup.c

index 349d24df37b864abe80cfcdfaffb51ec577632b9..225ab2d0a4c60baab67bc7c8f834f157954eed1a 100644 (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)