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

[PATCH v3 3/6] xen: add field "flags" to cover all internal CDF_XXX


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Wed, 27 Apr 2022 17:27:40 +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=gKV5xiCmhipxoNF2c34Y3bk6wQOs8dxWyNC/VQODx1s=; b=iyTOPSfCeh1M3ZF4i1u6E685Nd0i9+Z7Gk+YOSKwh/uUcXYKvA5b2FAvrcSpgfs41GFE8aF89XShXRQbWDERhGtpQElMvzPW3Ki8IVGx6Gnb3JMqTHGc4vcPkS4JgfLS+SuIQ0Tn8Sv5nxJ7o9/nP6wP6qZ9d8h0ASyp2G0TAqprEFR6M16nGK4Ba5dxMO+b4R8SYORo6Efzq1eKkXC5eeUTFdKlmcQPO7rXVREz0oIR9GyRPnYKTXCVgbur+fz5SRgkEGHDwbj1wKBVj1EIvsSrLjcDG4+2saV+TsUUXIRjV+gmAyuuqe7s95LVzhTeV0l/axZLvhYLwOApTWyoNA==
  • 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=gKV5xiCmhipxoNF2c34Y3bk6wQOs8dxWyNC/VQODx1s=; b=NAQEzoOpN30dQe3a5WB1YHDHkrcOVZ5h4X7W+2dFKuAPZPsJ6rIKtiAhfiNrs7bpvhWJZL65912LxhJ+T6YqkIKnqSkFYFDHCmx4GZo+rqVljPCoKdlGG8iI+Dy4PAaIVeLdDTllIyl40ckau6iyRO3otr95ATrYXRUEUZFnTAtI+PVFatnzt2dkR/Cp/1dHeYSQsRc55hAo6Y9H9JrG4Eb5nz5G2jxz+ljrIB24i9YC1npziFyHoIvZVeCE4BR0SDAEaUrr6pIcOtcoiiEj1uuQqmoYe/kBuAI4Ts213nc0k7m/mN+aE4eeLqoVm7pxxoyBQ2YOc8AbkfHdXbe6tA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=ca957iFd3GwcadLwUBIDY2Xk61wjByJebQxyw/mmKDb2q7Lh7ol7sDSmTmR+2Nwcy+Bvy/gez8fYIiZyrGpXL7M4llq5SrqjBJg6ofioBE9OIUE1LMalh7b1CSrh4L039WY0wtqfSAw/rmPVWG1KwWWW+0ci7BkmsfdKmC8zI2/TMcsSnR55zcLzAm9E445ecNlybVKsurELMx8Rz9zkZhjraIvjit3beCjljzJMUisgnH/O5QmZAlpU5DNxHofDV5zsQGgVebT8x1kKUCi6dA4pcN1/3fQF4UYkPN6Pm8rI6mpwsTLrI8X/gUSCW/yhtoFvc0sEkk3smr4h6huzLQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iSLOTXDgBsOyagF0KTsSY8SYlON3Zr/TSjLE/RM73no0g98EKxpShw9hVHGsSm6w4IV41y0FvlBefX6wgllPHlkNMYgUXps+/gQj9uFxcSaIJhq0yHFtPHHKo6mPbExs5l8DGS8BdNo79MUVxbHGbtmNAU418R5JkCmYu35OwJauJGjXIYOgjKYBP0tNMhHapZtRiZyCgS4I/pC+bT8cZemSafM+UX7RiY+EKwRxkIMD2E4bil2AmuaEkKKEQ45W64DbGCuptsDjyo+as/biqdH+vMqSu917KJTCtlGSC4zd1XRCuWhgoGJs7dPUbuTntqwo6DzCaxV2sRfj8WZUzg==
  • 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:06 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

With more and more CDF_xxx internal flags in and to save the space, this
commit introduces a new field "flags" in struct domain to store CDF_*
internal flags directly.

Another new CDF_xxx will be introduced in the next patch.

Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>
---
v3 changes:
- change fixed width type uint32_t to unsigned int
- change "flags" to a more descriptive name "cdf"
---
v2 changes:
- let "flags" live in the struct domain. So other arch can take
advantage of it in the future
- fix coding style
---
 xen/arch/arm/domain.c             | 2 --
 xen/arch/arm/include/asm/domain.h | 3 +--
 xen/common/domain.c               | 3 +++
 xen/include/xen/sched.h           | 3 +++
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 8110c1df86..74189d9878 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -709,8 +709,6 @@ int arch_domain_create(struct domain *d,
     ioreq_domain_init(d);
 #endif
 
-    d->arch.directmap = flags & CDF_directmap;
-
     /* p2m_init relies on some value initialized by the IOMMU subsystem */
     if ( (rc = iommu_domain_init(d, config->iommu_opts)) != 0 )
         goto fail;
diff --git a/xen/arch/arm/include/asm/domain.h 
b/xen/arch/arm/include/asm/domain.h
index ed63c2b6f9..fe7a029ebf 100644
--- a/xen/arch/arm/include/asm/domain.h
+++ b/xen/arch/arm/include/asm/domain.h
@@ -29,7 +29,7 @@ enum domain_type {
 #define is_64bit_domain(d) (0)
 #endif
 
-#define is_domain_direct_mapped(d) (d)->arch.directmap
+#define is_domain_direct_mapped(d) ((d)->cdf & CDF_directmap)
 
 /*
  * Is the domain using the host memory layout?
@@ -103,7 +103,6 @@ struct arch_domain
     void *tee;
 #endif
 
-    bool directmap;
 }  __cacheline_aligned;
 
 struct arch_vcpu
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 8d2c2a9897..6373407047 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -567,6 +567,9 @@ struct domain *domain_create(domid_t domid,
     /* Sort out our idea of is_system_domain(). */
     d->domain_id = domid;
 
+    /* Holding CDF_* internal flags. */
+    d->cdf = flags;
+
     /* Debug sanity. */
     ASSERT(is_system_domain(d) ? config == NULL : config != NULL);
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index ed8539f6d2..49415a113a 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -591,6 +591,9 @@ struct domain
         struct ioreq_server     *server[MAX_NR_IOREQ_SERVERS];
     } ioreq_server;
 #endif
+
+    /* Holding CDF_* constant. Internal flags for domain creation. */
+    unsigned int cdf;
 };
 
 static inline struct page_list_head *page_to_list(
-- 
2.25.1




 


Rackspace

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