[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


  • To: Grygorii Strashko <grygorii_strashko@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • Date: Thu, 31 Jul 2025 14:58:24 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=epam.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/RSM/MNDAlV96D5QSqKfladsPTQ2VXwvrkNGuFBgTOg=; b=ejx0ZVzTJyo/c3a8OICRO5CNuU8rwfVftUdpCAR+RHaj9jyFA1ewSLcX65vew49Nc92a4WOuGs1mtOmrRwT9B4Wh5ig8dw0cya3AutOnqwQw7urAQ+QT5xzdhj/EVO3FjRVC/7jndE/2TQqIbR80ASLU3fEUuR6L/47yizuYJKrEmss/jQBZ6Jw7IogO8z2H2OVCufXTlsIS4aU75FJT70P53xfNsKevaES4XsKt1srdT6MIVHGq1GvTq/LI3j+NOMODYGq6l+SxlMLMA+UfX9GOiTV4cDHSH8E8Y6yHOxwJTBbXbWcWMJipgnZCqLRDeuCr0OOXGmN/R/t5o/I2nQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wC/lHXCHwWiCaZb7icI4m8WZr8CrXHB9WuUZDFpuwIO2OSeelZIWoZtIAfZJ+ezjxJ8Jtro4wyTTHK90gso/xsJfxEVnGNdDmZw5Z2jb0sfWRGrFdU/rndPQ8rgiGPV8DSm2qW9JnDqicmLkOnszXZ9+kPsJVdpKRLbaLMUsYmxgSbK9Z7SFtenFnx/8TLFo3JVkQKmC1ik807T9WWe5nrjN03FyTMrp/1A/ivTd4BGPwm9EcxyuuJPzhiMZ+YH2pz2CpMtkK+6HqT/toAdc2/ZEcJrB1tQyGtkQkrsQhE9yOWOXlqNTDXBiTgsOK+ytEKbTqmmNrxBh4tutLP4ylg==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Thu, 31 Jul 2025 12:58:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.