|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] xen/dt: Only parse direct child nodes of /reserved-memory
On 27-Oct-26 04:18, Kuan-Wei Chiu wrote:
> process_reserved_memory() uses device_tree_for_each_node(), which walks
> all descendants of /reserved-memory rather than just its direct children.
> However, a child node such as nvmem-rmem can contain nvmem-layout and
> cell subnodes whose reg properties specify internal offsets rather than
> physical memory addresses. Parsing these subnodes records invalid
> reserved memory regions and fails the overlap check when bitfield cells
> share the same offset.
>
> Ignore nodes with depth != 1 in process_reserved_memory_node().
>
> Fixes: d96594eef39a ("xen/arm: keep track of reserved-memory regions")
> Signed-off-by: Kuan-Wei Chiu <visitorckw@xxxxxxxxx>
> ---
> xen/common/device-tree/bootinfo-fdt.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/xen/common/device-tree/bootinfo-fdt.c
> b/xen/common/device-tree/bootinfo-fdt.c
> index ca64daf4cd..eea35325f7 100644
> --- a/xen/common/device-tree/bootinfo-fdt.c
> +++ b/xen/common/device-tree/bootinfo-fdt.c
> @@ -185,8 +185,13 @@ static int __init process_reserved_memory_node(const
> void *fdt, int node,
> u32 size_cells,
> void *data)
> {
> - int rc = process_memory_node(fdt, node, name, depth, address_cells,
> - size_cells, data);
> + int rc;
> +
It would be easier to understand with the comment like:
/* Only direct children of /reserved-memory describe memory regions */
> + if ( depth != 1 )
> + return 0;
> +
> + rc = process_memory_node(fdt, node, name, depth, address_cells,
> + size_cells, data);
>
> if ( rc == -ENOSPC )
> panic("Max number of supported reserved-memory regions reached.\n");
I will change on commit. Thanks for the submission.
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
~Michal
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |