u-boot/test
Sughosh Ganu 56f186a68b lmb: check if a region can be reserved by lmb_reserve()
The logic used in lmb_alloc() takes into consideration the existing
reserved regions, and ensures that the allocated region does not
overlap with any existing allocated regions. The lmb_reserve()
function is not doing any such checks -- the requested region might
overlap with an existing region. This also shows up with
lmb_alloc_addr() as this function ends up calling lmb_reserve().

Add a function which checks if the region requested is overlapping
with an existing reserved region, and allow for the reservation to
happen only if both the regions have LMB_NONE flag, which allows
re-requesting of the region. In any other scenario of an overlap, have
lmb_reserve() return -EEXIST, implying that the requested region is
already reserved.

Add corresponding test cases which check for overlapping reservation
requests made through lmb_reserve() and lmb_alloc_addr(). And while
here, fix some of the comments in the test function being touched.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-03-17 19:39:27 -06:00
..
boot test: Drop suites.h 2025-02-11 20:12:36 -06:00
cmd test: Drop suites.h 2025-02-11 20:12:36 -06:00
common test: Drop suites.h 2025-02-11 20:12:36 -06:00
dm test: Make all tests depend on UNIT_TEST 2025-02-11 20:10:59 -06:00
env test: Drop suites.h 2025-02-11 20:12:36 -06:00
fdt_overlay test: Drop suites.h 2025-02-11 20:12:36 -06:00
fs test: fs: fs-test: Move the tests to use sha256sum 2024-01-11 21:19:25 -05:00
fuzz global: Rename SPL_ to XPL_ 2024-10-11 11:44:48 -06:00
hush test: Drop the function for running hush tests 2025-01-24 14:34:40 -06:00
image spl: Create a function to init spl_load_info 2024-08-23 15:58:42 -06:00
lib lmb: check if a region can be reserved by lmb_reserve() 2025-03-17 19:39:27 -06:00
log test: Drop suites.h 2025-02-11 20:12:36 -06:00
optee test: Drop suites.h 2025-02-11 20:12:36 -06:00
py Prepare v2025.04-rc3 2025-02-24 17:15:14 -06:00
stdint Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"" 2024-05-19 08:16:36 -06:00
cmd_ut.c test: Update documentation 2025-02-11 20:12:36 -06:00
Kconfig test: Make all tests depend on UNIT_TEST 2025-02-11 20:10:59 -06:00
Makefile test: Move fdt-overlay-test rule into test/ 2025-02-11 20:10:59 -06:00
run test: Run the VPL tests with 'make check' 2023-04-03 06:53:53 +12:00
test-main.c test: Allow running a selection of suites 2025-02-11 20:12:36 -06:00
ut.c test: Move stats into a struct 2025-01-24 14:34:41 -06:00