u-boot/test/lib
Ilias Apalodimas 1d9aa4a283 lmb: Fix the allocation of overlapping memory areas with !LMB_NONE
At the moment the LMB allocator will return 'success' immediately on two
consecutive allocations if the second one is smaller and the flags match
without resizing the reserved area.

This is problematic for two reasons, first of all the new updated
allocation won't update the size and we end up holding more memory than
needed, but most importantly it breaks the EFI SCT tests since EFI
now allocates via LMB.

More specifically when EFI requests a specific address twice with the
EFI_ALLOCATE_ADDRESS flag set, the first allocation will succeed and
update the EFI memory map. Due to the LMB behavior the second allocation
will also succeed but the address ranges are already in the EFI memory
map due the first allocation. EFI will then fail to update the memory map,
returning EFI_OUT_OF_RESOURCES instead of EFI_NOT_FOUND which break EFI
conformance.

So let's remove the fast check with is problematic anyway and leave LMB
resize and calculate address properly. LMB will now
- try to resize the reservations for LMB_NONE
- return -1 if the memory is not LMB_NONE and already reserved

The LMB code needs some cleanup in that part, but since we are close to
2025.01 do the easy fix and plan to refactor it later.
Also update the dm tests with the new behavior.

Fixes: commit 22f2c9ed9f ("efi: memory: use the lmb API's for allocating and freeing memory")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-12-05 09:01:44 +02:00
..
abuf.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
alist.c alist: Add a way to efficiently filter an alist 2024-11-03 21:27:12 -06:00
asn1.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
cmd_ut_lib.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
compression.c compression: test: Move into the lib suite 2024-11-13 11:56:01 -06:00
efi_device_path.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
efi_image_region.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
getopt.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
hexdump.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
Kconfig test: improve configuration for Kconfig test options 2023-04-25 15:31:27 -04:00
kconfig.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
kconfig_spl.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
lmb.c lmb: Fix the allocation of overlapping memory areas with !LMB_NONE 2024-12-05 09:01:44 +02:00
longjmp.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
Makefile Merge patch series "test: Tidy up the test/ directory" 2024-11-13 16:02:58 -06:00
rsa.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
sscanf.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
str.c test: unit test for hextoull() 2024-11-22 15:04:54 -06:00
string.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
strlcat.c Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet" 2024-05-20 13:35:03 -06:00
test_aes.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
test_crc8.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
test_crypt.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
test_errno_str.c test: Drop the blank line before test macros 2024-08-26 18:51:49 -06:00
test_print.c test: Tidy up checking for console end 2024-08-26 18:51:49 -06:00
time.c Revert "test: Update time tests to use unit-test asserts" 2024-11-22 14:37:21 -06:00
unicode.c test: Move unicode tests into the lib suite 2024-11-13 11:56:02 -06:00
uuid.c test: lib/uuid: add tests for UUID version/variant bits 2024-09-12 17:35:38 +02:00