[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v8] uboot-script-gen: Dynamically compute addr and size when loading binaries


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrei Cherechesu <andrei.cherechesu@xxxxxxxxxxx>
  • Date: Tue, 29 Apr 2025 00:10:09 +0300
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FGWSsNNXV7CjdiC8jqKdZ7OZwAbLCfgHq6W3XM6odE4=; b=q/qwRjLcPlkl/MlK3Mg2O17rTV+ufSUUj11uX+4twyJmpfBpmpd4gnuhsIbQFEtSeTpAtRbHVg3/svVuMd7GcGqrDM8gsLBtWnT8M8vwRVuHiqBDSZzQPrPZM0XFymZ23d13dvz7yp/hx15TDRhD6q46RqAQ0gXhdPnYmiCGUlgHkwtYhxulMZ9hdGvOYHJ415ZV4NrXDLwAdWnooBQWjKna+B21xx0LO+e0lgnazNHdNM87Ze194sRP67uQaW211hWkxHiCvE09WPvtYOrxcBNVPGeWfPWvUEQ4lNzm3Oo5faipjJOS14zZ640FjZz8stYm18/01cBnHZHkaVHFbg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wvtIAoCFgK4Ew3QK++2gKa5bxqrtbKSszpkGY+sLePCVKb2qwLxpbx/09Qs5n4dQrUncepZ67QsdKzMdfG2cq0ePAXREYN4QTy+0KdhxULXTuHynmhNTiRTzdwmrdfkhaalr0V78VfYh6rq/ewxgQMZlbuHsk2rwx9Ugavl89EL9/wzqKFa7RgW/hqzB4xCqB6DmN03G5VhbFUFp8t4kq0Q+E3HAg4Pr2kmluK8wkUCznFzZVagToljDcEhKPuv6DW+DBRsNXAi3y7tCbVFxNPzjN0d1RcxGQIUynIhP+rbo5WSz6aPe09ktbRc6wSH3dUEEWDKkJk9vyy5it8KTpw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com;
  • Cc: Andrei Cherechesu <andrei.cherechesu@xxxxxxx>, dmukhin@xxxxxxxx, Michal Orzel <michal.orzel@xxxxxxx>, jason.andryuk@xxxxxxx, "S32@xxxxxxx" <S32@xxxxxxx>
  • Delivery-date: Mon, 28 Apr 2025 21:10:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Stefano,

On 28/04/2025 23:55, Andrei Cherechesu wrote:
> From: Andrei Cherechesu <andrei.cherechesu@xxxxxxxxxxx>
>
> Normally, the Imagebuilder would precompute the sizes of the loaded
> binaries and addresses where they are loaded before generating the
> script, and the sizes and addresses that needed to be provided to
> Xen via /chosen would be hardcoded in the boot script.
>
> Added an option via "-s" parameter to avoid hardcoding any
> address in the boot script, and dynamically compute the
> loading addresses for binaries. The first loading address is based
> on the MEMORY_START parameter and after loading each binary,
> the loading address and the size of the binary are stored in
> variables with corresponding names. Then, the loading address
> for the next binary is computed and aligned to 0x200000.
>
> If the "-s" parameter is not used, the normal flow is executed,
> where the loading addresses and sizes for each binaries are
> precomputed and hardcoded inside the script, but the loading
> addresses and sizes for each binary are now also stored for eventual
> later use.
>
> Reserved memory regions are left TBD in the -s case.
>
> Link: 
> https://lists.xenproject.org/archives/html/xen-devel/2022-09/msg01862.html
> Signed-off-by: Andrei Cherechesu <andrei.cherechesu@xxxxxxx>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
> Reviewed-by: Andrei Cherechesu <andrei.cherechesu@xxxxxxx>
> Reviewed-by: Denis Mukhin <dmukhin@xxxxxxxx>
> ---
> Changes in v8:
> - remove quotes in heredoc
> - change memaddr to hex for readability
>
> Changes in v7:
> - use $()
> - better description and alphabetical order
> - use heredoc
>
> Changes in v6:
> - make initial ${memaddr} setting depending on CALC
>
> This patch adds quite a bit of complexity which is the reason why I
> didn't originally commit it. Now that we are enabling ImageBuilder in
> Yocto, it turns out this patch is required because Yocto invokes
> ImageBuilder before all the binaries are ready and available.
>
> Andrei, sorry for taking so long to realize why it is essential, but we
> are getting there now.
>
> The changes I made to the original patch are purely to make it simpler
> to maintain.
> ---
>  README.md                |   2 +
>  scripts/uboot-script-gen | 181 ++++++++++++++++++++++++++++++++-------
>  2 files changed, 152 insertions(+), 31 deletions(-)

Everything looks good to me, briefly tested it locally as well.

Regards,
Andrei Cherechesu





 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.