From patchwork Fri Jan 9 23:11:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1398 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768000345; bh=t1yTrl8lKiOEMKTPBdTiw91e3WBhQeTwWWbq5+h+SUE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=CiSbJlhTLA3bqhahzeOpDG4thQ4ycQ69CkaEDDACRsQILGDblnS05Li0KckrPZLgp Sv+div0PBSOoG4LPFg7u+7K1kAWhz5b4bz2QP1hS9boB1Z/n3H+bw0srQsozhVsoOX li8nv+jYj73qX7bmAJzHMlTDAQVkoF5n3MFDyaE0S3dsEsCG9nNFizy0hC6iBibhUf HqPAydrxj5d5ggIh8m9vvL4vtQmVlPfFkBu3JENYt9yaD4TVk06pk2YC7foYbZKbcN 5fey/AUeH2saThu5sswOtRae8JimWPYx49gpTmTjq1GZxty3lQ1QrCtFvgEqrLvVhK DZYVT3ecxN7Ug== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 839436923A for ; Fri, 9 Jan 2026 16:12:25 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id k784p2kptuhS for ; Fri, 9 Jan 2026 16:12:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768000345; bh=t1yTrl8lKiOEMKTPBdTiw91e3WBhQeTwWWbq5+h+SUE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=CiSbJlhTLA3bqhahzeOpDG4thQ4ycQ69CkaEDDACRsQILGDblnS05Li0KckrPZLgp Sv+div0PBSOoG4LPFg7u+7K1kAWhz5b4bz2QP1hS9boB1Z/n3H+bw0srQsozhVsoOX li8nv+jYj73qX7bmAJzHMlTDAQVkoF5n3MFDyaE0S3dsEsCG9nNFizy0hC6iBibhUf HqPAydrxj5d5ggIh8m9vvL4vtQmVlPfFkBu3JENYt9yaD4TVk06pk2YC7foYbZKbcN 5fey/AUeH2saThu5sswOtRae8JimWPYx49gpTmTjq1GZxty3lQ1QrCtFvgEqrLvVhK DZYVT3ecxN7Ug== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7247669238 for ; Fri, 9 Jan 2026 16:12:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768000344; bh=RU6j31AyQ8uf4JTCrq672sDVx49OA9D+rhgclHviZqc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MnHPgmSO+7429d4/CEaFOv8PimMcj3LQCEGGZNm5UTBK3q7XJ9wp8NiH84cqS4g9k J1Fz4+HnfacfqFLj098f2k4eeXlnmuIwASkKi7cMOwzIOtSg4qQzFd9WfERcVyggpZ 1yJPonPYmyl6a3iqdN2pJ2tHOhneZEU5MCpAiuUUnlxpQM2N0iPRnrQ6ju/WHEryBO CLL7GyygVvn/37oNWJCSOIu05CDHHRDyBb5dMuVAzjiBC8iUgscClV1LvVLwzq5qmd GpO/GV9Ighpqiv2yz7248dk3aE4yCp/IzAug+h0JTp+kje+w5MO5zbD/JtFVXox+Au JVCnsaGtbN94g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1D36069218; Fri, 9 Jan 2026 16:12:24 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id eEgwJysmv7qp; Fri, 9 Jan 2026 16:12:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768000340; bh=wC8RGu1n21cTniyJhzI4c3CCtgCQ1R9FrRrA9IitkXY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E80r2QWRCwEQ80r10orn9rRUD3H6OewUwRsZdp5+FzIxVbx3yfCM66O7JeSoNLjkT etYR69Q6iw2QayCXVGgbeBM3lgQ7y9yKNYkZ9Cs5XlacAGAjlYLSyA5Mm45yDBW/DA /fXHZSs5J/SvHxR1NIGk9ntMaEO0unkSksPT5Rhday3A6Oau2YyqxfjiNL9SLzrZFr +KbQM8qVm6muOrT9pr8hfoA0ZD0hEJdEoecZ3sW469eqt1IToOdkWGEHJYTZr5d7vP e0ZtHjrEng3Pbwl4/Xz5YiGrcx1o34DP/YzhEjHCugYOQP81TiByEIWkmWLyy+CiHw hnHcoZ+xzpB2g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B667369206; Fri, 9 Jan 2026 16:12:19 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Fri, 9 Jan 2026 16:11:11 -0700 Message-ID: <20260109231151.4056804-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260109231151.4056804-1-sjg@u-boot.org> References: <20260109231151.4056804-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: THNLUST4CQDHBFUMKSUBXD55VPL5F7HD X-Message-ID-Hash: THNLUST4CQDHBFUMKSUBXD55VPL5F7HD X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 02/32] sandbox: bootz: Fix incorrect pointer passed to unmap_sysmem() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass 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 Signed-off-by: Simon Glass --- arch/sandbox/lib/bootm.c | 2 +- test/boot/pxe.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/sandbox/lib/bootm.c b/arch/sandbox/lib/bootm.c index 8ed923750f4..c1d970d021d 100644 --- a/arch/sandbox/lib/bootm.c +++ b/arch/sandbox/lib/bootm.c @@ -45,7 +45,7 @@ int bootz_setup(ulong image, ulong *start, ulong *end) ret = 1; } - unmap_sysmem((void *)image); + unmap_sysmem(zimage); return ret; } diff --git a/test/boot/pxe.c b/test/boot/pxe.c index 9398cf5757f..0da28be8576 100644 --- a/test/boot/pxe.c +++ b/test/boot/pxe.c @@ -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);