xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: Julien Grall <julien.grall@arm.com>
Cc: xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Stefano Stabellini <stefanos@xilinx.com>
Subject: Re: [Xen-devel] [PATCH v4 3/7] xen/arm: keep track of reserved-memory regions
Date: Fri, 9 Aug 2019 15:19:55 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.21.1908091515220.7788@sstabellini-ThinkPad-T480s> (raw)
In-Reply-To: <ac88a18f-0651-628c-fb74-e979f26df6b3@arm.com>

On Wed, 7 Aug 2019, Julien Grall wrote:
> Hi Stefano,
> 
> On 06/08/2019 22:49, Stefano Stabellini wrote:
> > As we parse the device tree in Xen, keep track of the reserved-memory
> > regions as they need special treatment (follow-up patches will make use
> > of the stored information.)
> > 
> > Reuse process_memory_node to add reserved-memory regions to the
> > bootinfo.reserved_mem array.
> > 
> > Refuse to continue once we reach the max number of reserved memory
> > regions to avoid accidentally mapping any portions of them into a VM.
> > 
> > Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>
> > 
> > ---
> > Changes in v4:
> > - depth + 1 in process_reserved_memory_node
> 
> Ah, you fixed it in this patch. But then, this does not match the
> documentation in patch #1.

Yes good point, see below


> > - pass address_cells and size_cells to device_tree_for_each_node
> > - pass struct meminfo * instead of a boolean to process_memory_node
> > - improve in-code comment
> 
> I can't see any comment, is that an improvement? :)

It got lost with the refactoring of the code, but I don't think we need
it anymore


> > - use a separate process_reserved_memory_node (separate from
> >    process_memory_node) function wrapper to have different error handling
> > 
> > Changes in v3:
> > - match only /reserved-memory
> > - put the warning back in place for reg not present on a normal memory
> >    region
> > - refuse to continue once we reach the max number of reserved memory
> >    regions
> > 
> > Changes in v2:
> > - call process_memory_node from process_reserved_memory_node to avoid
> >    duplication
> > ---
> >   xen/arch/arm/bootfdt.c      | 43 +++++++++++++++++++++++++++++++------
> >   xen/include/asm-arm/setup.h |  1 +
> >   2 files changed, 38 insertions(+), 6 deletions(-)
> > 
> > diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
> > index c22d57cd72..3e6fd63b16 100644
> > --- a/xen/arch/arm/bootfdt.c
> > +++ b/xen/arch/arm/bootfdt.c
> > @@ -144,6 +144,7 @@ static int __init process_memory_node(const void *fdt,
> > int node,
> >       const __be32 *cell;
> >       paddr_t start, size;
> >       u32 reg_cells = address_cells + size_cells;
> > +    struct meminfo *mem = (struct meminfo *)data;
> 
> The cast is unnecessary.
> 
> The rest of the code looks good. Pending the discussion about
> device_tree_for_each_node:
> 
> Acked-by: Julien Grall <julien.grall@arm.com>

Thank you. I removed the cast. Also, I think that it makes more sense to
do the depth increase (depth + 1) inside the implementation of
device_tree_for_each_node instead of at the caller site, like it is done
in this patch. This would match the documentation better and is cleaner
from an interface point of view. So I'll remove the depth increase from
this patch and move it to the first patch (min_depth = depth + 1).

Given the change, I won't add the acked-by to give you the chance to
give it another look.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-08-09 22:20 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-06 21:49 [Xen-devel] [PATCH v4 0/7] reserved-memory in dom0 Stefano Stabellini
2019-08-06 21:49 ` [Xen-devel] [PATCH v4 1/7] xen/arm: extend device_tree_for_each_node Stefano Stabellini
2019-08-07 16:08   ` Julien Grall
2019-08-07 16:16     ` Julien Grall
2019-08-09 22:01     ` Stefano Stabellini
2019-08-06 21:49 ` [Xen-devel] [PATCH v4 2/7] xen/arm: make process_memory_node a device_tree_node_func Stefano Stabellini
2019-08-07 16:19   ` Julien Grall
2019-08-09 21:08     ` Stefano Stabellini
2019-08-06 21:49 ` [Xen-devel] [PATCH v4 3/7] xen/arm: keep track of reserved-memory regions Stefano Stabellini
2019-08-07 16:33   ` Julien Grall
2019-08-09 22:19     ` Stefano Stabellini [this message]
2019-08-09 23:57       ` Julien Grall
2019-08-12 18:10         ` Stefano Stabellini
2019-08-07 16:46   ` Julien Grall
2019-08-09 20:37     ` Stefano Stabellini
2019-08-06 21:49 ` [Xen-devel] [PATCH v4 4/7] xen/arm: early_print_info print reserved_mem Stefano Stabellini
2019-08-07 16:36   ` Julien Grall
2019-08-09 20:29     ` Stefano Stabellini
2019-08-06 21:49 ` [Xen-devel] [PATCH v4 5/7] xen/arm: handle reserved-memory in consider_modules and dt_unreserved_regions Stefano Stabellini
2019-08-06 21:49 ` [Xen-devel] [PATCH v4 6/7] xen/arm: don't iomem_permit_access for reserved-memory regions Stefano Stabellini
2019-08-08 19:19   ` Volodymyr Babchuk
2019-08-09 22:56     ` Stefano Stabellini
2019-08-12 10:43       ` Julien Grall
2019-08-12 17:45         ` Stefano Stabellini
2019-08-06 21:49 ` [Xen-devel] [PATCH v4 7/7] xen/arm: add reserved-memory regions to the dom0 memory node Stefano Stabellini
2019-08-07 18:29   ` Julien Grall
2019-08-08 19:11 ` [Xen-devel] [PATCH v4 0/7] reserved-memory in dom0 Volodymyr Babchuk
2019-08-08 19:16   ` Stefano Stabellini

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=alpine.DEB.2.21.1908091515220.7788@sstabellini-ThinkPad-T480s \
    --to=sstabellini@kernel.org \
    --cc=julien.grall@arm.com \
    --cc=stefanos@xilinx.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).