Skip to content

Commit

Permalink
memory-device: break the loop if tmp exceed the hinted range
Browse files Browse the repository at this point in the history
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 <richardw.yang@linux.intel.com>
Message-Id: <20190730003740.20694-3-richardw.yang@linux.intel.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
  • Loading branch information
Wei Yang authored and ehabkost committed Oct 15, 2019
1 parent fc2db85 commit 64afc7c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hw/mem/memory-device.c
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 64afc7c

Please sign in to comment.