[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: Ayan Kumar Halder <ayankuma@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Tue, 3 Jan 2023 10:39:35 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=c2ya0maJOkqbjYxQwcP9WS/1jwK67qwB1Qca1G3RDtk=; b=F6F11XGXRk69Tld0eJOrFiyWaWOEXOIK6UQnTP1QzEHJi7yQ4QNc/Zs489G1VNOEUN2pAKEzqGcHuMzGBmDKZTOTLbyXXvQ9q+52gwA5ex63hvERzB1PKLskX/HTgP9I8n4uKismrNQaJnhMAsX2KGcoWxsLTrPdH2BeJm6IGnGGz70Epn9a+0IDTlc0FzZM5VSgoutzvS1mvz0W0lGXHkm20x4FW0uYg5HSAn8PUPxgYZDSZyrznXEJnbfl/J2GTKmtLLUpxeqC0ufqQDXN1T82H3niroedVHXO8P8STpwWaW651FP/Jw0RvOMW6mmALUfUybxELJnFIlvMuLhA+w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZbDtK9IN8dJyVC3JAft+EUdIKXjvw1pWdfjiTScHZYPs09NGXc4D8aJ5YCI4qOAoUg9EL2x4OEhE8CsG9kTYhh6xz3WOwQ7k263D4MYei7WkteBqNNSkZqAPrr/tz829tONYuYrdoV8hJgeAN/ahQUmCIWEUaf763T0l3oIFNMiK6BQ2++94wi14ffKsY9eAZp3gTp1UkWFyPW+3dLqzOboEJXmJraMTYPo/g92G2Bnoi3IeL/dI7w/eDCgoJVHs79r0rtCYEBQltGg6w60zCOhPhqfHZOWBTvdvOMlXt3tqZMcgXXWO2LhFLBZXyPMqnoZqzBU/cZjXlS6/4EgSSA==
  • Delivery-date: Tue, 03 Jan 2023 09:39:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Ayan,

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.

~Michal



 


Rackspace

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