Skip to content

Commit bb95f1c

Browse files
stevecapperarmgregkh
authored andcommitted
arm64: Initialise high_memory global variable earlier
commit f24e583 upstream. The high_memory global variable is used by cma_declare_contiguous(.) before it is defined. We don't notice this as we compute __pa(high_memory - 1), and it looks like we're processing a VA from the direct linear map. This problem becomes apparent when we flip the kernel virtual address space and the linear map is moved to the bottom of the kernel VA space. This patch moves the initialisation of high_memory before it used. Fixes: f7426b9 ("mm: cma: adjust address limit to avoid hitting low/high memory boundary") Signed-off-by: Steve Capper <steve.capper@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 76fcdc8 commit bb95f1c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/arm64/mm/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ void __init arm64_memblock_init(void)
296296
arm64_dma_phys_limit = max_zone_dma_phys();
297297
else
298298
arm64_dma_phys_limit = PHYS_MASK + 1;
299+
high_memory = __va(memblock_end_of_DRAM() - 1) + 1;
299300
dma_contiguous_reserve(arm64_dma_phys_limit);
300301

301302
memblock_allow_resize();
@@ -322,7 +323,6 @@ void __init bootmem_init(void)
322323
sparse_init();
323324
zone_sizes_init(min, max);
324325

325-
high_memory = __va((max << PAGE_SHIFT) - 1) + 1;
326326
memblock_dump_all();
327327
}
328328

0 commit comments

Comments
 (0)