cloud-hypervisor/vm-allocator/src
Sebastien Boeuf 0ff074d2b8 vm-allocator: Fix potential allocation errors
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>
2019-07-25 11:45:38 +01:00
..
address.rs vm-allocator: Fix potential allocation errors 2019-07-25 11:45:38 +01:00
gsi.rs vm-allocator: Expand the IRQ allocation API to support GSI 2019-07-22 09:51:16 -07:00
lib.rs vm-allocator: Expand the IRQ allocation API to support GSI 2019-07-22 09:51:16 -07:00
system.rs vm-allocator: Fix potential allocation errors 2019-07-25 11:45:38 +01:00