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

Re: [ImageBuilder v2] Add support for 64-bit addresses/sizes


  • To: Xenia Ragiadakou <burzalodowa@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Mon, 10 Oct 2022 13:17:08 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.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=k6OCjTyvdzPX0EU3EY/BixjntWzEslkxV2JB4JQdw6o=; b=HhnNHfOuaCfvMtou4VrS8XOMNv2GWLjlwSJ/byr0L+Oejo7RzhyiRrd5oxM/YAr1aE2cfrecKEkgNXvmmBDyO7vH9zSFVaTS0Xo3N0zsh9+Zj7skxiY8Cvx+0Rk8uDF2BP0GH6v06AUrpvXiVPy3R7oQ/8byB+8uW+rJHPXq8EIuPwOW4ZLUHtinU+LZ2+UTUAenaLqy+lMGpxHXT51z2T6pbECeYcGm6RsU4wjFRcBcXKzT5i+2V2TE2AuqS9dZ7BCbHju9lxvI5f17Qp863wt5T2yOZQc2aUvts18C7P/3M+Wg4PZDyO2svoJJLhy3+WCvP2SS/xzdN952Kzsk1Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KBY6RjRxWRivXIiK04D50FeHD4/ShUxrZm4oxgHkDP3yzvszwtVqUtY+bNuOnBLzSC31SL57o4K2TCQpe+lwxvmgdeMpyRiqQKTWTBH7SPNZgvZblht4eSn8wIGAE/maHViKsNB7YkPFiiyhGcbagud1a4uaDY7gJXDBTozL/w9xo8hrhNbjmh4EMoTHC23WbOxDulZnit0FzLEclYJI/wzM6oYRfIO9I9l1luvtEmw6x+tyuVWnvaH++5HEGa5rOvs6JvQZAEgRjXFwTj6uxk4T2km5RK/bXXpo2TpkUaFXI2z0KNN+AG5cGvBwhXtVQffiEQNv24tRhvoK34TWrA==
  • Cc: <sstabellini@xxxxxxxxxx>
  • Delivery-date: Mon, 10 Oct 2022 11:17:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 10/10/2022 12:48, Xenia Ragiadakou wrote:
> 
> 
> On 10/10/22 12:48, Michal Orzel wrote:
>> Hi Xenia,
>>
>> On 10/10/2022 10:52, Xenia Ragiadakou wrote:
>>>
>>>
>>> On 10/10/22 10:29, Michal Orzel wrote:
>>>
>>> Hi Michal
>>>
>>>> At the moment, ImageBuilder assumes that all addresses/sizes are
>>>> 32-bit max. It sets #{address,size}-cells to 0x2 and puts 0x0 as the
>>>> value for the first cell. Because of that, we cannot specify
>>>> MEMORY_START and MEMORY_END to be above 32-bits (e.g. to place the images
>>>> in the upper memory bank).
>>>>
>>>> Add support to properly handle 64-bit addresses/sizes:
>>>>    - add function split_into_halves to split the value passed as a first
>>>>      argument into upper and lower halves. These are then set as values for
>>>>      variables passed respetively as the second and third argument,
>>>
>>> s/respetively/respectively/
>> Ok.
>>
>>>
>>>>    - add function split_addr_size to split address and size and form a
>>>>      string to be passed to dt_set as data argument for reg property.
>>>>
>>>> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
>>>> ---
>>>> Changes in v2:
>>>> - redesign a patch based on master-next instead of NXP dynamic assignment 
>>>> patch
>>>> ---
>>>>    scripts/uboot-script-gen | 33 ++++++++++++++++++++++++++++-----
>>>>    1 file changed, 28 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/scripts/uboot-script-gen b/scripts/uboot-script-gen
>>>> index b24dca2b7f7e..09d237d192c1 100755
>>>> --- a/scripts/uboot-script-gen
>>>> +++ b/scripts/uboot-script-gen
>>>> @@ -22,6 +22,29 @@ function dt_mknode()
>>>>        fi
>>>>    }
>>>>
>>>> +# Usage:
>>>> +# split_into_halves <value> <variable_to_store_upper> 
>>>> <variable_to_store_lower>
>>>> +function split_into_halves()
>>>> +{
>>>> +    local value=$1
>>>> +    local upper=$2
>>>> +    local lower=$3
>>>> +
>>>> +    eval "$upper=$(printf "0x%X\n" $(($value >> 32)))"
>>>> +    eval "$lower=$(printf "0x%X\n" $(($value & 0xFFFFFFFF)))"
>>>> +}
>>>> +
>>>> +function split_addr_size()
>>>> +{
>>>> +    local addr=$1
>>>> +    local size=$2
>>>> +
>>>> +    split_into_halves $addr addr_upper addr_lower
>>>> +    split_into_halves $size size_upper size_lower
>>>> +
>>>
>>> Just a minor observation, the variables addr_upper, addr_lower,
>>> size_upper and size_lower can be declared local.
>>>
>> This function is to be called to perform substitution and as such
>> is always executed within a subshell so no need for local.
> 
> So split_addr_size() is supposed to be executed only in a subshell ...
> Ok I did not think of that. So neither addr or size need to be declared
> local.
Exactly, but in ImageBuilder we don't seem to use $1, $2, ... directly so
that is why I added local only for the arguments passed to this function.

> 
> --
> Xenia

~Michal



 


Rackspace

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