From: Simon Glass <simon.glass@canonical.com>
The bootz_setup() function maps the kernel image address to get a host
pointer, but then incorrectly passes the original physical address to
unmap_sysmem() instead of the mapped pointer. This causes a warning on
sandbox:
unmap_physmem() Address not mapped: 0000000002000000
Fix this by passing the mapped pointer (zimage) to unmap_sysmem()
instead of the raw physical address cast to a pointer.
Update the PXE tests to remove expectations for this warning message.
Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---
arch/sandbox/lib/bootm.c | 2 +-
test/boot/pxe.c | 4 ----
2 files changed, 1 insertion(+), 5 deletions(-)
@@ -45,7 +45,7 @@ int bootz_setup(ulong image, ulong *start, ulong *end)
ret = 1;
}
- unmap_sysmem((void *)image);
+ unmap_sysmem(zimage);
return ret;
}
@@ -299,7 +299,6 @@ static int pxe_test_sysboot_norun(struct unit_test_state *uts)
/* Boot fails on sandbox */
ut_assert_nextline("Unrecognized zImage");
- ut_assert_nextlinen(" unmap_physmem");
/* Verify files were loaded at the correct addresses */
kernel = map_sysmem(PXE_KERNEL_ADDR, 0);
@@ -376,7 +375,6 @@ static int pxe_test_fdtdir_norun(struct unit_test_state *uts)
/* Boot fails but we verified the path construction */
ut_assert_nextline("Unrecognized zImage");
- ut_assert_nextlinen(" unmap_physmem");
/* Verify FDT was loaded correctly */
fdt = map_sysmem(PXE_FDT_ADDR, 0);
@@ -405,7 +403,6 @@ static int pxe_test_fdtdir_norun(struct unit_test_state *uts)
/* Boot fails but we verified the path construction */
ut_assert_nextline("Unrecognized zImage");
- ut_assert_nextlinen(" unmap_physmem");
/* Verify FDT was loaded */
fdt = map_sysmem(PXE_FDT_ADDR, 0);
@@ -483,7 +480,6 @@ static int pxe_test_errors_norun(struct unit_test_state *uts)
* that label loading continued despite missing fdtdir FDT
*/
ut_assert_nextline("Unrecognized zImage");
- ut_assert_nextlinen(" unmap_physmem");
/* Clean up env vars */
env_set("fdtfile", NULL);