--- zzzz-none-000/linux-3.10.107/mm/memblock.c 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/mm/memblock.c 2021-11-10 11:53:56.000000000 +0000 @@ -102,6 +102,8 @@ phys_addr_t this_start, this_end, cand; u64 i; + memblock_dbg("[%s] start=%#x, end=%#x, size=%#x, align=%#x\n", __func__,start, end, size, align); + /* pump up @end */ if (end == MEMBLOCK_ALLOC_ACCESSIBLE) end = memblock.current_limit; @@ -368,6 +370,13 @@ phys_addr_t obase = base; phys_addr_t end = base + memblock_cap_size(base, &size); int i, nr_new; + + memblock_dbg(" memblock_add_region: @ %p [%#016llx-%#016llx] %pF\n", + type, + (unsigned long long)base, + (unsigned long long)base + size, + (void *)_RET_IP_); + if (!size) return 0; @@ -936,6 +945,12 @@ memblock.memory.regions[idx].size) >= end; } +int __init_memblock memblock_overlaps_memory(phys_addr_t base, phys_addr_t size) +{ + memblock_cap_size(base, &size); + return memblock_overlaps_region(&memblock.memory, base, size) >= 0; +} + /** * memblock_is_region_reserved - check if a region intersects reserved memory * @base: base of region to check