0ff074d2 | 24-Jul-2019 |
Sebastien Boeuf <sebastien.boeuf@intel.com> |
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) a
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>
show more ...
|
f98a69f4 | 17-Jul-2019 |
Sebastien Boeuf <sebastien.boeuf@intel.com> |
vm-allocator: Introduce an MMIO hole address allocator
With this new AddressAllocator as part of the SystemAllocator, the VMM can now decide with finer granularity where to place memory.
By allocat
vm-allocator: Introduce an MMIO hole address allocator
With this new AddressAllocator as part of the SystemAllocator, the VMM can now decide with finer granularity where to place memory.
By allocating the RAM and the hole into the MMIO address space, we ensure that no memory will be allocated by accident where the RAM or where the hole is. And by creating the new MMIO hole address space, we create a subset of the entire MMIO address space where we can place 32 bits BARs for example.
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
show more ...
|