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

[PATCH 08/10] dom0less: Allow arch_parse_dom0less_node() to be fallible


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
  • Date: Tue, 22 Jul 2025 13:59:48 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org 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=oFOSoi/32WLDNN9/GzpR2R3rnsXpnxjRZeNX0xaEwv0=; b=i1LyWo3Sh0/o2dtYIVznaoW3BsG/E0laYWXshpygznO3URVr/MwUlNYW0x1c2TDy4xO6sdK6Ee1bm6b2HtmE/oxJEWx1SJiWpXqQXxE4bm0sgk9DJ1jek2gmPfwis1m3ISD1mszSuj2/X3haresiD/Lkw48yjz2bFMUovXHf6yCVeNB03HfVT0D6XDnPv695MDXpIVESd1u42s5Indgx/49LZASD3mSam9OqTUGKHyYNuHyOlm6h+oLYmy5xSyVFsPOK1qhjOrLko/tViLCZXKZGblVFVINFcWXeEY0Ah98FKlLMLUyAIc2bRgXM9GC9XHDjx1g6LUbwZW3xC6On1g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fyBHcY3n8N6EikuBhO0Xmb8cvKGCVBRyNYPpo6hF0Yik2gM627J2qgNuF8zMEHZj+gZJqhBdlVAuSygxZe4xpJOxYmacS7uq37Or9q4eCLoCbGEUIOH6Cjlys/WvnXYR/l72nrzG3RWVuR0XYa7vaK/3NWKnVe23+mLefRIxea2WhqfmmT+1FdCCSX5MbJdaZjpDFaMWGFX0irccG0QaEqcqRKeSOrbrm38Qtk6nE2N3Omq5ByRGMZ8cry/7gcuhBq311D2fRSlvjz57OnHCOl3TczbOyPxpsryfnAE40S4UViLKjmvDihM9fEYk/DfXiPi924F10rghA78fN3eQgw==
  • Cc: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 22 Jul 2025 12:00:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Let the function return an errno, so fallible bindings are not precluded.

Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
---
 xen/arch/arm/dom0less-build.c           | 6 ++++--
 xen/common/device-tree/dom0less-build.c | 3 ++-
 xen/include/xen/dom0less-build.h        | 6 +++---
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/xen/arch/arm/dom0less-build.c b/xen/arch/arm/dom0less-build.c
index 3dea56dc76..c8d07213e2 100644
--- a/xen/arch/arm/dom0less-build.c
+++ b/xen/arch/arm/dom0less-build.c
@@ -272,8 +272,8 @@ int __init init_vuart(struct domain *d, struct kernel_info 
*kinfo,
     return rc;
 }
 
-void __init arch_parse_dom0less_node(struct dt_device_node *node,
-                                     struct boot_domain *bd)
+int __init arch_parse_dom0less_node(struct dt_device_node *node,
+                                    struct boot_domain *bd)
 {
     struct xen_domctl_createdomain *d_cfg = &bd->create_cfg;
     unsigned int flags = bd->create_flags;
@@ -354,6 +354,8 @@ void __init arch_parse_dom0less_node(struct dt_device_node 
*node,
         if ( !val )
             d_cfg->flags &= ~XEN_DOMCTL_CDF_trap_unmapped_accesses;
     }
+
+    return 0;
 }
 
 int __init init_intc_phandle(struct kernel_info *kinfo, const char *name,
diff --git a/xen/common/device-tree/dom0less-build.c 
b/xen/common/device-tree/dom0less-build.c
index 8caceb9f6b..ef4b095d97 100644
--- a/xen/common/device-tree/dom0less-build.c
+++ b/xen/common/device-tree/dom0less-build.c
@@ -960,7 +960,8 @@ void __init create_domUs(void)
             panic("'llc-colors' found, but LLC coloring is disabled\n");
 #endif
 
-        arch_parse_dom0less_node(node, &ki.bd);
+        if ( (rc = arch_parse_dom0less_node(node, &ki.bd)) )
+            panic("error parsing arch-specific dom0less props (rc=%d)", rc);
 
         /*
          * The variable max_init_domid is initialized with zero, so here it's
diff --git a/xen/include/xen/dom0less-build.h b/xen/include/xen/dom0less-build.h
index 8f3f90ae2a..72ca8f5e6d 100644
--- a/xen/include/xen/dom0less-build.h
+++ b/xen/include/xen/dom0less-build.h
@@ -9,7 +9,7 @@ struct domain;
 
 #ifdef CONFIG_DOM0LESS_BOOT
 
-struct xen_domctl_createdomain;
+struct boot_domain;
 struct dt_device_node;
 struct kernel_info;
 
@@ -45,8 +45,8 @@ void create_domUs(void);
 bool is_dom0less_mode(void);
 void set_xs_domain(struct domain *d);
 
-void arch_parse_dom0less_node(struct dt_device_node *node,
-                              struct boot_domain *bd);
+int arch_parse_dom0less_node(struct dt_device_node *node,
+                             struct boot_domain *bd);
 
 int init_vuart(struct domain *d, struct kernel_info *kinfo,
                const struct dt_device_node *node);
-- 
2.43.0




 


Rackspace

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