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

Re: [ImageBuilder][PATCH 1/2] uboot-script-gen: Add support for static heap


  • To: jiamei.xie <jiamei.xie@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Thu, 2 Mar 2023 13:17:23 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=arm.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=7R1xpcylum7C6uLtSxVOkGnQKc8q5CCpaCPLcgQuz+8=; b=X2mqqQtKmVRwpHywe/XcoIr5/cgEuQ4RSGR+los12r3oX6CF21378btuCgjrlKxFiM8j8YB4gfNfl0pMgzTQmGwN1XSOAo/IEi0URAeLgCoe6sprnzCYXRMyaM4OqDZPyNdquvqpUN52vXpXaQztdVA6eEa8jQk5hQb0g6Gj2eZJfjJRddyjlKEhRnFRLg2cWcHylO5ipIXdUW39dbRUNELP+3Jf727AxXZKPRec4LQXq7Kpb3nEwGxFCil/Z2Px5ZZkgKnmSWPrbMVFJ7iwMYdoYDQya6t3KvOFbe6lySg8Hr3XwxtOxTmkgApnPRuoZQl2JI5j0pZSL9RWrcP3SQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h0oZejs5tGnkSmXqtvSDoUg03FeXxZrApSwYnHk4BZd191g1cm1J/wld+VTD701iLuF9apBg9fQQyJsXneFlht5Os/qhzu6lVy2X5uv6PFAfBL8PsOD/bQiHET0mYo1ya2VGkTWiGgOoH6LX5UrU/Gs4KUkKHbLlO4CcDou3jWRWEF8TrBMhtAfq6rlYJ8ezMoXeDTotho5D4IFAFQDvza1RFiqfNKRIFgZk+DzL4JnVrXRPw0CCq5g4X+LVJOpQy4lUJOf7WQTGVVw1hh+c8LhHtGuYvkA+PgvDM5vNEFABVHEIE0xJzgUa0gp1dNio58NUloh1Bp/EEo/E8gneNw==
  • Cc: <wei.chen@xxxxxxx>, <sstabellini@xxxxxxxxxx>
  • Delivery-date: Thu, 02 Mar 2023 12:17:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Jiamei,

Patch looks good apart from minor comments down below.

On 02/03/2023 05:46, jiamei.xie wrote:
> 
> 
> From: jiamei Xie <jiamei.xie@xxxxxxx>
> 
> Add a new config parameter to configure static heap.
> STATIC_HEAP="baseaddr1 size1 ... baseaddrN sizeN"
> if specified, indicates the host physical address regions
> [baseaddr, baseaddr + size) to be reserved as static heap.
> 
> For instance, STATIC_HEAP="0x50000000 0x30000000", if specified,
> indicates the host memory region starting from paddr 0x50000000
> with a size of 0x30000000 to be reserved as static heap.
> 
> Signed-off-by: jiamei Xie <jiamei.xie@xxxxxxx>
> ---
>  README.md                |  4 ++++
>  scripts/uboot-script-gen | 20 ++++++++++++++++++++
>  2 files changed, 24 insertions(+)
> 
> diff --git a/README.md b/README.md
> index 814a004..787f413 100644
> --- a/README.md
> +++ b/README.md
> @@ -256,6 +256,10 @@ Where:
> 
>  - NUM_CPUPOOLS specifies the number of boot-time cpupools to create.
> 
> +- STATIC_HEAP="baseaddr1 size1 ... baseaddrN sizeN"
> +  if specified, indicates the host physical address regions
> +  [baseaddr, baseaddr + size) to be reserved as static heap.
As this option impacts Xen and not domUs, please call it XEN_STATIC_HEAP and 
move
it right after XEN_CMD documentation.

> +
>  Then you can invoke uboot-script-gen as follows:
> 
>  ```
> diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
> index f07e334..4775293 100755
> --- a/scripts/uboot-script-gen
> +++ b/scripts/uboot-script-gen
> @@ -189,6 +189,21 @@ function add_device_tree_static_mem()
>      dt_set "$path" "xen,static-mem" "hex" "${cells[*]}"
>  }
> 
> +function add_device_tree_static_heap()
> +{
> +    local path=$1
> +    local regions=$2
> +    local cells=()
> +    local val
> +
> +    for val in ${regions[@]}
> +    do
> +        cells+=("$(printf "0x%x 0x%x" $(($val >> 32)) $(($val & ((1 << 32) - 
> 1))))")
Please use split_value function instead of opencoding it.
It will then become:
cells+=("$(split_value $val)")

~Michal



 


Rackspace

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