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

[PATCH v2 4/6] xen/arm: introduce CDF_staticmem


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Mon, 18 Apr 2022 20:22:49 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=1mDieelJvb1HIU1cidQRUGTfXl8e3DylFrqxsNNPrcs=; b=b5ro8J7WQdbIDk9HVRgCQeZT4U6pwfxcKrAhEhf+cCg2ZAcuxpOdShABEMdAebwINiO1TJcURBBTLmEvZNuEwu0OJUpnuYGCSEQA5v6R3ar335wO641FqJaWDoNVjntVwTY/NHHaIvPxVqg0JoRM1/nRUHLa8jeN3YS7thnJPAJQtM2BdOQJIr/N0ptRbvXfzeL8XInglWeJOvyQ83k5ldJyVEm8t4f6Maz2IaQbOiRTmsnXsi1aDSt+z0xs01J1q0q8lhls9j7/W5x4NvSIGgLsP3oL9Yl5jZxEC4c8jxeeqw60/oW9Cmfj3VaCwuLKNnJ420VMrWABC/IKw15TEw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kIhNxDcOmyaw4juOGJZ/GX+RK+qwmky0FL4/A6z1EaN7HyR0MrwTH2DN2Gut8Gk5Etek4mq+gpKK7Ajh+Qe5My/oQGdyqoYbNz6Gp7ZtTOfi+ET47OMAA9pd324bL34O5SL94qkIdnedaS5Sy09h2rBRDjVXK39Pc39HeJJexQltb75C9XPDdLhIYAGX4WPQbjqQGrQInhe5ntbdIW/VDLkcjchC00BpQAWGM0FuXNqHP/jTM7ZxCKdzr7s6jcqJ0R5n3nB3WoS1TPqzvMnrsWQvfzdwToIJm9gqDG0dpqmmJLcxZ/oinoHUw/NplfTGWYe4NwE65Q96Ayp9GHnxLA==
  • Cc: <wei.chen@xxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Penny Zheng <penny.zheng@xxxxxxx>
  • Delivery-date: Mon, 18 Apr 2022 12:23:58 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

In order to have an easy and quick way to find out whether this domain memory
is statically configured, this commit introduces a new flag CDF_staticmem and a
new helper is_domain_static to tell.

Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>
---
v2 changes:
- change name from "is_domain_on_static_allocation" to "is_domain_static()"
---
 xen/arch/arm/domain_build.c       | 5 ++++-
 xen/arch/arm/include/asm/domain.h | 2 ++
 xen/include/xen/domain.h          | 2 ++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 8be01678de..4e62fd0bf1 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -3191,9 +3191,12 @@ void __init create_domUs(void)
         if ( !dt_device_is_compatible(node, "xen,domain") )
             continue;
 
+        if ( dt_find_property(node, "xen,static-mem", NULL) )
+            flags |= CDF_staticmem;
+
         if ( dt_property_read_bool(node, "direct-map") )
         {
-            if ( !IS_ENABLED(CONFIG_STATIC_MEMORY) || !dt_find_property(node, 
"xen,static-mem", NULL) )
+            if ( !IS_ENABLED(CONFIG_STATIC_MEMORY) || !(flags & CDF_staticmem) 
)
                 panic("direct-map is not valid for domain %s without static 
allocation.\n",
                       dt_node_name(node));
 
diff --git a/xen/arch/arm/include/asm/domain.h 
b/xen/arch/arm/include/asm/domain.h
index 36ec00e62d..b097433f9f 100644
--- a/xen/arch/arm/include/asm/domain.h
+++ b/xen/arch/arm/include/asm/domain.h
@@ -31,6 +31,8 @@ enum domain_type {
 
 #define is_domain_direct_mapped(d) ((d)->flags & CDF_directmap)
 
+#define is_domain_static(d) ((d)->flags & CDF_staticmem)
+
 /*
  * Is the domain using the host memory layout?
  *
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 1c3c88a14d..35dc7143a4 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -34,6 +34,8 @@ void arch_get_domain_info(const struct domain *d,
 #ifdef CONFIG_ARM
 /* Should domain memory be directly mapped? */
 #define CDF_directmap            (1U << 1)
+/* Is domain memory on static allocation? */
+#define CDF_staticmem            (1U << 2)
 #endif
 
 /*
-- 
2.25.1




 


Rackspace

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