|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH V4 09/10] xen/arm: check "xen,static-mem" property during domain construction
Hi, On 28/07/2021 11:27, Penny Zheng wrote: This commit checks "xen,static-mem" device tree property in /domUx node, to determine whether domain is on Static Allocation, when constructing domain during boot-up. Right now, the implementation of allocate_static_memory is missing, and will be introduced later. It just BUG() out at the moment. I think the code is small enough to fold it in patch #10. In fact... You don't need those information outside of allocate_static_memory(). So I think it would be best to move the code in that function. We don't split comment over multi-line (even they are more than 80
characters). This is to help grep message in the code.
Although for this one I would replaced "Error building Domu:" with simply with the domain ID (you can use %pd and 'd'). The caller will then print there was an error during building. My remark applies here as well. + return -EINVAL; + } + + BUG_ON(static_mem_size_cells > 2 || static_mem_addr_cells > 2); Did we validate the DT before hand? If not, then I think + }
rc = dt_property_read_u64(node, "memory", &mem);
With my suggestion above, the check can be replaced with: if ( !dt_find_property(node, "xen,static-mem", NULL) ) + allocate_memory(d, &kinfo); + else + /* TODO: allocate_static_memory(...). */ + BUG();rc = prepare_dtb_domU(d, &kinfo); Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |