|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 4/6] xen/arm: keep track of reserved-memory regions
Hi, On 2/26/19 11:07 PM, Stefano Stabellini wrote:
Please rework device_for_each_node to allow take a depth and node in parameter. Why this check? 0 is a valid value for "#address-cells" and "#size-cells". The property "reg" is not mandatory for a reserved-memory region. Also looking at the code, this looks very similar to how we deal with memory nodes. Can you please rework the code to avoid duplication? + + reg_cells = address_cells[depth-1] + size_cells[depth-1]; + cell = (const __be32 *)prop->data; + banks = fdt32_to_cpu(prop->len) / (reg_cells * sizeof (u32)); + + for ( i = 0; i < banks && bootinfo.reserved_mem.nr_banks < NR_MEM_BANKS; i++ ) There are few problems with this code itself. For a first, you will ignore the reserved-memory if there are no more space. This means that Xen will be free to allocate the memory for a guest. I don't think we want that. Note that it is fine to ignore memory banks (see process_memory_node) as nothing bad could happen. Furthermore, while today we would allow up to 128 reserved-memory region. I think this is pretty fragile as Xen would break if the DT contains more than that. But we can cross that later one. Lastly, we start already have different way to deal with memory, acpi tables, modules. Now you are adding the reserved-memory. I think it is time for us to create something like e820 internally. This would simplify greatly the setup_mm code as we would not need to go through all the "reserved" block (modules,...) to check intersection. Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |