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

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


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Wed, 27 Apr 2022 17:27:41 +0800
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dmarc=[1,1,header.from=arm.com])
  • 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=2; 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=Tc8bIziiDz6ap/XVy6bFd+Wj+r4OC2m3pmrld4YMMWs=; b=c6MavAhP3pQhqZTHg/lHz0VNXg2URbwNGXkoOK/v9gUt8sjVCmmrkJSPu78Cv4MmIZrxvPAb/r1E8n1eA7AFrEkepLxrldL70BDv7ujptA48EYB1iLA9sc+whXs+awzhWUezsfT4OtaJ1UwSBn3emtc5BcGys6Gz376EOLp1HAoB7+JHUAntHC73RpLsSow9UQbpLVERwPbMe5UTrGqqifP6F/2eVTJOUE/wsIi0NO1swP1gX96dHmel79U3LCi73v6w/gWDhIGDPxffh3/0Dd0onB3D+j+8ifKTKtqlLWGpGFBy/sIYjB5jqRfsvcOdoKTQkpd+cgm/XX0Yyg15Qg==
  • 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=Tc8bIziiDz6ap/XVy6bFd+Wj+r4OC2m3pmrld4YMMWs=; b=LpTS85ObVdYtRSONaujt9ujFWoDXizGd7S0gIe4A4ynK4pVQ+MPT7MDG1BwYV8cRcn+onbHoYQBWx+N17uNK3r683qqImPRC57CMqjLxwa1N8hv/Jz4nfx8tNtjeSumPdD5KZxPq52IQv1lm9sqjeeuBWyoSwhlbugdQTeVeG4umLLD/UF++uP0yRoIxQq0Y/0DK0Yo+QRPUPA5hHLwAIw/Ty4/lEsRy1SJq8cKj6EvlUel4mPeTo+KBCsPalAvIEQzNEaHEV4k7vR5t38IHYXOeXODxHqUpIT4S0wKXCWoVq6NDq5vPAReLrUtzBedGyxYbWkqeZV945K64JvANBQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=HfhCtJnwBt2pArU8TSVp6ZpUqeJ6J/UwQmD085e9c1UPnLTKkn0WCBwxeKajleyCO3qw+QGQ0EAv2ZYNJI8Ii7qen6wLncCZoJKfW02uh6DHPXCzs7ksmq/GYTuOfKPCjcvZHzXXCXHs1/0eMsuM2m7rzNZs1q3hsfpi/2gXylR2ZsGScnuZNxzDbyQfMJ4heY9P78hNtUtS8+vYpCNozbVuEW9XgB4eby4+i0yfvbj9hoeRVOyK3UAgvBBNSCYMLK1mxqxd03w5Zv0kRFSvzJETCXe8RNMGB7IxbQRkUKZhhlaBn3+Xtbrhlq5Fi2fV6S6dsAvas6xbLq6cNcmyZw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aH//NYMbAvLuGgJ/sm1XUff/yS1pY3tckyIsUDdmF8xKdo835V3dAfU87+8T7yoEeLX5XadkcnpufcatcX2jjpxtTuDe7G5IMJtqMMfUV/gxwrdC6KM3IVOStiYlEshI5joKKHGZEcEHFOs8IB5melE3GLssooOi3yDOnKUnezfWDDWG1wF5fj2176pR/XlQkODIJ6blyF76rcMs7+O/ebySeYAFNThwi0vdoChXuJKU1ewkPsOyEoTZiF9KhPmgYqbd9XRTi5tZ+Oxmlgl6dhTFebMtQ/H1AA9T5yo9ZPST26p0SDpeU4KBfIzUserAz+0retsW9s0RVEdfTUNVTA==
  • Cc: <wei.chen@xxxxxxx>, <henry.wang@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: Wed, 27 Apr 2022 09:29:10 +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_using_staticmem() to tell.

Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>
---
v3 changes:
- change name from "is_domain_static()" to "is_domain_using_staticmem"
---
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 1472ca4972..6830a282a0 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -3190,9 +3190,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 fe7a029ebf..110c672589 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)->cdf & CDF_directmap)
 
+#define is_domain_using_staticmem(d) ((d)->cdf & 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®.