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

[PATCH] xen/dt: reject "xen,static-mem" when CONFIG_STATIC_MEMORY is disabled


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Wed, 5 Aug 2026 14:11:24 +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=unubrNBuqj+l9w841dcepEg1+HSa6SRJQulOWbGXmbQ=; b=HxPIgH0f+9HrEyKUpVqGklGyWYFPLtPuCE744HupCsJPrCDVivftbbLxXq0pNDVrAJlBGaNxxi3AG8b9aYEt2kaCAyK3FBc5zwPPkuR3lhhfZKwB8mHu5ynS7J2DuChnwItHo0ooJhDfu+aUYQShqqS+TdtpZ1lL33/bbH/kI/J/Awyt3AVVHI8NF4QkTrlRvyNU3j/z7bNJ1M/tGShbpgaSFR8+rD+4vLn65/gH/6hpyH3AXcNhAj+BVPUCTV5O5NtrlJbQjBBWoJvtDSmCHlu12hatv/0Byw+kAwJ/rTpfEdopi94exGxHoVn1e+6/d1P7PV1ir3r5SYy2sFaAgw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Iq8h8IzjFckCyOTXJiuJ7qlHw9hvr9TUbx60pEibpOP6Kdu+EsVe6j2Kw80Lb78PfgsRDwJkGNVB6peip3vRmBRV7+j1gM735HPI/bKE3e/xZPa96DtHr7z4715VqjZ9aXhtsNEQxiT9JMtWnfAoyrz7RxDxkAvwbXGAFtagFGmD691B52V3a8x1iABX5bRo9eHCocmG6NyHn7hVPj0CJmNKkc7Q4v+dPz5OX4XfCDFLj4SYIgVh1V5c279o0OF8FQ855qHVWRKm8lxseGDSbebVpv+UeR5ZT6fp/Ij+WCcDgvDiSEEPjhxcspUxHMennYk3kaVQlSrye/slyECBjQ==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Michal Orzel <michal.orzel@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • Delivery-date: Wed, 05 Aug 2026 12:11:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

process_domain_node() parses "xen,static-mem" regardless of
CONFIG_STATIC_MEMORY. With the feature off, init_staticmem_pages() is a
no-op stub, so boot carries on until construct_domU() reaches the
ASSERT_UNREACHABLE() stubs of allocate_static_memory() /
assign_static_memory_11(): a debug build trips the assertion, a production
build gives the domain no memory at all.

Bail out at parse time instead, like process_shm_node() already does for
CONFIG_STATIC_SHM.

Fixes: 41c031ff437b ("xen/arm: introduce domain on Static Allocation")
Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
---
 xen/common/device-tree/bootinfo-fdt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/common/device-tree/bootinfo-fdt.c 
b/xen/common/device-tree/bootinfo-fdt.c
index 272b5a6c0ae6..ca64daf4cdc8 100644
--- a/xen/common/device-tree/bootinfo-fdt.c
+++ b/xen/common/device-tree/bootinfo-fdt.c
@@ -349,6 +349,12 @@ static int __init process_domain_node(const void *fdt, int 
node,
         /* No "xen,static-mem" present. */
         return 0;
 
+    if ( !IS_ENABLED(CONFIG_STATIC_MEMORY) )
+    {
+        printk("CONFIG_STATIC_MEMORY must be enabled for parsing 
xen,static-mem\n");
+        return -EINVAL;
+    }
+
     return device_tree_get_meminfo(fdt, node, "xen,static-mem", address_cells,
                                    size_cells, bootinfo_get_reserved_mem(),
                                    MEMBANK_STATIC_DOMAIN);
-- 
2.43.0




 


Rackspace

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