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

Re: [PATCH] xen/arm: Print memory size in decimal in construct_domU


  • To: Julien Grall <julien@xxxxxxx>, Ayan Kumar Halder <ayankuma@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Tue, 3 Jan 2023 11:08:39 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xen.org 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=IFbfQOi4RZr5UwQVShC5LQVMlBWdSbMPdaMTF/RdxIM=; b=aON696qhTVIuXYB3sZEhlUyLh5i+sltmNKN0TpC1P2HnZ7MlNVC1XZL5BlTZJTLcHV+gp7mlrIj31POmuV+EVPHRmQOopbk2UL3mw/7RG/gVGnN5ysffsAupo0nCfSJ7xQLq4DXwyHhtwDCbDJmxLVTcKOE45cFnxCAbOASiNYSMpn+huXQEorJj6hseOZNogcM/J92WG+FC1d7RiPjTZPPtsvrTBIKu60uDM+UVW5lccz6V7U404/oiIVXGMtpIJ2Zd7zrXrzkYo0rP41jVDmPNRuy2UM5s2pi8z6GudV0kPPWMtg7/1N/euUsaHIeq01+YyCf6rjvhmx95MqW+Tw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KQlAG2TdtiaLrntgRqveCMe6JhTH4SsrbrdG2OFGTR0PnkcFEhX4hioMc5kqQd/MjniP5T5wjSNGL5gasNyfSulBdRzv9YTCgQAB0PeG2b/rNDxt6RvOuqg+oT622TFlKUFw+Mvf1QJq5ISZpFy3XJZ/Jqd9lMyOhdU6We4isuxdCUTho563wBqtFYYw/HN9o2/QPljt4J7yjdR/HLXcg8hC21EfmH6hS81/qvsubUOwfgh6bVMseYY12MaF5TQRDiP0JMSLpMmcTmRGbNO7MiNHfLM8JH5kwOTjBnVYBpK8z2tWH6Pe+DtyL2R6pHOU10BhpPn0vdj74OFEtJ+d/Q==
  • Delivery-date: Tue, 03 Jan 2023 10:08:53 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Julien,

On 03/01/2023 10:56, Julien Grall wrote:
> 
> 
> Hi Michal,
> 
> On 03/01/2023 09:39, Michal Orzel wrote:
>> On 03/01/2023 10:21, Ayan Kumar Halder wrote:
>>>
>>>
>>> Hi Michal,
>>>
>>> On 02/01/2023 14:49, Michal Orzel wrote:
>>>> Printing domain's memory size in hex without even prepending it
>>>> with 0x is not very useful and can be misleading. Switch to decimal
>>>> notation.
>>>>
>>>> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
>>>> ---
>>>>    xen/arch/arm/domain_build.c | 2 +-
>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>>>> index 829cea8de84f..7e204372368c 100644
>>>> --- a/xen/arch/arm/domain_build.c
>>>> +++ b/xen/arch/arm/domain_build.c
>>>> @@ -3774,7 +3774,7 @@ static int __init construct_domU(struct domain *d,
>>>>        if ( rc != 0 )
>>>>            return rc;
>>>>
>>>> -    printk("*** LOADING DOMU cpus=%u memory=%"PRIx64"KB ***\n", 
>>>> d->max_vcpus, mem);
>>>> +    printk("*** LOADING DOMU cpus=%u memory=%"PRIu64"KB ***\n", 
>>>> d->max_vcpus, mem);
>>>
>>> I will prefer it to be printed in hex format with 0x prefixed. The
>>> reason being the mem is obtained from device-tree domU's 'memory' prop
>>> where the values are in hex.
>> No, I cannot agree. Refer to booting.txt documentation:
>> "A 64-bit integer specifying the amount of kilobytes of RAM to allocate to 
>> the guest."
>> Also note that in the provided examples, we are using the decimal values.
>> All in all it does not matter the notation, you can provide e.g. "memory = 
>> 131072;" or "memory = 0x20000".
>> I find it a bit odd to print e.g. 0x20000KB and decimal is easier to read.
> By easier, do you mean you can easily figure out how much memory in
> GB/MB/KB you gave to the guest? If so, then I have to disagree. Without
> a calculator, I will find quicker the split.
I guess it depends on the size but you have a valid point.

> 
> If you want to print in decimal, then I think we should split the amount
> in GB/MB/KB. Otherwise, we should stick in hexadecimal (so add 0x).
Ok, I will then just add a prefix.

> 
> Cheers,
> 
> --
> Julien Grall

~Michal



 


Rackspace

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