[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XEN][PATCH 5/7] dom0less: Parse memory properties in the common bindings


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Date: Thu, 31 Jul 2025 09:42:38 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • 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=2duM0JPOLQ5odxgjgBE2ib9pZ3inljj8ieFqvLWZu2c=; b=gN39UzAC716MWn2+R80sKjk7ftz2fZca/GAYK53NZtBAaUOu1K2vYy2FlwPTdo7u3utXlqwlxxqJfEAs35FWnSh1i5OxucXwPcTOnf94nW5n0cJJTGkJ1J/HFPU8p5ZgDrpB+2UZ10Ik9pGI3uUd5PI5v6x0xd8kk+uSpYdtTN46SeFSV8IRwWfOOO3swBuk0CVE08/dQ2Fh09bVqApoAar9gzrMIAnM8zcNA6Lkqims2fz3XJ1SfWDDFbwr7rQnerxAl6yZQxtnkuUOsTzX2ryDOBlOEiK4J7F55l3efrZQsmSibACH45cgxUbDlrfc+KfhlwhmUO1RAnDdfaNDLw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zOkkjvH8/54x8k/W+Iit357pwT2iQo3TTLNdvxKmJZsvEl906wCsoD6Pm9s4HK3iWZhfAF/MSgD1HP8aWMunPOcj5FFimJwqLP2K4aZ3ovuYK8TKmCQmREi6mY92i1US03X1rE6OQBePUN5dbqWQfZD5meN+8e5eYeRiCNOXzVbQJeAPv0956Hm1fO5ouYY/NNA7D7SNn4PRhgUyorecggdYo1knW9Kqv3pGiTRKLTmNA18GIKzlmlYaCqPMRwXl0IMKLPvzFbraa4AgMVr5KaNXX5L+A/R2F2gsUKDxdxSkAwJIkXJOrXwxRaaXRNIZ/GBB6u8dMGCm1WuJDMbCgQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Delivery-date: Thu, 31 Jul 2025 09:42:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHcAf9z2k2HeEdIvEqSKDGjQ7hw8g==
  • Thread-topic: [XEN][PATCH 5/7] dom0less: Parse memory properties in the common bindings

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;
 
     /* Input arguments to create_domain() */
     struct xen_domctl_createdomain create_cfg;
-- 
2.34.1



 


Rackspace

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