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

Re: [PATCH] xen/arm: Sanity test specified domain's memory for being a multiple of a page size


  • To: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Mon, 12 Oct 2026 10:48:58 +0200
  • 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 (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=oCR1mn7eIpteDAuy0Pd6JjVVXFIuKedDakhSMcIovI8=; b=KsXYyiNcB4OABuYLiHvpegVluhJBka6L8at3rYdfD9nLLNpvUtO3vhwh4XwHoI7Sge1gmK7L4B8OhQUR4u1fhyHmi2UwirRROcYCxPUMiAdG2SLdbh3Tl8d7gGBEEDdemMEkZqVoM2kpOSGjlH29q/U7KpS5ztEIOciql/j1igYUTdwO195YDw/jEgCl26Yf9XRyEqfWDDZwp9+pvGcHhssnWQf2FIgF3wRkuoDgY2VRGz/RYeuySdK41uuKwe5qCNfP4ygZWh7Djw24fdh3ZpEVMfcM/cVIkpEyu4So7gRaBNY+Xu3+N8288edzQIdgf3YKWCEjtSyTPu/mmGbmRg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CWUZcZVp0sMQtzGGn+2cmzYOyhmv4pVWKH52gmWgpzwq3Dcn2q73kgzYsaWByE7KI1Rkr2YcNHp9T51MeyWTYh0x8Er+3yKfVZ9c1b/8DaKi1CmhA9/SMORuE1PVf5kKbsYgBtwaoKdv65r8E3Kmsww2CzFe+mm7+HwYUhC0+ktbVySG22vvvLZIBihA9o2rHVbp4V+XbI/kV6f8LAzIf9qTLjRm5lAwJfmn7qnN0aq0jj0loxXq71BxoR7DEi6oJrFRKTDIgyb/PKTImLFN/GnZakzeitPl53ZLolMVolXe8MdaXWRlUNv4PUOWMPaQKQzUc+wCHbeXwivfnODZmQ==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>
  • Delivery-date: Mon, 12 Oct 2026 08:49:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 09-Oct-26 10:27, Alejandro Vallejo wrote:
> On Wed Oct 7, 2026 at 4:31 PM CEST, Orzel, Michal wrote:
>>
>>
>> On 07-Oct-26 16:21, Alejandro Vallejo wrote:
>>> On Wed Oct 7, 2026 at 4:11 PM CEST, Orzel, Michal wrote:
>>>>
>>>>
>>>> On 07-Oct-26 15:40, Alejandro Vallejo wrote:
>>>>> On Wed Oct 7, 2026 at 2:48 PM CEST, Michal Orzel wrote:
>>>>>> We require memory to allocate for a domain as RAM to be a multiple of a
>>>>>> page size. However, we neither document this nor sanity test. Specifying
>>>>>> memory size that does not conform to this requirement fails the domain
>>>>>> memory allocation in the non-obvious way that is difficult to parse for
>>>>>> the user (printing over-allocation messages followed by the panic that 
>>>>>> Xen
>>>>>> could not allocate the requested amount of memory).
>>>>>>
>>>>>> While there, fix indentation from tabs to spaces for "memory" parameter 
>>>>>> in
>>>>>> booting.txt.
>>>>>>
>>>>>> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
>>>>>> ---
>>>>>>  docs/misc/arm/device-tree/booting.txt   | 4 ++--
>>>>>>  docs/misc/xen-command-line.pandoc       | 5 +++--
>>>>>>  xen/arch/arm/domain_build.c             | 6 ++++++
>>>>>>  xen/common/device-tree/dom0less-build.c | 7 +++++++
>>>>>>  4 files changed, 18 insertions(+), 4 deletions(-)
>>>>>>
>>>>>> diff --git a/docs/misc/arm/device-tree/booting.txt 
>>>>>> b/docs/misc/arm/device-tree/booting.txt
>>>>>> index bcb06bc796bf..7dfac2062a37 100644
>>>>>> --- a/docs/misc/arm/device-tree/booting.txt
>>>>>> +++ b/docs/misc/arm/device-tree/booting.txt
>>>>>> @@ -155,8 +155,8 @@ with the following properties:
>>>>>>  
>>>>>>  - memory
>>>>>>  
>>>>>> -        A 64-bit integer specifying the amount of kilobytes of RAM to
>>>>>> -    allocate to the guest.
>>>>>> +    A 64-bit integer specifying the amount of kilobytes of RAM to
>>>>>> +    allocate to the guest. Must be a multiple of 4KB (the page size).
>>>>>
>>>>> nit: s/KB/KiB
>>>> Is it? I don't think it matters at all seeing the number of occurrences in 
>>>> the code.
>>>>
>>>>>
>>>>> But page size isn't always 4KiB on all ports. PowerPC has 64KiB pages.
>>>>> IMO, 4KB shouldn't be here or elsewhere in documentation.
>>>> This is Arm doc and on Arm we only support 4KB at the moment. User should 
>>>> not
>>>> need to dig into the code to check what is the page size. It's better imo 
>>>> to
>>>> give this information right away and change in the future when we add 
>>>> support
>>>> for 16 and 64KB pages on Arm.
>>>
>>> This is already the only reference the other ports have for dom0less.
>>> The document shouldn't be here since the movement of dom0less to common
>>> code, but the side effect of it is that this no longer an arm-only 
>>> reference.
>>>
>>> I won't be annoying about moving the doc on this patch because that's a
>>> separate matter, but not adding more easily avoidable debt seems
>>> warranted.
>> I don't quite understand your reasoning. If you worry about dom0less != Arm,
>> then on that basis HAS_DOM0LESS is selected only for Arm and RISCV where
>> PAGE_SIZE is 4KB. I don't think I'm introducing any doubt here. I can remove 
>> the
>> 4KB mentioning from the docs if you really insist but at least for me it's
>> clearer for the user to know right away what's the requirement for the size.
> 
> It's a small adjustment to make the documentation truly generic. And
> prevents the pgsz == 4KiB assumption from spreading further. Many docs
> are spawned from copying other docs.
> 
> If you're so strongly against, that's fine; it's not incorrect today.
> I still think the 4K should be gone, but if don't want to block the
> patch on such silly things.
Fine, I'll remove 4KB mentioning from the docs.

> 
>   Reviewed-by: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
Thanks. I'll handle the changes on commit.

~Michal




 


Rackspace

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