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

Re: [PATCH v2] xen/arm: Add 0x prefix when printing memory size in construct_domU


  • To: Julien Grall <julien@xxxxxxx>, Ayan Kumar Halder <ayankuma@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Thu, 5 Jan 2023 12:15:38 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; 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=DugpVJyShds+JdKCIeHKaDxrw2o9ohUEHmwSAbO7ieE=; b=FdMuWBcYihPW6GdIBk+kqpBWqP/7n1iSrBI0sn0aDpEopCmhkW7xySzs3g0jHKyvsREOxuHUGgFMimohuEMdIl1+FksC/XweDXrO2tvuy/rt4siTBdIO+ur0Yp3xoWDGK1AwUQTpYySj+S5yiiC2ijAfwUgq+mazthKexjB0a0C3Dmz5cAMTZI0JIzbVNV7nVgliEObDdyNpzwhgyBdQsQpClbAf8tfvqNyveZyo69GdTKFDqIIKrSPvJ79q1SKSmRtZPaCv+Rc+BCVXU5HzD9NaCADpvdAzaXM0ueqEuDzaV8VnJqEHUPN2pQEwK0I3aVEVCUdXIaZINiT4AeRBbw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dEuBtK7R2/dikj5S0egCNpZYTwdYKIaJZhTTqCRGVoMBuJmAOGxWJn84A8TbLEwgmF4rboWN+ZYfsXz8jYuKIVNmIgMRztbDF81zBlWmpkRRyx1ITt8HTBZoiMNDEz3y+nfuC3zlRv31XDp7fagCKTa3dUIDY4oUOTmgTJiXbxUHjqlEyJaQVh7IojblWUS/dbN9AvEnxJ2FX0I87ATj8swjtKoJYxp7fveFuYyiuWgPc8jnzhMQ1NVs8fBDFdMX9iLYce4mVz4xChfYVeuZzU2MPwteIHMuTexftQTxz57R9lWY4spOExu7R8miglXLNHQc53NsFDJ84jcCz7+pew==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Delivery-date: Thu, 05 Jan 2023 12:15:56 +0000
  • Ironport-data: A9a23:eSW5tK+hLxkHBFkgSSIQDrUDr3+TJUtcMsCJ2f8bNWPcYEJGY0x3m mEXXG6OMvrcYjSmKdB/O4rloB4B7JaBz9dlHgY/+3o8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKucYHsZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ire7kIx1BjOkGlA5AdmPKgW5AW2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklHz KImGhEwaiuH3bqJwvWZasJ9qpU8eZyD0IM34hmMzBn/JNN/GNXpZfWP4tVVmjAtmspJAPDSI dIDbiZiZwjBZBsJPUoLDJU5n6GjgXyXnz9w8QrJ4/ZopTWDilUvgdABM/KMEjCObexTklyVu STt+GPhDwtBHNee1SCE4jSngeqncSbTCdtIRezgpqQCbFu771NPLh1LSl6AoPi5zQmPBYpuE 3Ys9X97xUQ13AnxJjXnZDW6vXqFsxg0S9dWVeog52mlw7vd5QWEA2EsRztNLtchsaceVTEsk 1OEgd7tLThuq6GOD2KQ8K+OqjG/MjRTKnUNDRLoViMA6tjn5Ys13hTGS486FLbv14OkXzbt3 zqNsS4ywa0JitIG3Lm6+laBhC+wop/OTUg+4QC/sn+Z0z6VrbWNP+SAgWU3J94aRGpFZjFtZ EQ5pvU=
  • Ironport-hdrordr: A9a23:ZUG3m6xl1NPIJAR6A1g3KrPxHegkLtp133Aq2lEZdPULSKGlfp GV9sjziyWetN9IYgBZpTgZUJPwC080hqQFmrX5Wo3SETUO2VHYZ72KiLGP/9SOIVybygcw78 Zdmu1FeaTN5DtB/IrHCWuDYrEdKbC8mcjG69s2jU0dKz2CAJsQjDuRfzzrd3GeMzM2Z6bReq D92uN34x6bPVgHZMWyAXcIG8DFut3wjZrjJTIWGhI97wGKrDWwrJr3CQKR0BsyWy5Ghe5Kyx mKryXJooGY992rwB7V0GHeq7xQhdva09NGQOCcl8QPLT3oqwCwIKBsQaeLsjwZqPymrHwqjN 7PiRE9ONkb0QKfQkiF5T/WnyXw2jcn7HHvjXWCh2H4nMD/TDUmT+JcmINwaHLimgodleA59J gO83OStpJRAx+Ftj/6/cL0WxZjkVfxiWY+kNQUk2dUXeIlGfxsRM0kjQFo+aU7bWbHAbMcYa 5T5QbnlbBrmGahHjXkV69UsYWRtzoIb0+7qwM5y7aoOnBt7Q1EJg0jtY0idz47he0Ao9Mv3Z W5Do140L5JVcMYdqR7GaMIRta2EHXERVbWPHuVOkmPLtBwB5vhke+C3FwO3pDcRLUYiJ8p3J jRWlJRsmA/P0roFM2VxZVOthTAWn+0UzjhwtxXo8ERgMy1eJP7dSmYDFw+mcqppPsSRsXdRv aoIZpTR/vuN3HnF4pF1xD3H5NSNX4dWssIvctTYSPGnuvbbonx8uDLevfaI7TgVT4iR2PkG3 MGGCP+Ic1Rh3rbL0MQQCKhKU8FVnaPja6YSpKqgdT74LJ9R7Fko0wSlUmz4N2NJHlLrrE2FX EOU4/arg==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHZH13GXnua+lhJCkOWuIi1KAI8E66O7vgAgACh3ICAAAlTgIAAFk6AgAAPpYA=
  • Thread-topic: [PATCH v2] xen/arm: Add 0x prefix when printing memory size in construct_domU

On 05/01/2023 11:19 am, Julien Grall wrote:
> On 05/01/2023 09:59, Ayan Kumar Halder wrote:
>> Hi Julien,
>
> Hi,
>
>> I have a clarification.
>>
>> On 05/01/2023 09:26, Julien Grall wrote:
>>> CAUTION: This message has originated from an External Source. Please
>>> use proper judgment and caution when opening attachments, clicking
>>> links, or responding to this email.
>>>
>>>
>>> Hi Stefano,
>>>
>>> On 04/01/2023 23:47, Stefano Stabellini wrote:
>>>> On Tue, 3 Jan 2023, Michal Orzel wrote:
>>>>> Printing memory size in hex without 0x prefix can be misleading, so
>>>>> add it. Also, take the opportunity to adhere to 80 chars line length
>>>>> limit by moving the printk arguments to the next line.
>>>>>
>>>>> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
>>>>> ---
>>>>> Changes in v2:
>>>>>   - was: "Print memory size in decimal in construct_domU"
>>>>>   - stick to hex but add a 0x prefix
>>>>>   - adhere to 80 chars line length limit
>>>>
>>>> Honestly I prefer decimal but also hex is fine.
>>>
>>> decimal is perfect for very small values, but as we print the amount in
>>> KB it will become a big mess. Here some examples (decimal first, then
>>> hexadecimal):
>>>
>>>   512MB: 524288 vs 0x80000
>>>   555MB: 568320 vs 0x8ac00
>>>   1GB: 1048576 vs 0x100000
>>>   512GB: 536870912 vs 0x20000000
>>>   1TB: 1073741824 vs 0x40000000
>>>
>>> For power of two values, you might be able to find your way with
>>> decimal. It is more difficult for non power of two unless you have a
>>> calculator in hand.
>>>
>>> The other option I suggested in v1 is to print the amount in KB/GB/MB.
>>> Would that be better?
>>>
>>> That said, to be honest, I am not entirely sure why we are actually
>>> printing in KB. It would seems strange that someone would create a
>>> guest
>>> with memory not aligned to 1MB.
>>
>> For RTOS (Zephyr and FreeRTOS), it should be possible for guests to
>> have memory less than 1 MB, isn't it ?
>
> Yes. So does XTF. But most of the users are likely going allocate at
> least 1MB (or even 2MB to reduce the TLB pressure).
>
> So it would be better to print the value in a way that is more
> meaningful for the majority of the users.
>
>>> So I would consider to check the size is 1MB-aligned and then print the
>
> I will retract my suggestion to check the size. There are technically
> no restriction to run a guest with a size not aligned to 1MB.
> Although, it would still seem strange.

I have a need to extend tools/tests/tsx with a VM that is a single 4k
page.  Something which can execute CPUID in the context of a VM and
cross-check the results with what the "toolstack" (test) tried to configure.

Xen is buggy if it cannot operate a VM which looks like that, and a
bonus of explicitly testing like this is that it helps to remove
inappropriate checks.

~Andrew

 


Rackspace

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