mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-28 00:25:18 +00:00
0ff074d2b8
There is one corner case which was not properly handled by the current code from our AddressAllocator. If both the address start (from the next range) and the requested region size are already aligned on the same value as "alignment", when doing the substract of the requested size + alignment, the returned address is already aligned. The problem is that we might end up overlapping with an existing range since the check between the available delta and the requested size does not take into account a full extra alignment. By substracting the requested size + alignment - 1 from the address start of the next range, we ensure this kind of corner case would not happen since the address won't be naturally aligned and after some adjustment from the function align_address(), the correct start address will be returned. Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com> |
||
---|---|---|
.. | ||
address.rs | ||
gsi.rs | ||
lib.rs | ||
system.rs |