|
@@ -190,8 +190,12 @@ void __init arm64_memblock_init(void)
|
|
*/
|
|
*/
|
|
memblock_remove(max_t(u64, memstart_addr + linear_region_size, __pa(_end)),
|
|
memblock_remove(max_t(u64, memstart_addr + linear_region_size, __pa(_end)),
|
|
ULLONG_MAX);
|
|
ULLONG_MAX);
|
|
- if (memblock_end_of_DRAM() > linear_region_size)
|
|
|
|
- memblock_remove(0, memblock_end_of_DRAM() - linear_region_size);
|
|
|
|
|
|
+ if (memstart_addr + linear_region_size < memblock_end_of_DRAM()) {
|
|
|
|
+ /* ensure that memstart_addr remains sufficiently aligned */
|
|
|
|
+ memstart_addr = round_up(memblock_end_of_DRAM() - linear_region_size,
|
|
|
|
+ ARM64_MEMSTART_ALIGN);
|
|
|
|
+ memblock_remove(0, memstart_addr);
|
|
|
|
+ }
|
|
|
|
|
|
/*
|
|
/*
|
|
* Apply the memory limit if it was set. Since the kernel may be loaded
|
|
* Apply the memory limit if it was set. Since the kernel may be loaded
|