From: Wei Yang Date: Tue, 30 Jul 2019 00:37:40 +0000 (+0800) Subject: memory-device: break the loop if tmp exceed the hinted range X-Git-Tag: v4.2.0-rc0~52^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=64afc7c32bf1634df9d9ff77efbc39225400744a;p=thirdparty%2Fqemu.git memory-device: break the loop if tmp exceed the hinted range The memory-device list built by memory_device_build_list is ordered by its address, this means if the tmp range exceed the hinted range, all the following range will not overlap with it. And this won't change default pc-dimm mapping and address assignment stay the same as before this change. Signed-off-by: Wei Yang Message-Id: <20190730003740.20694-3-richardw.yang@linux.intel.com> Reviewed-by: David Hildenbrand Reviewed-by: Igor Mammedov Signed-off-by: Eduardo Habkost --- diff --git a/hw/mem/memory-device.c b/hw/mem/memory-device.c index 5029890e06b..aef148c1d7d 100644 --- a/hw/mem/memory-device.c +++ b/hw/mem/memory-device.c @@ -179,6 +179,8 @@ static uint64_t memory_device_get_free_addr(MachineState *ms, range_make_empty(&new); break; } + } else if (range_lob(&tmp) > range_upb(&new)) { + break; } }