[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XEN][PATCH 5/7] dom0less: Parse memory properties in the common bindings
On Thu Jul 31, 2025 at 11:42 AM CEST, Grygorii Strashko wrote: > From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx> > > Move the "memory" binding from dom0less-build to dom0less-bindings. > > Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx> > Signed-off-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx> > --- > xen/common/device-tree/dom0less-bindings.c | 3 +++ > xen/common/device-tree/dom0less-build.c | 8 +------- > xen/include/xen/bootfdt.h | 2 ++ > 3 files changed, 6 insertions(+), 7 deletions(-) > > diff --git a/xen/common/device-tree/dom0less-bindings.c > b/xen/common/device-tree/dom0less-bindings.c > index 41d72d0d580a..4513f03e367b 100644 > --- a/xen/common/device-tree/dom0less-bindings.c > +++ b/xen/common/device-tree/dom0less-bindings.c > @@ -141,5 +141,8 @@ int __init parse_dom0less_node(struct dt_device_node > *node, > panic("'llc-colors' found, but LLC coloring is disabled\n"); > #endif > > + if ( !dt_property_read_u64(node, "memory", &bd->memory) ) > + panic("missing memory binding for %s.\n", dt_node_name(node)); > + > return arch_parse_dom0less_node(node, bd); > } > diff --git a/xen/common/device-tree/dom0less-build.c > b/xen/common/device-tree/dom0less-build.c > index 6bb038111de9..8906e35e6978 100644 > --- a/xen/common/device-tree/dom0less-build.c > +++ b/xen/common/device-tree/dom0less-build.c > @@ -738,14 +738,8 @@ static int __init construct_domU(struct kernel_info > *kinfo, > struct domain *d = kinfo->bd.d; > const char *dom0less_enhanced; > int rc; > - u64 mem; > + uint64_t mem = kinfo->bd.memory; > > - rc = dt_property_read_u64(node, "memory", &mem); > - if ( !rc ) > - { > - printk("Error building DomU: cannot read \"memory\" property\n"); > - return -EINVAL; > - } > kinfo->unassigned_mem = (paddr_t)mem * SZ_1K; > > rc = domain_p2m_set_allocation(d, mem, node); > diff --git a/xen/include/xen/bootfdt.h b/xen/include/xen/bootfdt.h > index 0e82ccea2f84..0b73ed835000 100644 > --- a/xen/include/xen/bootfdt.h > +++ b/xen/include/xen/bootfdt.h > @@ -121,6 +121,8 @@ struct boot_domain { > struct boot_module *initrd; > > const char *cmdline; > + /* Memory the domain is expected to have attached after creation */ > + uint64_t memory; Either state here that the units are 1K, or make the units bytes by multiplying the result from the binding by 1K. If the latter, you can probably replace all instances of "unassigned_mem" for "memory" in boot_domain and remove that field in kernel_info, which goes in line with the intention of shrinking kernel_info in favour of boot_domain. Cheers, Alejandro
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |