All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alejandro Vallejo" <alejandro.garciavallejo@amd.com>
To: "Orzel, Michal" <michal.orzel@amd.com>, <xen-devel@lists.xenproject.org>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
	"Julien Grall" <julien@xen.org>,
	"Bertrand Marquis" <bertrand.marquis@arm.com>,
	"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Anthony PERARD" <anthony.perard@vates.tech>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger@xenproject.org>
Subject: Re: [PATCH] xen/arm: Sanity test specified domain's memory for being a multiple of a page size
Date: Fri, 09 Oct 2026 10:27:12 +0200	[thread overview]
Message-ID: <DM05YCBPLKR8.4ISDKVT1L933@amd.com> (raw)
In-Reply-To: <9600e1ea-d85c-4c59-abf9-bb90b1e8cd72@amd.com>

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@amd.com>
> >>>> ---
> >>>>  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.

  Reviewed-by: Alejandro Vallejo <alejandro.garciavallejo@amd.com>

Cheers,
Alejandro

>
> ~Michal



  reply	other threads:[~2026-10-09  8:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07 12:48 [PATCH] xen/arm: Sanity test specified domain's memory for being a multiple of a page size Michal Orzel
2026-10-07 13:40 ` Alejandro Vallejo
2026-10-07 14:11   ` Orzel, Michal
2026-10-07 14:21     ` Alejandro Vallejo
2026-10-07 14:31       ` Orzel, Michal
2026-10-09  8:27         ` Alejandro Vallejo [this message]
2026-10-12  8:48           ` Orzel, Michal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM05YCBPLKR8.4ISDKVT1L933@amd.com \
    --to=alejandro.garciavallejo@amd.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=bertrand.marquis@arm.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=roger@xenproject.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.